Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function PrintIO_UDF($vaPrint){
- $cType = aCfg("msJavaPrint");
- $cTypeOS = GetSetting("cSession_optOS") ;
- if($cType == "Y"){
- PrintIO_UDF2($vaPrint) ;
- }else{
- PrintIO($vaPrint,true,0,'','/dev/lp0') ;
- }
- }
- function PrintIO_UDF2($vaPrint,$nPortID=1){
- global $lNoJS;
- static $nCount = 0 ;
- $nCount ++ ;
- if($nCount > 5) $nCount = 5 ;
- $cFrameID = "IFRAMEPRINT_" . $nCount ;
- $cP = "" ;
- $cP = CHR(15) ; //RESET PRINTER
- $vaPrint[] = CHR(12) ;
- foreach($vaPrint as $key=>$value){
- //$cP .= $value . "\n" ;
- $cP .= CHR(27) . CHR(69) . $value . "\n" .CHR(27) . CHR(70);
- }
- $cTmpFile = GetTmpFile() . ".html" ;
- $cHTML = "<html><body onload='document.frmPrint.submit();'><form name='frmPrint' action='http://127.0.0.1:2700/print' method='post'>" ;
- $cHTML .= "<input type='hidden' name='nPort' value='$nPortID' />" ;
- $cHTML .= "<textarea name='cPrint'>$cP</textarea>" ;
- $cHTML .= "</form></body></html>" ;
- $fp = fopen($cTmpFile, "w");
- fwrite($fp, $cHTML);
- fclose($fp);
- if($lNoJS){
- echo('
- var o = a.getById("' . $cFrameID . '") ;
- if(o == null){
- o = a.addObj("iframe") ;
- o.id = "' . $cFrameID . '" ;
- }
- o.width = 0 ;
- o.height = 0 ;
- o.src = "' . $cTmpFile . '" ;
- ') ;
- }else{
- echo('
- <iframe id="' . $cFrameID . '" width=0 height=0 src="'. $cTmpFile.'"></iframe>
- ');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement