<?php

session_start();
$com = "M";
include("DMMYSQLG.php");
include("DSA3000.php");
require_once("DFJQUERY.inc");
include("JQUERY.inc");

?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<?php

if ($_REQUEST['bot']==""){
	echo '<h2>!!! SELECCIONE UN REGISTRO !!!</h2>';
	echo '<meta content="1; url=cat_areas_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	if(!isset($_REQUEST['tap2'])){
		include('cat_areas_CL.php');
		$varible_clase = new clase();
		$res=$varible_clase->lista_busqueda($_REQUEST["bot"]);
		$reg=mysqli_fetch_array($res);
                if(!isset($reg['id_pro']))$reg['id_pro']="";
		$_REQUEST['id_pro']=$reg['id_pro'];
                if(!isset($reg['np_desc1']))$reg['np_desc1']="";
		$_REQUEST['tap2']=$reg['np_desc1'];
                if(!isset($reg['lim_vta1']))$reg['lim_vta1']="";
		$_REQUEST['precio']=$reg['lim_vta1'];
                if(!isset($reg['afe_inv']))$reg['afe_inv']="";
		$_REQUEST['afe_inv']=$reg['afe_inv'];
                if(!isset($reg['cve_iva_ven']))$reg['cve_iva_ven']="";
		$_REQUEST['cve_iva_ven']=$reg['cve_iva_ven'];
                if(!isset($reg['afe_coman']))$reg['afe_coman']="";
		$_REQUEST['afe_coman']=$reg['afe_coman'];
                if(!isset($reg['linea']))$reg['linea']="";
		$_REQUEST['select']=$reg['linea'];
                if(!isset($reg['gpo_basico']))$reg['gpo_basico']="";
		$_REQUEST['select2']=$reg['gpo_basico'];
                if(!isset($reg['exi_min']))$reg['exi_min']="";
		$_REQUEST['tap4']=$reg['exi_min'];
                if(!isset($reg['exi_max']))$reg['exi_max']="";
		$_REQUEST['tap5']=$reg['exi_max'];
                if(!isset($reg['tip_mon']))$reg['tip_mon']="";
		$_REQUEST['tap18']=$reg['tip_mon'];
                if(!isset($reg['cve_uni_com']))$reg['cve_uni_com']="";
		$_REQUEST['tap14']=$reg['cve_uni_com'];
                if(!isset($reg['capacidad']))$reg['capacidad']="";
		$_REQUEST['capacidad']=$reg['capacidad'];
                if(!isset($reg['cve_uni_vta']))$reg['cve_uni_vta']="";
		$_REQUEST['tap15']=$reg['cve_uni_vta'];
                if(!isset($reg['cve_marca']))$reg['cve_marca']="";
		$_REQUEST['tap8']=$reg['cve_marca'];
                if(!isset($reg['cve_iva']))$reg['cve_iva']="";
		$_REQUEST['tap9']=$reg['cve_iva'];
                if(!isset($reg['es_inv']))$reg['es_inv']="";
		$_REQUEST['es_inv']=$reg['es_inv'];
                if(!isset($reg['cos_prom']))$reg['cos_prom']="";
		$_REQUEST['cos_prom']=$reg['cos_prom'];
                if(!isset($reg['cod_var']))$reg['cod_var']="";
		$_REQUEST['cod_var']=$reg['cod_var'];
                if(!isset($reg['fic_tec']))$reg['fic_tec']="";
		$_REQUEST['fic_tec']=$reg['fic_tec'];
		//$_REQUEST['proteinas']=$reg['proteinas'];
		
		//$_REQUEST['calcio']=$reg['calcio'];	
		
		//$_REQUEST['dias_alm']=$reg['dias_alm'];
                
                if(!isset($reg['casillero']))$reg['casillero']="";
		$_REQUEST['casillero']=$reg['casillero'];
                if(!isset($reg['afe_coman']))$reg['afe_coman']="";
		$_REQUEST['afe_coman']=$reg['afe_coman'];
                if(!isset($reg['des_cor']))$reg['des_cor']="";
		$_REQUEST['des_cor']=$reg['des_cor'];
                if(!isset($reg['id_receta']))$reg['id_receta']="";
		$_REQUEST['id_receta']=$reg['id_receta'];
                if(!isset($reg['pos_pun_ven']))$reg['pos_pun_ven']="";
		$_REQUEST['pos_pun_ven']=$reg['pos_pun_ven'];
                if(!isset($reg['status']))$reg['status']="";
		$_REQUEST['status']=$reg['status'];
                if(!isset($reg['codigo']))$reg['codigo']="";
		$_REQUEST['descpvta']=$reg['codigo'];
	}
?>

