<?php 
session_start();
include('../cfg/cfg.php');

if(empty($_SESSION['user_vcrx_tipo']) || !isset($_SESSION['user_vcrx_tipo']))
{
	die('<a href="../salir.php">SU SESSION EXPIRO.</a>');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $empr_nombre .' - ' . $_SESSION['user_vcrx_descri'];?></title>


<link rel="stylesheet" href="http://vcrxol.com/css/ambiente.css"  type="text/css" />

<link rel="stylesheet" href="http://vcrxol.com/css/pedido.css"  type="text/css" />



<script type="text/javascript" src="../js/jquery-1.11.1.js"></script>
<script type="text/javascript" src="../js/busca_maes.js"></script>
<script type="text/javascript" src="../js/hoja_pedido.js"></script>
<!-- <script type="text/javascript" src="../js/contable.js"></script> -->
<script>
var fila=1;
var docucambio='';
var enticambio='';
var docuregcont='';
var id_user='<?php echo $_SESSION['user_id'];?>';
window.onload = function() {
galleta();
hojapedido();
}
function galleta(){
$.ajax({
		cache:false,
		url:'../lib/galleta.php',
		datatype: "text",
	    async:true,
		type:'POST',
		data:{},
		beforeSend: function(jqXHR, textStatus)
		{
	
		}, 
		success:function(data, textStatus, jqXHR)
		{		
			
			if(data!='1')
			{
				alert('Su Tiempo de Sesion Expiro!');
				location.href='../salir.php';
			}
		},
		error:function(jqXHR,textStatus,errorThrown )
		{
           if (jqXHR.status === 0) {
              alert('Sin Conexion: Verifique Red.');
			  location.href='../salir.php';
           } else if (jqXHR.status == 404) {
               console.log('Requested page not found [404]');
           } else if (jqXHR.status == 500) {
               console.log('Internal Server Error [500].');
           } else if (exception === 'parsererror') {
               console.log('Requested JSON parse failed.');
           } else if (exception === 'timeout') {
               alert('Servidor no Responde');
			   location.href='../salir.php';
           } else if (exception === 'abort') {
               console.log('Ajax request aborted.');
           } else {
               console.log('Uncaught Error: ' + jqXHR.responseText);
           }

		}, 
		 complete:function(jqXHR, textStatus)
    	{
			
			if(textStatus==='success')
	        {
			}
		},
			timeout:90000
		});
}


function hojapedido(){
console.log(	window.innerHeight);
var alto=window.innerHeight;
alto = alto - 100;
document.getElementById('carga_hojapedido').innerHeight = alto - 200;
document.getElementById('carga_hojapedido').style.height = ''+alto+'px';

$.ajax({
		cache:false,
		url:'hojapedido3.php',
		datatype: "text",
	    async:false,
		type:'POST',
		data:{},
		beforeSend: function(jqXHR, textStatus)
		{
	
		}, 
		success:function(data, textStatus, jqXHR)
		{		
			document.getElementById('carga_hojapedido').innerHTML=data;
		},
		error:function(jqXHR,textStatus,errorThrown )
		{
           if (jqXHR.status === 0) {
              alert('Sin Conexion: Verifique Red.');
			  location.href='../salir.php';
           } else if (jqXHR.status == 404) {
               console.log('Requested page not found [404]');
           } else if (jqXHR.status == 500) {
               console.log('Internal Server Error [500].');
           } else if (exception === 'parsererror') {
               console.log('Requested JSON parse failed.');
           } else if (exception === 'timeout') {
               alert('Servidor no Responde');
			   location.href='../salir.php';
           } else if (exception === 'abort') {
               console.log('Ajax request aborted.');
           } else {
               console.log('Uncaught Error: ' + jqXHR.responseText);
           }

		}, 
		 complete:function(jqXHR, textStatus)
    	{
			
			if(textStatus==='success')
	        {
			}
		},
			timeout:90000
		});
		
}

</script>
<style type="text/css">
body{background:#ffffff;}
.dper_txt{border:solid 1px #000000; border-radius:2px; padding:2px; margin:2px;}



.dper_err{color:#F00; font-weight:bolder;}
.txt_adr{border:solid 1px #000000; width:100px;}
#docu_fecha{border:solid 1px #999; width:70px;}
#num_lbl{border:solid 1px #999; width:30px;}
#cuent_lbl{border:solid 1px #999; width:100px;}
#cont_lbl{border:solid 1px #999; width:100px;}
#deb_lbl{border:solid 1px #999; width:100px;}
#cre_lbl{border:solid 1px #999; width:100px;}
#csub_lbl{border:solid 1px #999; width:100px;}
#ctrsub_lbl{border:solid 1px #999; width:100px;}
#det_lbl{border:solid 1px #999; width:100px;}
.num{border:solid 1px #999; width:30px;}
.ctas{border:solid 1px #999; width:100px;}
.ctas_descri{border:solid 1px #999; width:100px;}
.deb_cont{border:solid 1px #999; width:100px;text-align:right;}
.cre_cont{border:solid 1px #999; width:100px;text-align:right;}
.csub_cont{border:solid 1px #999; width:100px;}
.ctrsub_cont{border:solid 1px #999; width:100px;}
.det_cont{border:solid 1px #999; width:100px;}

.num:focus{border-color:#000000;background:#eee;}
.ctas:focus{border-color:#000000;background:#eee;}
.ctas_descri:focus{border-color:#000000;background:#eee;}
.deb_cont:focus{border-color:#000000;background:#eee;}
.cre_cont:focus{border-color:#000000;background:#eee;}
.csub_cont:focus{border-color:#000000;background:#eee;}
.ctrsub_cont:focus{border-color:#000000;background:#eee;}
.det_cont:focus{border-color:#000000;background:#eee;}



#item_lbl{border:solid 1px #999; width:100px;}
#desc_lbl{border:solid 1px #999; width:100px;}
#cant_lbl{border:solid 1px #999; width:100px;}
#puni_lbl{border:solid 1px #999; width:100px;}
#dcto_lbl{border:solid 1px #999; width:100px;}
#icex_lbl{border:solid 1px #999; width:100px;}
#ivax_lbl{border:solid 1px #999; width:100px;}
#irbp_lbl{border:solid 1px #999; width:100px;}
#deta_lbl{border:solid 1px #999; width:100px;}

.item_comp{border:solid 1px #999; width:100px;}
.desc_comp{border:solid 1px #999; width:100px;}
.cant_comp{border:solid 1px #999; width:100px;}
.puni_comp{border:solid 1px #999; width:100px;}
.dcto_comp{border:solid 1px #999; width:100px;}
.icex_comp{border:solid 1px #999; width:100px;}
.ivax_comp{border:solid 1px #999; width:100px;}
.irbp_comp{border:solid 1px #999; width:100px;}
.deta_comp{border:solid 1px #999; width:100px;}
.talla_cab_cod{width:60px;}
.talla_cab_descri{ width:225px;}
.talla_cab_cat{width:40px; padding:0px;}
.talla_cab_pag{width:30px; padding:0px;}
</style>
</head>

<body>

<div align="center">
<div align="left" style="width:1000px; border: solid 1px #000;">
	<table width="100%">
	<tr>
    	<td>
			<a href="http://<?php echo $empr_codigo;?>.vcrxol.com/main/" title="INICIO" ><img src="http://vcrxol.com/_logo/logo<?php echo $empr_codigo;?>1.png" width="190"/></a>		</td>
        <td>
	        <div style="font-size:18px; font-weight:bolder;  margin:0px 0px 0px 5px; padding:0px 0px 0px 5px; width:300px;border-bottom:#09c solid 2px;" align="left">Hoja de Pedido</div>
        </td>
        <td  align="right"><span style="font-weight:bolder;"><?php echo $_SESSION['user_vcrx_descri'];?></span>&nbsp;</td>
    	<td width="70"  align="right"><input type="image" src="http://vcrxol.com/_img/salir.png"  title="Salir" onclick="if(confirm('Esta Seguro que Desea Salir?')){window.location.href ='../salir.php';}" style="border:none;"/>&nbsp;</td>
    </tr>
</table>

    
    <div style="width:800px;">
    <table border="1" id="tabla_pedido_cabecera" cellpadding="0" cellspacing="0" style="border-collapse:collapse;font-size:12px; border:#000000 solid 2px;">
		<tr style="font-size:14px;  font-weight:bold; border-top:solid 3px #000; border-bottom:solid 2px #000;">
		<td align="center"><div class="talla_cab_cat">Cat</div></td>
		<td align="center"><div class="talla_cab_pag">Pag</div></td>
		<td align="center"><div class="talla_cab_cod">Cod</div></td>
        <td align="center"><div class="talla_cab_descri">Descri</div></td>
		<td align="center"><div class="talla_cab_pvp" style="width:60px;">PVP</div></td>
		<td style="border-left:solid 2px #000;" align="center"><div class="talla_vacio">U</div></td>
		<td style="border-left:solid 2px #000;" align="center"><div class="talla_vacio">4</div></td>
		<td align="center"><div class="talla_vacio">6</div></td>
		<td align="center"><div class="talla_vacio">8</div></td>
		<td align="center"><div class="talla_vacio">10</div></td>
		<td align="center"><div class="talla_vacio">12</div></td>
		<td align="center"><div class="talla_vacio">14</div></td>
		<td align="center"><div class="talla_vacio">16</div></td>
		<td style="border-left:solid 2px #000;" align="center"><div class="talla_vacio">XS</div></td>
		<td align="center"><div class="talla_vacio">S</div></td>
		<td align="center"><div class="talla_vacio">M</div></td>
		<td align="center"><div class="talla_vacio">L</div></td>
		<td align="center"><div class="talla_vacio">XL</div></td>
		<td align="center"><div class="talla_vacio" style="font-size:10px;">XXL</div></td>
		</tr>
	</table>
    <div id="carga_hojapedido" style=" overflow-y:scroll;"></div>
    </div>
</div>
</div>

 
	<table width="100%" border="0" cellpadding="2" cellspacing="0" style="background: #EAEAFF ; border-collapse:collapse;">
	<tr>
	<td  align="left" width="50%"><strong>UNIDADES:</strong></td>
	<td align="right"><span id="sub_uni_car"></span></td>
	</tr>

	<tr>
	<td  align="left" width="50%"><strong>SUBTOTAL:</strong></td>
	<td align="right"><span id="sub_tot_car"></span></td>
	</tr>

	<tr>
	<td  align="left"><strong>DCTO:</strong></td>
	<td align="right"><span id="dcto_tot_car"></span></td>
	</tr>

	<tr>
	<td  align="left"><strong>IVA:</strong></td>
	<td align="right"><span id="iva_car"></span></td>
	</tr>

	<tr>
	<td  align="left"><strong>ENVIO:</strong></td>
	<td align="right"><span id="envio_car"></span></td>
	</tr>

	<tr>
	<td  align="left"><strong>TOTAL:</strong></td>
	<td align="right"><span id="total_car"></span></td>
	</tr>


	</table>
 
 



</body>
</html>
