<?php 
session_start();
include('../cfg/cfg.php');
include('../cfg/res.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/pedido.css"  type="text/css" />
<link rel="stylesheet" href="http://vcrxol.com/css/inf_vtas.css"  type="text/css" />
<script type="text/javascript" src="../js/jquery-1.11.1.js"></script>
<script type="text/javascript" src="../js/hoja_pedido.js"></script>
<script type="text/javascript" src="../js/busca_maes.js"></script>

<script>
var fila=1;
var docucambio='';
var enticambio='';
var docuregcont='';
var id_user='<?php echo $_SESSION['user_id'];?>';
window.onload = function() {

setInterval('galleta()',90000);

}

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 _adr_dato(idx){

$.ajax({
		cache:false,
		url:'op_hoja_addr.php',
		datatype: "text",
	    async:true,
		type:'POST',
		data:{idx:idx},
		beforeSend: function(jqXHR, textStatus){}, 
		success:function(dato, textStatus, jqXHR)
		{		
			console.log(dato);
			document.getElementById('nom_lbl').innerHTML=$(dato).find("nombre").text();
			document.getElementById('dir_lbl').innerHTML=$(dato).find("direccion").text();
			document.getElementById('ciu_lbl').innerHTML=$(dato).find("ciudad").text();
			document.getElementById('tel_lbl').innerHTML=$(dato).find("telefono").text();
			document.getElementById('ema_lbl').innerHTML=$(dato).find("email").text();
			document.getElementById('con_lbl').innerHTML=$(dato).find("contacto").text();
		},
		error:function(jqXHR,textStatus,errorThrown )
		{
           if (jqXHR.status === 0) {
              alert('Sin Conexion: Verifique Red.');
           } 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_descri{ width:350px;}
</style>
</head>

<body>
<div style="padding:0px 5px 0px 5px;"><?php require('../../_lib/cabecera.php');?></div>


<?php include('../cfg/res.php');?>
<?php
$sql_vtas='select count(*)as ventas from vtas0 where codigo="'.$_SESSION['user_vcrx_id'].'"';

$sql_vtas='select count(*)as ventas from vtas1 where enti="'.$_SESSION['user_vcrx_id'].'"';
$res_vtas=mysql_query($sql_vtas,$link_vcrx);
$n_vtas=mysql_result($res_vtas,0,'ventas');
//echo $n_vtas;

$sql_drtr='select * from drtr0 where left(enti_codigo,10) = "'.$_SESSION['user_vcrx_id'].'"';

$res_drtr=mysql_query($sql_drtr,$link_vcrx);
$drtr=0;
if (mysql_num_rows($res_drtr)!=0){	$drtr=1;}

$sql_dcto='select * from enti0 where enti_codigo="'.$_SESSION['user_vcrx_id'].'"';
$res_dcto=mysql_query($sql_dcto,$link_vcrx);
if(mysql_num_rows($res_dcto)==0){	$dcto=0;}
else
{
	$dcto=mysql_result($res_dcto,0,'enti_dcto');
	$referidox=mysql_result($res_dcto,0,'enti_referidox');
	if(empty($dcto)) {$dcto=0;}
	if((empty($referidox) || !isset($referidox)) && $drtr==0) {$dcto=0;}
}

$dcto=28;


?>


<div class=WordSection1>
<table width = "100%" class=MsoTableGrid border=0 cellspacing=0 cellpadding=0 style='background:#FFE89F;border-collapse:collapse;border:none;mso-yfti-tbllook: 1184;mso-padding-alt:0cm 0cm 0cm 0cm;mso-border-insideh:none;mso-border-insidev: none'>
 <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:2.0cm'>
  <td width=589 colspan=3 valign=bottom style='width:441.9pt;padding:0cm 0cm 0cm 0cm;
  height:1.5cm'>
  <p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt;
  text-align:center;line-height:normal'>
		<![if !vml]>
	<span style='mso-ignore:vglayout;  position:absolute;z-index:1;left:0px;margin-left:264px;margin-top:69px;  width:167px;height:147px'></span>
		<![endif]><span class=SpellE>
		<b style='mso-bidi-font-weight:normal'>
		<span style='font-size:72.0pt;mso-bidi-font-size: 11.0pt;font-family:"Edwardian Script ITC";color:#C00000'>Germanya  2016</span>
		</b>
	</span>
	</p>
		
  </td>
 </tr>
 <tr style='mso-yfti-irow:1;mso-yfti-lastrow:yes;height:40.00pt' valign=center>
  <td width=340 valign=center style='width:9.0cm;padding:0cm 0cm 0cm 0cm;  height:42.00pt;text-align:center;'>
  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:  normal'>
	<b style='mso-bidi-font-weight:normal'>
	<span style='font-size:36.0pt; mso-bidi-font-size:16.0pt;font-family:"Edwardian Script ITC";color:#C00000;'>te esperamos con el</span>
	<span style='font-size:45.0pt; mso-bidi-font-size:45.0pt;font-family:"Edwardian Script ITC";color:#C00000;'>30%</span>
	<span style='font-size:36.0pt; mso-bidi-font-size:16.0pt;font-family:"Edwardian Script ITC";color:#C00000;'> de descuento</span>
	</b>
	</p>
  </td>
 </tr>
</table>

</div>



<?php
// echo '*';
?>

<div align="left" id="frm_excel_pedido">
<table width="100%" cellpadding="2" cellspacing="0">


<tr valign="top">
<td width="53%">

<div style="width:915px;">
<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:16px;  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">Codigo</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>

<div style="width:970px;height:450px;overflow-y: scroll;">
<form name="frm_pedido" id="frm_pedido"  method="post" style="padding:0px; margin:0px;"  >
<input type="hidden" id="h_ped_dcto" value="<?php echo $dcto;?>" />
<table border="1" id="tabla_pedido" cellpadding="0" cellspacing="0" style="border-collapse:collapse;font-size:12px; border:#000000 solid 2px;">
<tr>
	<td><div class="talla_cab_cat"></div></td>
    <td><div class="talla_cab_pag"></div></td>
	<td><div class="talla_cab_cod"></div></td>
    <td><div class="talla_cab_descri"></div></td>
	<td><div class="talla_cab_pvp"></div></td>
	<td style="border-left:solid 2px #000;"><div class="talla_vacio"></div></td>
	<td style="border-left:solid 2px #000;"><div class="talla_vacio"></div></td>
	<td><div class="talla_vacio"></div></td>
	<td><div class="talla_vacio"></div></td>
	<td><div class="talla_vacio"></div></td>
	<td><div class="talla_vacio"></div></td>
	<td><div class="talla_vacio"></div></td>
	<td><div class="talla_vacio"></div></td>
	<td style="border-left:solid 2px #000;"><div class="talla_vacio"></div></td>
	<td><div class="talla_vacio"></div></td>
	<td><div class="talla_vacio"></div></td>
	<td><div class="talla_vacio"></div></td>
	<td><div class="talla_vacio"></div></td>
    <td><div class="talla_vacio"></div></td>
</tr>
<?php
$sql_nctlg='SELECT item_nctlg
from invhoja
GROUP BY item_nctlg
ORDER BY item_nctlg desc LIMIT 2';

$filax=1;

$result_nctlg=mysql_query($sql_nctlg,$link_vcrx);
while($row_nctlg=mysql_fetch_assoc($result_nctlg))
{
	$sql_item='select 
	left(item_codigo,6)as codigo,
	item_pctlg,
	item_modelo,
	ROUND(item_pvp1, 2),
	item_puni,
	item_descri
	from invhoja 
	where item_nctlg="'.$row_nctlg['item_nctlg'].'"
	group by left(item_codigo,6) order by item_pctlg asc';
	$result_item=mysql_query($sql_item,$link_vcrx);
	while($row_item=mysql_fetch_row($result_item)){?>
	<tr style=" <?php if($filax==4){echo 'border-bottom:solid 1px #000;';$filax=1;}else{echo 'border-bottom:dotted 1px #000;';$filax++;} ?> font-size:14px;">
	<td style ="padding-right:5px" align="right"><?php echo $row_nctlg['item_nctlg'];?></td>
    <td align="center"><?php echo $row_item[1];?></td>	
    <td style ="padding-left:5px" align="left" onclick="ver_item('<?php echo $row_item[2];?>');"><?php echo $row_item[2];?></td>
    <td align="center" style="font-size:10px;"><?php echo $row_item[5];?></td>	
    <td style="padding-right:5px;width:55px" align="right" ><?php echo $row_item[3];?></td>
	<input type="hidden"   value="<?php echo $row_item[3];?>" readonly="readonly" style=" border:none; margin:0px; padding:0px; text-align:right;" />
    <input type="hidden"  id="<?php echo $row_item[2];?>" value="<?php echo $row_item[4];?>" readonly="readonly" />
        

<?php
$sql_talla='select item_codigo,RIGHT(item_codigo,2) as talla from invhoja where item_codigo like "'.$row_item[0].'%"
and  item_nctlg="'.$row_nctlg['item_nctlg'].'" order by talla asc ';
//echo $sql_talla;
	$res_talla=mysql_query($sql_talla,$link_vcrx);
	$arreglo[0]='<td style="border-left:solid 2px #000;" class="talla_vacio">&nbsp;</td>';
	$arreglo[1]='<td style="border-left:solid 2px #000;" class="talla_vacio">&nbsp;</td>';
	$arreglo[2]='<td class="talla_vacio">&nbsp;</td>';
	$arreglo[3]='<td class="talla_vacio">&nbsp;</td>';
	$arreglo[4]='<td class="talla_vacio">&nbsp;</td>';
	$arreglo[5]='<td class="talla_vacio">&nbsp;</td>';
	$arreglo[6]='<td class="talla_vacio">&nbsp;</td>';
	$arreglo[7]='<td class="talla_vacio">&nbsp;</td>';
	$arreglo[8]='<td style="border-left:solid 2px #000;" class="talla_vacio">&nbsp;</td>';
	$arreglo[9]='<td class="talla_vacio">&nbsp;</td>';
	$arreglo[10]='<td class="talla_vacio">&nbsp;</td>';
	$arreglo[11]='<td class="talla_vacio">&nbsp;</td>';
	$arreglo[12]='<td class="talla_vacio">&nbsp;</td>';
	$arreglo[13]='<td class="talla_vacio">&nbsp;</td>';
	
	while($row_talla=mysql_fetch_row($res_talla))
	{
 		if($row_talla[1]=='00'){$arreglo[0]='<td style="border-left:solid 2px #000;" align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt" onkeydown="mover(event,this.id);" onblur="recalc_ped();"  /></div></td>';}
		if($row_talla[1]=='04'){$arreglo[1]='<td style="border-left:solid 2px #000;" align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);" onblur="recalc_ped();"  /></div></td>';}
		if($row_talla[1]=='06'){$arreglo[2]='<td align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);" onblur="recalc_ped();"  /></div></td>';}
		if($row_talla[1]=='08'){$arreglo[3]='<td align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);" onblur="recalc_ped();"  /></div></td>';}
		if($row_talla[1]=='10'){$arreglo[4]='<td align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);" onblur="recalc_ped();"  /></div></td>';}
		if($row_talla[1]=='12'){$arreglo[5]='<td align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);" onblur="recalc_ped();"  /></div></td>';}
		if($row_talla[1]=='14'){$arreglo[6]='<td align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);" onblur="recalc_ped();"  /></div></td>';}
		if($row_talla[1]=='16'){$arreglo[7]='<td align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);" onblur="recalc_ped();"  /></div></td>';}
		if($row_talla[1]=='90'){$arreglo[8]='<td style="border-left:solid 2px #000;" align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);"  onblur="recalc_ped();" /></div></td>';}
		if($row_talla[1]=='91'){$arreglo[9]='<td align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);"  onblur="recalc_ped();" /></div></td>';}
		if($row_talla[1]=='92'){$arreglo[10]='<td align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);"  onblur="recalc_ped();" /></div></td>';}
		if($row_talla[1]=='93'){$arreglo[11]='<td align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);"  onblur="recalc_ped();" /></div></td>';}
		if($row_talla[1]=='94'){$arreglo[12]='<td align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);"  onblur="recalc_ped();" /></div></td>';}
		if($row_talla[1]=='95'){$arreglo[13]='<td align="center" class="celda"><div class="talla_div"><input type="text" name="'.$row_talla[0].'" id="'.$row_talla[0].'" class="talla_txt"  onkeydown="mover(event,this.id);"  onblur="recalc_ped();" /></div></td>';}				
	}
		
	foreach($arreglo as $valor){echo $valor;}
 ?> 
 </tr>    
<?php		
	}
}
?>
</table>

</form>






</div>

</td>

<td width="47%">

	<div align="center" style="margin-bottom:5px;">
    	<a href="../lib/pedidos_formato.php" target="new" style="text-decoration:none;color:#ffffff;font-size:14px; font-weight:bolder; background:#09c;">
        &nbsp; IMPRIMIR HOJA DE FORMATO &nbsp;
        </a>
    </div>
    <div align="center">Envio</div>
  	<div><input type="hidden" name="radio_car" id="radio" value="0"  onclick="recalc_ped();" /></div>
  	<div><input type="radio" name="radio_car" id="radio1" value="1" checked="checked" onclick="recalc_ped();" />a Director</div>
  	<div><input type="radio" name="radio_car" id="radio2" value="4" onclick="recalc_ped();" />a Domicilio</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>

<div align="center">
	<?php					
		require('../../lib/valdatenti.php');
		$valdatentix=new valdatenti('../cfg/res.php',$_SESSION['user_vcrx_id']);
		if($valdatentix->existe==1 ||  1==1) { ?>
		<?php	if($_SESSION['user_vcrx_tipo']=='admi' || $_SESSION['user_vcrx_tipo']=='sist' || $drtr==1){ 			//echo '<div></div><div>c.i. Empresario</div><input type="text" class="est_txt" id="enti" onKeyDown="busca_maes(event,this.id,'+'enti100'+');" />';    ?>	
			   
                           <div>CI Empresario</div>
                           <div><input type="text" class="est_txt" id="enti" style="width:80%" onKeyDown="busca_maes(event,this.id,'enti100');" /></div>
                           <div>NombreApellido</div>
                           <div><input type="text" class="est_txt" id="nom_ape" style="width:80%"  /></div>
                           <div>Telefono</div>
                           <div><input type="text" class="est_txt" id="telefono" style="width:80%"  /></div>
			
           <?php } else{ echo '<input type="hidden" class="est_txt" id="enti" value=""  />'; } ?>
        <div id="enti100"></div>
        <div id="lista_maes" align="left"></div>
		<div></div>
		<input type="image" src="../img/carrito.jpg" height="40"   onclick="carrito('<?php if($n_vtas!=0){echo 1;}else{echo 1;}?>');" id="carrito_ico"/>
		<div align="center" id="carrito_status"></div>

        
 <?php $adr_sql='select *from adrs0 where adrs_enti="'.$_SESSION['user_vcrx_id'].'"  and adrs_status!="X" order by adrs_defa desc, adrs_cdad,adrs_calle1';
	  $adr_res=mysql_query($adr_sql,$link_vcrx);
	  if(mysql_num_rows($adr_res)!=0){ $adr_aux=0;?>
      <div align="left">Escoja Dirección de Envio :
<select id="adr_dir" onchange="_adr_dato(this.value);" >		
<?php while($adr_r=mysql_fetch_assoc($adr_res)){ $adr_aux++;?>
		<option value="<?php echo $adr_r['adrs_codigo'];?>" <?php if($adr_r['adrs_defa']=='1'){echo 'selected="selected"';} ?>   ><?php echo $adr_aux.'-'.$adr_r['adrs_calle1'];?></option>	
<?php }?>
	  </select></div>        
<?php } ?>        

        <?php  } ?>        
        
        
<?php  
$dper_sql='select *from adrs00 where adrs_enti="'.$_SESSION['user_vcrx_id'].'"  and adrs_status!="X" and adrs_defa="1"';

$dper_res=mysql_query($dper_sql,$link_vcrx);
$dper_nom='N/A';
$dper_dir='N/A';
$dper_ciu='N/A';
$dper_pro='N/A';
$dper_tel='N/A';
$dper_ema='N/A';
$dper_con='N/A';

if(mysql_num_rows($dper_res)!=0)
{
$dper_nom=mysql_result($dper_res,0,'enti_descri');
$dper_dir=mysql_result($dper_res,0,'adrs_calle1').mysql_result($dper_res,0,'adrs_calle2').mysql_result($dper_res,0,'adrs_callen').mysql_result($dper_res,0,'adrs_calle3');
$dper_ciu=mysql_result($dper_res,0,'cdad_descri');
$dper_pro=mysql_result($dper_res,0,'prvc_descri');
$dper_tel=mysql_result($dper_res,0,'adrs_tlfn').'-'.mysql_result($dper_res,0,'adrs_ext');
$dper_ema=mysql_result($dper_res,0,'adrs_email');
$dper_con=mysql_result($dper_res,0,'adrs_contacto');

}
?>		
<table width="100%">
<tr align="left"><td>NOMBRE: </td><td><span id="nom_lbl" ><?php echo $dper_nom;?></span></td></tr>
<tr align="left"><td>DIRECCION: </td><td><span id="dir_lbl" ><?php echo $dper_dir;?></span></td></tr>
<tr align="left"><td>CIUDAD: </td><td><span id="ciu_lbl" ><?php echo $dper_pro.'-'.$dper_ciu;?></span></td></tr>
<tr align="left"><td>TELEFONO: </td><td><span id="tel_lbl" ><?php echo $dper_tel;?></span></td></tr>
<tr align="left"><td>EMAIL: </td><td><span id="ema_lbl" ><?php echo $dper_ema;?></span></td></tr>
<tr align="left"><td>CONTACTO: </td><td><span id="con_lbl" ><?php echo $dper_con;?></span></td></tr>
</table> 
<!-- <a href="../lib/dper1.php?idx=<?php echo $_SESSION['user_vcrx_id'];?>" target="_blank" style="color:#F00; text-decoration:none;">Si sus datos personales son incorrectos, Actualice sus Datos Aqui.!</a> -->
<a href="../lib/nenti.php?idx=<?php echo $_SESSION['user_vcrx_id'];?>" target="_blank" style="color:#F00; font-weight:bolder; text-decoration:none;">Si sus datos personales son incorrectos, Actualice sus Datos Aqui.!</a>
</div>
<div align="center" id="carrito_error"></div>




</td>



</tr>
</table>
<div align="center" id="carrito_es"></div>
</div>
<script type="text/javascript">
function ver_item(indit)
{
	//window.open('../lib/vradrs1.php?ci='+idx+'&nom='+nomx, this.target, 'width=300,height=400'); 
	//return false; 
	console.log(indit);

}
</script>





</body>
</html>
