<?php
 
session_start();
$com = "A";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");
require_once("DFJQUERY.inc");
include("DF30000.inc");
?>
<html>
<link rel="stylesheet" href="COS_CSS.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<style type="text/css">
<!--
.Estilo19 {font-size: 16px}
.Estilo18 {color: #FFFFFF}
.Estilo20 {
	font-size: 18px;
	font-weight: bold;
}
-->
</style>
<script language="javascript">
function openWindow(dataGen,valores){
	var objDate=new Date();
	var getVars,getVarsAux,distPage;
	var idVentana;
	for(getVarsAux in valores){
		getVars +='&'+getVarsAux+'='+valores['getVarsAux'];
	}
	if(typeof dataGen.width=='undefined') dataGen.width='800';
	if(typeof dataGen.height=='undefined') dataGen.height='600';
	distPage='?tmr='+objDate.getHours()+objDate.getMinutes()+objDate.getSeconds()+objDate.getDay()+objDate.getMonth()+objDate.getFullYear();
	idVentana=window.open(dataGen.action+distPage+getVars,dataGen.name,'width='+dataGen.width+',height='+dataGen.height+',top=100,left=50,scrollbars=yes,menubar=yes,status=yes');
	return idVentana;
}
</script>
<script language="javascript">
$(document).ready(function(){
	function formatItem(row) {
		return " (<strong>" + row[1] + "</strong>)"+row[0];
	}
	$("#tap2").autocomplete('CO10200_AU.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>
<DIV STYLE="position:absolute; top:-20px; left:10px">
<img src="img/sihteolsd.gif"/>
</DIV> 

<form name="frm1" method="post" action=""  enctype="multipart/form-data">
  <table width="430"  align="center" bordercolor="#FF6600" bordercolordark="#FF6600">
    <tr>
      <th colspan="4">AGREGAR DATOS DE RECETA</th>
    </tr>
    <tr>
      <td width="77"><span class="Estilo18">FOLIO</span></td>
      <td width="337" colspan="3"><span class="Estilo19">
      <input name="codigo" type="text" id="codigo" size="15" disabled="disabled"
		  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['codigo'].'"';
		}
		?>
		>
      <input name="Submit22" type="Button" onClick="openpage('CO10200_AC.php','_self')" value="Guardar" class="bot_WsW">
      <input type="Button" name="Submit2" value="Regresar" onClick="envia1('CO10200_PR.php','_self')" class="original">
</span></td>
    </tr>
  </table>
  <div id="divVent" style="display:">
    <table width="695"  align="center" bordercolor="#FF6600" bordercolordark="#FF6600" >
      <tr>
        <td colspan="3"><span class="Estilo18"><strong>NOMBRE</strong>
            <input name="tap2" id="tap2" type="text" tabindex="2"
		  onBlur="may(this)" size="70"
		<?php

			if(isset($_REQUEST['tap2'])){ 
				echo 'value="' . $_REQUEST['tap2'] .  '"';
			}
		?>>
        </span></td>
        <td width="91" rowspan="8" nowrap bordercolor="#FFFFFF" style="#5F84B1"><div align="center" id="capa"><?php

			$fotografia = 'foto/corec2/NO_'. $reg["n_reg"] .'.JPG';
			if (file_exists($fotografia)) {
				echo '<img src="foto/corec2/NO_'.$reg["n_reg"].'.JPG" width="150" height="175">';
			}else{
				echo '<img src="foto/sin_producto.jpg" width="150" height="175">';
			}
		  ?>
	    </div>
	    <input type="checkbox" name="ac" value="1" onClick="act_fichero(ac.checked)">
        <input name="fichero" type="file" disabled="disabled" size="1" ></td>
      </tr>
      <tr>
        <td colspan="2"><span class="Estilo18"><strong>TIEMPO</strong>
            <label></label>          
            <label></label>
            <label></label>          
            <label></label>          
            <select name="p1" id="p1" onChange="javascript: document.getElementById('frm1').submit()" tabindex="6">
              <option value="">-----SELECCIONE-----</option>
              <?php
 
$sql = mysqli_query($con ,"SELECT * FROM cotimp");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['p1']==$reg['np_desc1'] ){
		echo '<option value="' . $reg['np_desc1'] . '" selected>' . $reg['np_desc1'] . '</option>';
	}else{
		echo '<option value="' . $reg['np_desc1'] . '">' . $reg['np_desc1'] . '</option>';
	}
}
?>
              </select>
        </span></td>
        <td width="227"><span class="Estilo18"><strong>FECHA</strong>
            <input name="gfecini" type="text" class="emplea" id="gfecini" size="15" maxlength="15"
		  <?php

			  	echo 'value="'.date("d/m/Y").'"'; 
			  
			  ?>
		  />
          <input name="reset2" id="bot" type="image" value"Cal" src="logos/cal4.jpg" />
        </span></td>
      </tr>
      <tr>
        <td width="216"><span class="Estilo18"><strong>PORCIONES</strong>
            <label>
            <input name="codigo" type="text" id="codigo" size="5"
		onBlur="may(this)"
		<?php

			if(isset($_REQUEST['codigo'])){ 
				echo 'value="' . $_REQUEST['codigo'] .  '"';
			}
		?>/>
            </label>
        </span></td>
        <td width="133"><span class="Estilo18">
          <label> </label>
          <strong>UNIDAD.</strong>
          <select name="p2" id="p2" onChange="javascript: document.getElementById('frm1').submit()" tabindex="6">
            <option value="">-SEL-</option>
            <?php
 
$sql = mysqli_query($con ,"SELECT * FROM dgmedida");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['p2']==$reg['np_desc1'] ){
		echo '<option value="' . $reg['np_desc1'] . '" selected>' . $reg['np_desc1'] . '</option>';
	}else{
		echo '<option value="' . $reg['np_desc1'] . '">' . $reg['np_desc1'] . '</option>';
	}
}
?>
          </select>
        </span></td>
        <td><span class="Estilo18"><strong>COLOR</strong>
            <select name="almacen" id="almacen" onChange="javascript: document.getElementById('frm1').submit()" tabindex="6">
              <option value="">---SELECCIONE---</option>
              <?php
 
