<?php
 
session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DF30000.inc");
include("DF80000.php");
include('JQUERY.inc');
$totve=0;
$totpr=0;
$totse=0;
$totv=0;

?>
<html>
<HEAD> <meta name="tipo_contenido" content="text/html;" http-equiv="content-type" charset="utf-8">

</HEAD>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<script language="javascript">
function abrir2popup(val1,val2) 
{

a= window.open("rep_propinas_IMK.php?bot=<?php
 echo $_POST['fecini']; ?>&but=<?php
 echo $_POST['fecfin']; ?>&ven=<?php
 echo $_POST['secodven']; ?>&pven=<?php
 echo $_POST['setipvent']; ?>&pvent=<?php
 echo $_POST['setipven']; ?>","",
"scrollbars=yes, resizable=no, width=300,height=700, top=85, left=140",);
}
</script>
  <script language="javascript">
    $(document).ready(function() {
     $(".botonExcel").click(function(event) {
      $("#datos_a_enviar").val( $("<div>").append( $("#pcs").eq(0).clone()).html());
      $("#FormularioExportacion").submit();
     });
    });
    </script>
<body>
<?php
 
$sq_pvta = mysqli_query($con ,"select * from ctmeser");//Datos para combo punto de venta 
$sq_pv = mysqli_query($con ,"select * from ptventa");//Datos para combo punto de venta 
?>
<div align="center">
  <form name="frm1" id="frm1" method="post" action="">
    <table width="441" border="0">
	<tr> <th colspan="2"><span class="Estilo16">PROPINAS POR PAGAR</span> </th> 
	</tr>
		<tr>
     	  <td><div align="right" class="Estilo19 Estilo21">Punto de Venta:</div></td>
        	<td>
            	<div align="left">
            	  <select name="setipven" id="setipven">
            	    <option value="T">------ TODOS ------</option>
            	    <?php
 
						while ($dt_pv = mysqli_fetch_array($sq_pv)){
							if($dt_pv['nparte1'] == $_POST['setipven']) 
								echo '<option value="'.$dt_pv['nparte1'].'" selected>'.$dt_pv['np_desc1'].'</option>';
							else
								echo '<option value="'.$dt_pv['nparte1'].'">'.$dt_pv['np_desc1'].'</option>';
						}
					?>
          	    </select>
       	        </div></td>
      	</tr>
		<tr>
     	  <td><div align="right" class="Estilo22">Mesero:</div></td>
        	<td>
            	<div align="left">
            	  <select name="setipvent" id="setipvent">
            	    <option value="T">------ TODOS ------</option>
            	    <?php
 
						while ($dt_tippag = mysqli_fetch_array($sq_pvta)){
							if($dt_tippag['nparte1'] == $_POST['setipvent']) 
								echo '<option value="'.$dt_tippag['nparte1'].'" selected>'.$dt_tippag['np_desc1'].'</option>';
							else
								echo '<option value="'.$dt_tippag['nparte1'].'">'.$dt_tippag['np_desc1'].'</option>';
						}
					?>
          	    </select>
       	        </div></td>
      	</tr>		
		<tr>
      	  <td><div align="right" class="Estilo21"><span class="Estilo4"><strong><span class="Estilo19">Cajero:</span>:</strong></span></div></td>
      	  <td><span class="Estilo4">
      	    <select name="secodven" id="secodven">
      	      <option value="T">---- TODOS ----</option>
      	      <?php
 
			$sql = mysqli_query($con ,"SELECT * FROM dgcatven order by CONCAT(nom_ven,' ',ap_pat_ven,' ',ap_mat_ven) asc");
			while($reg=mysqli_fetch_array($sql)){
				if($reg['cod_ven'] == $_POST['secodven']){
					echo '<option value="' . $reg['cod_ven'] . '" selected>' . $reg['nom_ven'] . ' ' . $reg['ap_pat_ven'] . ' ' . $reg['ap_mat_ven'] .'</option>';
				}else{
					echo '<option value="' . $reg['cod_ven'] . '">' . $reg['nom_ven'] . ' ' . $reg['ap_pat_ven'] . ' ' . $reg['ap_mat_ven'] . '</option>';
				}
			
			}
			?>
   	        </select>
   	      &nbsp;</span></td>
   	  </tr>
	  	<tr>
     	  <td>Tipo Pago:</td>
        	<td>
            	<div align="left">
            	  <select name="setippag" id="setippag">
            	    <option value="T">------ TODOS ------</option>
            	    <?php
 $sq_tippag = mysqli_query($con ,"select * from dgtippag");
						while ($dt_tippag = mysqli_fetch_array($sq_tippag)){
							if($dt_tippag['tip_pag'] == $_POST['setippag']) 
								echo '<option value="'.$dt_tippag['tip_pag'].'" selected>'.$dt_tippag['desc_pag'].'</option>';
							else
								echo '<option value="'.$dt_tippag['tip_pag'].'">'.$dt_tippag['desc_pag'].'</option>';
						}
					?>
          	    </select>
       	        </div></td>
      	</tr>    
      <tr>
      
        <td width="67%" colspan="2"><div align="center" class="Estilo21">
            
            De:
           
            <input name="fecini" type="text" class="Estilo23 datefrom" id="fecini" size="9" maxlength="20" 
			<?php

				if(isset($_POST['fecini'])){ //este es el truco
					echo 'value="' . $_POST['fecini'] .  '"';
				}else{
					echo 'value="'.date("d/m/Y").'"';
				}
			?>onkeypress="return soloNumeros(event)" 
		/>
                    Al:
            <input name="fecfin" type="text" class="Estilo23 dateto" id="fecfin" size="9" maxlength="20" 
			<?php

				if(isset($_POST['fecfin'])){ //este es el truco
					echo 'value="' . $_POST['fecfin'] .  '"';
				}else{
					echo 'value="'.date("d/m/Y").'"';
				}
			?>onkeypress="return soloNumeros(event)"		/>
     
        </div></td>
      </tr>
      <tr>
        <td colspan="2">
          <div align="center"> 
          
			<input name="imp" id="imp" type="submit" class="bot_WsW" onClick="openpage('rep_bebidas_IM.php','_self')" value="Imprimir"/>			
		  </div></td>
      </tr>
    </table>
     
  </form>
</div>
<div align="center">
   
       
  
</div>
</body>
</html>