<?php
$tra_id=$_GET['tra_id'];
?>
<page backtop="1mm" backbottom="5mm" backleft="5mm" backright="5mm" style="font-size: 11pt; font-family: arial" >
    <table cellspacing="0" style="width: 100%;" >
        <tr>
            <td style="width: 48%; color: #444444;">
                <img style="width: 60%;" src="../../../img/<?php echo $empresa;?>.png" alt="Logo"><br>
            </td>
			<td style="width: 40%;font-size:12px;text-align:center;">
				<strong style="font-size:15px"><?php echo $emp_nombre;?></strong><br>
				<strong>Nit: <?php echo $emp_nit;?></strong> <br>
				<strong><?php echo $emp_direccion;?></strong><br>
				<strong><?php echo $emp_correo;?></strong><br>
				<strong>Tel: <?php echo $emp_cel;?> / <?php echo $emp_telefono;?></strong><br>
				<!--<strong>Responsable de IVA </strong><br> 
				<strong>Agente de retención en el impuesto sobre las ventas</strong>-->
			</td>
        </tr>
    </table>
    <?php
    $can3=mysqli_query($con,"SELECT * FROM trasladoe where tra_id='$tra_id'") or die(mysqli_error($con));  
	$row3=mysqli_fetch_array($can3);
	?>
 	<table cellspacing="0" style="width: 100%;" >
        <tr>
            <td style="width: 70%;">
            	
            </td>
			<td style="width: 30%;">
				<table cellspacing="0" style="width: 100%; padding-left:5px">
			        <tr>
						<td style="width: 100%;color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
							<strong style="font-size:10px;color: #000">TRASLADO N°</strong>
						</td>
					</tr>
					<tr>
						<td style="width: 100%;padding:2px;text-align:center;border:solid 1px #bdc3c7;font-size:12px"> 
							<strong style="color: red"><?php echo $row3['tra_n_traslado'];?></strong>
						</td>
					</tr>
			    </table>
			</td>
		</tr>
    </table>



	<table cellspacing="0" style="width: 100%; padding-top: 5px;">
        <tr>
			<td style="width: 10%; color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">CODIGO</strong>
			</td>
			<td style="width: 60%; color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">DESCRIPCIÓN</strong>
			</td>			
			<td style="width: 10%; color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">CANT</strong>
			</td>
			<td style="width: 10%; color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">PRECIO U</strong>
			</td>
			<td style="width:10%; color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">TOTAL</strong>
			</td>
		</tr>
<?php

$sumador_total=0;
$can7=mysqli_query($con,"SELECT * FROM trasladoe_detalle where trasladoe_tra_id='$tra_id'") or die(mysqli_error($con));  
while($row=mysqli_fetch_array($can7))
{
    $trad_id=$row['trad_id'];
    $trad_referencia=$row['trad_referencia'];
    $trad_nombre=$row['trad_nombre'];
    $trad_cantidad=$row['trad_cantidad'];
    $trad_precio=$row['trad_precio'];
    $total=$trad_precio*$trad_cantidad;
    $sumador_total+= $total;
?>		
		<tr>
			
			<td style="width:10%;padding:2px;text-align:center;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo $trad_referencia;?>
			</td>
			<td style="width:60%;padding:2px;text-align:center;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo $trad_nombre;

				$sql3=mysqli_query($con,"SELECT * from serial_trasladoe where trasladoe_detalle_trad_id='$trad_id'");
                $result4=mysqli_num_rows($sql3);
                if($result4>0)
                { 
				 echo '  ( Serial ';
				 $sql2=mysqli_query($con,"SELECT * from serial_trasladoe where trasladoe_detalle_trad_id='$trad_id'");
	                while ($row1=mysqli_fetch_array($sql2))
	                {
	                    echo ' - ';
	                    echo $row1['sert_codigo']; 
	                    
	                }  echo '  )';
	            }
				?>
			</td>
			
			<td style="width: 10%;padding:2px;text-align:center;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo utf8_decode($trad_cantidad);?>
			</td>
			<td style="width:10%;padding:2px;text-align:right;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo number_format($trad_precio,0);?>
			</td>
			
			<td style="width: 10%;padding:2px;text-align:right;border-left:solid 1px #bdc3c7;border-right:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo number_format($total,0);?>
			</td>
		</tr>
<?php } ?>		
    </table>


    <table cellspacing="0" style="width: 100%;padding-top: 5px;">
        <tr>
            <td style="width:69%;">
            	<table cellspacing="0" style="width: 100%;">
					<tr>
						<td>
							<table cellspacing="0" style="width: 100%;" >
								<tr>
									<td colspan="3" style="width: 100%;padding-bottom: 36px"></td>
								</tr>
								<tr>
									<td style="width: 45%;">_______________________________</td>
									<td style="width: 5%;"></td>
									<td style="width: 45%;">_____________________________</td>	
								</tr>
								<tr>
									<td style="width: 45%;font-size:8px;">ELABORADO POR</td>
									<td style="width: 5%;"></td>
									<td style="width: 45%;font-size:8px;">ACEPTADO POR</td>		
								</tr>
						    </table>
						</td>
					</tr>
			    </table>
            </td>
            <td style="width: 1%;"></td>
			<td style="width:30%;">
				<table cellspacing="0" style="width: 100%;">
			        <tr>
						<td colspan="2" style="width: 100%;color:white;background-color:#bdc3c7;text-align:center;padding:2px;"> 
							<strong style="font-size:10px;color: #000" >TOTALES</strong>
						</td>
					</tr>
					<tr>
						<td style="width: 50%;padding:4px;text-align:center;border-bottom:solid 1px #bdc3c7;border-left:solid 1px #bdc3c7;font-size:10px;text-align:right;"> 
							TOTAL
						</td>
						<td style="width: 50%;padding:4px;text-align:center;border-bottom:solid 1px #bdc3c7;border-left:solid 1px #bdc3c7;border-right:solid 1px #bdc3c7;font-size:10px;text-align:right;"> 
							<?php echo number_format($sumador_total,0); ?>
						</td>
					</tr>
			    </table>
			</td>
		</tr>
    </table>

   
	<div style="width:100%; border-top:dashed 1px;margin-top:1mm;"></div>
	
</page>	  