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/liquidacion_pagos_memoriales_gene.php
.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Generador de Pagos</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;}
.texto2 {background-color: #CCCCCC; 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;}
.Estilo2 {font-family: Arial;	font-size: 16px;	color: #990000;}
.boton2 {font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid; width:70px; height:22px;}
body {
	background-image: url();
}
.Estilo19 {
	font-family: "Arial Narrow";
	font-weight: bold;
	color: #993333;
	font-size: 14px;
}
.Estilo50 {color: #CC3333;
	font-family: "Arial Narrow";
	font-weight: bold;
}
.botongp {
	font-family: "Courier New", Courier, monospace;
	font-weight: bold;
	background-color: #9DF4C0;
	margin: 2px;
	padding: 2px;
	height: 1cm;
	width: 4cm;
	border: medium outset #0033CC;
}
.botongp {
	background-color: #ADF1CA;
	margin: 2px;
	padding: 2px;
	height: 0.5cm;
	width: 3cm;
	border: medium outset #0033CC;
}
.botongp {
	background-color: #A9FAD3;
	margin: 2px;
	padding: 2px;
	height: 0.7cm;
	width: 3cm;
	border: medium outset #003399;
}
-->
</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>
<?php
   
   require_once("mainfile.php");
   include ("config.php");
   global $dbi;
   require_once("Conectarse.php");

$sql4 = mysql_query('SELECT * FROM asjudinet_abogados  WHERE vigentes = "1" order by nombre_completo');
			if (!$sql4) {
				die('Invalid query: ' . mysql_error());
			}
		$row_sql4 = mysql_fetch_assoc($sql4);
		$totalRows_sql4 = mysql_num_rows($sql4);
?>
<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 class="titulos"><div align="center">GENERACION PAGOS MEMORIAL </div></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td  align="center"><div align="center"><span class="Estilo19 ">Fecha dd-mm/aaaa:</span><span class="Estilo21"> <span class="Estilo13">
          <input name="dia"  id="dia2" value="<?php echo date("d"); ?>" size="2" maxlength="2" readonly="">
          <input name="mes"  id="mes2" value="<?php echo date("m"); ?>" size="2" maxlength="2" readonly="">
          <input name="ano"  id="ano2" value="<?php echo date("Y"); ?>" size="4" maxlength="4" readonly="">
        </span></span></div></td>
        
  </tr>
  <tr bgcolor="#FFCC99">
    <td height="42"><fieldset>
   <legend><span class="texto">Ingrese Funcionario :</span></legend>
   <table  border="0" cellspacing="0" cellpadding="0">
     <tr>
       <td><span class="Estilo2">Funcionario:</span></td>
       <td><select name="ced_funcionario" class="Estilo66" id="ced_funcionario">
            <option value="">-SELECCIONE ABOGADO-</option>
            <?php
     do {  
?>
            <option value="<?php echo $row_sql4['codigo_abogado'];?>"><?php echo $row_sql4['nombre_completo']?></option>
            <?php
} while ($row_sql4 = mysql_fetch_assoc($sql4));
  $rows4 = mysql_num_rows($sql4);
  if($rows4 > 0) {
      mysql_data_seek($sql4, 0);
       $row_sql4 = mysql_fetch_assoc($sql4);
  }
?>
        </select></td>
	   <td>
	   </td>
	    <td>
	   </td>
	  
	    <td><span class="Estilo2">Codigo Funcionario:</span></td>
	    <td>
	    <input name="celufun" type="text"  id="celufun" value="<?php echo $_POST[ced_funcionario]; ?>" size="10" maxlength="10" readonly="">
	   </td>
     </tr>
   </table>

    </fieldset></td></tr>
  <tr bgcolor="#FFCC99">
    <td><div align="center">
      <input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='menu_liquidacion_gene.php'" value="IR AL MENU">
	  
	
    </div></td>
  </tr>
  
  <tr bgcolor="#FFCC99">
    <td><div align="center">
      <input name="consultar" id="consultar" type="submit" class="boton" value="Consultar">
      <input name="button" type="button" class="boton" onclick="history.back()" value="Atr&aacute;s">
      <input name="button" type="button" class="boton" onclick="window.location.reload()" value="Actualizar">
    </div></td>
  </tr>
  <tr bgcolor="#FFCC99">
    <td><div align="center">
      <label>
      <input name="gp" type="submit" class="botongp" id="gp" value="Generar Pago">
      </label>
    </div></td>
  </tr>
</table>
</fieldset></td>
  </tr>
</table>
</form>
</body>
</html>


<?php

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

//$cedulfun = $ced_funcionario; 

 
				 
	  $misql3 = mysql_query('SELECT nombre_completo FROM asjudinet_abogados WHERE codigo_abogado = "' . $_POST[ced_funcionario] . '" ');
			if (!$misql3) {
				die('Invalid query 14: ' . mysql_error());
			} 	 
	  list($nomfun) = mysql_fetch_row($misql3);
		
					  
						 $control = mysql_query('SELECT cedula , numero_proceso , fecha_actuacion , codigo_abogado, tipo_orden, folio1, folio2 , total_folio  FROM memorial WHERE codigo_abogado = "' . $_POST[ced_funcionario] . '" and tipo_orden = "MEMORIAL"  and estado = "2" order by numero_proceso');
			if (!$control) {
				die('Invalid query: ' . mysql_error());
			}
                      if ((mysql_num_rows($control)!=0)) 
	                    {	 
					
							  echo "<TABLE width='600' border='2' align='center' cellpadding='5' cellspacing='3'>
                              
							  <TR>
                              <TD bgcolor='#FFCC66'><div align='center'><span class='texto2'>NOMBRE FUNCIONARIO</span></div></TD>
                              <TD bgcolor='#FFCC66'><div align='center'><span class='texto2'>FECHA RANGO</span></div></TD>";	
														   printf("<tr>						   
		                           <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$nomfun."</span></div></td>
								   <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$dia."".'-'."".$mes."".'-'."".$ano."</span></div></td>");
					 		echo "</table>";			  
							  
							  echo "<TABLE width='600' border='2' align='center' cellpadding='0' cellspacing='1'>
                              
							  <TR>
                              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NUMERO PROCESO</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'>FECHA ACTUACION</span></div></TD>
                              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TIPO ORDEN</span></div></TD>
							  <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>FOLIO 1</span></div></TD>
							  <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>FOLIO 2</span></div></TD>
							  <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TOTAL FOLIOS</span></div></TD>	";		 		  
                              
     
              while(list($cedul , $numpro, $fecha, $codigo, $tipo, $folio1, $folio2, $totafo ) = mysql_fetch_row($control)) 
                              {  
                                   $cont++;   
								   $folio = $folio + $totafo - 1  ;
								   printf("<tr>

                                   <td bgcolor='#ECE9D8'><div align='center' class='lista'>".$numpro."</a></span></div></td>	
								   <td bgcolor='#ECE9D8'><div align='center' class='lista'>".$cedul."</a></span></div></td>												
                                   	<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$fecha."</span></div></td>								   
		                           <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$tipo."</span></div></td>
								   <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$folio1."</span></div></td>
								   <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$folio2."</span></div></td>
								   <td bgcolor='#C5D6FC'><div align='center' class='lista'>".$totafo."</span></div></td>");
								   
                               }
			                       echo "</table> <br>";		  
                        }
						else
						{
                              echo "<script>alert('Los datos ingresados no existe');</script>";
						}

	
	$memorial=$cont*7000;
	$folios=$folio*1000;
	$total = $memorial + $folios;

	 echo "<TABLE width='400' border='2' align='center' cellpadding='0' cellspacing='1'>
                              
							  <TR>
                              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VALOR MEMORIALES</span></div></TD>
                              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>VALOR FOLIOS</span></div></TD>	
							  <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TOTAL A PAGAR</span></div></TD>";	
	
	
	   printf("<tr>

                                   <td bgcolor='#ECE9D8'><div align='center' class='lista'>".$memorial."</a></span></div></td>	
								   <td bgcolor='#ECE9D8'><div align='center' class='lista'>".$folios."</a></span></div></td>												
                                   	<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$total."</span></div></td>");
							
                               
			                       echo "</table>";	
	
	 echo "<TABLE width='200' border='2' align='center' cellpadding='0' cellspacing='1'>
							  <TR>
                              <TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>NUMERO TOTAL MEORIALES</span></div></TD>";	

	   printf("<tr>
											
                                   	<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$cont."</span></div></td>");
						
}	



if(isset($_POST["gp"]))
{

	  
$fecha_pago = ($_POST[ano]."-".$_POST[mes]."-".$_POST[dia]);

 $control = mysql_query('SELECT cedula , numero_proceso , fecha_actuacion , codigo_abogado , tipo_orden  FROM memorial  WHERE codigo_abogado = "' .$_POST[celufun]. '"  and estado = "2" and tipo_orden = "MEMORIAL" ');
			if (!$control) {
				die('Invalid query: ' . mysql_error());
							}

	while(list($cedul , $numcon, $fecha, $codigo, $ti ) = mysql_fetch_row($control)) 
                 { 
	  
	$mssql = mysql_query("UPDATE  memorial  set estado = '3' , fecha_pago   = '" . $fecha_pago. "' WHERE cedula  = '" . $cedul. "' and numero_proceso   = '" . $numcon. "'  and estado = '2' and tipo_orden = 'MEMORIAL' ");
								if (!$mssql) {
				die('Invalid query updete 1: ' . mysql_error());
											}  
	  				
						
	  }

	 
}	
?>