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/cartera_consulta_renova_deb.php
.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Consulta Renovaciones Debito</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
<!--
.titulos {font: 16px; color: red; font-family:Arial; font-weight:bold}
.boton {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.texto {background-color: #CCFFCC; font-size: 11px; font-family: Arial; color:#0000CC; display: block;}
.fecha {font-size: 12px; font-family: Arial; color:#990000; display: block; }
.campo {background-color:#FFFFAA; width: 100px; border:2px solid #990000;}
.lista {font-family: Arial; font-size: 11px;	color: #990000;}
.lista2 {font-family: Arial; font-size: 16px;	color: #FF6600;}
.boton2 {
	font-family: Verdana;
	font-size: 8 pt;
	color: #000080;
	background-color: #C0C0C0;
	border-style: solid;
	width:90px;
	height:22px;
}
body {
	background-image: url();
}
.Estilo50 {color: #CC3333;
	font-family: "Arial Narrow";
	font-weight: bold;
}
.Estilo51 {
	color: #3366FF;
	font-weight: bold;
}
.boton1 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.boton11 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
-->
</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">
<form name="formulario" action="" method="post">
<table width="671" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td><fieldset><table width="669" border="0" align="center" cellpadding="2" cellspacing="2">
  <tr bgcolor="#FFFFCC">
    <td colspan="4" class="titulos"><div align="center"> CONSULTA CARTERA - RENOVACIONES </div></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td height="22" colspan="4" class="fecha"><div align="center">
      <script languaje="JavaScript">Mostrar_Fecha()</script>
    </div></td>
  </tr>
  
   <tr>
        
          <td width="149" height="49" align="right" bgcolor="#DEFEFD"><div align="center"><span class="Estilo57">FECHA DESDE    </span></div></td>
		  <td bgcolor="#DEFEFD">
		    <div align="center">
		      <input name="fecha1" type="text" class="est_cont2" id="fecha1" value="0000-00-00" size="10" maxlength="10" />
        </div></td>
		    <td width="149" height="49" align="right" bgcolor="#DEFEFD"><div align="center"><span class="Estilo57">HASTA </span></div></td>
		    <td bgcolor="#DEFEFD">
		      <div align="center">
		        <input name="fecha2" type="text" class="est_cont2" id="fecha2" value="0000-00-00" size="10" maxlength="10" />
        </div></td>
  <tr bgcolor="#FFCC99">
    <td colspan="4" bgcolor="#DEFEFD"><div align="center" class="Estilo51">
      <input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='menu_reporte_debito.php'" value="IR AL MENU">
	     <input name="consultar" id="consultar" type="submit" class="Estilo50" value="CONSULTAR">
    </div></td>
  </tr>
</table>
</fieldset></td>
  </tr>
</table>

</form>
</body>
</html>

<?php

   
if(isset($_POST["consultar"]))
{
    function Conectarse()
	{
	   if (!($link=@mysql_connect("localhost","asjudine","as2006")))
	   {
		  echo "Error conectando con el servidor.";
		  exit();
	   }
	   $dbname = "asjudinet";
	   if (!@mysql_select_db($dbname,$link))
	   {
		  echo "Error seleccionando la base de datos.";
		  exit();
	   }
	   return $link;
	}
	Conectarse();
		
	echo "<form name='form' action='' method='post'>";
    require_once("mainfile.php");
    include ("config.php");
    global $dbi;

$mssql = mysql_query('SELECT *  FROM cartera_serviasjudinet  ');
		  if (!$mssql) {
				die('Invalid query 1: ' . mysql_error());
			}
		
   if($mssql)
   {
         $filas = mysql_num_rows($mssql);
         if ($filas > 0)
         {
						$control = mysql_query('SELECT cedula, nombre, numerocontrato, tipocontrato, tipo_afiliado, estado FROM cartera_serviasjudinet  WHERE renovacion = "S" and fecha_termino_contrato >= "' . $_POST["fecha1"] . '" and  fecha_termino_contrato <= "' . $_POST["fecha2"] . '" and (unidad_descuento  = "YYY0" || unidad_descuento = "DABG" || unidad_descuento  = "DACM" || unidad_descuento  = "DABF" || unidad_descuento  = "DPCC" || unidad_descuento  = "CADC"  || unidad_descuento  = "CPPJ"  || unidad_descuento  = "CPRD"  || unidad_descuento  = "CCPP" ) and estado = "1" order by nombre ');
		  if (!$control) {
				die('Invalid query 2: ' . mysql_error());
			} 



                     if ((mysql_num_rows($control)!=0)) 
	                    {	 
                              echo "<TABLE width='900' border='0' align='center' cellpadding='0' cellspacing='1'>
                              <TR>
                              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CEDULA</span></div></TD>
							  <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NOMBRE</span></div></TD>	
                              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TIPO CONTRATO</span></div></TD>
							  <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TIPO AFILIADO</span></div></TD>
							  <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VIGENTE/HISTORICO </span></div></TD>";		  
                           							  
                        
  while(list($cedula, $nombres , $numcon, $tipo, $afili, $estado) = mysql_fetch_row($control)) 
                              {  
                 
				 if ($tipo > 0)
				 {                 		
	$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "' . "$tipo". '" ');
		  if (!$cont10) {
				die('Invalid query 42: ' . mysql_error());
			}
		list($tipo) = mysql_fetch_row($cont10);  
		}
						   
                              
							   if ($estado == 0)
							   {
							   $esta = "HISTORICO";
							   }   				
							   else
							   {
							   $esta = "VIGENTE";
							   }
							   $sum = $sum + 1;
								   printf("<tr>
                                 
								   	<TD bgcolor='#ECE9D8'><div align='center' class='lista'><input type='button' value=$cedula name='cedu' class=est_cont1 onClick =window.open('cartera_aplicar_renovacion_deb.php?ced2=$cedula&numcon=$numcon','','top=50,left=100,toolbar=no,scrollbars=yes,width=850,height=550,status=yes')></a></span></div></TD>
                                   <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nombres."</span></div></td>
								   <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$tipo."</span></div></td>
								   <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$afili."</span></div></td>
								   <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$esta."</span></div></td>");              								   
                               }
								   echo "</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 "</form>";
 
  } 
?>