MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/public_html/comercial/consulta_regional_ventas_diarias.php
<?
require_once("../Conectarse.php");

////////////////

$Recordset2 = mysql_query('SELECT * FROM sucursal WHERE codigo = "1" || codigo = "2" || codigo = "3" || codigo = "7" || codigo = "8" || codigo = "10" || codigo = "13"  order by nombre'); 
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
////////////////  

?>
<!DOCTYPE HTML>
<html>
<head>
<title>Pendientes Funcionario</title>
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
    *{margin: 0;padding: 0;}
    body{background-color:#EAEAEA;font-family:Geneva, Arial, Helvetica, sans-serif;}
    header {background-color: #B7271F; text-align: center;}
    
    .titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
    table{margin: 0 auto;border: 4px solid #bebebe; text-align: center;}
    .divirmenu{text-align: center;}
    .irmenu{width: 150px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
    .irmenu:hover{background-color: #67a0d9; color: #000;}
    .tdizq{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
    .fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
    td{padding: 1px; border: 1px solid #a0a0a0;}
    .td{background-color: #e5e5e5; padding: 1px 30px;color: #00135F;font-size: 14px;font-weight: 600; text-align: center;}
    .boton1{width: 150px;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:6px;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
    input[type=text],select{border-radius: 5px; padding: 3px;background-color: #FFFFF4;}
	
	.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
    .tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 12px;}
    .botonnew{background-color: #e3dec0;color: #b20606;padding: 1px;}
    .botonnew:hover{background-color: #cbbd6a;color: #000;padding: 1px;}
</style>
<script languaje="JavaScript">
function Mostrar_Fecha()
{
         var mydate=new Date()
         var year=mydate.getYear()
         if (year < 1000)
                 year+=1900
                 var day=mydate.getDay()
                 var month=mydate.getMonth()
                 var daym=mydate.getDate()
                 if (daym<10)
                    daym="0"+daym
                    var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
                    var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
                    document.write("<b><font face='Arial, Helvetica, sans-serif'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></b>")
}					
</script>
<script language="javascript">
function AbreGral()
{ 
    var menu;   
	menu=window.open("mostrar_ingreso.php","","toolbar=no,scrollbars=no,width=800,height=500,status=yes");  
	menu.focus();  
	var ventana = window.self;  
	ventana.opener = window.self;  
	ventana.close();
}
</script>
</head>
<body onLoad="document.formulario.cedula.focus()" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<header>
    <img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">CONSULTA POR REGIONAL</h3>
<form name="formulario" action="" method="post">

  <tr>
    <td>
   

<form name="formulario" action="" method="post">
<table width="480" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td><fieldset><table width="541" border="6" align="center" cellpadding="2" cellspacing="2" >

  <tr bgcolor="#ECE9D8">
    <td height="22" colspan="2" bgcolor="#FFFFFF" class="fecha"><div align="center">
      <script languaje="JavaScript">Mostrar_Fecha()</script>
    </div></td>
  </tr>
  
  
  <td class="td">SELECCIONE LA SUCURSAL 
  <td class="tdizq"><SELECT NAME="sucursal">
            <OPTION value="">--Sucursal--</OPTION>
            <?php
do {  
?>
        <option value="<?php echo $row_Recordset2['codigo']?>"><?php echo $row_Recordset2['nombre']?></option>
            <?php
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
  $rows = mysql_num_rows($Recordset2);
  if($rows > 0) {
      mysql_data_seek($Recordset2, 0);
	  $row_Recordset2 = mysql_fetch_assoc($Recordset2);
  }
?>
          </SELECT>
        </td>

  
 <tr>
    <td colspan="2">
    
    <input name="menu2" type="button" class="irmenu" id="menu2" onClick="window.location.href='menu_reporte_ventas_diarias.php'" value="IR AL MENU">
    <input name="consultar" id="consultar" type="submit" class="boton1" value="Consultar">
    </td>
  </tr>

</table>
</fieldset></td>
  </tr>
</table>
</form>
</body>
</html>

<?php
require_once("../Conectarse.php");
$sucu =$_GET["sucu"] ;
$nom =$_GET["nom"] ;
$ced =$_GET["ced"] ;
 

$diser=$_POST["nombredir"];


if(isset($_POST["consultar"]))
{
	///////////
	$controlsucu = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "'.$_POST[sucursal].'" ');
	if (!$controlsucu) {
		die('Invalid query sucursal: ' . mysql_error());
	}
	$num=mysql_num_rows($controlsucu);
		 
	list($nombsucu) = mysql_fetch_row($controlsucu);
	/////////////

  
	$control = mysql_query('SELECT id,cedula,nombre_completo, regional,fecha, estado FROM reporte_ventas_diarias WHERE regional = "'.$nombsucu.'" ');
	if (!$control) {   
		die('Invalid query 0: ' . mysql_error());
	}					          				          
					
	if ((mysql_num_rows($control)!=0)) 
	{	 
   		echo "<TABLE width='700' border='3' align='center' cellpadding ='0' cellspacing='1'>
        <TR>
		<TD class='tdtitulo'>REGIONAL</TD>                      
		<TD class='tdtitulo'>NOMBRE</TD>
		<TD class='tdtitulo'>FECHA</TD>
		<TD class='tdtitulo'>ESTADO</TD>
		";		 		  
		
		
		while(list($id, $cedula,$nombre,$regional,$fecha, $estado) = mysql_fetch_row($control)) 
        {     
			if($estado == 0){
				$esta = "Coordinador Nacional";	
			}
			
			if($estado == 1){
				$esta = "Consultor Juridico";	
			}
			
			if($estado == 2){
				$esta = "Genercia Comercial";	
			}
			
			if($estado == 3){
				$esta = "FINALIZADO";	
			}
			
			
			$tota = $tota + 1;
							  
   
			printf("<tr>
		   	<td class='tdfull'><input type='button' value=$regional name='proceso' class=botonnew onClick =	window.open('formulario_revision_final.php?ced2=$cedula&id=$id','','top=30,left=50,toolbar=yes,scrollbars=yes,width=1000,height=900,status=yes')></td>
			<td class='tdfull'>".$nombre."</td>
			<td class='tdfull'>".$fecha."</td>
			<td class='tdfull'>".$esta."</td>
			");
		}
	}
	mysql_free_result($control);				  
}
						
/*else
{
     echo "<script>alert('No Hay Registros En Esas Fechas');</script>";
}
*/
					
echo "<TABLE width='200' border='0' align='center' cellpadding ='0' cellspacing='1'>
<TR>
<TD class='tdtitulo'>TOTAL</TD>";		 		  

printf("<tr>   
								   
<td class='tdfull'>".$tota."</td>");	

echo "</form>"; 
?>