<?php
 
session_start();
$com = "M";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");
require_once("DFJQUERY.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=MS10000_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	if(!isset($_REQUEST['tap2'])){
		include('MS10000_CL.php');
		$varible_clase = new clase();
		$res=$varible_clase->lista_busqueda($_REQUEST["bot"]);
		$reg=mysqli_fetch_array($res);
		$_REQUEST['id_pro']=$reg['id_pro'];
		$_REQUEST['tap2']=$reg['np_desc1'];
		$_REQUEST['precio']=$reg['lim_vta1'];
		$_REQUEST['afe_inv']=$reg['afe_inv'];
		$_REQUEST['cve_iva_ven']=$reg['cve_iva_ven'];
		$_REQUEST['afe_coman']=$reg['afe_coman'];
		$_REQUEST['select']=$reg['linea'];
		$_REQUEST['select2']=$reg['gpo_basico'];
		$_REQUEST['tap4']=$reg['exi_min'];
		$_REQUEST['tap5']=$reg['exi_max'];
		$_REQUEST['tap18']=$reg['tip_mon'];
		$_REQUEST['tap14']=$reg['cve_uni_com'];
		$_REQUEST['capacidad']=$reg['capacidad'];
		$_REQUEST['tap15']=$reg['cve_uni_vta'];
		$_REQUEST['tap8']=$reg['cve_marca'];
		$_REQUEST['tap9']=$reg['cve_iva'];
		$_REQUEST['es_inv']=$reg['es_inv'];
		$_REQUEST['cos_prom']=$reg['cos_prom'];
		$_REQUEST['cod_var']=$reg['cod_var'];
		$_REQUEST['fic_tec']=$reg['fic_tec'];
		$_REQUEST['potacio']=$reg['potacio'];
		$_REQUEST['proteinas']=$reg['proteinas'];
		$_REQUEST['lipidos']=$reg['lipidos'];
		$_REQUEST['kcalorias']=$reg['kcalorias'];
		$_REQUEST['calcio']=$reg['calcio'];
		$_REQUEST['carboidratos']=$reg['carboidratos'];
		$_REQUEST['sodio']=$reg['sodio'];
		$_REQUEST['fac_rend']=$reg['fac_rend'];
		$_REQUEST['temperatura']=$reg['temperatura'];
		$_REQUEST['dias_alm']=$reg['dias_alm'];
		$_REQUEST['casillero']=$reg['casillero'];
		$_REQUEST['afe_coman']=$reg['afe_coman'];
		$_REQUEST['des_cor']=$reg['des_cor'];
		$_REQUEST['id_receta']=$reg['id_receta'];
		$_REQUEST['pos_pun_ven']=$reg['pos_pun_ven'];
		$_REQUEST['descpvta']=$reg['descripcion'];
		$_REQUEST['area']=$reg['area'];
		$_REQUEST['status']=$reg['status'];
	}
?>

<script language="javascript">
$(document).ready(function(){
	function formatItem(row) {
		return " (<strong>" + row[1] + "</strong>)"+row[0];
	}
	$("#tap2").autocomplete('BUSMESA.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="" >
<input name="bot" type="hidden" value="<?php
 echo $_REQUEST['bot'];?>"> 
  <table width="475"  align="center">
    <tr>
      <th colspan="4">MODIFICAR MESAS </th>
    </tr>
    <tr>
      <td width="346" colspan="3"><span class="Estilo19">
          </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" value="<? echo $_REQUEST['tap2'];?>">
		
        </label></td>
      </tr>
      <tr>
        <td>DESCRIPCION PUNTO VTA. </td>
        <td>
		<select name="descpvta" id="descpvta" onChange="javascript: document.getElementById('frm1').submit()" >
			<option>------------Selecciona-------------</option>
			<?php
 
			@$resultado2=mysqli_query($con ,"select * from ptventa ORDER BY np_desc1");
			while($registro2=mysqli_fetch_array($resultado2)){
				if($_REQUEST['descpvta']==$registro2['nparte1'])
					echo '<option value="'. $registro2['nparte1'] .'" selected>'.$registro2['np_desc1'].'</option>';
				else
					echo '<option value="'. $registro2['nparte1'] .'">'.$registro2['np_desc1'].'</option>';
			}
		?>
		
	    </select>
		</td>
      </tr>
      <tr>
        <td>AREA.</td>
        <td>
		<select name="area" id="area" >
          <option>------------Selecciona----------</option>
	<?php

	if(isset($_REQUEST['descpvta'])){ 
		@$res=mysqli_query($con ,"select * from ctarea where codigo='".$_REQUEST['descpvta']."'");
		while($reg=mysqli_fetch_array($res)){
			if($_REQUEST['area']==$reg['nparte1'])
				echo '<option value="' . $reg['nparte1'] . '" selected>' . $reg['np_desc1'] . '</option>';
			else
				echo '<option value="' . $reg['nparte1'] . '">' . $reg['np_desc1'] . '</option>';
		}
	}
	?>
        </select>
		</td>
      </tr>
      
      
      <tr>
        <td height="29" colspan="2">
          <div align="center">
            <input type="button" name="bot1" value="Modificar" onClick="openpage('MS10000_MC.php','_self')"/>
            <input type="button" name="bot4" value="Regresar" onClick="openpage('MS10000_PR.php','_self')"/>
			<input type="button" name="bot3" value="Eliminar" onClick="openpage('MS10000_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="MS10000_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	
}
?>
 <?php
 
}
?>
</body>
</html>
<?php
 mysqli_close($con);?>

</body>
</html>



