File: /home/asjudine/www/credito_aprobacion_solicitud.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("Conectarse.php");
$resul = mysql_query('SELECT cedula, ced_ciudad, nombre, direccion, ciudad, telefono, celular, email, devengado, descuentos, neto, unidad, monto_solicitado, numero_cuenta, banco, codigo_asesor, codigo_militar, grado, codigo_sucursal, numero_libranza, cuotas_credito, no_solicitud, valor_mensual_cre , con_valor_mensual, con_valor_total, interes_deducible , neto_consignar , fecha_nac FROM solicitud_credito WHERE cedula = "' . $HTTP_GET_VARS["ced2"] . '" and numero_libranza = "' . $HTTP_GET_VARS["numlib"] . '" ');
if (!$resul) {
die('Invalid query: ' . mysql_error());
}
list($cedula, $ciudad, $nombre, $direccion, $ciudad, $telefono, $celular, $email, $devengado, $descuento, $salario, $unidad, $monto, $cuenta, $banco, $codigo_ase, $codigo, $grado, $sucursal, $numlib, $numcuo, $numsoli, $valcuo, $vmt, $val_ment,$interes, $neto, $fecna) = mysql_fetch_row($resul);
if(isset($_POST["guardar"]))
{
if($_POST[GrupoOpciones1]==1||$_POST[GrupoOpciones1]==-1)
{
if ($_POST[numsoli] == "")
{
$mssql = mysql_query("UPDATE solicitud_credito set ced_ciudad= '" . $_POST[ciudad] . "', nombre= '" . $_POST[nombre] . "', direccion='" . $_POST[direccion] . "', ciudad= '" . $_POST[ciudad] . "', telefono= '" . $_POST[telefono] . "', celular= '" . $_POST[celular] . "', email= '" . $_POST[email] . "', neto= '" . $_POST[neto] . "', monto_solicitado= '" . $_POST[monto] . "', numero_cuenta= '" . $_POST[cuenta] . "', banco= '" . $_POST[banco] . "', grado= '" . $_POST[grado] . "', codigo_sucursal= '" . $_POST[sucursal] . "', numero_libranza= '" . $_POST[numlib] . "', cuotas_credito= '" . $_POST[numcuo] . "', valor_mensual_cre = '" . $_POST[valcuo] . "', concepto_rechazo= '" . $_POST[motem] . "', estado_cre = '" . $_POST[GrupoOpciones1] . "', interes_deducible = '" . $_POST[interes] . "', neto_consignar = '" . $_POST[neto] . "' WHERE cedula = '" . $HTTP_GET_VARS["ced2"] . "' and numero_libranza = '" . $HTTP_GET_VARS["numlib"] . "' ");
if (!$mssql) {
die('Invalid query primer UPDATE: ' . mysql_error());
}
}
else
{
$mssql = mysql_query("UPDATE solicitud_credito set ced_ciudad= '" . $_POST[ciudad] . "', nombre= '" . $_POST[nombre] . "', direccion='" . $_POST[direccion] . "', ciudad= '" . $_POST[ciudad] . "', telefono= '" . $_POST[telefono] . "', celular= '" . $_POST[celular] . "', email= '" . $_POST[email] . "', neto= '" . $_POST[neto] . "', monto_solicitado= '" . $_POST[monto] . "', numero_cuenta= '" . $_POST[cuenta] . "', banco= '" . $_POST[banco] . "', grado= '" . $_POST[grado] . "', codigo_sucursal= '" . $_POST[sucursal] . "', numero_libranza= '" . $_POST[numlib] . "', cuotas_credito= '" . $_POST[numcuo] . "', valor_mensual_cre = '" . $_POST[valcuo] . "', concepto_rechazo= '" . $_POST[motem] . "', estado_cre = '1', interes_deducible = '" . $_POST[interes] . "', neto_consignar = '" . $_POST[neto] . "' WHERE cedula = '" . $HTTP_GET_VARS["ced2"] . "' and numero_libranza = '" . $HTTP_GET_VARS["numlib"] . "' ");
if (!$mssql) {
die('Invalid query primer UPDATE: ' . mysql_error());
}
}
echo "<script>alert('Solicitud Aprobada Correctamente');</script>";
}
else{
echo "<script>alert('Debe Seleccionar aprobar o Rechazar');</script>";
}
}
$sql = mysql_query('SELECT * FROM entidad_laboral order by nombre ');
if (!$sql) {
die('Invalid query: ' . mysql_error());
}
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql);
$sql2 = mysql_query('SELECT * FROM proveedores order by nombre ');
if (!$sql2) {
die('Invalid query: ' . mysql_error());
}
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2);
$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=utf-8" />
<title>INGRESAR SOLICITUD CARTERA</title>
<style type="text/css">
<!--
.est_cont5 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-style: normal;
font-weight: normal;
background-color: #EDFAF4;
margin: 2px;
padding: 2px;
height: auto;
width: auto;
border: thin groove #E9AAF0;
color: #C72350;
}
.color_fondo_sc {
background-color: #DCE0E4;
}
.est_cont2 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #2B39EC;
background-color: #F0F5CF;
height: 18px;
width: auto;
border: thin solid #FABF85;
}
.est_cont6 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 11px;
font-style: normal;
font-weight: normal;
color: #006262;
background-color: #EDFED3;
margin: 1px;
padding: 1px;
height: auto;
width: auto;
border: thin solid #D9B6F8;
}
.sol_cre1 {
font-family: "Times New Roman", Times, serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #0B3495;
background-color: #E6FAFF;
margin: 1px;
padding: 1px;
height: 18px;
width: auto;
border: thin outset #56AD95;
}
.col_cre2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: bold;
color: #F92F0B;
background-color: #B3D9F0;
height: auto;
width: auto;
border: medium groove #FC9227;
}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.Estilo53 {color: #2492FF;
font-weight: bold;
}
.recaudo {font-family: "Courier New", Courier, monospace;
font-size: 12px;
font-style: normal;
font-weight: bold;
font-variant: normal;
color: #000000;
background-color: #B6CBDC;
margin: 4px;
padding: 8px;
width: auto;
border: medium outset #339966;
}
.campo1 {background-color: #B7FFFF;
border: thin dashed #B6B6B6;
}
.campo1 {font-family: "Courier New", Courier, monospace;
font-size: 16px;
font-style: normal;
font-weight: bold;
background-color: #E1EFFD;
border: thin doble #009999;
}
.campo1 { font-family: "Courier New", Courier, monospace;
font-size: 11px;
color: #5151FF;
background-color: #C4E4FD;
border: thin solid #009999;
height: 18px;
width: auto;
}
.datos1 {font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 16px;
font-style: normal;
text-decoration: blink;
background-color: #CCFFCC;
margin: 5px;
padding: 7px;
height: auto;
width: auto;
border: thin solid #0099FF;
}
.datos1 {font-family: Georgia, "Times New Roman", Times, serif;
font-size: 16px;
background-color: #FDE0C1;
margin: 2px;
padding: 3px;
border: medium doble #DBAED7;
}
.datos1 { font-family: Georgia, "Times New Roman", Times, serif;
font-size: 11px;
font-weight: normal;
background-color: #B8F5E8;
margin: 4px;
padding: 5px;
border: thin outset #009999;
}
.datos2 { font-family: "Courier New", Courier, monospace;
font-size: 10px;
font-style: normal;
font-weight: normal;
color: #0033FF;
background-color: #FFE2C6;
margin: 2px;
padding: 3px;
border: medium doble #EEBFEB;
}
.datos3 { font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-style: normal;
font-weight: normal;
color: #FF3300;
background-color: #A6ECD7;
margin: 4px;
padding: 4px;
border: medium groove #CCCCFF;
}
.go { font-family: "Times New Roman", Times, serif;
font-size: 9px;
font-style: normal;
color: #FF6633;
background-color: #FBDCBD;
padding: 1px;
height: auto;
width: auto;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
}
.Estilo66 {
font-size: 10px;
font-weight: bold;
}
.label {background-color: #FFFFCC; font-size: 16px; font-family: Arial; color:#0000CC; display: block;}
.Estilo67 {font-size: 18px}
.Estilo70 {color: #000066; }
.Estilo71 {font-size: 10px; font-weight: bold; color: #000066; }
-->
</style>
<script Language="JavaScript">
function validarEntero(valor){
//intento convertir a entero.
//si era un entero no le afecta, si no lo era lo intenta convertir
valor = parseInt(valor)
//Compruebo si es un valor numérico
if (isNaN(valor)) {
//entonces (no es numero) devuelvo el valor cadena vacia
return ""
}else{
//En caso contrario (Si era un número) devuelvo el valor
return valor
}
}
function valida_envia(){
if (document.form1.nombre.value == ""){
alert("Falta Ingresar Apellidos y Nombres")
document.form1.nombre.focus()
return (false);
}
if (document.form1.numsoli.value == ""){
alert("Falta Digitar Numero De Solicitud")
document.form1.numsoli.focus()
return (false);
}
if (document.form1.cedula.value == ""){
alert("Falta Digitar numero de Cedula")
document.form1.cedula.focus()
return (false);
}
if (document.form1.codigo.value == ""){
alert("Falta Digitar el codigo militar")
document.form1.codigo.focus()
return (false);
}
if (document.form1.grado.value == ""){
alert("Falta Ingresar el grado")
document.form1.grado.focus()
return (false);
}
if (document.form1.direccion.value == ""){
alert("Falta Ingresar la Dirreccion")
document.form1.direccion.focus()
return (false);
}
if (document.form1.email.value == ""){
alert("Falta Ingresar el email")
document.form1.email.focus()
return (false);
}
if (document.form1.ciudad.value == ""){
alert("Falta escribir ciudad ")
document.form1.ciudad.focus()
return (false);
}
if (document.form1.telefono.value == ""){
alert("Falta Digitar Telefono")
document.form1.telefono.focus()
return (false);
}
if (document.form1.celular.value == ""){
alert("Falta Digitar celular")
document.form1.celular.focus()
return (false);
}
if (document.form1.cuenta.value == ""){
alert("Falta escribir No cuenta")
document.form1.cuenta.focus()
return (false);
}
if (document.form1.banco.value == ""){
alert("Falta escribir banco ")
document.form1.banco.focus()
return (false);
}
if (document.form1.sucursal.value == ""){
alert("Falta seleccionar sucursal ")
document.form1.sucursal.focus()
return (false);
}
if (document.form1.numlib.value == ""){
alert("Falta escribir número de Libranza ")
document.form1.numlib.focus()
return (false);
}
if (document.form1.monto.value == ""){
alert("Falta escribir monto Solicitado")
document.form1.monto.focus()
return (false);
}
if (document.form1.numcuo.value == ""){
alert("Falta Digitar numero de cuotas")
document.form1.numcuo.focus()
return (false);
}
if (document.form1.valcuo.value == ""){
alert("Falta Digitar valor de la cuotas")
document.form1.valcuo.focus()
return (false);
}
if (document.form1.neto.value == ""){
alert("Falta Digitar valor neto a consignar")
document.form1.neto.focus()
return (false);
}
if (document.form1.interes.value == ""){
alert("Falta Digitar interes deducible")
document.form1.interes.focus()
return (false);
}
return (true);
}
</script>
</head>
<body >
<form action="" method="post" onsubmit="return valida_envia()" enctype="multipart/form-data" name="form1" id="form1">
<div align="center">
<div class="Estilo50 Estilo67">APROBACION SOLICITUD CREDITO </div>
<br />
<table width="702" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr bgcolor="#F7FFE1" >
<th width="75" bgcolor="#F7FFE1" scope="col"><div align="right" class="Estilo70">
<div align="right"><strong>Fecha Solicitud :</strong></div>
</div></th>
<th width="127" bgcolor="#F7FFE1" scope="col"><div align="left" class="Estilo70">
<input name="fecha" type="text" class="Estilo66" id="fecha" value="<?php echo date("Y-m-d"); ?>" size="10" maxlength="10" />
</div></th>
<td align="right" bgcolor="#F7FFE1" ><span class="Estilo70"><strong>Apellidos y Nombres:</strong></span></td>
<td colspan="2" align="left" bgcolor="#F7FFE1"> <input name="nombre" type="text" class="Estilo66" id="nombre" value="<?php echo $nombre ?>" size="60" maxlength="65" /></td>
<td align="left" bgcolor="#F7FFE1" ><span class="Estilo70"><strong>No Solicitud:</strong></span> <input name="numsoli" type="text" class="Estilo66" id="numsoli" value="<?php echo $numsoli ?>" size="6" maxlength="6" /></td>
</tr>
<tr>
<td width="75" height="21" bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Cedula No:</strong></div></td>
<td width="127" bgcolor="#F7FFE1" ><div align="left" class="Estilo70">
<input name="cedula" type="text" class="Estilo66" id="cedula" value="<?php echo $cedula ?>" size="20" maxlength="20" />
</div></td>
<td width="109" bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Cogido Militar :</strong></div></td>
<td width="100" bgcolor="#F7FFE1" ><div align="left" class="Estilo70">
<input name="codigo" type="text" class="Estilo66" id="codigo" value="<?php echo $codigo ?>" size="14" maxlength="20" />
</div></td>
<td width="84" bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Grado :</strong></div></td>
<td width="172" bgcolor="#F7FFE1"><div align="left" class="Estilo70">
<input name="grado" type="text" class="Estilo66" id="grado" value="<?php echo $grado ?>" size="12" maxlength="10" />
</div></td>
</tr>
<tr>
<td bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Direccion :</strong></div></td>
<td colspan="2" bgcolor="#F7FFE1"><div align="left" class="Estilo70">
<input name="direccion" type="text" class="Estilo66" id="direccion" value="<?php echo $direccion ?>" size="45" maxlength="45" />
</div></td>
<td bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>E-mail :</strong></div></td>
<td colspan="2" bgcolor="#F7FFE1"><div align="left" class="Estilo70">
<input name="email" type="text" class="Estilo66" id="email" value="<?php echo $email ?>" size="35" maxlength="35" />
</div></td>
</tr>
<tr>
<td bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Ciudad :</strong></div></td>
<td bgcolor="#F7FFE1"><div align="left" class="Estilo70">
<input name="ciudad" type="text" class="Estilo66" id="ciudad" value="<?php echo $ciudad ?>" size="14" maxlength="20" />
</div></td>
<td bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Telefono :</strong></div></td>
<td bgcolor="#F7FFE1"><div align="left" class="Estilo70">
<input name="telefono" type="text" class="Estilo66" id="telefono" value="<?php echo $telefono ?>" size="10" maxlength="20" />
</div></td>
<td bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Celular :</strong></div></td>
<td bgcolor="#F7FFE1"><div align="left" class="Estilo70">
<input name="celular" type="text" class="Estilo66" id="celular" value="<?php echo $celular ?>" size="20" maxlength="20" />
</div></td>
</tr>
<tr >
<td bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Cuenta No :</strong></div></td>
<td bgcolor="#F7FFE1"><div align="left" class="Estilo70">
<input name="cuenta" type="text" class="Estilo66" id="cuenta" value="<?php echo $cuenta ?>" size="20" maxlength="20" />
</div></td>
<td bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Banco :</strong></div></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>
<th width="84" bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Sucursal :</strong></div></th>
<th colspan="3" bgcolor="#F7FFE1" scope="col"><div align="left" class="Estilo70">
<input name="sucursal" type="text" class="Estilo66" id="sucursal" value="<?php echo $sucursal ?>" size="30" maxlength="30" />
</div></th>
</tr>
<tr>
<td bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Numero libranza:</strong></div></td>
<td bgcolor="#F7FFE1" ><div align="left" class="Estilo70">
<input name="numlib" type="text" class="Estilo66" id="numlib" value="<?php echo $numlib ?>" size="12" maxlength="12" />
</div></td>
<td height="28" bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Monto Solicitado :</strong></div></td>
<td bgcolor="#F7FFE1"><div align="left" class="Estilo70">
<input name="monto" type="text" class="Estilo66" id="monto" value="<?php echo $monto ?>" size="12" maxlength="10" />
</div></td>
<td bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Numero de Cuotas:</strong></div></td>
<td bgcolor="#F7FFE1" ><div align="left" class="Estilo70">
<input name="numcuo" type="text" class="Estilo66" id="numcuo" value="<?php echo $numcuo ?>" size="12" maxlength="12" />
</div></td>
</tr>
<tr>
<td bgcolor="#F7FFE1" ><div align="right" class="Estilo70"><strong>Valor Mensual:</strong></div></td>
<td bgcolor="#F7FFE1"><div align="left" class="Estilo70">
<input name="valcuo" type="text" class="Estilo66" id="valcuo" value="<?php echo $valcuo ?>" size="12" maxlength="12" />
</div></td>
<td bgcolor="#F7FFE1" ><div align="right" class="Estilo70"><strong>Neto Consignar:</strong></div></td>
<td bgcolor="#F7FFE1"><div align="left" class="Estilo70">
<input name="neto" type="text" class="Estilo66" id="neto" value="<?php echo $neto ?>" size="12" maxlength="12" />
</div></td>
<td bgcolor="#F7FFE1" ><div align="right" class="Estilo70"><strong>Interes Deducible:</strong></div></td>
<td bgcolor="#F7FFE1">
<input name="interes" type="text" class="Estilo66" id="interes" value="<?php echo $interes ?>" size="12" maxlength="12" />
</tr>
<tr>
<td height="27" colspan="6" bgcolor="#DEFEFD"><div align="center">
<div align="center">
<input type="radio" name="GrupoOpciones1" value="1" id="GrupoOpciones1" />
<span class="Estilo55">Aprobar</span>
<input type="radio" name="GrupoOpciones1" value="-1" id="GrupoOpciones2" />
<span class="Estilo55">Rechazar </span>
<select name="motem" id="motem">
<option value="0" selected="selected">--SELECCIONE EL MOTIVO--</option>
<option value="CAPACIDAD DE ENDEUDAMIENTO">CAPACIDAD DE ENDEUDAMIENTO</option>
<option value="INEXISTENTE RELACION LABORAL">INEXISTENTE RELACION LABORAL</option>
<option value="INEXACTITUD BANCARIA">INEXACTITUD BANCARIA</option>
<option value="INEXACTITUD INFORMACION FAMILIAR">INEXACTITUD INFORMACION FAMILIAR</option>
</select>
</div>
<label></label></td>
</tr>
</table>
<p>
<label>
<input name="guardar" type="submit" class="Estilo53" id="guardar" value="Aprobar" />
</label>
</p>
</div>
</form>
</body>
</html>