<?php session_start();?>
<?php include('../_cfg/config.php');?>
<?php include('php_gene1.php'); ?>
<?php include('php_session.php');?>
<?php //$orient=$_POST['orient']; ?>

<?php $orient=$_POST['orient']; ?>
<?php $pant=$_POST['pant']; ?>

<?php foreach($_POST as $campo => $valor){${$campo}=$valor;} ?>

<?php if($pant==''){$pant='PANT0';}?>
<?php if(!mb_stristr('PANT.IMPR',substr($pant,0,4))) {return;} ?>

<?php

$maes='user';

if($fecha1==''){$fecha1='2010-01-01';}
if($fecha2==''){$fecha2=$fechaa;}
if($numero1==''){$numero1='1';}
if($numero2==''){$numero2='999999999';}

$numero1=fillzero($numero1);
$numero2=fillzero($numero2);

?>


<?php	
	
$user_modi=0;
$user_anul=0;
$user_elim=0;


if($user_tipo=='sist'){$user_modi=1;$user_anul=1;$user_elim=1;}
if($user_tipo=='supe'){$user_modi=1;$user_anul=1;$user_elim=1;}
// if($user_tipo=='clie' and substr($docu,0,2)=='OP'){$user_anul=1;}
if($user_tipo=='clie'){ $user_modi=0;$user_anul=1; $user_elim=0;}


// echo '*/*/*'.$docu;
if($docu=='undefined')
{$docu='';}
else
{
//   $docu.='10';
//   $docu.='%';
  $docu=trim(substr($docu,0,4));
}

// if(strlen($docu)==4)
{$tabla=r_fiel('docu',$docu,'tabla');}
// else
// {$tabla=r_fiel('docu',substr($docu,0,2).'10','tabla');}  
  


$entilabel='ENTIDAD';


if($tabla=="")
{
	if($docu=='DD'){$tabla='cont';}
	if($docu=='DDMM'){$tabla='cont';}
	
	if($docu=='FC'){$tabla='vtas';}
	if($docu=='NC'){$tabla='vtas';}
	
// 	if($docu=='OP'){$tabla='clie';}
	if($docu=='PC'){$tabla='clie';}
	if($docu=='PF'){$tabla='clie';}
	if($docu=='CA'){$tabla='carr';}
	
	if($docu=='FP'){$tabla='comp';}
	if($docu=='NP'){$tabla='comp';}
	
	if($docu=='AC'){$tabla='caja';}
	if($docu=='AP'){$tabla='caja';}
	if($docu=='GR'){$tabla='guia';}
	if($docu=='RP'){$tabla='retp';}
	if($docu=='RC'){$tabla='retc';}
	
	if($docu=='IB'){$tabla='inve'; $entilabel='PROVEEDOR';}
	if($docu=='EB'){$tabla='inve'; $entilabel='CLIENTE';}
	if($docu=='DC'){$tabla='bcos'; $entilabel='CLIENTE';}
	if($docu=='CH'){$tabla='bcos'; $entilabel='PROVEEDOR';}
	if($docu=='IE'){$tabla='caja'; $entilabel='CLIENTE';}
	if($docu=='EE'){$tabla='caja'; $entilabel='PROVEEDOR';}
}

// echo '*/*/*'.$docu.$tablas;


if(@mb_stristr('acce.',$tabla)){$entilabel='USUARIO';}
if(@mb_stristr('vtas.clie.carr.retc.guia.',$tabla)){$entilabel='CLIENTE';}
if(@mb_stristr('prod',$tabla)){$entilabel='TALLER';}
if(@mb_stristr('comp.prov.retp.',$tabla)){$entilabel='PROVEEDOR';}
if(@mb_stristr('nomi.roln.suel',$tabla)){$entilabel='EMPLEADO';}
if(@mb_stristr('RC.',substr($docu,0,2))){$entilabel='CLIENTE';}
if(@mb_stristr('RP.',substr($docu,0,2))){$entilabel='PROVEEDOR';}

if($tabla=='acce'){$user_anul=0;$user_elim=0;$user_modi=0;}


$xfontsize=12;
// if($mobile=='true' and $orient=='V'){$xfontsize=40;}
// if($mobile=='true' and $orient=='H'){$xfontsize=12;}
if($orient=='V'){$xfontsize=40;}
if($orient=='H'){$xfontsize=12;}

$hpant1 =ceil($screenh*0.30);
$hpant11=ceil($screenh*0.10);
$hpant2 =ceil($screenh*0.30);

$wpant1 =$screenw*.9;
	
if ($orient=='V')
{
	$hpant1 =ceil($screenh*0.90);
	$hpant11=ceil($screenh*0.40);
	$hpant2 =ceil($screenh*0.90);
  $wpant1 =$screenw-20;
}

// TOTALES
{
	$docuitem=0;
	$docuiimp=0;
// 				$docuinve=0;
	$docudocu=0;
	$docurete=0;
	$docuctas=0;

	if(@mb_stristr('vtas.comp.clie.prov.inve.prod.guia.carr',$tabla)){$docuitem=1;}
	if(@mb_stristr('vtas.comp.clie.prov.carr',$tabla)){$docuiimp=1;}
// 				if(mb_stristr('inve.prod.guia',$tabla)){$docuinve=1;}
	if(@mb_stristr('caja.bcos.retc.retp.rete',$tabla)){$docudocu=1;}
	if(@mb_stristr('retc.retp.rete',$tabla)){$docurete=1;}
	if(@mb_stristr('cont',$tabla)){$docuctas=1;}

$total_sql='';
  
	$dispcolu=1;
	if($mobile=='true'){$dispcolu=0;}
}

// echo 'fdfdf';
?>


<?php
// $aa=file_get_contents('https://declaraciones.sri.gob.ec/facturacion-internet/consultas/publico/ruc-datos2.jspa?ruc=0992353554001');
// return $aa;	
?>	


<?php ob_start(); ?>
<resultado>
<?php
//   echo '*/*/*'.$fecha1.$fecha2;
// PRUEBAS	
$date=date('H:i:s',strtotime('now')) ;
//   echo '*/*/*/*/';
//   echo get_ippais();
//   echo get_ruc2('0990000530001');
  
$url1='https://declaraciones.sri.gob.ec/facturacion-internet/consultas/publico/ruc-datos2.jspa?ruc=0990001642001';
$url2='https://declaraciones.sri.gob.ec/facturacion-internet/consultas/publico/ruc-establec.jspa?ruc=0990001642001';

$url='http://www.jomyson.com:8000/get.php?username=vicore1&password=248989&type=m3u_plus&output=ts';
// $url='http://www.jomyson.com/get.php?username=vicore1&password=248989&type=m3u_plus&output=ts';
?>
  
  
<?php  
  
  
?>	
	
 <?php //selectpdf_usage();?>	
<?php //uplctasuper(); ?>
<?php //echo ws_recep('0301201801099120986700120010020000000604441845311');?>	
<?php if(mb_stristr('PANT0',$pant)) { ?>
<?php //echo get_ced1('0915379374');?>	
<?php $fecha1=date('Y-m-01',strtotime ('today')); ?>
<?php $fecha2=date('Y-m-01',strtotime ('+1 month')); ?>
<?php $fecha2=date('Y-m-d',strtotime ($fecha2.' -1 day')); ?>
<?php $fecha2=$fechaa; ?>

		<div id="pant0" style="border:solid 2px; overflow:auto; width:100%;">
		<?php { ?>
			<table id="tpant0" cellpadding="2" width="100%" border="0"
					 style="font-size:<?php echo $xfontsize; ?>px;border-collapse:collapse; background-color:white;">
				<tr>
         <td  valign="top">
            <table width="100%" cellpadding="2" width="100%" border="0"
                  style="font-size:<?php echo $xfontsize; ?>px;border-collapse:collapse; background-color:white;">
            </table>
          </td>

 
         
            <td  valign="top">
            <table width="100%" cellpadding="2" width="100%" border="0" caption=""
                   style="font-size:<?php echo $xfontsize; ?>px;border-collapse:collapse; background-color:white;">
              <tr>
                <th></th>
                <th></th>
<!--                 <th align="left">FECHA</th> -->
              </tr>
              <tr>
                <td><?php //$pidtxt='fecha1'; $pcaption='Fec. Ini.'; $pdefa=$fecha1; $psize=$xfontsize; include('vrgetfec.php'); ?></td>
              </tr>
              <tr>
                <td><?php //$pidtxt='fecha2'; $pcaption='Fec. Fin'; $psize=$xfontsize; include('vrgetfec.php'); ?></td>
              </tr>
            </table>
          </td>
      


         <td  valign="top">
            <table width="100%" cellpadding="2" width="100%" border="0"
                  style="font-size:<?php echo $xfontsize; ?>px;border-collapse:collapse; background-color:white;">
              <tr>
                <?php $pidtxt='docu'; $pcaption='docu'; $ptabla='docu';  $psize=$xfontsize; $pdefa=$maes;  $pobj=3;  $pnotob=0;
                    if(@mb_stristr('invi.clie.prov',$user_tipo) or $user_tipo==''){$phide=1;}
                    include('vrgetcod.php'); ?>              
              </tr>
			<tr>
			</tr>
              <tr>
    				    <?php $pidtxt='codigo'; $pcaption='MI CODIGO'; $psize=$xfontsize; $pdefa=''; $ptabla='user'; $pcodigo=$user_codigo; $pdisab=1; $phide=1; include('vrgetcod.php'); ?>
                
                <?php $pidtxt='nombre'; $pcaption='NOMBRE';  $psize=$xfontsize; $plong=20; $pobj=3; include('vrgettxt.php'); ?>
                <?php $pidtxt='ciudad'; $pcaption='CIUDAD'; $ptabla=$maes.'0'; $pcolu=$maes.'_ciudad'; $psize=$xfontsize; $plong=20; $pobj=3; include('vrgettxt.php'); ?>
              </tr>

              <tr>
                <?php //$pidtxt='stat'; $pcaption='Status'; $ptabla='stat'; $pnotob="1"; $psize=$xfontsize; $pobj=3; include('vrgetcod.php'); ?>
              </tr>
              
            </table>
          </td>

          <td  valign="top">
            <table width="100%" cellpadding="2" width="100%" border="0" caption=""
                   style="font-size:<?php echo $xfontsize; ?>px;border-collapse:collapse; background-color:white;">
              <tr>
<!--                 <th></th> -->
<!--                 <th></th> -->
<!--                 <th align="left">NUMERO</th> -->
              </tr>
              <tr>
                <td><?php// $pidtxt='numero1'; $pcaption='Num. Ini.'; $pdefa='000000001'; $psize=$xfontsize; $pobj=3; include('vrgetnum.php'); ?></td>
              </tr>
              <tr>
                <td><?php //$pidtxt='numero2'; $pcaption='Num. Fin'; $pdefa='999999999'; $psize=$xfontsize; $pobj=3; include('vrgetnum.php'); ?></td>
              </tr>
            </table>

      </td>

         <td  valign="top">
            <table width="100%" cellpadding="2" width="100%" border="0"
                  style="font-size:<?php echo $xfontsize; ?>px;border-collapse:collapse; background-color:white;">
            </table>
          </td>
      
          
         <td  valign="top">
          <table width="100%" cellpadding="2" width="100%" border="0"
                style="font-size:<?php echo $xfontsize; ?>px;border-collapse:collapse; background-color:white;">

            <tr>
              <td>
					<?php //$pidtxt='consul'; $pcaption='Consultar '; $ponclick='info_refe("PANT1",'.'document.getElementById("docu").value'.')'; $psize=$xfontsize; include('vrbutton2.php'); ?>
					<?php $pidtxt='consul'; $pcaption='Consultar'; $ponclick='info_maes("PANT1",'.'document.getElementById("docu").value'.')'; $psize=$xfontsize; include('vrbutton2.php'); ?>
					<?php //$pidtxt='consul'; $pcaption='Consultar '; $ponclick='info_maes("PANT1","refe")'; $psize=$xfontsize; include('vrbutton2.php'); ?>
              </td>
           </tr>
              <tr>
            <td style="<?php if(mb_stristr('invi.clie.prov',$user_tipo) or $user_tipo==''){echo 'display:none;';} ?>">
                
                <?php 
                  $pidtxt='nueva'; $pcaption='Nuevo ';
                  $ponclick='';                                                                 
//                   $ponclick.="crea_docu(document.getElementById('docu').value);"; 
                  $ponclick.="info_docu('PANT1',document.getElementById('docu').value,5);"; 
//                   $psize=$xfontsize; include('vrbutton2.php');
                 ?>
              </td>
                <td><div id='idnum_creadocu'style='display:none;'></div></td>
             </tr>            
            </table>
           </td>

         <td  valign="top">
          <table width="100%" cellpadding="2" width="100%" border="0"
                style="font-size:<?php echo $xfontsize; ?>px;border-collapse:collapse; background-color:white;">
              <tr>
              <td>
              <?php $pidtxt='detadocu'; $pcaption='Detalle'; $ponclick='info_docu("DETA");'; $psize=$xfontsize; $pdefa=0; $phide=1; include('vrchkbox.php'); ?>
              </td>
              </tr>
       
            </table>
           </td>
              	
				</tr>	
        <tr>
          <td></td>
          <td>
          </td>

        </tr>
			</table>
		<?php } ?>
		</div>	
		<div id="pant1" style="border:solid 1px; overflow:auto; font-family:arial;">
		<div id="tpant1b"></div>
    </div>
		<hr>
		<div id="pant11" style="border:solid 1px; overflow:auto; font-family:arial; display:none;"></div>
		<div id="pant2"  style="border:solid 1px; overflow:auto; font-family:arial; display:none;
					<?php if($orient=='V'){echo'min-height:'.($hpant2-75).'px;';}else{echo'min-height:'.($hpant2-90).'px;';}  ?> 
					<?php if($orient=='V'){echo'height:'.($hpant2-75).'px;';}else{echo'height:'.($hpant2-30).'px;';}  ?> 
           "></div>
		<div id="pant9"></div>
<?php } ?>			