<script language="javascript">
     $(document).ready(function(){
	function formatItem(row) {
		return " (<strong>" + row[1] + "</strong>)"+row[0];
	}
	var pagRes='BUSAREA.php';
	var idObjDes='tap2';
	

	var nomObjRad='tip_bus_ope';
        
	$("#"+idObjDes).autocomplete({
            source:pagRes,
		minChars: 1,                 //Caracteres Minimos antes de autocompletar
		max:20,                      //maximo de resultados mostrados, se manda como limit en autosugestion
		                 //ancho del cuadro de despliegue
		 delay: 200,           //Resalta letras coincidentes
		autoFill: true,             //autocompleta en texto la posible palabra
		scroll: true,				 //si cuadro tiene barra scroll
		scrollHeight: 100,           //alto del cuadro para el scroll
		
                           select: function( event, ui ) {
                        
                     $("#"+idObjDes).val( ui.item.np_desc1);
                  	
          }
 //Parametros Extra a Mandar en autosugestion
	});	
});
//$(document).ready(function(){
//	function formatItem(row) {
//		return " (<strong>" + row[1] + "</strong>)"+row[0];
//	}
//	$("#tap2").autocomplete('BUSAREA.php',{
//		minChars: 1,                 //Caracteres Minimos antes de autocompletar
//		//max:3                        //maximo de resultados mostrados, se manda como limit en autosugestion
//		delay: 200,                  //Retardo de autocompletar 
//		width: 500,                  //ancho del cuadro de despliegue
//		highlight: false,            //Resalta letras coincidentes
//		autoFill: false,             //autocompleta en texto la posible palabra
//		scroll: true,				 //si cuadro tiene barra scroll
//		scrollHeight: 300,           //alto del cuadro para el scroll
//		formatItem:formatItem,	     //formato de presentacion de las posibles busquedas
//		extraParams:{tipBus:'d'}     //Parametros Extra a Mandar en autosugestion
//	});
//});
</script>

<script language="javascript">
function ocultaMuestra(divVent){
	if(divVent.style.display=='none'){
		divVent.style.display='';

	}else{
		divVent.style.display='none';

	}
}	
	</script>
	
	
<body>

<form name="frm1" method="post" action="" enctype="multipart/form-data">
<input name="bot" type="hidden" value="<?php
 echo $_REQUEST['bot'];?>"> 
  <table width="475"  align="center">
    <tr>
      <th colspan="4">MODIFICAR AREAS </th>
    </tr>
    <tr>
      <td width="346" colspan="3"><span class="Estilo19">
        <input name="nparte1" type="hidden" id="nparte1" size="15"
		  <?php
 
		if(isset($_REQUEST['bot'])){
		echo 'value="'.$reg['nparte1'].'"';
		}
		?>
		
		>
      </span></td>
    </tr>
  </table>
  <div id="divVent" style="display:">
    <table width="475"  align="center"  >
      <tr>
        <td width="113">DESCRIPCION.</td>
        <td width="346"><label>
        <input name="tap2" id="tap2" type="text" tabindex="2"
		  onBlur="may(this)" size="30"
		 <?php
 
		if(isset($_REQUEST['bot'])){
		echo 'value="'.$reg['np_desc1'].'"';
		}
		?>>
        </label></td>
      </tr>
      <tr>
        <td>DESCRIPCION PUNTO VTA. </td>
        <td><select name="descpvta" id="descpvta">
          <?php

			$sql = mysqli_query($con ,"SELECT * FROM ptventa");
				while($row=mysqli_fetch_array($sql)){
					if($row['nparte1'] == $reg['codigo']){
						echo '<option value="' . $row['nparte1'] . '" selected>' . $row['np_desc1'].'</option>';
					}else{
						echo '<option value="' . $row['nparte1'] . '">' . $row['np_desc1'].'</option>';
					}
				}
		?>
        </select></td>
      </tr>
      
      
      <tr>
        <td height="29" colspan="2">
          <div align="center">
            <input type="button" name="bot1" value="Modificar" onClick="openpage('cat_areas_MC.php','_self')"/>
            <input type="button" name="bot4" value="Regresar" onClick="openpage('cat_areas_PR.php','_self')"/>
			<input type="button" name="bot3" value="Eliminar" onClick="openpage('cat_areas_EL.php','_self')"/>
        </div></td>
      </tr>
    </table>
  </div>
  <div id="divArt" style="display:none">
</form>
    <?php
 
if(isset($_POST['bot3'])){
	echo '<div align="center"
<?php
 mysqli_close($con);?>>
	<form id="form1" name="form1" action="cat_areas_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	
}
?>
 <?php
 
}
?>
</body>
</html>
<?php
 mysqli_close($con);?>

</body>
</html>



