+ Post New Thread
Results 1 to 12 of 12
Enterprise Software Thread, Papercut in Technical; Hello All, We are currently looking into implementing Papercut in our school, it has already been set up and is ...
  1. #1

    Join Date
    Jun 2013
    Location
    Swindon
    Posts
    21
    Thank Post
    4
    Thanked 4 Times in 3 Posts
    Rep Power
    3

    Papercut

    Hello All,

    We are currently looking into implementing Papercut in our school, it has already been set up and is ready to go!!
    However we want to be able to add a daily generated password for the morning and afternoon which the staff and students would have to enter to be able to print, have had a look into this but just wanted to know if anyone else has had any experience with this?

  2. #2
    MicrodigitUK's Avatar
    Join Date
    May 2007
    Location
    Wiltshire
    Posts
    336
    Thank Post
    37
    Thanked 55 Times in 51 Posts
    Rep Power
    24
    Yes, you can do this with department pin codes that reset twice a day. I have a script somewhere for my student shard acounts that dose that. I'll see if I can dig it out.

  3. Thanks to MicrodigitUK from:

    kidpressingbuttons (27th March 2014)

  4. #3

    Join Date
    Jun 2013
    Location
    Swindon
    Posts
    21
    Thank Post
    4
    Thanked 4 Times in 3 Posts
    Rep Power
    3
    That would be extremely helpful thank you!

  5. #4

    Join Date
    Jan 2012
    Location
    London
    Posts
    30
    Thank Post
    0
    Thanked 8 Times in 6 Posts
    Rep Power
    7
    You can create a shared account with a PIN code if that is what you are asking?

  6. #5

    Join Date
    Jun 2013
    Location
    Swindon
    Posts
    21
    Thank Post
    4
    Thanked 4 Times in 3 Posts
    Rep Power
    3
    Mostly along the lines that MicroDigitUK was saying. But I'm open to any other suggestions if you have any?

  7. #6

    Join Date
    Jan 2012
    Location
    London
    Posts
    30
    Thank Post
    0
    Thanked 8 Times in 6 Posts
    Rep Power
    7
    MicroDigitUK is spot on, there is a scripting recipe for this called "Require Approval Code", however i don't know how to cycle through PIN codes automatically, might be worth asking papercut support they are very helpful.

  8. #7
    Big_Ted's Avatar
    Join Date
    Apr 2011
    Location
    Clevedon
    Posts
    135
    Thank Post
    1
    Thanked 20 Times in 20 Posts
    Rep Power
    11
    Sounds like something that would require some upkeep. people asking for passwords and then new passwords being created. If you are going to tell them the password anyway what is the point of ever changing it
    In my experience you would be better off using 1 of the many other features in papercut to keep an eye and restrict printing.

  9. #8
    MicrodigitUK's Avatar
    Join Date
    May 2007
    Location
    Wiltshire
    Posts
    336
    Thank Post
    37
    Thanked 55 Times in 51 Posts
    Rep Power
    24
    OK, this script is to reset shared accounts. All of the shared account names must start with "STUDENT" or the script will ignore them. e.g. I have student shared accounts called "STUDENT Art", "STUDENT D and T" and "STUDENT ICT" ...

    This BAT/CMD script is then just scheduled to run at the times you wish to reset the pin codes for the shared accounts.

    You, will need to set the SERVER_COMMAND to the correct path. This must be the shortened abbreviation old DOS style path e.g. "c:\Progra~1" and not "C:\Program Files". Had issues running the script with full path.

    Code:
    @echo off
    
    setlocal EnableDelayedExpansion
    
    ::set SERVER_COMMAND="%~d0%~p0..\..\..\bin\win\server-command.exe"
    ::set SERVER_COMMAND="C:\Program Files\PaperCut NG\server\bin\win\server-command.exe"
    set SERVER_COMMAND=c:\Progra~1\PaperC~1\server\bin\win\server-command.exe
    
    set ACTION="set-shared-account-property"
    
    set /a number=0
    
    FOR /f "delims=" %%A in ('%SERVER_COMMAND% list-shared-accounts') DO (
    	IF /i %number% LSS 1234 (
    		Call :_RandomNumber
    	)
    	call :studentcheck "%%A"
    	set /a number=0
    )
    
    :studentcheck
    set str=%1
    :: remove ampasand from string to prevent errors after removing quotes
    set str=%str:&=%
    :: Remove quotes from string
    set str=%str:~1,-1%
    :: Trim string to the first 7 chars
    set str=%str:~0,7%
    :: if the string is student it is a student account
    IF /I "%str%"=="STUDENT" (
    	FOR /f "tokens=1 delims=" %%B in ('%SERVER_COMMAND% get-shared-account-property %1 disabled') DO (
    		:: see if the acount is disabled and skip if it is
    		IF /I "%%B"=="true" (
    			GOTO :eof
    		) ELSE (
    			::Set the random pin number
    			%SERVER_COMMAND% %ACTION% %1 "pin" %number%
    		)
    	)
    )
    GOTO :eof
     
    :_RandomNumber
     
    :_setmax
    set /a max=%random%
    if %max% LSS 8000 GOTO _setmax
     
    :_setmaxrand
    set /a maxrand=%random%
    if %maxrand% LSS 10000 GOTO _setmaxrand
     
    set /a min=%random%%%7999
    set /a range=%max%-%min%
    set /a minrand=%random%%%9999
    set /a rangerand=%maxrand%-%minrand%
    set /a rand=%random%%%3
    set /a number=(((%random% - %minrand%) * %range%) / ((%rangerand% + %min%) ^^ %rand%))
    if %number% LSS 9999 Call :_RandomNumber
    GOTO :EOF
     
    :_End

  10. Thanks to MicrodigitUK from:

    FragglePete (29th March 2014)

  11. #9
    MicrodigitUK's Avatar
    Join Date
    May 2007
    Location
    Wiltshire
    Posts
    336
    Thank Post
    37
    Thanked 55 Times in 51 Posts
    Rep Power
    24
    Part 2: Ok once you have all of your student shared account codes reset you will need to easily view them. This script will output all of the "STUDENT" shared accounts to a JASON formatted file. This can then be read by a web based application and displayed on a staff intranet or VLE page.

    The script also uses "Iconv" to convert character encoding as most systems read JASON in UTF-8 format. Iconv can be downloaded from:

    http://gnuwin32.sourceforge.net/down...nv-bin-zip.php

    SERVER_COMMAND, JSONFILEPATH and JSONTEMPFILE should be changed to meet the setup of your server.

    Code:
    @echo off
    
    set JSONFILEPATH="C:\Program Files\PaperCut NG\server\custom\web\StudentPins.json"
    set JSONTEMPFILE="C:\Program Files\PaperCut NG\server\custom\web\TempStudentPins.json"
    if exist %JSONTEMPFILE% (del %JSONTEMPFILE%)
    
    ::set SERVER_COMMAND="C:\Program Files\PaperCut MF\server\bin\win\server-command.exe"
    
    set SERVER_COMMAND=c:\Progra~1\PaperC~1\server\bin\win\server-command.exe
    
    setlocal EnableDelayedExpansion
    
    echo { > %JSONTEMPFILE%
    
    echo "data": >> %JSONTEMPFILE%
    
    echo [ >> %JSONTEMPFILE%
    
    SET /A COUNT=0
    
    FOR /f "delims=" %%A in ('%SERVER_COMMAND% list-shared-accounts') DO (call :studentcheck "%%A")
    
    echo %last%
    
    echo ]} >> %JSONTEMPFILE%
    
    ::move /Y %JSONTEMPFILE% %JSONFILEPATH%
    
    iconv -f ISO-8859-1 -t UTF-8 %JSONTEMPFILE% > %JSONFILEPATH%
    
    if exist %JSONTEMPFILE% (del %JSONTEMPFILE%)
    
    :studentcheck
    set str=%1
    :: remove ampasand from string to prevent errors after removing quotes
    set str=%str:&=%
    :: Remove quotes from string
    set str=%str:~1,-1%
    :: Trim string to the first 7 chars
    set str=%str:~0,7%
    :: if the string is student it is a student account
    IF /I "%str%"=="STUDENT" (
    
    	FOR /f "tokens=1 delims=" %%B in ('%SERVER_COMMAND% get-shared-account-property %1 disabled') DO (
    		:: see if the acount is disabled and skip if it is
    		IF /I "%%B"=="true" (
    			GOTO :eof
    		) ELSE (
    			FOR /f "tokens=1 delims=" %%C in ('%SERVER_COMMAND% get-shared-account-property %1 notes') DO (
    				IF /I "%%C"=="Hidden" (
    					GOTO :eof
    				) ELSE (
    					call :studentcheck2 %1 "%%C"
    					GOTO :eof
    				)
    			)
    			call :studentcheck2 %1 ""	
    		)
    	)
    )
    GOTO :eof
    
    :studentcheck2
    FOR /f "tokens=1 delims=" %%D in ('%SERVER_COMMAND% get-shared-account-property %1 pin') DO (
    	FOR /f "tokens=1 delims=" %%E in ('%SERVER_COMMAND% get-shared-account-property %1 balance') DO (
    		FOR /f "tokens=1 delims=" %%F in ('%SERVER_COMMAND% get-shared-account-property %1 restricted') DO (
    			IF "!COUNT!"=="0" (
    				echo {"Account": %1, "Pin": "%%D", "Balance": "%%E", "Restricted": "%%F", "Notes": %2} >> %JSONTEMPFILE%
    			) ELSE (
    				echo ,{"Account": %1, "Pin": "%%D", "Balance": "%%E", "Restricted": "%%F", "Notes": %2} >> %JSONTEMPFILE%
    			)
    			SET /A COUNT+=1
    		)
    	)
    )
    GOTO :eof
     
    :_End

  12. Thanks to MicrodigitUK from:

    FragglePete (29th March 2014)

  13. #10
    MicrodigitUK's Avatar
    Join Date
    May 2007
    Location
    Wiltshire
    Posts
    336
    Thank Post
    37
    Thanked 55 Times in 51 Posts
    Rep Power
    24
    Part 3: The web app to display the information from your JASON file on your VLE or intranet to the staff to distribute the shared account codes.

    I have published 2 options but you could re-produce this in ASP.net, SharePoint, or as a Moodle block. My 2 options given are as simple PHP page and a Frog3 widget.

    PHP version (just change "$JSONfile" to point to your JSON file):
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd">
    <html>
        <head>
            <title>Papercut Student Printing Pins</title>
    
        	<meta name="author" content="MicrodigitUK" />
    
        	<style>
    		        body {background:white; font-family:arial; font-size:10pt; color:#333333;}
    		        div.row {cursor:pointer}
    		        div.el {float:left; width:200px;}
    		        .restr {color:#FE9621; font-weight:bold}
    		        tr.oddrow {background:#EAECEC; }
    		        tr.oddrow2 {background:#fed671; }
    		        tr.evenrow {}
    		        tr :hover {background:#d1e7f0}
    		        span.pinno {font-size:1.2em; background:yellow; padding:1px 3px}
    
    		        td.col1 {padding:2px 20px 0 5px; cursor:pointer}
    		        .col2 {padding:5px 0 0 15px}
    
    		        table.pcut {border-collapse:collapse; border:0; padding:0; width:100%}
    		        table.pcut td {vertical-align:middle; text-align:left; font-size:1em; border:1px solid #D4D8D8; border-width:1px 0; padding:2px 0 2px 10px}
    		        div.spacerbox {clear:both; height:2500px; width:100%;}
    
    		        div.moduleHeader {display: none;}
    		        div.moduleFooter {display: none;}
            </style>
    
            <script type="text/javascript">
            //<![CDATA[
    
            onload=function(){
            	if (document.getElementsByClassName == undefined){
            		document.getElementsByClassName = function(className){
    					var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)");
    					var allElements = document.getElementsByTagName("*");
    					var results = [];
    
    					var element;
    					for (var i = 0; (element = allElements[i]) != null; i++){
    						var elementClass = element.className;
    						if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass)){
    							results.push(element);
    						}
    					}
    
    					return results;
    				}
    			}
    		}
    
    		change = function(what) {
    			var e=document.getElementById(what);
    			if(e.style.display == 'block'){
    				e.style.display = 'none';
    			}
    			else{
    				e.style.display = 'block';
    			}
    			var arr = document.getElementsByClassName("col2");
    			for (i = 0; i < arr.length; i++) {
    				if (arr[i].id != what) {
    					arr[i].style.display = 'none';
    				}
    			}
    		}
    		//]]>
            </script>
    
        </head>
        <body>
            <?php
            	$JSONfile = "http://papercutserver:9191/custom/StudentPins.json";
    			//populate array with mounths
    			$month_name[0]="January";
            	$month_name[1]="February";
    			$month_name[2]="March";
    			$month_name[3]="April";
    			$month_name[4]="May";
    			$month_name[5]="June";
    			$month_name[6]="July";
    			$month_name[7]="August";
    			$month_name[8]="September";
    			$month_name[9]="October";
    			$month_name[10]="November";
    			$month_name[11]="December";
    
    			function http_file_exists($url, $followRedirects = true)
    			{
    			   $url_parsed = parse_url($url);
    			   extract($url_parsed);
    			   if (!@$scheme) $url_parsed = parse_url('http://'.$url);
    			   extract($url_parsed);
    			   if(!@$port) $port = 80;
    			   if(!@$path) $path = '/';
    			   if(@$query) $path .= '?'.$query;
    			   $out = "HEAD $path HTTP/1.0\r\n";
    			   $out .= "Host: $host\r\n";
    			   $out .= "Connection: Close\r\n\r\n";
    			   if(!$fp = @fsockopen($host, $port, $es, $en, 5)){
    			       return false;
    			   }
    			   fwrite($fp, $out);
    			   while (!feof($fp)) {
    			       $s = fgets($fp, 128);
    			       if(($followRedirects) && (preg_match('/^Location:/i', $s) != false)){
    			           fclose($fp);
    			           return http_file_exists(trim(preg_replace("/Location:/i", "", $s)));
    			       }
    			       if(preg_match('/^HTTP(.*?)200/i', $s)){
    			           fclose($fp);
    			           return true;
    			       }
    			   }
    			   fclose($fp);
    			   return false;
    			}
    
    			// try up to 5 times to read the JSON file from $JSONfile
    			for ($x=0; $x<=5; $x++){
    
    				//read the JSON file from Papercut server
    				if (http_file_exists($JSONfile)) {
    					$handle = fopen($JSONfile, "rb");
    					while ( !feof($handle) ) {
    						$myJSONObject = fread($handle, 8192);
    					}
    					fclose($handle);
    				}
    
    				//decode jeason into array
    				$pcutjson = json_decode($myJSONObject, true);
    				if (!empty($pcutjson)) {
    					//brack out of th for loop if JSON was returned
    					$x=5;
    				}
    
    			}
    
    			//check if ther was jason data returned from the file
    			if (empty($pcutjson)) {
    				echo('<p style="color:red">Sorry, there are no published printer pins. Please let ICT Support know so we can fix it!</p>');
    			}
    			else {
    				/////pins found
                    $pcutitems = count($pcutjson['data']);
    
                    $inner = "<table class='pcut'>";
    
                    for ($j=0;$j<$pcutitems;$j++) {
                    	$balance = round($pcutjson['data'][$j]['Balance']*-100);                                         // 123.45   67.8    .09     0       .1
    				    if (strlen((string)$balance) == 2) {
    				    	$bal = "0.".substr((string)$balance,(strlen((string)$balance)-2),strlen((string)$balance));
    					}
    					elseif (strlen((string)$balance) == 1) {
    					    $bal = "0.0".substr((string)$balance,(strlen((string)$balance)-2),strlen((string)$balance));
    					}
    					else {
    					    $bal = substr((string)$balance,0,strlen((string)$balance)-2) .".". substr((string)$balance,strlen((string)$balance)-2,strlen((string)$balance));   // 123.45   67.80   .9      .0      .10
                        }
                        /////classify even table rows so they can be styled
    					if ($j%2) {
    						/////check whether papercut account is restricted, if so highlight text to differentiate
    					    if ($pcutjson['data'][$j]['Restricted']=="true") {
    					    	$inner = $inner."<tr class='evenrow'><td class='col1' onClick='change(\"".$pcutjson['data'][$j]['Pin']."\")'><span class='restr'>".$pcutjson['data'][$j]['Account']."</span><div class='col2' id='".$pcutjson['data'][$j]['Pin']."' style='display: none;'><b>Pin</b>: <span class='pinno'>".$pcutjson['data'][$j]['Pin']."</span> &nbsp; <b>".$month_name[date('m')-1]." balance</b>: £ ".$bal."<br /><b class='restr'>Notes</b>: ".$pcutjson['data'][$j]['Notes']."</td></tr>";
    					    }
    					    else {
    					        $inner = $inner."<tr class='evenrow'><td class='col1' onClick='change(\"".$pcutjson['data'][$j]['Pin']."\")'>".$pcutjson['data'][$j]['Account']."<div class='col2' id='".$pcutjson['data'][$j]['Pin']."' style='display: none;'><b>Pin</b>: <span class='pinno'>".$pcutjson['data'][$j]['Pin']."</span> &nbsp; <b>".$month_name[date('m')-1]." balance</b>: £ ".$bal."</td></tr>";
    					    }
    					}
    					else {
    						/////check whether papercut account is restricted, if so highlight text to differentiate
    						if ($pcutjson['data'][$j]['Restricted']=="true") {
    							$inner = $inner."<tr class='oddrow'><td class='col1' onClick='change(\"".$pcutjson['data'][$j]['Pin']."\")'><span class='restr'>".$pcutjson['data'][$j]['Account']."</span><div class='col2' id='".$pcutjson['data'][$j]['Pin']."' style='display: none;'><b>Pin</b>: <span class='pinno'>".$pcutjson['data'][$j]['Pin']."</span> &nbsp; <b>".$month_name[date('m')-1]." balance</b>: £ ".$bal."<br /><b class='restr'>Notes</b>: ".$pcutjson['data'][$j]['Notes']."</td></tr>";
    						}
    						else {
    							$inner = $inner."<tr class='oddrow'><td class='col1' onClick='change(\"".$pcutjson['data'][$j]['Pin']."\")'>".$pcutjson['data'][$j]['Account']."<div class='col2' id='".$pcutjson['data'][$j]['Pin']."' style='display: none;'><b>Pin</b>: <span class='pinno'>".$pcutjson['data'][$j]['Pin']."</span> &nbsp; <b>".$month_name[date('m')-1]." balance</b>: £ ".$bal."</td></tr>";
    						}
                        }
    
    				}
    				$inner = $inner."</table>";
                    echo($inner);
                }
    
            ?>
        </body>
    </html>

  14. Thanks to MicrodigitUK from:

    FragglePete (29th March 2014)

  15. #11
    MicrodigitUK's Avatar
    Join Date
    May 2007
    Location
    Wiltshire
    Posts
    336
    Thank Post
    37
    Thanked 55 Times in 51 Posts
    Rep Power
    24
    Frog3 UWA Widget version:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:widget="http://www.netvibes.com/ns/"
    xmlns:frog="http://fdp.frogtrade.com/ns/">
        <head>
            <meta name="frogLib" content="1.1" />
            <title>Papercut Student Pins FDP v4</title>
            <frog:roles>
            </frog:roles>
    
            <widget:preferences>
                <preference type="text" name="servuri" label="PaperCut server URI (as set in FDP proxy)" defaultValue="http://printserver.local" />
                <preference type="text" name="servport" label="PaperCut port" defaultValue="9191" />
                <preference type="text" name="jsonfile" label="JSON file in Papercut\server\custom\web\ " defaultValue="StudentPins.json" />
            </widget:preferences>
    
            <script type="text/javascript">
            //<![CDATA[
            // http://printserver.local:9191/server/custom/web/StudentPins.json
            var uid = UWA.Environment.user.id;
            var mybaseobj = {};
            var servuri = widget.getValue('servuri');
            var servport = widget.getValue('servport');
            var jsonfile = widget.getValue('jsonfile');
            var pcutitems = 0;
            
            var thismonth=new Date();
            var month_name=new Array(12);
            month_name[0]="January"
            month_name[1]="February"
            month_name[2]="March"
            month_name[3]="April"
            month_name[4]="May"
            month_name[5]="June"
            month_name[6]="July"
            month_name[7]="August"
            month_name[8]="September"
            month_name[9]="October"
            month_name[10]="November"
            month_name[11]="December"
    
            change = function(what) {
                UWA.extendElement(widget.body.getElementsByClassName(what)[0]).toggle();
                for (var k=0;k<pcutitems;k++) {
                    var h = UWA.extendElement(widget.body.getElementsByClassName("id"+k)[0]);
                    if ("id"+k != what) {
                        h.hide();
                    }
                }
            }
            
            widget.environment.handleLinks = function(){};
            widget.onLoad = function(){
                //alert("onload pcutitems="+pcutitems);
                UWA.Data.getJson(servuri+":"+servport+"/custom/"+jsonfile,mybaseobj.process);
                var c = widget.createElement('div');
                c.addClassName('spacerbox');
                widget.addBody(c);
            }
            
            mybaseobj.process = function(pcuttext) {
                var pcutjson = eval("("+pcuttext+")");
                if (!pcutjson.data) {
                    widget.setBody('<p style="color:red">Sorry, there are no published printer pins. Please let ICT Support know so we can fix it!</p>');
                }
                else {
                    /////pins found
                    pcutitems = pcutjson.data.length;
                    
                    var parray = new Array(pcutjson.data.length);
                    for (var i=0;i<pcutjson.data.length;i++) {
                        parray[i] = new Array(6);
                        parray[i][0] = "id"+i;
                        parray[i][1] = pcutjson.data[i].Account;
                        parray[i][2] = pcutjson.data[i].Pin;
                        parray[i][3] = pcutjson.data[i].Balance;
                        parray[i][4] = pcutjson.data[i].Restricted;
                        parray[i][5] = pcutjson.data[i].Notes;
                    }
                    
                    var pinstable = widget.createElement('div');
                    var inner = "<table class='pcut'>";
                    for (var j=0;j<parray.length;j++) {
                        /////65533 is the ASCII character code for £ symbol, 163 is UTF8
                        /////strip the notes to include on amount
                        /*var searchar = String.fromCharCode(163);
                        var startchar = parray[j][5].search(searchar)+1;
                        var endchar = parray[j][5].length;
                        var restricttext = parray[j][5].substring(startchar,endchar);*/
                        var balance = Math.round(parray[j][3]*-100);                                         // 123.45   67.8    .09     0       .1
                        var num = parseInt(balance).toString();                                            // 12345    6780    9       0       10
                        if (num.length == 2) {
                            var bal = "0."+num.substring(num.length-2,num.length);
                        }
                        else if (num.length == 1) {
                            var bal = "0.0"+num.substring(num.length-2,num.length);
                        }
                        else {
                            var bal = num.substring(0,num.length-2) +"."+ num.substring(num.length-2,num.length);   // 123.45   67.80   .9      .0      .10
                        }
                        
                        /////classify even table rows so they can be styled
                        if (j%2) {
                            /////check whether papercut account is restricted, if so highlight text to differentiate
                            if (parray[j][4]=="true") {
                                inner += "<tr class='evenrow'><td class='col1' onClick='change(\""+parray[j][0]+"\")'><span class='restr'>"+parray[j][1]+"</span><div class='col2 "+parray[j][0]+"' style='display: none;'><b>Pin</b>: <span class='pinno'>"+parray[j][2]+"</span> &nbsp; <b>"+month_name[thismonth.getMonth()]+" balance</b>: £ "+bal+"<br /><b class='restr'>Notes</b>: "+parray[j][5]+"</td></tr>";
                            }
                            else {
                                inner += "<tr class='evenrow'><td class='col1' onClick='change(\""+parray[j][0]+"\")'>"+parray[j][1]+"<div class='col2 "+parray[j][0]+"' style='display: none;'><b>Pin</b>: <span class='pinno'>"+parray[j][2]+"</span> &nbsp; <b>"+month_name[thismonth.getMonth()]+" balance</b>: £ "+bal+"</td></tr>";
                            }
                        }
                        else {
                            /////check whether papercut account is restricted, if so highlight text to differentiate
                            if (parray[j][4]=="true") {
                                /////find ASCII or UTF8 character code for the evasive £ symbol (depending on json encoding)
                                //alert("char 22 = "+parray[j][5].charAt(22)+" in ASCII/UTF8 = "+parray[j][5].charCodeAt(22)+" so restrict: "+restricttext);
                                inner += "<tr class='oddrow'><td class='col1' onClick='change(\""+parray[j][0]+"\")'><span class='restr'>"+parray[j][1]+"</span><div class='col2 "+parray[j][0]+"' style='display: none;'><b>Pin</b>: <span class='pinno'>"+parray[j][2]+"</span> &nbsp; <b>"+month_name[thismonth.getMonth()]+" balance</b>: £ "+bal+"<br /><b class='restr'>Notes</b>: "+parray[j][5]+"</td></tr>";
                            }
                            else {
                                inner += "<tr class='oddrow'><td class='col1' onClick='change(\""+parray[j][0]+"\")'>"+parray[j][1]+"<div class='col2 "+parray[j][0]+"' style='display: none;'><b>Pin</b>: <span class='pinno'>"+parray[j][2]+"</span> &nbsp; <b>"+month_name[thismonth.getMonth()]+" balance</b>: £ "+bal+"</td></tr>";
                            }
                        }
                    }
                    inner += "</table>";
                    pinstable.setHTML(inner);
                    widget.setBody(pinstable);
                }
            }      
            //]]>
            </script>
    
            <style>
            body {background:white; font-family:arial; font-size:10pt; color:#333333;}
            div.row {cursor:pointer}
            div.el {float:left; width:200px;}
            .restr {color:#FE9621; font-weight:bold}
            tr.oddrow {background:#EAECEC; }
            tr.oddrow2 {background:#fed671; }
            tr.evenrow {}
            tr :hover {background:#d1e7f0}
            span.pinno {font-size:1.2em; background:yellow; padding:1px 3px}
            
            td.col1 {padding:2px 20px 0 5px; cursor:pointer}
            .col2 {padding:5px 0 0 15px}
            
            table.pcut {border-collapse:collapse; border:0; padding:0; width:100%}
            table.pcut td {vertical-align:middle; text-align:left; font-size:1em; border:1px solid #D4D8D8; border-width:1px 0; padding:2px 0 2px 10px}
            div.spacerbox {clear:both; height:2500px; width:100%;}
            </style>
        </head>
        <body>
            <p>Retrieving pins...</p>
        </body>
    </html>

  16. #12
    MicrodigitUK's Avatar
    Join Date
    May 2007
    Location
    Wiltshire
    Posts
    336
    Thank Post
    37
    Thanked 55 Times in 51 Posts
    Rep Power
    24
    @kidpressingbuttons a bit of background into how we use shard accounts and scripts in my school.

    We use the PaperCut with shared accounts and donít give anyone credit on their personal accounts.

    We use the shared accounts as department accounts, similar to how most schools do on their photocopiers. Each department has a pin code and they enter that code in the popup window to release there prints.

    Also for students/pupils printing each department has a second student pin code. The only difference being that the student codes change twice a day. (Done with a simple script and scheduled task) This is to stop students memorizing pin codes and printing to the incorrect department.

    All department pin codes are published on intranet/VLE for staff access only, Staff then only give out the code to classes when they want students/pupils to print. At the end of each month the total of Staff and Student shared accounts are charged back to the departments covering toner and paper. (Departments are allocated in budgets enough funds to cover their printing charges.)

SHARE:
+ Post New Thread

Similar Threads

  1. Papercut Print Logging Software
    By Mr_M_Cox in forum Network and Classroom Management
    Replies: 4
    Last Post: 7th April 2011, 11:33 AM
  2. Papercut shared accounts and card top-ups.
    By boomam in forum How do you do....it?
    Replies: 3
    Last Post: 7th April 2010, 04:59 AM
  3. Can you buy Papercut with E-Learning credits
    By Mr_M_Cox in forum Network and Classroom Management
    Replies: 3
    Last Post: 21st July 2007, 07:45 AM
  4. Papercut print monitoring.
    By maniac in forum How do you do....it?
    Replies: 1
    Last Post: 9th March 2007, 01:52 PM
  5. PaperCut
    By steve in forum Recommended Suppliers
    Replies: 0
    Last Post: 24th February 2007, 11:24 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •