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/acreditos/credito_rotativo_formulario_aprobacion.php
<?php
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("../Conectarse.php");


//////////////////////////////////
// INFORMACION DE CREDITO ROTATIVO
//////////////////////////////////

$control = mysql_query('SELECT cedula, codigo_militar, nombre, grado, numerocontrato, tipocontrato , numero_libranza, direccion , telefono, celular, ciudad , email, cuenta, banco, fecha_inscripcion, nombre_padre, nombre_madre, direccion_padres, ciudad_padres, telefono_padres, celular_padres, referencia_compa, celular_compa FROM credito_rotativo WHERE cedula =  "' . $_GET["ced2"] . '" and numerocontrato =  "' . $_GET["numcon"] . '" ');
	if (!$control) {
		die('Invalid query 1: ' . mysql_error());
	}
$num=mysql_num_rows($control); 
list($cedula, $codigo, $nombre, $grado, $numcon, $plan, $num_lib, $direccion, $telefono, $celular, $ciudad, $email, $cuenta, $banco, $fecha_inscribio, $nompadre, $nommadre, $direcpadres, $ciudadpadres, $telpadres, $celpadres, $refcompa, $celcompa) = mysql_fetch_row($control);


$buscamonto = mysql_query('SELECT fecha, monto_solicitado, libranza_credito FROM redimir_bonos WHERE cedula =  "' . $_GET["ced2"] . '" and numero_contrato =  "' . $_GET["numcon"] . '" ');
if (!$buscamonto) {
	die('Invalid query 1: ' . mysql_error());
}
list($fecha_bonos,$montosolicitado, $creditolibranza)=mysql_fetch_row($buscamonto);

	





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



$permanencia = 24;

/*$controlcartera = mysql_query('SELECT cedula, codigo_militar, nombre, numero_libranza, grado, direccion, telefono, celular, ciudad, email, unidad_descuento FROM cartera_serviasjudinet WHERE  cedula =  "' . $_GET["ced2"] . '"  ');
if (!$controlcartera) {
	die('Invalid query 2: ' . mysql_error());
}  
list($cedula, $codigo, $nombre, $numlib, $grado, $direccion, $telefono, $celular, $ciudad, $email, $unidad ) = mysql_fetch_row($controlcartera);*/

?>

