<!-- 
1 pantalla
2 impresora
 -->
<?php
		include('../cfg/res.php');

// 		$sql_saydoc='describe '.$ptabla.'1';
// 		$res_saydoc=mysql_query($sql_saydoc,$link_vcrx);
// 		if(!mysql_error($link_vcrx))	
// 		{
// 			$plong=mysql_result($res_saydoc,0,'type');
// 			$plong=str_replace(')','',$plong);
// 			$plong=str_replace('varchar(','',$plong);
// 			$plong=str_replace('char(','',$plong);
// 		}
?>
<?php if(empty($plong)){$plong=10;}?>
<?php if(empty($pdeci)){$pdeci=0;}?>
<?php if(empty($pdest)){$pdest=1;}?>
<?php if(empty($ptitle) || $pdest==2){$ptitle='';}?>
<?php if(empty($ptitle) || $pdest==2){$ptitle='';}?>
<?php if(empty($pcaption)){$pcaption='';}?>
<?php if(empty($ptabla)){$ptabla='empr';}?>
<?php if(empty($pidnum)){$pidnum=0;}?>
<?php if(empty($piddet)){$piddet=0;}?>
<?php if(empty($pcolumn)){$pcolumn='';}?>
<?php if(empty($pobj)){$pobj=3;}?>

<?php
  $xvalor='';
	if($piddet==0)
	{$sql_saydoc='select * from '.$ptabla.'11 where idnum1="'.$pidnum.'"';}
	else
	{$sql_saydoc='select * from '.$ptabla.'12 where idnum1="'.$pidnum.'" and iddet="'.$piddet.'"';}
	$res_saydoc=mysql_query($sql_saydoc,$link_vcrx);

	if(mysql_num_rows($res_saydoc)!=0)
  {$xvalor=mysql_result($res_saydoc,0,'docu');}
?>                         

<?php if($pobj==3){?>
<?php if(empty($pcaption)) {$pcaption= mysql_result($res_saydoc,0,'docu').'-'.mysql_result($res_saydoc,0,'numero');} ?>
<td>
<input type="button"
				 tabIndex="-1"
         style="
								text-transform:uppercase;
								font-weight:bold;
								border-style:outset;
								border-width:3px;
								border-radius:0px;
								padding:2px;
								margin:0px;
								max-width:100%;
								font-family:arial;
								font-size:12px;
								<?php if($pobj==1 ){echo 'display:none;';} ?>
								" 
       title="<?php echo mysql_result($res_saydoc,0,'docu').'-'.mysql_result($res_saydoc,0,'ptonumero'); ?>"
       value="<?php echo $pcaption; ?>"
			 >
</input>
</td>
<?php } ?>

<?php if($pobj==2 ||$pobj==3){?>
<td>
<?php $xtitle= mysql_result($res_saydoc,0,'enti_descri') ;?>
<?php $xvalue= mysql_result($res_saydoc,0,'docu_descri') ;?>
<input type="text"
			 	 disabled='true'
				 tabIndex="-1"
         style="
								background-color:white;
								font-weight:bold;
								border-style:outset;
								border-width:3px;
								border-radius:0px;
								padding:2px;
								margin:0px;
								max-width:100%;
								font-family:courier new;
								font-size:14px;
								<?php if($pobj==5 ){echo 'display:none;';} ?>
								" 
       title="<?php echo $xtitle; ?>"
       value="<?php echo $xvalue; ?>"
			 >
</input>
</td>
<?php } ?>

<?php if(empty($pcolumn)){?>
<?php $pcolumn= mysql_result($res_saydoc,0,'enti_descri') ;?>
<?php } ?>
<span 
     style="
            font-weight:bold;
            font-family:arial;
            font-size:12px;
						max-width:100%;
            <?php if($pobj==5){echo 'display:none;';} ?>
            " 
      >
      <?php echo $pcolumn; ?>
</span>


<?php $ptabla=''; ?>
<?php $pidnum=''; ?>
<?php $piddet=''; ?>
<?php $pcolumn=''; ?>
<?php $pobj=0; ?>

<?php $pvalor=0; ?>
<?php $pdeci=0; ?>
<?php $pdest=0; ?>
<?php $ptitle=''; ?>