$sql = mysqli_query($con ,"SELECT * FROM fcolor");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['almacen']==$reg['clave'] ){
		echo '<option value="' . $reg['clave'] . '" selected>' . $reg['descrip'] . '</option>';
	}else{
		echo '<option value="' . $reg['clave'] . '">' . $reg['descrip'] . '</option>';
	}
}
?>
                </select>
        </span></td>
      </tr>
      
      <tr>
        <td height="22" colspan="2"><span class="Estilo18"><strong>COSTO POR PLATILLO</strong>
            <label>
          <span class="Estilo20">$</span>
          <input name="invmin" type="text" id="invmin" size="8"
		  <?php

			if(isset($_REQUEST['invmin'])){ 
				echo 'value="' . $_REQUEST['invmin'] .  '"';
			}
		?>
		  />
            </label>
        </span></td>
        <td><span class="Estilo18"><strong>COSTO POR PORCION</strong><span class="Estilo20">$</span></span>
          <span class="Estilo18">
          <label>
          <input name="invmax" type="text" id="invmax" size="8"
		  <?php

			if(isset($_REQUEST['invmax'])){ 
				echo 'value="' . $_REQUEST['invmax'] .  '"';
			}
		?>
		  />
          </label>
        </span></td>
      </tr>
      <tr>
        <th colspan="3">CLASIFICACION</th>
      </tr>
      
      
      <tr>
        <td><span class="Estilo18">
          <input name="entradae" type="checkbox" id="entradae" value="SI"<?php
if($_REQUEST['entradae']) echo 'checked';?>>
          <strong>1.) ENSALADAS Y GUARNICIONES</strong></span></td>
        <td><span class="Estilo18">
          <input name="salidae" type="checkbox" id="salidae" value="SI"<?php
if($_REQUEST['salidae']) echo 'checked';?>>
          <strong> 4.) SOPAS</strong></span></td>
        <td><span class="Estilo18">
          <input name="entradama" type="checkbox" id="entradama" value="SI"<?php
if($_REQUEST['entradama']) echo 'checked';?>>
          <strong>7.) PAN Y TORTILLAS</strong></span></td>
      </tr>
      <tr>
        <td><span class="Estilo18">
          <input name="entradam" type="checkbox" id="entradam" value="SI"<?php
if($_REQUEST['entradam']) echo 'checked';?>>
          <strong>2.)PLATILLO PRINCIPAL Y FRIJOLES</strong></span></td>
        <td><span class="Estilo18">
          <input name="salidam" type="checkbox" id="salidam" value="SI"<?php
if($_REQUEST['salidam']) echo 'checked';?>>
          <strong> 5.)POSTRES  </strong></span></td>
        <td><span class="Estilo18">
          <input name="salidama" type="checkbox" id="salidama" value="SI"<?php
if($_REQUEST['salidama']) echo 'checked';?>>
          <strong>8.) SALSAS, CHILES Y ADEREZOS</strong></span></td>
      </tr>
      <tr>
        <td><span class="Estilo18">
          <input name="salidaf" type="checkbox" id="salidaf" value="SI"<?php
if($_REQUEST['salidaf']) echo 'checked';?>>
          <strong> 3.) SEGUNDO PLATO </strong></span></td>
        <td><span class="Estilo18">
          <input name="salidaa" type="checkbox" id="salidaa" value="SI"<?php
if($_REQUEST['salidaa']) echo 'checked';?>>
          <strong>6.) BEBIDAS</strong></span></td>
        <td><span class="Estilo18">
          <input name="salidaj" type="checkbox" id="salidaj" value="SI"<?php
if($_REQUEST['salidaj']) echo 'checked';?>>
          <strong>9.) OPCIONES</strong></span></td>
      </tr>
      <tr>
        <th colspan="2"><div align="center">PREPARACION PREVIA(Medidas de Higiene y Seguridad) </div></th>
        <th colspan="2">MODO DE PREPARACION</th>
      </tr>
      <tr>
        <td colspan="2"><textarea name="costop" cols="46" rows="7" id="costop"
		  onBlur="may(this)"><?php

				if(isset($_POST['costop'])){ //este es el truco
					echo $_POST['costop'];
				}
			?>
        </textarea></td>
        <td colspan="2"><textarea name="capacidad" cols="46" rows="7" id="capacidad"
		  onBlur="may(this)"><?php

				if(isset($_POST['capacidad'])){ //este es el truco
					echo $_POST['capacidad'];
				}
			?>
          </textarea></td>
      </tr>
      <tr>
        <th colspan="4">PRESENTANCION</th>
      </tr>
      <tr>
        <td colspan="4"><div align="center">
          <textarea name="descripcion" cols="74" rows="5" id="descripcion"
		  onBlur="may(this)"><?php

				if(isset($_POST['descripcion'])){ //este es el truco
					echo $_POST['descripcion'];
				}
			?>
        </textarea>
        </div></td>
      </tr>
    </table>
  </div>
</form>
</body>
</html>
<?php
 mysqli_close($con);?>
