<?php 

session_start();

require_once ("../../config/Cado.php");

require_once ("../producto/cCatalogo.php");

$oCatalogo = new cCatalogo();

require_once ("../producto/cInfo.php");

$oInfo = new cInfo();

require_once ("../stock/cStock.php");

$oStock = new cStock();

require_once ("../formatos/formato.php");





require_once ("../producto/cProducto.php");

$oProducto = new cProducto();



$id = $_GET['id'];



$dts= $oCatalogo->mostrarUno($id);

		$dt = mysqli_fetch_array($dts);

			$pro_nom	= $dt['tb_producto_nom'];

			$pro_ser	= $dt['tb_producto_nroser'];

			$cate_nom	= $dt['tb_categoria_nom'];

			$mar_nom	= $dt['tb_marca_nom'];

			$pre_id	= $dt['tb_presentacion_id'];

			$uni = $dt['tb_unidad_abr'];

			$uni_nom = $dt['tb_unidad_nom'];

			$pro_id = $dt['tb_producto_id'];

		mysqli_free_result($dts);







?>





<div style="text-align:center;">

<span style="color:#fff;" >INFORMACION SOBRE <?php echo $pro_nom; ?></span>

</div>





<div class="col-lg-5 col-sm-6 col-xs-12" style="color:#fff;text-align:left;" >



<div class="col-lg-12 col-sm-12 col-xs-12" style="text-align:left;" >

<label class="text-yellow">INFORMACION GENERAL</label>

</div>



<div class="col-lg-12 col-sm-12 col-xs-12" style="text-align:left;" >

<label for=""><?php echo 'Producto: '. $pro_nom.' | '.$uni; ?></label>	

</div>	

<div class="col-lg-12 col-sm-12 col-xs-12" style="text-align:left;" >			

<label for=""><?php echo 'Serie del producto: '.$pro_ser; ?></label>

</div>	

<div class="col-lg-12 col-sm-12 col-xs-12" style="text-align:left;">				

<label for=""><?php echo 'Categoria: '.$cate_nom; ?></label>

</div>	

<div class="col-lg-12 col-sm-12 col-xs-12" style="text-align:left;">				

<label for=""><?php echo 'Marca: '.$mar_nom; ?></label>					

</div>



</div>



<div class="col-lg-7 col-sm-6 col-xs-12" style="color:#fff;" >



<div class="col-lg-12 col-sm-12 col-xs-12" style="text-align:left;" >

<label class="text-yellow">ALMACENES Y STOCK</label>

</div>





<?php

$dtsstock = $oStock->mostrarstocktodos_x_presentacion($pre_id);

	while ($dts = mysqli_fetch_array($dtsstock))

	{

		if($dts['tb_almacen_id']==1){

			$alm = 'ALMACEN JV';

		}else if($dts['tb_almacen_id']==2){

			$alm = 'ALMACEN ID';

		}else if($dts['tb_almacen_id']==3){

			$alm = 'ALMACEN JV';

		}

	?>

<div class="col-lg-12 col-sm-12 col-xs-12" style="text-align:left;" >

<label for=""><?php echo $dts['tb_almacen_nom'].':  '.$dts['tb_stock_num']*1 .' '.$uni_nom; ?></label>	

</div>	

	<?php 

	}

?>

</div>





<div class="col-lg-12 col-sm-12 col-xs-12" >



</div>







<div class="col-lg-5 col-sm-6 col-xs-12" style="color:#fff;text-align:left;" >



<div class="col-lg-12 col-sm-12 col-xs-12" style="text-align:left;" >

<label class="text-yellow">PROVEEDORES Y ULTIMOS PRECIOS</label>

</div>



<?php 

$dts= $oInfo->proveedorCompra_x_catalogo($id);

while ($dt = mysqli_fetch_array($dts))

	{

		$pre_comp = 0;

		$can_comp = 0;

		

		$dts1= $oInfo->ultimacompra_x_proveedor($id,$dt['tb_proveedor_id']);	

		$dt1 = mysqli_fetch_array($dts1);

			

		mysqli_free_result($dts1);

		

?>



<div class="col-lg-12 col-sm-12 col-xs-12" style="text-align:left;">				

<label for=""><?php echo $dt['tb_proveedor_nom'];?></label>		<br />			

<label for=""><?php echo $dt1['tb_compra_reg'].' |  PRE. '.formato_money($dt1['tb_compradetalle_preuni']).' | CANT. '.$dt1['tb_compradetalle_can']*1; ?></label>					

</div>	



<?php 

	}

?>







</div>









<div class="col-lg-7 col-sm-6 col-xs-12" style="color:#fff;text-align:left;" >



<div class="col-lg-12 col-sm-12 col-xs-12" style="text-align:left;" >

<label class="text-yellow">FAMILIAS Y SERIES</label>

</div>





<?php 

$dts=$oProducto->mostrarFamilia($pro_id);

$num_rows= mysqli_num_rows($dts);

?>

<style>



	div#tabla_pago_detalle table td, div#tabla_pago_detalle table th { border: 0px ; padding: 3px 5px; font-size:12px;font-weight:bold; }

	div#tabla_pago_detalle table th { height:16px,padding: 3px 5px;  }

</style>



<div id="tabla_pago_detalle" style="text-align:left;">



	<table  >

		<thead>

			<tr>

				<th align="left" nowrap="nowrap" >NRO SERIE</th>

				<th align="left" nowrap="nowrap" >FAMILIA</th>

				<th align="left" nowrap="nowrap" >DETALLE</th>

			</tr>

		</thead>

		<tbody>

			<?php

			if($num_rows>0){

			

			while($dt = mysqli_fetch_array($dts)){

							

			?>

			<tr>

				<td align="left" >

					<?php echo $dt['tb_familia_ser']; ?>

				</td>

				<td align="left" >

					<?php echo $dt['tb_familia_nom']; ?>

				</td>

				<td align="left" >

					<?php echo $dt['tb_familia_des']; ?>

				</td>

				

			</tr>

			<?php						

			}

			}else{

			?>

			

			<tr>

			<td colspan="3">Sin familias y series </td>			

			</tr>

		

			<?php 

			}

			?>

		</tbody>

	</table>

</div>





</div>





