* @author Laurent Giovannoni */ include("../session.php"); require_once("../class_functions.php"); require_once("../class_db.php"); require_once("../fpdi.php"); require_once("class_get_barcode.php"); if(file_exists("../".$_SESSION['config']['lang'].'.php')) { include("../".$_SESSION['config']['lang'].'.php'); } else { $_SESSION['error'] = "Language file missing...
"; } //Init $ingoing = $ingoing_label = $priority = $priority_label = $entity = $entity_label = ""; //print_r($_POST); exit; if (isset ($_REQUEST['serviceslist']) && !empty($_REQUEST['serviceslist'])) { if( isset($_REQUEST['ingoing']) ) { $ingoing = $_REQUEST['ingoing']; if ($ingoing =="Y") { $ingoing_label = _INGOING_UP; } else { $ingoing_label = _ONGOING_UP; } } if( isset($_REQUEST['priority']) ) { foreach($_SESSION['priority'] as $k_pt => $d_pt) if( is_array($d_pt) && !empty($d_pt['label']) ) { if ( $k_pt == $_REQUEST['priority']) { $priority = $k_pt; $priority_label = $d_pt['label']; break; } } } $connexion = new dbquery(); $connexion -> connect(); $pdf= new fpdi();//create a new document PDF $cab_pdf= new barcocdeFPDF();//create a new document PDF $pdf->DisplayPreferences('HideMenubar,HideToolbar,HideWindowUI'); $title = _PRINT_SEP_TITLE; //to begin, create a img file to generate CAB for ($i=0; $iquery("select SERVICE FROM ".$_SESSION['tablename']['services']." WHERE ID ='".$entity."' "); $res = $connexion->fetch_object(); $entity_label = html_entity_decode($res->SERVICE); //Keyword if( isset($_SESSION['print_sep_mode']['KEYWORD']) ) { $keyword = $_SESSION['print_sep_mode']['KEYWORD']; } else { $keyword = "MAARCH"; } //Ingoing $code = "*".$keyword." ".trim($entity); if( isset($_REQUEST['ingoing']) ) $code .= " ".$ingoing; if( isset($_REQUEST['priority']) ) $code .= " ".$priority; $code .="*"; $pdf->addPage(); //Add a blank page $pdf->SetFont('Arial','B',20); $pdf->Cell(180,20,$title,0,1, 'C'); $type = 'C39'; $p_cab = $cab_pdf->generateBarCode($type,$code, 40); $pdf->Image($p_cab,40,35,120); unlink($p_cab); $pdf->Cell(180,80,$code,0,1, 'C'); if( isset($_REQUEST['ingoing']) ) $pdf->Cell(180,10,'',0,1, 'C'); if( isset($_REQUEST['priority']) ) $pdf->Cell(180,10,'',0,1, 'C'); $pdf->Cell(180,10, utf8_decode(_ENTITY." : ".$entity_label),1,1, 'C'); if( isset($_REQUEST['ingoing']) ) $pdf->Cell(180,10, utf8_decode(_NATURE." : ".$ingoing_label),1,1, 'C'); if( isset($_REQUEST['priority']) ) $pdf->Cell(180,10, html_entity_decode(utf8_decode(_PRIORITY." : ".$priority_label)),1,1, 'C'); } $pdf->AutoPrint(true); $pdf->Output("tmp_print".DIRECTORY_SEPARATOR.$_SESSION['user']['UserId'].".PDF"); ?>