<?php

require_once('pdf/pdf_js.php');
include('DV36000_CL.php');
session_cache_limiter('private');
session_start();
$com = "I";
include("DMMYSQLG.php");
require_once("DF80000.php");
include("DMMYSQLG.php");
//include("DSA3000.php");
class PDF extends PDF_JavaScript{
	function AutoPrint($dialog=false){
		//Open the print dialog or start printing immediately on the standard printer
		$param=($dialog ? 'true' : 'false');
		$script="print($param);";
		$this->IncludeJS($script);
	}
	
	function AutoPrintToPrinter($server, $printer, $dialog=false){
		//Print on a shared printer (requires at least Acrobat 6)
		$script = "var pp = getPrintParams();";
		if($dialog)
			$script .= "pp.interactive = pp.constants.interactionLevel.full;";
		else
			$script .= "pp.interactive = pp.constants.interactionLevel.automatic;";
		$script .= "pp.printerName = '\\\\\\\\".$server."\\\\".$printer."';";
		$script .= "print(pp);";
		$this->IncludeJS($script);
	}
	function SendToDefaultPrinter($dialog=false,$printer="",$arrOpt=NULL){
		$script  = "var pp = getPrintParams();";
		$script .= "fv = pp.constants.flagValues;";
		$script .= "pp.flags |=(fv.suppressCenter|fv.suppressRotate);";
		$script .= "pp.pageHandling=pp.constants.handling.none;";		
		($dialog)?($script .= "pp.interactive = pp.constants.interactionLevel.full;"):($script .= "pp.interactive = pp.constants.interactionLevel.automatic;");
		$script .= "this.print(pp);";
		$script .= "this.print(pp);";
		$script .= "this.print(pp);";
		$this->IncludeJS($script);				
	}
	
	function GetPageWidth(){
		return $this->fw;
	}
	
	function GetPageHeight(){
		return $this->fh;
	}
	
	function GetRMargin(){
		return $this->rMargin;
	}
	function GetLMargin(){
		return $this->rMargin;
	}
	function GetTMargin(){
		return $this->rMargin;
	}
	function GetBMargin(){
		return $this->rMargin;
	}

}
$id_encfac=$_REQUEST["bot"];
$dt_encfac['idEncFac']=$id_encfac;
$dataDet['idEncFac']=$id_encfac;
$dataDet['idDetFac']=$id_detfac;
$encFac = new EncFac($dt_encfac);
$detFac = new DetFac($dataDet);
$res=$encFac->busReg();
$dt_encfac=mysqli_fetch_array($res);

if(!file_exists($dt_encfac['nomRepTipFac'].".php")){
	echo "ERROR: NO FORMAT FOUND ($dt_encfac['nomRepTipFac'].\".php\")";
}else{
	require_once($dt_encfac['nomRepTipFac'].".php");
}
?>