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/financiera_consulta_coopservinet.php
<?php 
require_once("mainfile.php");
include ("config.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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Ventas hechas por Coasjudinet</title>
<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(ELEMENTOS/azul1.jpg);
	color: #000;
}
.Estilo50 {
	color: #72003E;
	font-family: "Arial Narrow";
	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;}
.Estilo54 {color: #333399; font-family: "Arial Narrow"; font-weight: bold; }
.Estilo57 {
	color: #000
}
-->
</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>
<center> <img src="ELEMENTOS\CABEZOTE SERVIASJUDINET.jpg" WIDTH=60% > </center>
<br></br>

<form action="" method="post" name="form1" class="provd" id="form1">
  <div align="center">
    <table width="315" border="3" cellpadding="3" cellspacing="3"  bgcolor="white">  
      <tr>
        <td colspan="4 bgcolor="#55619B"><div align="center" class="Estilo50">CONSULTA VENTAS  COOPSERVINET</div></td>
      </tr>
      <tr>
        
        <td width="149" bgcolor=#BBBBBB><span class="Estilo57">FECHA aaaa-mm </span></td>
		<th width="147" scope="col" bgcolor="#BBBBBB">
            <input name="fecha1" type="text" class="Estilo66" id="fecha1" value="0000-00" size="7" maxlength="7" />
       </th>
		  
      </tr>
      </table>
  
    <p>
<input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_gerencia_financiera.php'" value="IR AL MENU" />
	   <input name="consultar" id="consultar" type="submit" class="Estilo50" 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 FROM cartera_serviasjudinet  WHERE  (ano_inicio = "'.$separar[0].'") and   (mes_inicio = "'.$separar[1].'")  and (tipocontrato="SP01" || tipocontrato="SP02" || tipocontrato="SP03" || tipocontrato="SP04" || tipocontrato="SP05" || tipocontrato="SP09" || tipocontrato="SP10" || tipocontrato="SP11" || tipocontrato="SCP1" || tipocontrato="SCP2" || tipocontrato="SLITI") 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' bgcolor='#0000FF'>
                              <TR>
                              <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo54'>CEDULA</span></div></TD>
							  <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo20'>NOMBRE</span></div></TD>	
							  <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo20'>UNIDAD DESC</span></div></TD>
							  <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo20'>N° CONTRATO</span></div></TD>
                              <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo20'>TIPO </span></div></TD>
							  <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo20'>FECHA INICIO CONTRATO</span></div></TD>
							  <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo20'>MES INICIO </span></div></TD>
							  <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo20'>AŅO INICIO </span></div></TD>
							  <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo20'>CODIGO DESC</span></div></TD>
							  <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo20'>VALOR </span></div></TD>
							  <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo20'>VIGENTE/HISTORICO </span></div></TD>";		  
                           							   
                        
  while(list($cedula, $nombres , $numcon, $tipo, $unidesc, $codidesc, $fecha,$mes_inicio,$ano_inicio, $valor, $estado) = mysql_fetch_row($control)) 
                              {  

			   if ($tipo > 0)
						  {
		 $cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "'.$tipo.'" and codigo_contrato = "COA01" and codigo_contrato = "COA02"');
		  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 bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$cedula."</span></div></td>
                                   <td bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$nombres."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$unidesc."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$numcon."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$tipo."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$fecha."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$mes_inicio."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$ano_inicio."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$codidesc."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$valor."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$esta."</span></div></td>");              								   
                               }
								   echo "</table>";		
								   echo "<TABLE width='200' border='0' align='center' cellpadding='0' cellspacing='1' bgcolor='#0000FF'>
                              <TR>
                              <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo20'>TOTAL REGISTROS</span></div></TD>
							  <TD bgcolor='#BBBBBB'><div align='center'><span class='estilo20'>TOTAL VALOR</span></div></TD>";
							  printf("<tr>
                                 
								   <td bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$sum."</span></div></td>
								   <td bgcolor='#FFFFFF'><div align='center' class='estilo57'>".$vato."</span></div></td>");	  
                        }
						
		       
	      }
     }
    

echo "</form>";


}
?>