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/consulta_fecha_gestion1_asistente1.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Consulta Cobranzas Juridica gestion por fecha</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo1 {font-family: "Arial Narrow"}
.Estilo2 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.Estilo18 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; }
.Estilo19 {font-family: "Arial Narrow"; font-weight: bold; }
-->
</style>

<script Language="JavaScript"><!--
function validar(formulario)
{
/*
  if (formulario.cedula.value == "")
  {
    alert("Ingrese número de cédula del deudor");
    formulario.cedula.focus();
    return (false);
  }
  return (true);
}
*/
  if (formulario.dia_act.value > 31)
  {
    alert("El número de día no se debe exceder de 31");
    formulario.dia_act.focus();
    return (false);
  }

  if (formulario.mes_act.value > 12)
  {
    alert("El número del mes no se debe exceder de 12");
    formulario.mes_act.focus();
    return (false);
  }


  return (true);
}
//--></script>

<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>

</head>
<body onload="document.formulario.cedula.focus()">
<form method="post" name="formulario" action="" onSubmit="return validar(this)">
<table width="697" border="0" align="center" cellpadding="3" cellspacing="3">    
  <tr valign="baseline" bgcolor="#0099FF">
    <td colspan="6" align="right" nowrap><div align="center"><span class="Estilo2">CONSULTA CON FECHA DE GESTION </span></div></td>
  </tr>
  <tr valign="baseline" bgcolor="#FFCC66">
    <td colspan="6" align="right" nowrap><div align="center" class="Estilo2">
      <script languaje="JavaScript">Mostrar_Fecha()</script></div></td>
  </tr>
  <tr valign="baseline" bgcolor="#FFCCCC">
    <td width="29"><div align="right" class="Estilo19">DE:</div></td>
    <td width="93"><input name="fecha1" type="text" id="fecha1" value="0000-00-00" size="13" maxlength="13" ></td>
    <td width="48"><span class="Estilo19">HASTA:</span></td>
    <td width="143"><input name="fecha2" type="text" id="fecha2" value="0000-00-00" size="13" maxlength="13" ></td>
    <td width="336" colspan="2"><input name="consultar" type="submit" id="consultar"value ="Buscar" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid">
      <input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid" onclick="window.location.href='menu_cobranzas_jur2.php'" value="Volver al Men&uacute;">
      <input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid" onclick="window.location.reload()" value="Actualizar">      </td>
  </tr>
  </table>  
</form>  
</body>
</html>

<?php

require_once("Conectarse.php");

if(isset($_POST["consultar"]))
{
require_once("mainfile.php");
include ("config.php");
global $dbi;


       	
                          echo "<table width='1100' border='0' align='center' cellpadding='3' cellspacing='3'>      
                          <tr valign='baseline' bgcolor='#0099FF'>
                          <td width='110' align='right' nowrap><div align='center'><span class='Estilo18'>C&eacute;dula</span></div></td>
                          <td width='73' align='right' nowrap><div align='center'><span class='Estilo18'># carpeta</span></div></td>
                          <td width='300' align='right' nowrap><div align='center'><span class='Estilo18'>Apellidos y nombres </span></div></td>
                          <td width='72' align='right' nowrap><div align='center'><span class='Estilo18'>Contrato</span></div></td>
                          <td width='50' align='right' nowrap><div align='center'><span class='Estilo18'>Tipo</span></div></td>
						  <td width='70' align='right' nowrap><div align='center'><span class='Estilo18'>Unidad</span></div></td>
                          <td width='100' align='right' nowrap><div align='center'><span class='Estilo18'>Codigo Gestion</span></div></td>
                          <td width='100'><div align='center'><span class='Estilo18'>Fecha Gestion </span></div></td>
						  <td width='100'><div align='center'><span class='Estilo18'>Funcionario Que Realiza Gestion</span></div></td>
                          <td width='109'><div align='center'><span class='Estilo18'>N&uacute;m.Ofic.Envio </span></div></td>
                          <td width='132' colspan='2'><div align='center'><span class='Estilo18'>Fecha ofic.env&iacute;o </span></div></td>
                          </tr>";
				
				
				$result = mysql_query('SELECT cedula, numero_carpeta, nombre_completo, numero, tipo, oficio_numero, fecha_oficio, unidad, codigo_gestion, fecha_gestion FROM cobranzas WHERE (fecha_gestion  between "' . $_POST[fecha1]. '" and "' .$_POST[fecha2]. '") and (estado = "1" || estado = "2")  and unidad != "MCPE" and unidad != "CADC" order by fecha_gestion');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}

	while(list($cc, $nc, $an, $con, $tip, $nof, $fecha, $unidad, $codigog, $fechag) = mysql_fetch_row($result))
                                  { 
										$sum = $sum + 1; 
										$tres=substr($fecha, 0, 4);
										$dos=substr($fecha, 5, 2);
										$uno=substr($fecha, 8, 2);
										$fecha = ($uno."-".$dos."-".$tres);	
										
	$resulta1 = mysql_query('SELECT cedula_usuario FROM actuaciones_cobranzas WHERE fecha= "' . $fechag. '" and codigo_gestion= "' . $codigog. '" and cedula= "' . $cc. '" ');
			if (!$resulta1) {
				die('Invalid query: ' . mysql_error());
			}

	list($funcionario) = mysql_fetch_row($resulta1);		
	
	
	$resulta2 = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE cedula= "' . $funcionario. '" ');
			if (!$resulta2) {
				die('Invalid query: ' . mysql_error());
			}

	list($nomfun) = mysql_fetch_row($resulta2);		
										
										
										
													  
                                        printf("<tr>
          <td bgcolor='#ECE9D8'><div align='center' class='Estilo1 Estilo14'><em>".$cc."</a></span></em></div></td>					 
                                       <td bgcolor='#ECE9D8'><div align='center' class='Estilo1 Estilo14'><em><a href=\"consultar_cobranzas_asistente1.php?id=$cc&carpeta=$nc\"  target='_blank'>".$nc."</span></em></div></td>					 
         <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$an."</span></em></div></td>
		 <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$con."</span></em></div></td>					         <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$tip."</span></em></div></td>					         <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$unidad."</span></em></div></td>
		 <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$codigog."</span></em></div></td>					         <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$fechag."</span></em></div></td>
		 <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$nomfun."</span></em></div></td>
		 <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$nof."</span></em></div></td>
		 <td bgcolor='#C5D6FC'><div align='center' class='Estilo1 Estilo14'><em>".$fecha."</span></em></div></td>");
								  }	   
				         // }
						  echo "</tr></table>";
             
      
		 echo "<TABLE width='200' border='0' align='center' cellpadding='0' cellspacing='1'>
         <TR>
             <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TOTAL REGISTROS</span></div></TD>";	
							   printf("<tr>
                                 
            <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$sum."</span></div></td>");    
								   echo "</table>";


}
?>