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/www/afinanciera/financiera_consulta_interasjudinet.php
<?php include("b.php"); ?>
<?php
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("../Conectarse.php");


$sql5 = mysql_query('SELECT * FROM sucursal order by nombre ');
if (!$sql5) {
	die('Invalid query: ' . mysql_error());
}
$row_sql5 = mysql_fetch_assoc($sql5);
$totalRows_sql5 = mysql_num_rows($sql5); 

?>


<!DOCTYPE html>
<html>
<head>

<title>Ventas hechas por Coasjudinet</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;}
    .cerrarsesion{width: auto;background-color: #DBD8C9;color: #000;font-size: 13px;position:absolute;top: 15px;right:10px;z-index:0;padding: 10px;border-radius: 10px;cursor: pointer;}
    .cerrarsesion:hover{background-color: #ffffff;color: #000;}
    .titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
	.subtitulos{width: 100%;text-align: left;color: #b20606;padding: 2px 0;font-size: 13px;}
    table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
    .divirmenu{text-align: center;}
    .irmenu{width: 120px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
    .irmenu:hover{background-color: #67a0d9; color: #000;}
    
    .fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
    td{border: #969696 solid 1px;}
    .tdizq{background-color: #EEE; padding: 1px 1px;color: #00135F;font-size: 13px;font-weight: 300; text-align: left;}
    .tdcen{background-color: #EEE; padding: 1px 1px;color: #00135F;font-size: 13px;font-weight: 300; text-align: center;}
    .tdder{background-color: #EEE; padding: 1px 1px;color: #00135F;font-size: 13px;font-weight: 300; text-align: right;}
	.tdroja{background-color: #EEE; padding: 1px 1px;color: #CC0005;font-size: 13px;font-weight: 600; text-align: right;}
	.exp{color:#8A0000; font-size:10px;}
	.fuerte{font-weight:400;}
    .boton1{width:100px;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:3px;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
    input[type=text]{border-radius: 5px; padding: 3px;background-color: #FFFEF4;}
	
	.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{width: 90px; background-color: #e3dec0;color: #b20606;padding: 1px;border-radius:5px;}
    .botonnew:hover{width: 90px; background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
	
	.btncontrato{width:auto; padding: 2px 5px; background:#F5F1C2; color:#000;}
	.btncontrato:hover{background-color:#716D04; color:#fff;}
</style>

<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>

<body>

<header>
    <img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">CONSULTA VENTAS  INTERASJUDINET</h3>
<?php echo "<div class='cerrarsesion' onclick='location.href=\"../cerrar_session.php\"'>CERRAR SESION</div>";?>


<form action="" method="post" name="form1" class="provd" id="form1">
  <div align="center">
    <table width="305" border="3" cellpadding="3" cellspacing="3" >  
      <!--<tr>
        <td colspan="4 bgcolor="#55619B"><div align="center" class="Estilo50">CONSULTA VENTAS  COASJUDINET </div></td>
      </tr>-->
<tr>
	<td class="tdcen" width="177">FECHA  aaaa-mm</td>
	<td class="tdcen" width="167"><input name="fecha1" type="text" id="fecha1" value="0000-00" size="7" maxlength="7" /></td>
</tr>

</table>
  
<p>
<input name="menu2" type="button" class="irmenu" id="menu2" onclick="window.location.href='menu_gerencia_financiera.php'" value="IR AL MENU" />
<input name="consultar" id="consultar" type="submit" class="boton1" value="CONSULTAR">
</p>
</div>
</form>
</body>
</html>

<?php
 
if(isset($_POST["consultar"]))
{

	/////////////////////////////
	$fecha=$_POST["fecha1"];


	$separar = explode('-',$fecha);


 	$separar[0];
 	$separar[1];
 
 	/////////////////////////////
	$fecha2=$_POST["fecha2"];


	$separar2 = explode('-',$fecha2);


 	$separar2[0];
 	$separar2[1];

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

 

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







	$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, unidad_descuento, codigo_descuento, fecha_inicio_contrato,mes_inicio,ano_inicio,valorcontrato, estado,email, ciudad, direccion, celular FROM cartera_serviasjudinet  WHERE (ano_inicio = "'.$separar[0].'") and   (mes_inicio = "'.$separar[1].'")  and unidad_descuento != "CDCA" and (tipocontrato="INT01" || tipocontrato="INT02" || tipocontrato="INT03" || tipocontrato="INT04" || tipocontrato="INT05") AND estado ="1" order by fecha_afiliacion ');
		  	if (!$control) {
				die('Invalid query 2: ' . mysql_error());  
			}          

            if ((mysql_num_rows($control)!=0))
	        {	 
            	echo "<TABLE width='1180' border='2' align='center' cellpadding='3' cellspacing='1'>
                <TR>
                <TD class='tdtitulo'>CEDULA</TD>
				<TD class='tdtitulo'>NOMBRE</TD>	
				<TD class='tdtitulo'>N° CONTRATO</TD>
               	<TD class='tdtitulo'>TIPO </TD>
				<TD class='tdtitulo'>FECHA INICIO CONTRATO</TD>
				<TD class='tdtitulo'>MES INICIO </TD>
				<TD class='tdtitulo'>AÑO INICIO </TD>
				<TD class='tdtitulo'>VALOR </TD>
                <TD class='tdtitulo'>EMAIL </TD>
                <TD class='tdtitulo'>CIUDAD </TD>
                <TD class='tdtitulo'>DIRECCIÓN </TD>
                <TD class='tdtitulo'>TELEFONO </TD>";		  
                           							  
                        
  				while(list( $cedula, $nombres , $numcon, $tipo, $unidesc, $codidesc, $fecha, $mes_inicio,$ano_inicio,$valor, $estado, $email, $ciudad, $direccion, $celular) = mysql_fetch_row($control)) 
                {  

			  		if ($tipo > 0)
					{
		 				$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "'.$tipo.'" and codigo_contrato = "INT01" and codigo_contrato = "INT02" and codigo_contrato = "INT03" and codigo_contrato = "INT04" and codigo_contrato = "INT05"');
		  				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 ;
					$vato = $vato + $valor;
					printf("<tr>  
                                 
					<td class='tdfull'>".$cedula."</td>
					<td class='tdfull'>".$nombres."</td>
					<td class='tdfull'>".$numcon."</td>
					<td class='tdfull'>".$tipo."</td>
					<td class='tdfull' >".$fecha."</td>
					<td class='tdfull'>".$mes_inicio."</td>
					<td class='tdfull'>".$ano_inicio."</td>
					<td class='tdfull'>".$valor."</td>
                    <td class='tdfull'>".$email."</td>
                    <td class='tdfull'>".$ciudad."</td>
                    <td class='tdfull'>".$direccion."</td>
                    <td class='tdfull'>".$celular."</td>");          								   
        		}
				echo "</table>";		
				echo "<TABLE width='200' border='0' align='center' cellpadding='0' cellspacing='1'>
				<TR>
				<TD class='tdtitulo'>TOTAL REGISTROS</TD>
				<TD class='tdtitulo'>TOTAL VALOR</TD>";
				printf("<tr>
									 
				<td class='tdfull'>".$sum."</td>
				<td class='tdfull'>".$vato."</td>");	  
      		}
		}
	}
    

echo "</form>";


}
?>