<?php

session_start();
include("DMMYSQLG.php");
require_once('DFJSISCI.inc');
require_once('DF80000.php');
include("JQUERY.inc");
//$_SESSION['al']='0A'; || $_SESSION['tipven']==''
//if($_SESSION['vendedor']==''){
//	echo "<h2>Vuelva a identificarse!!</h2>";
//	exit();
//}
$dt_parame=mysqli_fetch_array(mysqli_query($con ,"SELECT * from dgparame"));
?>
<!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=iso-8859-1" />
<link rel="stylesheet" href="CMD2_PR.css" type="text/css"/>
<script type="text/javascript" language="javascript" src="DSSCRIPT.js"></script>
<script type="text/javascript" language="javascript" src="CMD2_PR.js"></script>
<title>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}

-->
</style></head>

<body onload="getDetVen()">
<form name="mainForm" id="mainForm" method="post" action="" target="_self" onsubmit="return false">
<?php

//echo "AKIIIIIIII".$_GET['pos'];
//echo "msea".$_GET['ms']; 
if ($_GET['pos']!=""){
$bus=mysqli_query($con ,"select fol_ven from fpos where nparte1=".$_GET['pos']." and mesa=".$_GET['ms']." and status=1 order by id desc limit 1");
$resul=mysqli_fetch_array($bus);
$resul['fol_ven'];
$folio=$resul['fol_ven'];
} ?>
  <div id="foliooo" style="display:none">
<input type="text" name="bot" id="bot" value="
<?php
  if (isset($_GET['fol'])){
echo $_GET['fol']; 
}else if (isset($folio)){
echo $folio;
}?>">
<input type="text" name="comand" id="comand" value="
<?php
  
echo $_GET['comand'];
?>">
  </div>
<input type="hidden" name="bat" id="bat" value="2">    <!--1-Tot.fol. 2-orden.fol.-->
<input type="hidden" name="idDetSel" id="idDetSel" value="">
<input type="hidden" name="virtualKey_focus" id="virtualKey_focus" value="NO_FOCUS">
<table  border="0" cellpadding="0" cellspacing="0" align="center">
  <!--DWLayoutTable-->
  <tr>
    <td height="20"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td colspan="2">
        <input name="termina" type="submit" id="HSIAD_usuario" onclick="nuevoPedido();imprimePedido();envia2('MESA5000_PR.php?pos=<?php
 echo $_GET['cont']; ?>&amp;mesero=<?php
 echo $_GET['mesero']; ?>&amp;pt=<?php
 echo $_GET['pt'] ?>&amp;ar=<?php
 echo $_GET['ar']; ?>&amp;ms=<?php
 echo $_GET['ms']; ?>','_self','mainForm');" value="Terminar"/>
        <input name="pagar2" type="submit" id="HSIAD_usuario" onclick="javascript:window.open('CAL10000.php?tpo=7&amp;pos=<?php
 echo $_GET['pos']; ?>&amp;pt=<?php
 echo $_GET['pt'] ?>&amp;ar=<?php
 echo $_GET['ar']; ?>&amp;ms=<?php
 echo $_GET['ms']; ?>&amp;cont=<?php
 echo $_GET['cont']; ?>&amp;mesero=<?php
 echo $_GET['mesero']; ?>','VENTANA','width=180,height=260,scrollbars=NO,minimize=0');" value="Pagar"/>
        <?php
 if (!isset($_GET['comand']))
			{ 	$_SESSION['comand']="0";?>
        <input name="comand2" type="submit" id="HSIAD_usuario" onclick="javascript:window.open('CAL10000.php?tpo=4&amp;pos=<?php
 echo $_GET['pos']; ?>&amp;pt=<?php
 echo $_GET['pt'] ?>&amp;ar=<?php
 echo $_GET['ar']; ?>&amp;ms=<?php
 echo $_GET['ms']; ?>&amp;cont=<?php
 echo $_GET['cont']; ?>&amp;mesero=<?php
 echo $_GET['mesero']; ?>','VENTANA','width=180,height=260,scrollbars=NO,minimize=0');" value="Comanda"/>
        <?php
 }?>
		  <input name="pagar2" type="submit" id="HSIAD_usuario" onclick="javascript:window.open('CAL10000.php?tpo=7&amp;pos=<?php
 echo $_GET['pos']; ?>&amp;pt=<?php
 echo $_GET['pt'] ?>&amp;ar=<?php
 echo $_GET['ar']; ?>&amp;ms=<?php
 echo $_GET['ms']; ?>&amp;cont=<?php
 echo $_GET['cont']; ?>&amp;mesero=<?php
 echo $_GET['mesero']; ?>','VENTANA','width=180,height=260,scrollbars=NO,minimize=0');" value="Cancela Cta."/>
		    <input name="pagar2" type="submit" id="HSIAD_usuario" onclick="enviar2('MESA5000_PR.php?tamp;pos=<?php
 echo $_GET['pos']; ?>&amp;pt=<?php
 echo $_GET['pt'] ?>&amp;ar=<?php
 echo $_GET['ar']; ?>&amp;ms=<?php
 echo $_GET['ms']; ?>&amp;cont=<?php
 echo $_GET['cont']; ?>&amp;mesero=<?php
 echo $_GET['mesero']; ?>','_self','form1');" value="Regresar"/></td>
			</tr>
			<tr>
    <td width="4"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td height="20" class="titVenta">MESERO(A):<?php 
												 $_SESSION['punto']=$_GET['pt'];
												 $_SESSION['area']=$_GET['ar'];
												 $_SESSION['mesa']=$_GET['ms'];