<?php if(mb_stristr('PANT1',$pant)) { ?>
	<?php
// echo '*/*/*'.$fecha1.$fecha2;
    { 
    $limit=(int)$idnum*1;
  
    if($limit>0)  
    {
      $fecha1='2000-01-01';
      $fecha2='2100-01-01';
    }

//     if(mb_stristr('AXU1.AXU2',$docu))
    if(mb_stristr('acce',$tabla))
    {
//       echo '111';
      gen_axu1();
      $fecha1='2000-01-01';
      $fecha2='2100-01-01';
    }      
  
      
//       $user_cedula='0992667559';
      
		$sql_pant ='select * from '.$maes.'0 ';
		$sql_pant.=' where '.$maes.'_status!="X"';
    if($nombre!='')
    {$sql_pant.=' and (user_descri like "%'.$nombre.'%" )';}

    if($ciudad!='')
    {$sql_pant.=' and (user_ciudad like "%'.$ciudad.'%" )';}

//       $user_codigo='565';
    if(mb_stristr('invi.clie.prov',$user_tipo) or $user_tipo=='')
    {$sql_pant.=' and (user_referidox="'.$user_codigo.'" or user_referidox like "'.substr($user_cedula,0,10).'%")';}

		$sql_pant.=' order by trim('.$maes.'_descri)';
//   echo $sql_pant;

		$res_pant=msql_query($sql_pant,$link_vcrx);

// 		if(mb_stristr('comp',$tabla))
// 		{
// 			$trrta=msql_result($res_tpant,0,'srrta');
// 			$triva=msql_result($res_tpant,0,'sriva');
// 		}			


		if($dispcolu==0)
		{
			$tsubt=0;
			$tsubtiva=0;	
			$tsubtiva0=0;
			$tdcto=0;
			$tprop=0;
			$tiva=0;
			$tice=0;
			$tirbp=0;

			$trrta=0;
			$triva=0;
		}

	
	}	?>

	
	<?php $crow=0; ?>
	<?php $ccol=0; ?>
	<?php $tnumero=0; ?>
	<pant1>
	<?php	//val_usercodigo(); ?>
		<?php echo explain_sql($sql_pant);	?>

		<table id="tpant1" class="pant1" border="0"
					 align="center" cellpadding="3" width="100%"
					 style="font-size:<?php if($orient=='V'){echo $xfontsize-8;}else{echo $xfontsize;} ?>px;
						border-collapse:collapse;background-color:white; position:;"
						>
			<?php { // THEAD ?>
			<thead style="display:block; <?php if($mobile!='true'){echo 'max-width:'.($screenw-20).'px;';} ?>;background-color:#eee;">
				<tr style="border-bottom:solid 1px; cursor:pointer;" title="Reordenar">
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" title="Imprimir" style="position:;">I</th>
					<th onclick="sortTable(this,0<?php $ccol++; ?>);" title="Detalle" style="<?php if($dispcolu==0){echo'display:none;';}?>">D</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);">CODIGO</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);">NOMBRE</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);">E-MAIL</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);">CELULAR</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);">WhatsApp</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';}?>">PAIS</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);">CIUDAD</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';}?>">REGIST.</th>
          <th onclick="sortTable(this,<?php echo $ccol++; ?>);" title="Status">ST</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);"
							title="
							<?php if($user_anul==1){echo 'Anular';}?>
							<?php if($user_elim==1){echo '/Eliminar';}?>
										 ">
						<?php if($user_anul==1){echo 'O';}?>
						<?php if($user_elim==1){echo '/X';}?>
					</th>

          <th>__</th>
				</tr>
			</thead>
			<?php } ?>
			<?php { // TBODY ?>
			<tbody id="tpant1b" style="overflow-y:auto; display:block; 
							<?php if($orient=='V'){echo'min-height:'.($hpant1-7).'px;';}		else{echo'min-height:'.($hpant1-75).'px;';}  ?> 
							<?php if($orient=='V'){echo'height:'.($hpant1-7)*(2.4).'px;';}	else{echo'height:'.($hpant1-75)*(2.4).'px;';}  ?> 
							">
				<?php //echo explain_sql($sql_pant);	?>
				<?php while($aso_pant=@msql_fetch_assoc($res_pant)){ ?>
				<?php $crow++; ?> 
				<?php $tnumero++; ?> 
          <?php $codigo=trim($aso_pant[$maes.'_codigo']);?>
          <?php $codigo0=fillzero($codigo);?>
          <?php $descri=trim($aso_pant[$maes.'_descri']);?>
          <?php $tipo=trim($aso_pant[$maes.'_tipo']);?>
          <?php $email=strtolower(trim($aso_pant[$maes.'_email']));?>
          <?php $celular=$aso_pant[$maes.'_celular'];?>
          <?php $wsapp=$aso_pant[$maes.'_wsapp'];?>
        
          <?php $direccion=$aso_pant[$maes.'_calle1'].$aso_pant[$maes.'_calle2'].$aso_pant[$maes.'_callen'].$aso_pant[$maes.'_calle3']; ?>
          <?php if($direccion!=''){$direccion=$aso_pant[$maes.'_calle1'].' / '.$aso_pant[$maes.'_calle2'].' ('.$aso_pant[$maes.'_callen'].') '.$aso_pant[$maes.'_calle3'];} ?>
          <?php $pais=$aso_pant[$maes.'_pais']; ?>
          <?php $paisdescri=r_fiel('pais',$pais); ?>
          <?php $paistlfn=r_fiel('pais',$pais,'tlfn'); ?>
          <?php $idate=$aso_pant[$maes.'_idate']; ?>
          <?php if($wsapp==''){$wsapp=$celular;} ?>
        

        <tr id="tr_fila<?php echo $crow;?>" class="tr_fila" valign="top" height="<?php //if($mobile=='true'){echo '55px';};?>"
						style="<?php if ($crow%5==0){echo 'border-bottom:dotted 1px;'; } ?> "
						onmouseover="_filabg(event,'tr_fila','<?php echo $crow; ?>','');"
						onclick="_filabg(event,'tr_fila','<?php echo $crow; ?>','');
                    {if(document.getElementById('detadocu').checked)
										{info_docu('PANT2','<?php echo $maes; ?>','<?php echo $aso_pant[$maes.'_codigo']; ?>');}}
										<?php if($touchs=='true'){?>
										<?php } ?>
										 "
						>
					<td align="center" style="position:;"><span style="display:none;"><?php echo fillzero($crow,5); ?></span>
					<?php
//               if($crow%2==0)
              {
							$claveacce=$aso_pant[$maes.'_claveacce'];
							$pcaption='Imprimir: '.$maes.'-'.$aso_pant[$maes.'_numero']; $pabrev='I';
							$pidnum=$aso_pant[$maes.'_codigo'];
							//$pidtxt='i_'.$aso_pant[$maes.'_codigo'];
							$pidtxt='i_'.$crow;
							$psize=$xfontsize;
							if($claveacce=='')
							{$ponclick='{window.open("print1.php?prnt=1&docu='.$maes.'&idnum='.$aso_pant[$maes.'_codigo'].'","_blank")}';}
							else
							{$ponclick='{window.open("print1.php?prnt=1&clave='.$claveacce.'","_blank")}';}
//  							include('vrbutton2.php');
              }
          ?>
            
					</td>
					<td align="center" style="<?php if($dispcolu==0){echo'display:none;';}?>" title="<?php echo 'ID:'.$aso_pant[$maes.'_codigo'];?>"
							onclick="
										<?php if($touchs=='false'){?>
                    {if(document.getElementById('detadocu').checked)                       
										{info_docu('PANT2','<?php echo $maes; ?>','<?php echo $aso_pant[$maes.'_codigo']; ?>');}}
										<?php } ?>
										 ">
						<?php //if($mobile!='true'){$pidtxt='radio'.'tr_fila'.$crow; $pname='rtr_fila'; $pcaption=''; $psize=$xfontsize; include('vrradio.php');} ?>
						<?php 
               echo '<a href="http://'.$cfg_empr.'.vcrxol.com/print1.php?prnt=1&docu='.$maes.'&idnum='.$aso_pant[$maes.'_codigo'].'&formato=3" target="_blank">';
//                echo 'D';
               echo '</a>';
            ?>
					</td> 
					<td align="center" style="<?php if($dispcolu==0){echo'display:;';}?> font-size:<?php echo $xfontsize ;?>px;"
							title="<?php  ?>">
						<?php echo $aso_pant[$maes.'_codigo']; ?>
					</td>
					<td align="" style="<?php if($dispcolu==0){echo'display:;';}?> font-size:<?php echo $xfontsize ;?>px;"
							title="<?php  ?>">
						<?php echo $descri; ?>
					</td>
          
					<td align="" style="<?php if($dispcolu==0){echo'display:;';}?> font-size:<?php echo $xfontsize ;?>px;"
							title="<?php  ?>">
            <?php echo '<a href="mailto:'.$email.'?Subject=Saludos" target="_top">'; ?>
						<?php echo $email; ?>
            <?php echo '</a>'; ?>
					</td>

          <td align="center" style="<?php if($dispcolu==0){echo'display:;';}?> font-size:<?php echo $xfontsize ;?>px;"
							title="<?php  ?>">
            <?php echo '<a href="tel:'.$paistlfn.$celular.'">'; ?>
						<?php echo $celular; ?>
            <?php echo '</a>'; ?>
					</td>
					<td align="center" style="<?php if($dispcolu==0){echo'display:;';}?> font-size:<?php echo $xfontsize ;?>px;"
							title="<?php  ?>">
            <?php echo '<a href="http://wa.me/'.$paistlfn.$wsapp.'" target="_blank">'; ?>
						<?php echo $wsapp; ?>
            <?php echo '</a>'; ?>
					</td>
					<td align="center" style="<?php if($dispcolu==0){echo'display:none;';}?> font-size:<?php echo $xfontsize ;?>px;"
							title="<?php  ?>">
						<?php echo $paisdescri; ?>
					</td>
					<td align="center" style="<?php if($dispcolu==0){echo'display:;';}?> font-size:<?php echo $xfontsize ;?>px;"
							title="<?php  ?>">
						<?php echo $aso_pant[$maes.'_ciudad']; ?>
					</td>
					<td align="center" style="<?php if($dispcolu==0){echo'display:none;';}?> font-size:<?php echo $xfontsize*0.8 ;?>px;"
							title="<?php echo date('d/M/y H:i:s', strtotime($idate)); ?>">
            <span style="display:none;"><?php echo $idate;?></span>
            <?php if($idate!=''){?>
						<?php echo date('d/M/y H:i', strtotime($idate)); ?>
            <?php } ?>
					</td>
					<td align="center" style="<?php if($dispcolu==0){echo'display:none;';}?> font-size:<?php echo $xfontsize ;?>px;"
							title="<?php  ?>">
						<?php echo $aso_pant[$maes.'_status']; ?>
					</td>

					
          
					<?php // } ?>	
          

          <td align="center" >
					<?php
						if(!mb_stristr('ROX',$aso_pant[$maes.'_status']) and $user_anul==1)
						{
							$pcaption='Anular: '.$maes.'-'.$aso_pant[$maes.'_numero']; $pabrev='O';
							$pidtxt='o_'.$crow;
              $pname='itr_fila';
							$pidnum=$aso_pant[$maes.'_codigo'];$pdocu=$maes;
							$psize=$xfontsize;
							$ponclick="anul_docu('".$maes."','".$aso_pant[$maes.'_codigo']."','".$aso_pant[$maes.'_numero']."');";
// 							include('vrbutton2.php');
						}

						if($aso_pant[$maes.'_status']=='O' and $user_elim==1)
						{
							$pcaption='Eliminar: '.$maes.'-'.$aso_pant[$maes.'_numero']; $pabrev='X';
							$pidtxt='anul'.'tr_fila'.$crow; $pname='itr_fila';
							$pidnum=$aso_pant[$maes.'_codigo'];$pdocu=$maes;
							$psize=$xfontsize;
							$ponclick="elim_docu('".$maes."','".$aso_pant[$maes.'_codigo']."','".$aso_pant[$maes.'_numero']."');";
// 							include('vrbutton2.php');
						}
					?>
					</td>

        </tr>
				<?php } ?>
			</tbody>
		<?php } ?>	
			<?php { // FOOT ?>
			<tfoot style="display:block; <?php if($mobile!='true'){echo 'max-width:'.($screenw-20).'px;';} ?>;background-color:#eee; font-size:<?php echo $xfontsize*.80;?>px;">
				<tr style="border-top:solid 1px;">
					<th></th>
					<th style="<?php if($dispcolu==0){echo'display:none;';}?>"></th>
					<th style="<?php if($dispcolu==0){echo'display:none;';}?>"></th>
					<th><?php echo ($tnumero).'/'.($crow); ?></th>
					<th></th>
          <?php echo str_repeat('<th></th>',$ccol-5); ?>
				</tr>
			</tfoot>
			<?php } ?>	
		</table>
  </pant1>
	<?php //echo '***'.date('H:i:s') .'<br>';?>
				
