<?php
// session_start();
// require('../../_lib/vrdocu0.php');
// require('../../_lib/vr_contab.php');

// PARA CHEQUES CH_GNYA.PHP O CH_GNYA_PICH.PHP

?>

<?php
class vrcelec1
{
	
	function vrcelec1($docu,$idnum,$formato)
	{
// 		formatos
// 			1 - general
// 			2 - diario contable (directo de la tabla cont1)
// 			3 - diario contable (desde el modulo a cont.idfrom)
//			5 - egreso detallado
		
		require('../cfg/res.php');
		require('../../_lib/vrnumlet2.php');
		require('../../_lib/vr_contab.php');
// 		require('../../_lib/vr_invedocu.php');


		$xcelec='vtas.comp.guia.retc.retp.cont';
		$xcelec1='vtas.retp.guia';
		$xcelec2='comp.retc';

		
			$sql_bcos='select * from ctab0 where ctab_codigo in(select ctab from bcos1 where idnum1="'.$_GET['idnum'].'") ';
			$res_bcos=mysql_query($sql_bcos,$link_vcrx);
			$bcos=strtolower(mysql_result($res_bcos,0,'ctab_bcos'));
			$bcos=strtoupper(mysql_result($res_bcos,0,'ctab_bcos'));
		
		
			$sql_tabla='select * from bcos11 where status!="X" and status!="O" and docu="'.$docu.'" and idnum1="'.$idnum.'"';
			$res_tabla=mysql_query($sql_tabla,$link_vcrx);
// echo $sql_tabla;
			$cdoble=1;

			$xbenefic=mysql_result($res_tabla,0,'benefic');
			if ($xbenefic==""){$xbenefic=mysql_result($res_tabla,0,'enti_razsoc');}

		ob_start();		
?>




<html>

<head><meta http-equiv="Content-Type" content="text/html; charset=shift_jis">

<title>Cheque PACIFICO</title>

<style type="text/css">
BODY{
	font-family: Arial;
	font-size: 18px;
	}

@page {
/*    size: 7in 9.25in; */
/* 	 top left bott right */
/*     size: 215mm 297mm;  */
    size: 215mm 297mm; 
   margin: 1mm 1mm 1mm 1mm; /* 	top right bottom left */
}

	
</style>
</head>

<body>
<?php if(mb_stristr('PACI.PICH.INTE.BOLI.GUAY',$bcos)){?>	
<div style="height:7px;"></div>
<!-- <div align="left" style="width:450px; font-size:12px; font-family:courier new; font-weight:bold;"> -->
<div align="left" width="" style="font-size:14px; font-family:arial; font-weight:bold;">
<table width="70%" border="0" cellspacing="0" cellpadding="5px">
<tr></tr>	
<tr>
<td width="20px"></td>	
<td width="40px"></td>	
<td style="font-size:12px;">
<?php echo $xbenefic;?>
</td>
<td align="right" width="10px"  >
<?php echo str_pad(number_format(abs(mysql_result($res_tabla,0,'total')),2),13,'*',STR_PAD_LEFT);	?>
</td>
</tr>	
<tr>
<td></td>	
<td></td>	
<td colspan="2" valign="top" style="height:45px;">
<?php echo str_pad(numtoletras(abs(mysql_result($res_tabla,0,'total'))),100,' -',STR_PAD_RIGHT);	?>
</td>
</tr>	
<tr>
<td width="20px"></td>	
<td colspan="3" >
<?php echo 'Guayaquil, '.mysql_result($res_tabla,0,'fecha');	?>
</td>
</tr>	
</table>	
<?php } ?>	
	
</div>

</body>
</html>
<?php		
//file_put_contents($html1, ob_get_contents());
}
}
?>