$dt_clav=mysqli_fetch_array(mysqli_query($con ,"SELECT nparte1 FROM ctmeser WHERE codigo='".$_GET['mesero']."'")); 
												 $_SESSION['vendedor']=$dt_clav['nparte1'];
												 $_SESSION['tipven']=1;
												$_SESSION['fecven']=$dt_empres['fec_alta'];
	$dt_des=mysqli_fetch_array(mysqli_query($con ,"SELECT ctmeser.np_desc1 as mesero FROM ctmeser WHERE ctmeser.nparte1='".$_SESSION['vendedor']."'")); 
	echo $dt_des['mesero']; ?></td>
    <td height="20" class="titVenta"><?php echo whatday($_SESSION['fecven']).', '.chfecha($_SESSION['fecven'],'Y-m-d','d de M de Y');?></td>
  </tr>
  <tr>
    <td width="4" height="80"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td>
		<div style="width:340px; height:80px" id="divMenu">
		<table width="138"  border="0">
          <tr>
            <td colspan="2" class="cellFootCanDesTit"><div align="left">FOLIO: 
              <?php
 
			  if (isset($folio)){
				echo $folio;
			  }else if (!isset($_GET['fol'])){
			@$fol=mysqli_fetch_array(mysqli_query($con ,"select fol_ven as folio from dgpemema order by fol_ven desc")); 
			echo $fol['folio']+1;}
			else {
			echo $_GET['fol'];
			}
			?> 
            </div></td>
          </tr>
          <tr>
            <td colspan="2" class="cellFootCanDesTit"><div align="left">No. MESA: <?php
 
	$busm=mysqli_fetch_array(mysqli_query($con ,"SELECT np_desc1 FROM ctmesas WHERE nparte1='".$_SESSION['mesa']."'"));
	echo $busm['np_desc1']; 
			 $_SESSION['posi']=$_GET['pos']; ?></div></td>
          </tr>
          <tr>
            <td colspan="2" class="cellFootCanDesTit"><div align="left">HABITACION:
              <?php
 
			@$hab=mysqli_fetch_array(mysqli_query($con ,"select no_hab as habitacion,nparte1 from fcomhues where cvmesa='".$_SESSION['mesa']."' order by nparte1 desc limit 1")); 
			$_SESSION['hsp']=$hab['nparte1'];
			if ($hab['habitacion']!=0){
			echo $hab['habitacion'];}
			else {
			echo "----";
			}?> 
            </div></td>
			
			<?php

			   @$cfol=mysqli_fetch_array(mysqli_query($con ,"select nparte1 from fcomanda order by nparte1 desc limit 1"));
			   if (isset($cfol['nparte1'])){
			   $_SESSION['cclav']=$cfol['nparte1']+1; 
			   }else {
   			   $_SESSION['cclav']='';
			   } 
				$_SESSION['comand']=$_GET['comand'];
				?> 
			</tr>
        </table>
		</div></td>
    <td width="650" align="left" valign="top" class="basCellLinea">
		<div style="width:650px; height:80px" id="divLineas"></div>	</td>
  </tr>
  <tr>
    <td height="80"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td rowspan="2" class="basCellCalculadora"><div style="width:340px; height:150px;" id="divCalculadora">
      <?php require_once('CAJA2_MEN.php');?>
    </div></td>
    <td class="basCellGrupo" valign="top">
	  <div style="width:650px; height:80px" id="divGrupos"></div>	</td>
  </tr>
  <tr>
    <td height="70"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td rowspan="2" class="basCellProducto" valign="top">
		<div style="width:650px; height:300px;" id="divProductos"></div><div style="width:650px; height:385px; display:none;" id="divScrPag"><?php include("CAJA3_MEN.php");?></div>	  </td>
  </tr>
  
  <tr>
    <td height="315"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td  class="basCellDetVen"><div style="width:340px; height:315px;" id="divDetVen"><?php require_once("CAJA1_MEN.php");?></div></td>
  </tr>
</table>
</form>
</body>
</html>