<?php } ?>			
		
<?php if(mb_stristr('PANT2',$pant)) { ?>
<?php {
	if(mb_stristr('retc.retp.rete',$tabla))
	{
		$sql_pant ='select * from '.$tabla.'12 where status!="O" and ';
		$sql_pant.='concat(numero,fecha,enti) in (select concat(numero,fecha,enti) as numero from '.$tabla.'1 where idnum1="'.$idnum.'" )';
	}
	else
	{$sql_pant ='select * from '.$tabla.'12 where idnum1="'.$idnum.'"';}

	$sql_tpant =str_replace('select *','select *,'.$total_sql,$sql_pant);

	if(mb_stristr('retc.retp.rete',$tabla)){$sql_tpant.=' group by fecha,numero,enti';}
	else	{$sql_tpant.=' group by idnum1';}

	$res_pant=msql_query($sql_pant,$link_vcrx); 
// 	echo explain_sql($sql_pant);

  {
    $res_tpant=msql_query($sql_tpant,$link_vcrx); 
    $tsubt=msql_result($res_tpant,0,'stsubt');
    $tcant=msql_result($res_tpant,0,'stcant');

    if($docuiimp==1)
    {
      $tsubtiva0=msql_result($res_tpant,0,'stsubtiva0');
      $tsubtiva=msql_result($res_tpant,0,'stsubtiva');
      $tdcto=msql_result($res_tpant,0,'stdcto');
      $tprop=msql_result($res_tpant,0,'stprop');
      $tice=msql_result($res_tpant,0,'stice');
      $tiva=msql_result($res_tpant,0,'stiva');
      $tirbp=msql_result($res_tpant,0,'stirbp');
    }
    $mdetalle=msql_result($res_tpant,0,'mdetalle');
    $total=msql_result($res_tpant,0,'stotal');

    if($tabla=='comp')
    {
      $trrta=msql_result($res_tpant,0,'strrta');
      $triva=msql_result($res_tpant,0,'striva');
    }

    if(mb_stristr('retc.retp.rete',$tabla))
    {
      $trrta=msql_result($res_tpant,0,'srrta');
      $triva=msql_result($res_tpant,0,'sriva');
    }
  }

}	?>
<pant11>
	<div style="font-size:<?php echo $xfontsize; ?>px;">
		<?php //echo date('H:i:s');?>
		<table border="0" width="<?php if($orient=='V'){echo '200%';}else{echo '100%';} ?>" cellpadding="2" width="100%"
						style="font-size:<?php if($orient=='V'){echo $xfontsize-12;}else{echo $xfontsize;} ?>px;
										max-height:<?php echo $hpant11-15; ?>px;
										border-collapse:collapse; background-color:#eee;">
			<tr valign="top" >
				<td width="3%">
<?php //echo 	'***'.explain_sql($sql_tpant); ?>
					<?php
// 							$claveacce=@msql_result($res_tpant,0,'claveacc');
// 							$pcaption='Imprimir: '.msql_result($res_tpant,0,'docu').'-'.msql_result($res_tpant,0,'numero'); $pabrev='I';
// 							$pidnum=msql_result($res_tpant,0,'idnum1');
// 							$psize=$xfontsize;
// 							if($claveacce=='')
// 							{$ponclick='{window.open("print1.php?prnt=1&docu='.msql_result($res_tpant,0,'docu').'&idnum='.msql_result($res_tpant,0,'idnum1').'","_blank")}';}
// 							else
// 							{$ponclick='{window.open("print1.php?prnt=1&clave='.$claveacce.'","_blank")}';}
//  							include('vrbutton2.php');
					?>
				</td>
				<td style="font-weight:bold; font-size:80%" width="">
					<?php echo 'ID : '.msql_result($res_tpant,0,'idnum1'); ?>
          <br>
					<?php echo msql_result($res_tpant,0,'docu_descri'); ?>
          <br>
					<?php echo 'NUM: '.msql_result($res_tpant,0,'ptonumero'); ?>
          
					<?php
            $claveacce=@msql_result($res_tpant,0,'claveacc');
            if($claveacce!=''){echo '<br>'.'CA: '.$claveacce;}
          ?>
				</td>
				<td>
					<div style="font-weight:bold;">
					<?php echo ''.substr(msql_result($res_pant,0,'enti_descri'),0,200); ?>
					</div>
					<div style="font-size:<?php if($mobile=='true' and strlen(msql_result($res_tpant,0,'concepto')>100)){echo $xfontsize-16;}?>px" ;>
					<?php echo substr(msql_result($res_tpant,0,'concepto'),0,200); ?>
					</div>
				</td>
				<?php if($empr_cont=='1' and $tabla=='comp'){ ?>
				<td style="font-size:<?php echo $xfontsize*.80;?>px;">
					<div>
					<?php echo '<strong>S.COMP.: </strong>'.msql_result($res_tpant,0,'suco_descri'); ?>
					</div>
					<div>
					<?php echo '<strong>F.PAGO: </strong>'.msql_result($res_tpant,0,'fpag_descri'); ?>
					</div>
					<div>
					<?php echo '<strong>No.AUT.: </strong>'.msql_result($res_tpant,0,'atrz').msql_result($res_tpant,0,'autornum'); ?>
					</div>
				</td>
				<td align="right">
					<div style="">
					<?php echo '<strong>Ret.RTA.: </strong>'.number_format(msql_result($res_tpant,0,'srrta'),2); ?>
					</div>
					<div style="">
					<?php echo '<strong>Ret.IVA.: </strong>'.number_format(msql_result($res_tpant,0,'sriva'),2); ?>
					</div>
				</td>
				<?php } ?>
			</tr>
		</table>
	</div>
	<?php if($mobile=='true'){?>
	<div style="font-size:<?php echo $xfontsize; ?>px;">
		<table width="100%" cellpadding="2" width="100%" border="0"
						 style="font-size:<?php if($mobile=='true'){echo $xfontsize-8;}else{echo $xfontsize;} ?>px;
										border-collapse:collapse; background-color:#eee;">
			<tr>
				<?php if($tsubt!=0){ ?><th align="center">SUBT:</th><?php }?>
				<?php if($tsubtiva0!=0){ ?><th align="center">SUBT-IVA0:</th><?php }?>
				<?php if($tsubtiva!=0){ ?><th align="center">SUBT-IVA:</th><?php }?>
				<?php if($tdcto!=0){ ?><th align="center">DCTO:</th><?php }?>
				<?php if($tprop!=0){ ?><th align="center">PROP:</th><?php }?>
				<?php if($tice!=0){ ?><th align="center">ICE:</th><?php }?>
				<?php if($tiva!=0){ ?><th align="center">IVA:</th><?php }?>
				<?php if($tirbp!=0){ ?><th align="center">IRBP:</th><?php }?>
				<?php if($trrta!=0){ ?><th align="center">RENTA:</th><?php }?>
				<?php if($triva!=0){ ?><th align="center">IVA:</th><?php }?>
				<?php if($total!=0){ ?><th align="center">TOTAL:</th><?php }?>
			</tr>
			<tr>
					<?php if($tsubt!=0){ ?><td align="center"><?php echo number_format(abs($tsubt),2); ?></td><?php }?>
					<?php if($tsubtiva0!=0){ ?><td align="center"><?php echo number_format($tsubtiva0,2); ?></td><?php }?>
					<?php if($tsubtiva!=0){ ?><td align="center"><?php echo number_format($tsubtiva,2); ?></td><?php }?>
					<?php if($tdcto!=0){ ?><td align="center"><?php echo number_format($tdcto,2); ?></td><?php }?>
					<?php if($tprop!=0){ ?><td align="center"><?php echo number_format($tprop,2); ?></td><?php }?>
					<?php if($tice!=0){ ?><td align="center"><?php echo number_format($tice,2); ?></td><?php }?>
					<?php if($tiva!=0){ ?><td align="center"><?php echo number_format($tiva,2); ?></td><?php }?>
					<?php if($tirbp!=0){ ?><td align="center"><?php echo number_format($tirbp,2); ?></td><?php }?>
					<?php if($trrta!=0){ ?><td align="center"><?php echo number_format($trrta,2); ?></td><?php }?>
					<?php if($triva!=0){ ?><td align="center"><?php echo number_format($triva,2); ?></td><?php }?>
					<?php if($total!=0){ ?><td align="center"><?php echo number_format(abs($total),2); ?></td><?php }?>
			</tr>
		</table>
	</div>
	<?php } ?>
  
<div id="pant11b" style="display:none">
  <table sborder="0" cellpadding="0" cellspacing="0" 
         style="
                border-collapse:collapse
								padding:0px;
								margin:0px;
								width:100%;
								max-width:100%;
								font-family:arial;
								font-size:<?php echo $xfontsize;?>px;
         ">
    <?php if ($tsubt!=0) {?>
    <tr>
      <td align="right" >
        <input type="button" value="SUB-TOTAL" style="font-weight:bold;">
      </td>
      <td align="right" style="font-weight:bold;">
        <?php echo number_format(abs($tsubt),2);?>
      </td>
    </tr>
    <?php } ?>
    <?php if ($tsubtiva0!=0) {?>
    <tr>
      <td align="right">
        <input type="button" value="SUB-TOT.IVA 0%" style="font-weight:bold;">
      </td>
      <td align="right" style="font-weight:bold;">
        <?php echo number_format(abs($tsubtiva0),2);?>
      </td>
    </tr>
    <?php } ?>
    <?php if ($tsubtiva!=0) {?>
    <tr>
      <td align="right">
        <input type="button" value="SUB-TOT.IVA" style="font-weight:bold;">
      </td>
      <td align="right" style="font-weight:bold;">
        <?php echo number_format(abs($tsubtiva),2);?>
      </td>
    </tr>
    <?php } ?>
    <?php if ($tdcto!=0) {?>
    <tr>
      <td align="right">
        <input type="button" value="DSCTO." style="font-weight:bold;">
      </td>
      <td align="right" style="font-weight:bold;">
        <?php echo number_format(abs($tdcto)*-1,2);?>
      </td>
    </tr>
    <?php } ?>
    <?php if ($tprop!=0) {?>
    <tr>
      <td align="right">
        <input type="button" value="PROP." style="font-weight:bold;">
      </td>
      <td align="right" style="font-weight:bold;">
        <?php echo number_format(abs($tprop),2);?>
      </td>
    </tr>
    <?php } ?>
    <?php if ($tice!=0) {?>
    <tr>
      <td align="right">
        <input type="button" value="ICE" style="font-weight:bold;">
      </td>
      <td align="right" style="font-weight:bold;">
        <?php echo number_format(abs($tice),2);?>
      </td>
    </tr>
    <?php } ?>
    <?php if ($tiva!=0) {?>
    <tr>
      <td align="right">
        <input type="button" value="IVA" style="font-weight:bold;">
      </td>
      <td align="right" style="font-weight:bold;">
        <?php echo number_format(abs($tiva),2);?>
      </td>
    </tr>
    <?php } ?>
    <?php if ($tirbp!=0) {?>
    <tr>
      <td align="right">
        <input type="button" value="IVA" style="font-weight:bold;">
      </td>
      <td align="right" style="font-weight:bold;">
        <?php echo number_format(abs($tirbp),2);?>
      </td>
    </tr>
    <?php } ?>
    <tr>
      <td align="right">
        <input type="button" value="TOTAL" style="font-weight:bold; font-size:<?php echo $xfontsize*1.5;?>px;">
      </td>
      <td align="right" style="font-weight:bold; font-size:<?php echo $xfontsize*1.5;?>px;">
        <div style="min-width:<?php echo $xfontsize*3*2;?>px;;"></div>
        <?php echo ' '. number_format(abs($total),2);?>
      </td>
    </tr>
  </table>
</div>
  
</pant11>

  
    
<pant2>
<?php $crow=0; ?>
<?php $ccol=0; ?>
<?php
  {$sql_pant='select * from '.$tabla.'12 where idnum2="'.$idnum.'" order by iddet';	} 
                                  
	if(mb_stristr('retc.retp.rete',$tabla))
  {
	 $sql_pant ='select * from '.$tabla.'12 where status!="O" and concat(fecha,numero,enti) in ';	
	 $sql_pant.='(select concat(fecha,numero,enti) as numero from '.$tabla.'1 where idnum1="'.$idnum.'") order by numer,cair';
	}
                                  
	if(mb_stristr('acce',$tabla))
  {
    $sql_pant ='select * from '.$tabla.'12 ';	
    $sql_pant.='where idnum2="'.$idnum.'" ';	
    $sql_pant.=' and docum_tabla !="" ';	
    $sql_pant.=' and docum_tabla is not null ';	
    $sql_pant.='order by docum_tabla, docum';	
  } 
	
// 	echo explain_sql($sql_pant);
	$res_pant=msql_query($sql_pant,$link_vcrx);	
?>
<?php $numrows=msql_num_rows($res_pant); ?>
	<table id="tpant2" class="pant2" align="left" border="0" cellpadding="3" width="100%"
				 style="font-size:<?php if($orient=='V'){echo $xfontsize-8;}else{echo $xfontsize;} ?>px;
								overflow-x:hidden;
								border-collapse:collapse;background-color:white;"
						 >
		<?php { // THEAD ?>
		<thead style="display:block;">
			<tr style="border-bottom:solid 1px;background-color:#eee;">
				<th onclick="sortTable(this,<?php echo $ccol++; ?>);" title="Linea">L</th>
				<th style="<?php if($dispcolu==0){echo 'display:none;';} ?><?php echo $ccol++; ?>">D</th>	
				<?php if($tabla=='acce') {?>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Modulo</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Codigo</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Documento</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Crear</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Modif</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Anular</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Elim</th>
				<?php } ?>
				<?php if($docuiimp==1){ ?>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" title="Cantidad">Cant</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" title="Código" style="<?php if((int)$dispcolu==0){echo'display:none;';}?>">Código</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" title="Descripción">Descripción</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" title="Prec.Unitario">P.Uni</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($tsubt==0){echo'display:none;';}?>">SUB-TOT</th>			
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($tdcto==0){echo'display:none;';}?>">DCTO</th>	
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($tprop==0){echo'display:none;';}?>">PROP</th>	
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($tice==0){echo'display:none;';}?>">ICE</th>	
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($tiva==0){echo'display:none;';}?>">IVA</th>	
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($tirbp==0){echo'display:none;';}?>">IRBP</th>
	<!-- 				<th onclick="sortTable(this,3);" title="Precio Unitario">PVP</th> -->
				<?php } ?>
				<?php if($docudocu==1){ ?>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" title="">Documento</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" title="">Numero</th>
				<?php } ?>
				<?php if($docurete==1){ ?>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" title="">Base Imponible</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" title="">Impuesto</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" title="">% Ret.</th>
				<?php } ?>
        <?php if($docuctas==1){ ?>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Cuenta</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Contable</th>
          <th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Debitos</th>
          <th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Creditos</th>
          <th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">C.Sub</th>
				<?php } ?>        
				<th onclick="sortTable(this,<?php echo $ccol++; ?>);"><?php if($docuctas==1){echo '';}else{echo 'TOTAL';} ?></th>
				<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="letter-spacing:10px;<?php if($dispcolu==0 or $mdetalle=='' ){echo'display:none;';}?>">DETALLE</th>
				<?php if($empr_cont=='1' and $tabla=='comp') {?>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Cuenta</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">Contable</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">CAIR</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">%Rta</th>
					<th onclick="sortTable(this,<?php echo $ccol++; ?>);" style="<?php if($dispcolu==0){echo'display:none;';} ?>">%IVA</th>
				<?php } ?>
        <?php if($user_modi==1){?>
				<th width="10%" align="center">
					<span style="display:none;">ELIMINAR</span>
					<?php $pidtxt='f_elim';  $pcaption='ELIMINAR TODO';  $psize=$xfontsize; if($mobile=='true' or 1==1){$pabrev="X";}; $psize=$xfontsize+3;
					$ponclick="if(confirm('Limpiar Detalle ?')){php_func('del_deta(".$idcarr.")');hoja_clie('PANT0');};";
					include('vrbutton.php'); ?>
				</th>
        
        <?php }?>
			</tr>
		</thead>
		<?php } ?>
		<?php { // TBODY ?>
		<tbody id="bodytpant2" style="overflow-y:auto; overflow-x:hidden; display:block; border-bottom:solid 1px;
					<?php if($orient=='V'){echo'min-height:'.($hpant2-75).'px;';}else{echo'min-height:'.($hpant2-90).'px;';}  ?> 
					<?php if($orient=='V'){echo'height:'.($hpant2-75).'px;';}else{echo'height:'.($hpant2-90).'px;';}  ?> ">
      <?php //explain_sql($sql_pant);?>
			<?php while($aso_pant=msql_fetch_assoc($res_pant)){ ?>
			<?php $crow++; ?>
			<?php $duni=$aso_pant[$maes.'_item_duni']; ?>
			<?php $dpre=$aso_pant[$maes.'_item_dpre']; ?>
			<?php $dval=$aso_pant[$maes.'_item_dval']; ?>
			<?php if($dval==0){$dval=2;} ?>
			<?php if($dpre==0){$dpre=2;} ?>
			<?php if($duni==0){$duni=0;} ?>
			<?php if(ceil($aso_pant[$maes.'_cant'])!=floor($aso_pant[$maes.'_cant']) and $duni==0){$duni=2;} ?>
			<tr id="tr_filad<?php echo $crow;?>" class="tr_filad" valign="top"
						style="<?php if ($crow%5==0){echo 'border-bottom:dotted 1px;'; } ?><?php if ($crow==$numrows){echo 'border-bottom:solid 2px;'; } ?>
									 font-size:<?php if($orient=='V'){echo $xfontsize-8;}else{echo $xfontsize;}?>"
						onmouseover="_filabg(event,'tr_filad','<?php echo $crow; ?>','');"
						onclick="_filabg(event,'tr_filad','<?php echo $crow; ?>','');";
						>
				<td align="center" style="font-size:80%;">
					<span style="display:none;"><?php echo fillzero($crow); ?></span><?php echo $aso_pant[$maes.'_iddet']; ?>
				</td>
				<td align="center" style="<?php if($dispcolu==0){echo'display:none;';}?>">
					<?php //$pidtxt='radio'.'tr_filad'.$crow; $pname='rtr_filad'; $pcaption=''; $psize=$xfontsize; include('vrradio.php'); ?>
				</td>
        
					 <?php if( $tabla=='acce') {?>
						<td align="center" style="<?php if($dispcolu==0){echo'display:none;';} ?>">
							<?php echo $aso_pant[$maes.'_docum_tabla']; ?>
						</td>
						<td align="center" style="<?php if($dispcolu==0){echo'display:none;';} ?>">
							<?php echo $aso_pant[$maes.'_docum']; ?>
						</td>
						<td align="left" style="<?php if($dispcolu==0){echo'display:none;';} ?>">
							<?php echo $aso_pant[$maes.'_docum_descri']; ?>
						</td>
						<td align="center" style="<?php if($dispcolu==0){echo'display:none;';} ?>">
							<?php 
                $pidtxt='chknuev'.$aso_pant[$maes.'_idnum2'].$aso_pant[$maes.'_iddet'];$pdefa=$aso_pant[$maes.'_nuev'];
                $ptabla="acce2"; $pline=$aso_pant[$maes.'_idnum2'].'-'.$aso_pant[$maes.'_iddet'];$pcolu="nuev";
                include('vrchkbox.php');
              ?>	
						</td>
						<td align="center" style="<?php if($dispcolu==0){echo'display:none;';} ?>">
							<?php 
                $pidtxt='chkmodi'.$aso_pant[$maes.'_idnum2'].$aso_pant[$maes.'_iddet'];$pdefa=$aso_pant[$maes.'_modi'];
                $ptabla="acce2"; $pline=$aso_pant[$maes.'_idnum2'].'-'.$aso_pant[$maes.'_iddet'];$pcolu="modi";
                include('vrchkbox.php');
              ?>	
						</td>
						<td align="center" style="<?php if($dispcolu==0){echo'display:none;';} ?>">
							<?php 
                $pidtxt='chkanul'.$aso_pant[$maes.'_idnum2'].$aso_pant[$maes.'_iddet'];$pdefa=$aso_pant[$maes.'_anul'];
                $ptabla="acce2"; $pline=$aso_pant[$maes.'_idnum2'].'-'.$aso_pant[$maes.'_iddet'];$pcolu="anul";
                include('vrchkbox.php');
              ?>	
						</td>
						<td align="center" style="<?php if($dispcolu==0){echo'display:none;';} ?>">
							<?php 
                $pidtxt='chkelim'.$aso_pant[$maes.'_idnum2'].$aso_pant[$maes.'_iddet'];$pdefa=$aso_pant[$maes.'_elim'];
                $ptabla="acce2"; $pline=$aso_pant[$maes.'_idnum2'].'-'.$aso_pant[$maes.'_iddet'];$pcolu="elim";
                include('vrchkbox.php');
              ?>	
						</td>
            <td></td>
						<?php } ?>
        
        
        
				<?php if($docuiimp==1){ ?>
					<td align="center"><?php echo number_format(abs($aso_pant[$maes.'_cant']),$duni); ?></td>
					<td align="left" style="<?php if((int)$dispcolu==0){echo'display:none;';}?>" title="<?php echo $aso_pant[$maes.'_itemce']; ?>">
						<?php echo $aso_pant[$maes.'_item']; ?>
					</td>
					<td align="left" title="<?php echo $aso_pant[$maes.'_itemce']; ?>"
								style="<?php if(strlen(trim($aso_pant[$maes.'_item_descri']))>20){echo 'font-size:80%';} ?>">
						<?php echo $aso_pant[$maes.'_item_descri']; ?>
					</td>
					<td align="right" >
						<div style="display:none;"><?php echo fillzero($aso_pant[$maes.'_puni'],15); ?></div>
						<?php echo number_format(abs($aso_pant[$maes.'_puni']),$dpre); ?>
					</td>
					<td align="right" style="<?php if($tsubt==0){echo'display:none;';} ?>">
						<div style="display:none;"><?php echo fillzero($aso_pant[$maes.'_tsubt'],15); ?></div>
						<?php echo number_format(abs($aso_pant[$maes.'_tsubt']),$dval); ?>
					</td>
					<td align="right" style="<?php if($tdcto==0){echo'display:none;';} ?>font-style:italic;" title="<?php echo number_format(abs($aso_pant[$maes.'_dcto']),$dval).'%'; ?>">
						<div style="display:none;"><?php echo fillzero($aso_pant[$maes.'_tdcto'],15); ?></div>
						<?php echo number_format(abs($aso_pant[$maes.'_tdcto']),$dval); ?>
					</td>
					<td align="right" style="<?php if($tprop==0){echo'display:none;';} ?>font-style:italic;" title="<?php echo number_format(abs($aso_pant[$maes.'_prop']),$dval).'%'; ?>">
						<div style="display:none;"><?php echo fillzero($aso_pant[$maes.'_tprop'],15); ?></div>
						<?php echo number_format(abs($aso_pant[$maes.'_tprop']),$dval); ?>
					</td>
					<td align="right" style="<?php if($tice==0){echo'display:none;';} ?>font-style:italic;" title="<?php echo number_format(abs($aso_pant[$maes.'_ice']),$dval).'%'; ?>">
						<div style="display:none;"><?php echo fillzero($aso_pant[$maes.'_tice'],15); ?></div>
						<?php echo number_format(abs($aso_pant[$maes.'_tice']),$dval); ?>
					</td>
					<td align="right" style="<?php if($tiva==0){echo'display:none;';} ?>font-style:italic;" title="<?php echo number_format(abs($aso_pant[$maes.'_iva']),$dval).'%'; ?>">
						<div style="display:none;"><?php echo fillzero($aso_pant[$maes.'_tiva'],15); ?></div>
						<?php echo number_format(abs($aso_pant[$maes.'_tiva']),$dval); ?>
					</td>
					<td align="right" style="<?php if($tirbp==0){echo'display:none;';} ?>font-style:italic;" title="<?php echo number_format(abs($aso_pant[$maes.'_irbp']),$dval); ?>">
						<div style="display:none;"><?php echo fillzero($aso_pant[$maes.'_tirbp'],15); ?></div>
						<?php echo number_format(abs($aso_pant[$maes.'_tirbp']),$dval); ?>
					</td>
				<?php } ?>
				<?php if($docudocu==1){ ?>
				<?php $duni=2;$dval=2; ?>
				<?php if($dispcolu==0){$docum=$aso_pant[$maes.'_docum'];}else{$docum=$aso_pant[$maes.'_docum_descri'];} ?>
					<td align="center" style=""><?php echo $docum; ?></td>
					<?php if($dispcolu==0){$numer=$aso_pant[$maes.'_numer'];}else{$numer=$aso_pant[$maes.'_ptonumer'];} ?>
					<td align="center" style="" ><?php echo $numer; ?></td>
					<td align="center"><?php echo number_format(abs($aso_pant[$maes.'_cant']),$duni).''; ?></td>
        
          <?php //if(mb_stristr('retc.retp.rete',$tabla)){ ?>
  				<?php if($docurete==1){ ?>
					<?php
						$cair='('.$aso_pant[$maes.'_cair'].')';
// 						if($aso_pant[$maes.'_puni']>=30 and $cair<300)
						if($aso_pant[$maes.'_biva']>0)
						{$cair_descri='IVA';}
						else
						{$cair_descri=$aso_pant[$maes.'_cair_descri']; $cair='<br>'.$cair;}
					?>
					<?php //if($dispcolu==0){$cair_descri='';} ?>
					<td align="center" ><?php echo $cair_descri.' '.$cair; ?></td>
				
					<?php if(ceil($aso_pant[$maes.'_puni'])==floor($aso_pant[$maes.'_puni'])){$dval=0;}else{$dval=2;}?>
					<td align="right"><div style="display:none;"><?php echo fillzero($aso_pant[$maes.'_puni'],15); ?></div>
						<?php echo number_format(abs($aso_pant[$maes.'_puni']),$dval).'%'; ?></td>
						<?php $duni=2;$dval=2; ?>
					
						<td align="right" style="<?php if($total==0){echo'display:none;';} ?>">
								<div style="display:none;"><?php echo fillzero($aso_pant[$maes.'_total'],15); ?></div>
								<?php echo number_format(abs($aso_pant[$maes.'_total']),$dval).''; ?>
						</td>
					<?php } ?>

					<?php } ?>
           <?php if($docuctas==1){ ?>        
  					<td><?php echo $aso_pant[$maes.'_ctas']; ?></td>
  					<td><?php echo $aso_pant[$maes.'_ctas_descri']; ?></td>
            <td align="right"><div style="display:none;"><?php echo fillzero(($aso_pant[$maes.'_tdebito']),15); ?></div>
              <?php echo number_format(abs($aso_pant[$maes.'_tdebito']),2); ?></td>
  					<td align="right"><div style="display:none;"><?php echo fillzero(($aso_pant[$maes.'_tcredito']),15); ?></div>
              <?php echo number_format(abs($aso_pant[$maes.'_tcredito']),2); ?></td>
  					<td></td>
  					<td><?php echo $aso_pant[$maes.'_csub_descri']; ?></td>
					<?php } ?>
        
					<td align="right" style="<?php if($total==0){echo'display:none;';} ?>">
						<div style="display:none;"><?php echo fillzero($aso_pant[$maes.'_total'],15); ?></div>
						<?php echo number_format(abs($aso_pant[$maes.'_total']),$dval); ?>
					</td>
        
          <td align="left" style="<?php if($dispcolu==0 or $mdetalle=='' ){echo'display:none;';} ?>
																		<?php if(strlen(trim($aso_pant[$maes.'_detalle']))>20){echo 'font-size:80%';} ?>">
							<?php if(trim($aso_pant[$maes.'_detalle'])!=trim($aso_pant[$maes.'_item_descri'])){echo $aso_pant[$maes.'_detalle'];};?></td>

					 <?php if($empr_cont=='1' and $tabla=='comp' and $mobile!='true') {?>
						<td align="left" style="<?php if($dispcolu==0){echo'display:none;';} ?>">
							<?php echo $aso_pant[$maes.'_ctas']; ?>
						</td>
						<td align="left" style="<?php if($dispcolu==0){echo'display:none;';} ?>">
							<?php echo $aso_pant[$maes.'_ctas_descri']; ?>
						</td>
						<td align="center" title="<?php echo $aso_pant[$maes.'_cair_descri']; ?>">
							<?php echo $aso_pant[$maes.'_cair']; ?>
						</td>
						<?php if(ceil($aso_pant[$maes.'_prrta'])==floor($aso_pant[$maes.'_prrta'])){$dpor=0;}else{$dpor=2;}?>
						<td align="center" style="<?php if($dispcolu==0){echo'display:none;';} ?>" 
								title="<?php echo number_format($aso_pant[$maes.'_rrta'],2).''; ?>">
							<?php echo number_format($aso_pant[$maes.'_prrta'],$dpor).''; ?>
						</td>
						<?php if(ceil($aso_pant[$maes.'_priva'])==floor($aso_pant[$maes.'_priva'])){$dpor=0;}else{$dpor=2;}?>
						<td align="center" style="<?php if($dispcolu==0){echo'display:none;';} ?>"
								title="<?php echo number_format($aso_pant[$maes.'_riva'],2).''; ?>">
							<?php echo number_format($aso_pant[$maes.'_priva'],$dpor).''; ?>
						</td>
						<?php } ?>
            <?php if($user_modi==1){?>
						<td align="center" style="">
							<?php $pidtxt='del_'.$aso_pant[$maes.'_iddet'].$aso_pant[$maes.'_iddet'];
							$pcaption='X';
							$ptitle='Eliminar'.$aso_pant[$maes.'_item_codigov'];
							$pabrev='X'; $psize=$xfontsize+3;
							$ponclick ="if(confirm('Eliminar Línea : ".$aso_pant[$maes.'_item']."-".$aso_pant[$maes.'_item_descri']." ?'))";
							$ponclick.="{";
// 							$ponclick.="php_func('del_deta(".$maes.",".$aso_pant[$maes.'_codigo'].",".$aso_pant[$maes.'_iddet'].")');";
							$ponclick.="this.parentNode.parentNode.parentNode.style.display='none';";
							$ponclick.="};";
							include('vrbutton2.php'); 
              ?>

<!--               document.getElementById('pant11').style.display='block'; -->
              
						</td>
      
            <?php }?>
				</tr>

			<?php } ?>
			</tbody>	
		<?php } ?>
		<?php { // TFOOT ?>
			<tfoot id="detafoot" style="display:none;">
				<tr style="border-top:solid 1px;background-color:#eee;">
          <th></th>
          <th></th>
					 <?php if( $tabla=='acce') {?>
<!--           <th></th>
          <th></th>
          <th></th>
          <th></th>
          <th></th>
          <th></th>
          <th></th>
          <th></th>
          <th></th>
          <th></th> -->
						<?php } ?>
				<?php if($docuiimp==1){ ?>
					<th><?php echo number_format($tcant,2); ?></th>
					<th style="<?php if((int)$dispcolu==0){echo'display:none;';}?>"></th>
					<th>TOTALES</th>
					<th></th>
					<th style="<?php if($tsubt==0){echo'display:none;';}?>"><?php echo number_format($tsubt,2); ?></th>			
					<th style="<?php if($tdcto==0){echo'display:none;';}?>"><?php echo number_format($tdcto,2); ?></th>	
					<th style="<?php if($tprop==0){echo'display:none;';}?>"><?php echo number_format($tprop,2); ?></th>	
					<th style="<?php if($tice==0){echo'display:none;';}?>"><?php echo number_format($tice,2); ?></th>	
					<th style="<?php if($tiva==0){echo'display:none;';}?>"><?php echo number_format($tiva,2); ?></th>	
					<th style="<?php if($tirbp==0){echo'display:none;';}?>"><?php echo number_format($tirbp,2); ?></th>
	<!-- 				<th onclick="sortTable(this,3);" title="Precio Unitario">PVP</th> -->
				<?php } ?>
				<?php if($docudocu==1){ ?>
					<th></th>
					<th></th>
				<?php } ?>
				<?php if($docurete==1){ ?>
					<th></th>
					<th></th>
					<th></th>
				<?php } ?>
					<th style=""><?php echo number_format($total,2); ?></th>
          
          <?php echo str_repeat('<th></th>',$ccol-2); ?>
        </tr>
			</tfoot>
		<?php } ?>
	</table>
		<?php //echo date('H:i:s');?>
	
</pant2>
		
<?php } ?>	
    
</resultado>

<?php $obstart = ob_get_clean(); ?>
<?php $obstart = alltrim($obstart) ?>
<?php echo $obstart;	?>

		