<!DOCTYPE html>
<html>
<head>
<title>APROBACION CREDITO ROTATIVO</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>
	*{margin: 0;padding: 0;}
    body{background-color:#FFF;font-family:Verdana, Geneva, sans-serif; text-align:center;}
    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;}
    table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
    .divirmenu{text-align: center;}
    .irmenu{width: 200px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
    .irmenu:hover{background-color: #67a0d9; color: #000;}
	.direcciona{width: 200px;background-color: #D4090C;color: #fff; padding: 4px;border-radius: 3px;}
	.direcciona:hover{background-color: #67a0d9; color: #000;}
    
    .fecha{background-color: #d6e08b; padding: 2px;color: #8A0003;font-size: 15px; text-align: center;font-weight:600;}
    
	td{border:#D6D6D6 solid 1px;}
    .tdizq{background-color: #EEE; padding: 0px 4px;color: #00135F;font-size: 13px;font-weight: 600; text-align: left;}
    .tdcen{background-color: #EEE; padding: 0px 4px;color: #00135F;font-size: 13px;font-weight: 600; text-align: center;}
    .tdder{background-color: #EEE; padding: 0px 4px;color: #00135F;font-size: 13px;font-weight: 600; text-align: right;}
	.exp{color:#8A0000; font-size:10px;}
	.rojo{color:#C60000;}
	.fuerte{font-weight:400;}
    .boton1{width:200px;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
    input[type=text],select{padding: 2px; font-weight:400;}
	
	/*Estilo Complementario*/
	.tdi{background-color: #F9FBC8; padding: 1px 4px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
	.tdc{background-color: #F9FBC8; padding: 1px 4px;color: #00135F;font-size: 12px;font-weight: 600; text-align: center;}
    .tdd{background-color: #F9FBC8; padding: 1px 4px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
	
	
	.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: 13px;}
    .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;}
	
	
	.aprobado{background-color:#2CA316; color:#FFF; padding:4px;}
	.aprobado:hover{background-color:#296411; color:#FFF; padding:4px;}
	.denegado{background-color:#BE161B; color:#FFF; padding:4px;}
	.denegado:hover{background-color:#A42023; color:#FFF; padding:4px;}
	
	.valida{background-color:#A41518; color:#FFF;}
	
	
	
</style>



<script>

function Verificar() {
	if (document.form1.fechareporte.value == "0000-00-00")
	{
		alert("Falta Fecha De Reporte");
		document.form1.fechareporte.focus()
		return (false);
	}
	var dt = new Date();
	if (document.form1.fechareporte.value < dt)
	{
		alert("Verifique Fecha De Reporte");
		document.form1.fechareporte.focus()
		return (false);
	}
	
	return(true);
	
	
	
}
</script>


</head>


<body>

<header>
    <img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">APROBACION DE CREDITO ROTATIVO</h3>


<form action="" method="post" name="form1" onSubmit="return Verificar()">

<table width="850" border="2"  cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
	<td class="tdder">Fecha Aprobacion :</td>
    <td class="tdizq"><input name="fecha" type="text" class="Estilo66" id="fecha" value="<?php echo date("Y-m-d"); ?>" size="10" maxlength="10" /></td>
  	<td class="tdder">Nombres:</td>
    <td class="tdizq" colspan="3"><input name="nombre" type="text" class="Estilo66" id="nombre" value="<?php echo $nombre ?>" size="60" maxlength="65" readonly/></td>
</tr>


<tr>
	<td class="tdder">Cedula No:</td>
    <td class="tdizq"><input name="cedula" type="text" class="Estilo66" id="cedula" value="<?php echo $cedula ?>" size="20" maxlength="20" readonly/></td>
   	<td class="tdder">Cogido Militar :</td>
    <td class="tdizq"><input name="codigo" type="text" class="Estilo66" id="codigo" value="<?php echo $codigo ?>" size="14" maxlength="20" readonly/></td>
  	<td class="tdder">Grado :</td>
    <td class="tdizq"><input name="grado" type="text" class="Estilo66" id="grado" value="<?php echo $grado; ?>" size="12" maxlength="10" readonly/></td>
</tr>


<tr>
	<td class="tdder">Direccion</td>
    <td class="tdizq" colspan="2"><input name="direccion" type="text" class="Estilo66" id="direccion" value="<?php echo $direccion ?>" size="45" maxlength="45" readonly/></td>
   	<td class="tdder">E-mail :</td>
    <td class="tdizq" colspan="2"><input name="email" type="text" class="Estilo66" id="email" value="<?php echo $email ?>" size="35" maxlength="35" readonly/></td>
</tr>


<tr>
	<td class="tdder">Ciudad :</td>
    <td class="tdizq"><input name="ciudad" type="text" class="Estilo66" id="ciudad" value="<?php echo $ciudad ?>" size="14" maxlength="20" readonly/></td>
   	<td class="tdder">Telefono :</td>
    <td class="tdizq"><input name="telefono" type="text" class="Estilo66" id="telefono" value="<?php echo $telefono ?>" size="10" maxlength="20" readonly/></td>
  	<td class="tdder">Celular :</td>
    <td class="tdizq"><input name="celular" type="text" class="Estilo66" id="celular" value="<?php echo $celular ?>" size="20" maxlength="20" readonly =""/></td>
</tr>


<tr>
	<td class="tdder">Monto Solicitado:</td>
    <td class="tdizq"><input name="montosolicitado" type="text" class="montosolicitado" id="ciudad" value="<?php echo $montosolicitado ?>" size="14" maxlength="20" readonly/></td>
    <td class="tdder">Credito Libranza:</td>
    <td class="tdizq"><input name="creditolibranza" type="text" class="creditolibranza" id="ciudad" value="<?php echo $creditolibranza ?>" size="14" maxlength="20" readonly/></td>
    <td class="tdizq" colspan="2"></td>
</tr>

<!--<tr >
        <td class="tdroja">Cuenta No :</td>
        <td bgcolor="#F7FFE1"><div align="left" class="Estilo70">
            <input name="cuenta" type="text" class="Estilo66" id="cuenta" value="<?php echo $cuenta ?>" size="25" maxlength="25" />
        </div></td>
        <td class="tdroja">Banco :</td>
        <td bgcolor="#F7FFE1" ><div align="left" class="Estilo70">
            <input name="banco" type="text" class="Estilo66" id="banco" value="<?php echo $banco ?>" size="20" maxlength="20" />
        </div></td>
	    </tr>
</tr>-->
      
 </table>
    
    
<br>
<table width="850" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
  <td class="fecha" colspan="6">INFORMACION COMPLEMENTARIA</td>
</tr>
<tr>
    <td class="tdder" colspan="2">FECHA INSCRIPCION</td>
    <td class="tdizq"><input name="fecha_insc" type="text" class="rojo" id="fecha_insc" value="<?php echo $fecha_inscribio ?>" size="30" maxlength="30" readonly/></td>
    <td class="tdder">BONOS REGISTRADOS</td>
    <td class="tdizq"><input name="fecha_bon" type="text" class="rojo" id="fecha_bon" value="<?php echo $fecha_bonos ?>" size="30" maxlength="30" readonly/></td>
</tr>


<!--<tr>
    <td class="tdder">Direccion</td>
    <td class="tdizq"><input name="direccion" type="text"  id="direccion" value="" size="12" maxlength="12" /></td>
    <td class="tdder">Ciudad</td>
    <td class="tdizq"><input name="ciudad" type="text"  id="ciudad" value="" size="30" maxlength="30" /></td>
    <td class="tdder">Telefono</td>
    <td class="tdizq"><input name="telefono" type="text"  id="telefono" value="" size="30" maxlength="30" /></td>
</tr>

<tr>
	<td class="tdder">Celular</td>
    <td class="tdizq"><input name="celular" type="text"  id="celular" value="" size="30" maxlength="30" /></td>
    <td class="tdder">Cuenta Nš</td>
    <td class="tdizq"><input name="numero_cuenta" type="text"  id="numero_cuenta" value="" size="20" maxlength="20" /></td>
    <td class="tdder">Banco</td>
    <td class="tdizq"><input name="banco" type="text"  id="banco" value="" size="30" maxlength="30" /></td>
</tr>-->


<tr>
	<td class="tdder">Nombre Padre</td>
    <td class="tdizq" colspan="2"><input name="nom_padre" type="text"  id="nom_padre" value="<?php echo $nompadre ?>" size="40" maxlength="40" / readonly></td>
    <td class="tdder">Nombre Madre</td>
    <td class="tdizq" colspan="2"><input name="nom_madre" type="text"  id="nom_madre" value="<?php echo $nommadre ?>" size="40" maxlength="40" readonly /></td>
</tr>



<tr>
	<td class="tdder">Direccion de Padres</td>
    <td class="tdizq" colspan="2"><input name="dir_padres" type="text"  id="dir_padres" value="<?php echo $direcpadres ?>" size="40" maxlength="40" readonly/></td>
    <td class="tdder">Ciudad</td>
    <td class="tdizq" colspan="2"><input name="ciudad_padres" type="text"  id="ciudad_padres" value="<?php echo $ciudadpadres ?>" size="40" maxlength="40" readonly/></td>
</tr>

<tr>
	<td class="tdder">Telefono Padres</td>
    <td class="tdizq" colspan="2"><input name="tel_padres" type="text"  id="tel_padres" value="<?php echo $telpadres ?>" size="40" maxlength="40" readonly/></td>
    <td class="tdder">Celular Padres</td>
    <td class="tdizq" colspan="2"><input name="cel_padres" type="text"  id="cel_padres" value="<?php echo $celpadres ?>" size="40" maxlength="40"readonly /></td>
</tr>

<tr>
	<td class="tdder" >Referencia <br> COMPA&Ntilde;ERO</td>
    <td class="tdizq" colspan="2"><input name="ref_compa" type="text"  id="ref_compa" value="<?php echo $refcompa ?>" size="40" maxlength="40" readonly/></td>
    <td class="tdder">N&ordm; Celular Compa&ntilde;ero</td>
    <td class="tdizq" colspan="2"><input name="cel_compa" type="text"  id="cel_compa" value="<?php echo $celcompa ?>" size="40" maxlength="40" readonly/></td>
</tr>


<tr>
	<td class="tdder" >N&ordm; CUENTA</td>
    <td class="tdizq" colspan="2"><input name="num_cuenta" type="text"  id="num_cuenta" value="<?php echo $cuenta ?>" size="40" maxlength="40" readonly/></td>
    <td class="tdder">Banco</td>
    <td class="tdizq" colspan="2"><input name="banco" type="text"  id="banco" value="<?php echo $banco ?>" size="40" maxlength="40" readonly/></td>
</tr>
	  
	  

<tr align="center">
<td colspan="6"></td>
	  </TR>
    </table>
    
    
    
    
    
<table width="800" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
  <td class="fecha" colspan="6">FECHA A REPORTAR</td>
</tr>
<tr>
    <td class="tdd">FECHA A REPORTAR</td>
    <td class="tdi" ><input name="fechareporte" type="text" class="Estilo66" id="fechareporte" value="0000-00-00" size="20" maxlength="20"/></td>
</tr>

</table>    
    
    
    
    
	<p>
<label>
<input name="aprobado" type="submit" class="aprobado" id="aprobado" value="APROBADO"  />&nbsp;&nbsp;&nbsp;&nbsp;
<input name="denegado" type="submit" class="denegado" id="denegado" value="DENEGADO"  />
   <br><br>
   <a href="javascript:history.back()" type="button" class="direcciona"> Volver</a>

   <!--<a href="credito_consulta_cartera.php">volver</a

  
      </label>
    </p>

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


<?php
if(isset($_POST["aprobado"]))
{
	$gestion = mysql_query('UPDATE credito_rotativo set aprobado="SI", fecha_aproba = "'.$_POST["fecha"].'", estado = 2 WHERE cedula = "'.$_GET["ced2"].'" and numerocontrato = "'.$_GET["numcon"].'" ');
	if(!$gestion){
		die('Invalid query 1: ' . mysql_error());
	}
	
	$actualizafecha = mysql_query('UPDATE redimir_bonos set fecha_reporte = "'.$_POST["fechareporte"].'", aprobada = "SI" WHERE cedula = "'.$_GET["ced2"].'" and numero_contrato = "'.$_GET["numcon"].'" ');
	
	echo "<script>alert('APROBADO');</script>";
	echo "<script languaje='javascript' type='text/javascript'>window.location.href = 'credito_rotativo_listado_general.php';</script>";
}	

if(isset($_POST["denegado"]))
{
	$gestion = mysql_query('UPDATE credito_rotativo set estado=3 WHERE cedula = "'.$_GET["ced2"].'" ');
	if(!$gestion){
		die('Invalid query 1: ' . mysql_error());
	}
	
	echo "<script>alert('APROBADO');</script>";
	echo "<script languaje='javascript' type='text/javascript'>window.location.href = 'credito_rotativo_listado_general.php';</script>";
}	

?>