File: /home/asjudine/public_html/credito_rotativo_formulario_desembolso.php
<?php
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("Conectarse.php");
/////////////////////////////////////
// INFORMACION DE CREDITO ROTATIVO //
/////////////////////////////////////
$control = mysql_query('SELECT cedula, codigo_militar, nombre, grado, numerocontrato, libranza_credito, numero_libranza, direccion , telefono, celular, ciudad , email, cuenta, banco, numerosolicitud, fecha_inscripcion, nombre_padre, nombre_madre, direccion_padres, ciudad_padres, telefono_padres, celular_padres, referencia_compa, celular_compa, valor_anticipo, saldo_pendiente, monto_solicitado FROM credito_rotativo WHERE cedula = "' . $_GET["ced2"] . '" and numerocontrato = "' . $_GET["numcon"] . '" ');
if (!$control) {
die('Invalid query prin: ' . mysql_error());
}
$num=mysql_num_rows($control);
list($cedula, $codigo, $nombre, $grado, $numcon, $cred, $num_lib, $direccion, $telefono, $celular, $ciudad, $email, $cuenta, $banco, $numerosolicitud, $fecha_inscribio, $nompadre, $nommadre, $direcpadres, $ciudadpadres, $telpadres, $celpadres, $refcompa, $celcompa, $valor_anticipo, $saldo_pendiente, $montosolicitado ) = mysql_fetch_row($control);
$solicitudes = mysql_query('SELECT MAX(numerosolicitud), solicitud1, fecha1, desembolso1 FROM credito_rotativo_solicitud WHERE cedula = "'.$cedula.'" and numerocontrato = "'.$numcon.'" and id = "'.$_GET["ix"].'" ');
list($numero_solicitud, $soli1, $fecha1, $desembolso1) = mysql_fetch_row($solicitudes);
$solofecha = mysql_query('SELECT fecha_reporte FROM credito_rotativo_solicitud WHERE cedula = "'.$cedula.'" and numerocontrato = "'.$numcon.'" ');
list($fecha_reporte) = mysql_fetch_row($solofecha);
/*if($desembolso1!="" and $desembolso2 ==""){$numero_solicitud = 1; $desem = $desembolso1;}
elseif($desembolso2!="" and $desembolso3 ==""){$numero_solicitud = 2; $desem = $desembolso2;}
elseif($desembolso3!="" and $desembolso4 ==""){$numero_solicitud = 3; $desem = $desembolso3;}
elseif($desembolso4!="" and $desembolso5 ==""){$numero_solicitud = 4; $desem = $desembolso4;}*/
/////////////////////////////////////////////////////////////////////
$permanencia = 24;
$revisaestado = mysql_query('SELECT id,estado FROM credito_rotativo_solicitud WHERE cedula = "' . $_GET["ced2"] . '" and numerocontrato = "' . $_GET["numcon"] . '" ');
while(list($id_esta, $estado_esta) = mysql_fetch_row($revisaestado))
{
$subconsulta = mysql_query('SELECT desembolso1 FROM credito_rotativo_solicitud WHERE id = "'.$id_esta.'" and estado = "0" ');
list($desembolsopendiente) = mysql_fetch_row($subconsulta);
if($estado_esta = 0);$alerta1 = $desembolsopendiente;
}
/*$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 type="text/css">
*{margin: 0;padding: 0;}
body{background-color:#EAEAEA;font-family:Verdana, Geneva, sans-serif;}
header {background-color: #B7271F; text-align: center;}
.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: #000;font-size: 15px; text-align: center;}
td{padding: 1px; border: 1px solid #a0a0a0;}
.td{background-color: #e5e5e5; padding: 1px 30px;color: #00135F;font-size: 14px;font-weight: 600; text-align: center;}
.boton1{width:30%;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:10px;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
input[type=text],select{border-radius: 5px; padding: 3px;background-color: #FFF;}
.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;}
.tdizq{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
.tdcen{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: center;}
.tdder{background-color: #e5e5e5; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
.tddered{background-color: #e5e5e5; padding: 1px 2px;color: #D40609;font-size: 12px;font-weight: 600; text-align: right;}
.tdbono{background-color: #FFFFCC; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
/*Estilo Complementario*/
.tdi{background-color: #F9FBC8; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
.tdc{background-color: #F9FBC8; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: center;}
.tdd{background-color: #F9FBC8; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
.tdrojad{background-color: #EEE; color: #8A0002; padding: 1px 4px;font-size: 12px;font-weight: 600; text-align: right;}
.tdrojai{background-color: #EEE; color: #8A0002; padding: 1px 4px;font-size: 12px;font-weight: 600; text-align: left;}
.rojo{color:#C60000;}
.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;}
.pendiente{background-color:#5170EC; color:#FFF; padding:4px;}
.pendiente:hover{background-color:#1B3A8D; color:#FFF; padding:4px;}
.valida{background-color:#A41518; color:#FFF;}
.botondelete{width: 90px; background-color: #FDFBD9;color: #C11E22;padding: 1px;}
.botondelete:hover{width: 90px; background-color: #910407;color: #FFF;padding: 1px;}
.hit{background-color: #47547C; color: #fff; padding: 2px; text-align: center; font-size: 12px; font-weight: 900;}
</style>
<script>
function Verificar() {
if (document.form1.fechareporte.value == "0000-00-00")
{
alert("Verifique FECHA A REPORTAR");
document.form1.fechareporte.focus()
return (false);
}
if (document.form1.fechareporte.value == "")
{
alert("Verifique FECHA A REPORTAR");
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);
}
if (document.form1.actuacion.value == "")
{
alert("Escriba Una Gestion");
document.form1.actuacion.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="tdrojad">MONTO SOLICITADO:</td>
<td class="tdizq"><input name="montosolicitado" type="text" class="rojo" id="montosolicitado" 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="rojo" id="creditolibranza" value="<?php echo $cred ?>" size="14" maxlength="20" readonly/></td>
<td class="tdder">Nš SOLICITUD:</td>
<td class="tdizq"><input name="numero_solicitud" type="text" class="rojo" id="numero_solicitud" value="<?php echo $numero_solicitud ?>" size="14" maxlength="20" readonly/></td>
</tr>
<tr>
<td class="tdder">VALOR ANTICIPO</td>
<td class="tdizq"><input name="valor_anticipo" type="text" class="rojo" id="valor_anticipo" value="<?php echo $valor_anticipo ?>" size="12" maxlength="10" readonly/>
</td>
<td class="tdder">SALDO PENDIENTE</td>
<td class="tdizq"><input name="saldo_pendiente" type="text" class="rojo" id="saldo_pendiente" value="<?php echo $saldo_pendiente ?>" size="12" maxlength="10" readonly/>
<!--<td class="tdder">DESEMBOLSO</td>
<td class="tdizq"><input name="valor_desembolso" type="text" class="rojo" id="valor_desembolso" value="<?php echo $desembolso1 ?>" size="30" maxlength="30" readonly/></td>-->
<td class="tdrojad">FECHA REPORTE</td>
<td class="tdizq"><input name="fecha_reporte" type="text" class="rojo" id="fecha_reporte" value="<?php echo $fecha_reporte ?>" size="10" maxlength="10" readonly/></td>
</tr>
<tr>
<td class="tdrojad" colspan="2">SOLICITUD PENDIENTE POR APROBAR</td>
<td class="tdizq"><input name="fecha_reporte" type="text" class="rojo" id="fecha_reporte" value="<?php echo $alerta1 ?>" size="15" maxlength="15" readonly/></td>
</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">Credito Numero:</td>
<td class="tdizq"><input name="credito_numero" type="text" class="rojo" id="credito_numero" value="<?php echo $numerosolicitud ?>" size="14" maxlength="20" readonly/></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Ñ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º Celular Compañ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º 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>
-->
<p align="center">
<label>
<!--<input name="pendiente" type="submit" class="pendiente" id="pendiente" value="PENDIENTE" />-->
<input name="button" type="button" class="boton1" onclick="window.location.href='credito_rotativo_listado_desembolso.php'" value="Volver">
<!--<a href="credito_consulta_cartera.php">volver</a>-->
</label>
</p>
</form>
</body>
</html>
<?php
$result = mysql_query('SELECT id, cedula, nombre, numerocontrato, libranza_credito, numerosolicitud, solicitud1, fecha1, desembolso1, actuaciones, aprobado, fecha_aproba FROM credito_rotativo_solicitud WHERE cedula = "'.$_GET["ced2"].'" and numerocontrato = "'.$_GET["numcon"].'" and estado = "3" ');
if (!$result) {
die('Error de consulta: ' . mysql_error());
}
if(mysql_num_rows($result) != 0)
{
echo "<center><table width=980 border=1 cellpadding=1 cellspacing=1>
<tr>
<td class='hit' colspan='7'>SOLICITUDES PENDIENTES</td>
</tr>
<tr>
<td class='tdtitulo' width='20'>Solicitud</td>
<td class='tdtitulo' width='80'>fecha Solicitud</td>
<td class='tdtitulo' width='100'>Desembolso</td>
<td class='tdtitulo' width=''>Actuación</td>
<td class='tdtitulo' width='75'>Fecha_aprobado</td>
<td class='tdtitulo' width='75'>Aprobado</td>
<td class='tdtitulo' width='75'>DESEMBOLSAR</td>
</tr></center>";
while(list($id_a,$cedula_a,$nombre_a,$numcon_a,$cred_a,$numerosolicitud_a,$solicitud_a,$fechasolicitud_a,$desembolso_a,$actuacion_a,$apro_a,$fecha_a) = mysql_fetch_row($result))
{
echo "<tr class=lista>
<td class='tdfull'>$numerosolicitud_a</td>
<td class='tdfull'>$fechasolicitud_a</td>
<td class='tdfull'>$desembolso_a</td>
<td class='tdfull'>$actuacion_a</td>
<td class='tdfull'>$fecha_a</td>
<td class='tdfull'>$apro_a</td>
<TD class='tdfull'><input type='button' value=PAGAR name='cedu' class=botondelete onClick =window.open('credito_rotativo_formulario_pago.php?id=$id_a&ced2=$cedula&numcon=$numcon','','top=50,left=100,toolbar=no,scrollbars=yes,width=850,height=400,status=yes')></a></TD>
</tr>";
}
}
?>
<?php
/////////////////////////////////////////////////////////////////////
$consulta_ciclo = mysql_query('SELECT id, numerosolicitud, desembolso1, fecha_reporte, fecha_transaccion FROM credito_rotativo_solicitud WHERE cedula = "'.$_GET["ced2"].'" and numerocontrato = "'.$_GET["numcon"].'" and estado = "4" ');
echo "<center><table width=750 border=1 cellpadding=1 cellspacing=1>
<tr>
<td class='hit' colspan='5'>DESEMBOLSOS REALIZADOS</td>
</tr>
<tr>
<td class='tdtitulo'>Nš</td>
<td class='tdtitulo'>PAGO</td>
<td class='tdtitulo'>FECHA DE TRANSACCION</td>
<td class='tdtitulo'>DIAS INTERES</td>
<td class='tdtitulo'>VALOR</td>
</tr></center>";
while(list($id_ciclo, $numero_solicitud_ciclo, $desembolso_ciclo, $fecha_reportar_ciclo, $fecha_transaccion_ciclo)=mysql_fetch_row($consulta_ciclo))
{
$fechat1 = strtotime($fecha_transaccion_ciclo);
$interes = 0.001;
$fechar = strtotime($fecha_reportar_ciclo);
$segundos_transcurridos1 = $fechar - $fechat1;
$dias_transcurridos1 = round($segundos_transcurridos1 / 86400);
$valor = ($desembolso_ciclo * $interes) * $dias_transcurridos1;
printf("<tr>
<td class='tdfull'>".$numero_solicitud_ciclo."</td>
<td class='tdfull'>".$desembolso_ciclo."</td>
<td class='tdfull'>".$fecha_transaccion_ciclo."</td>
<td class='tdfull'>".$dias_transcurridos1."</td>
<td class='tdfull'>".$valor."</td>
");
$capital = $capital + $desembolso_ciclo;
$valor_final = $valor_final + $valor;
$total = $capital + $valor_final;
}
echo "<center><table width=750 border=1 cellpadding=1 cellspacing=1>
<tr class=lista>
<td class='tdtitulo'>VALOR</td>
<td class='tdfull'>$capital</td>
<td class='tdtitulo'>VALOR ACUMULADOS</td>
<td class='tdfull'>$valor_final</td>
</tr>
<tr>
<td class='tdtitulo' colspan='1'>TOTAL</td>
<td class='tdfull' colspan='3'>$total</td>
</tr>
";
?>