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

<html>
<head>
<title>Consulta Por Fecha -   NUEVOS AFILIADOS</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:70px; 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;}
.Estilo53 {
	color: #00CC33;
	font-weight: bold;
}
-->
</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="14" class="titulos"><div align="center">CONSULTA NUEVOS AFILIADOS- Cedula </div></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td height="22" colspan="14" class="fecha"><div align="center">
      <script languaje="JavaScript">Mostrar_Fecha()</script>
    Ingrese Rango de Fechas</div></td>
  </tr>
  

  <tr bgcolor="#FFCC99">
    <!--<td width="57"><div align="right"><span class="Estilo53">Desde : </span></div></td>
    <td width="37"><div align="right"><span class="Estilo51">Dia : </span></div></td>
    <td width="30"><input name="diad" type="text" id="diad" size="2" maxlength="2"></td>
    <td width="44"><div align="right"><span class="Estilo51">Mes : </span></div></td>
    <td width="30"><input name="mesd" type="text" id="mesd" size="2" maxlength="2"></td>
    <td width="37"><div align="right"><span class="Estilo51">A&ntilde;o : </span></div></td>
    <td width="30"><label>
      </label>
      <label>
      <input name="anod" type="text" id="anod" size="5" maxlength="4">
      </label></td>
    <td width="62"><div align="right"><span class="Estilo53">Hasta : </span></div></td>
    <td width="46"><div align="right"><span class="Estilo51">Dia : </span></div></td>
    <td width="31"><input name="diah" type="text" id="diah" size="2" maxlength="2"></td>
    <td width="43"><div align="right"><span class="Estilo51">Mes : </span></div></td>
    <td width="48"><div align="left">
      <input name="mesh" type="text" id="mesh" size="2" maxlength="2">
    </div></td>
    <td width="48"><div align="right"><span class="Estilo51">A&ntilde;o : </span></div></td>
    <td width="44"><div align="left">
      <input name="anoh" type="text" id="anoh" size="5" maxlength="4">
    </div></td>
    -->
    
  </tr>
 <!-- <tr bgcolor="#FFCC99">
    <td colspan="14"><div align="center"><span class="Estilo51">
      <input name="consultar" id="consultar" type="submit" class="boton11" value="Consultar">
    </span></div></td>
  </tr> -->
  
  <tr bgcolor="#FFCC99">
    <td colspan="14"><div align="center" class="Estilo51">
      <input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='menu_movimiento_procesos.php'" value="IR AL MENU">
    </div></td>
  </tr>
</table>
</fieldset></td>
  </tr>
</table>
</form>
</body>
</html>

<?php

   
   
//if(isset($_POST["consultar"]))
//{
	
	echo "<form name='form' action='' method='post'>";
    require_once("mainfile.php");
    include ("config.php");
    global $dbi;
	
require_once("Conectarse.php");

 $linea = '-';

 	$fecha = $_POST[anod]."-".$_POST[mesd]."-".$_POST[diad];


 	$fecha2 = $_POST[anoh]."-".$_POST[mesh]."-".$_POST[diah];
		
if ( $anod < $anoh and $mesd < $mesh ){


	echo "<center>Verifique las fechas. Posiblemente la fecha inicial es posterior a la fecha final.</center>";
} 

else {


$mssql = mysql_query('SELECT cedula,nombre,numerocontrato,tipocontrato,entidad_laboral,fecha_afiliacion FROM  cartera_serviasjudinet WHERE bienvenida = "" order by nombre');
	if (!$mssql) {
		die('Invalid query: ' . mysql_error());
	} 
	if($mssql){
	  echo "<TABLE width='1000' 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'>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'>FECHA AFILIACION</span></div></TD>		              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>CONTRATO</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'>ENTIDAD LABORAL</span></div></TD>";	
							  
		while(list($cedula, $nombre, $numerocontrato, $tipocontrato , $codigo_laboral,$fecha_afiliacion) = mysql_fetch_row($mssql)) 
		{  
			
			
			
			
	$controlar = mysql_query('SELECT nombre  FROM entidad_laboral WHERE codigo =  "'.$codigo_laboral.'"');
		  if (!$controlar) {
				die('Invalid query 1: ' . mysql_error());
			}
		$num=mysql_num_rows($controlar); 
		list($entidad_laboral) = mysql_fetch_row($controlar);


			
			
				
		//	if ($fecha_afiliacion >= $fecha and $fecha_afiliacion <= $fecha2)
			//{
			
						$nuer = $nuer + 1;
				//echo "si le enconntre y son: $lafechadelabd >= $fecha and $lafechadelabd <= $fecha2 - $cedula, $nombre, $numerocontrato, $tipocontrato<br>";
				printf("<tr>
           <td bgcolor='#ECE9D8'><div align='center' class='lista'><input type='button' value=$cedula name='cedu' class=boton2 onClick =window.open('enviar_mensaje_afiliados_bienvenidas.php?cedula=$cedula&contrato=$numerocontrato&tipo=$tipocontrato','','top=50,left=100,toolbar=no,scrollbars=yes,width=790,height=610,status=yes')></a></span></div></td>
						
			<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$cedula."</span></div></td>
            <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nombre."</span></div></td>
			<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$fecha_afiliacion."</span></div></td>
		    <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$numerocontrato."</span></div></td>
		    <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$tipocontrato."</span></div></td>
			<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$entidad_laboral."</span></div></td>"); 
			}
		}
		echo "</table>";	
		 echo "<TABLE width='100' border='0' align='center' cellpadding='0' cellspacing='1'>
         <TR>
		 <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TOTAL DE REGISTROS</span></div></TD>";	
							   
		
			printf("<tr>
			 <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nuer."</span></div></td>"); 
		
	}

    
	//}
	
echo "</form>";

	

//}

 
   
?>