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


/////////////////////////////////////
// INFORMACION DE CREDITO ROTATIVO //
/////////////////////////////////////
$consultaconsultorio = mysql_query('SELECT unidad FROM consultorio_creditos_policia WHERE cedula =  "' . $_GET["ced2"] . '"');
list($unidad) = mysql_fetch_row($consultaconsultorio);
$row_consultorio = mysql_num_rows($consultaconsultorio);

if($row_consultorio == 0){
	$sql_unidad_credito = mysql_query('SELECT unidad FROM credito_rotativo WHERE cedula =  "' . $_GET["ced2"] . '"');
	list($unidad) = mysql_fetch_row($sql_unidad_credito);
}
else{
	$sql_unidad_credito = mysql_query('SELECT unidad, promocion FROM credito_rotativo WHERE cedula =  "' . $_GET["ced2"] . '"');
	list($unidad, $promocion) = mysql_fetch_row($sql_unidad_credito);
}



$control = mysql_query('SELECT cedula, apellidos, nombres, grado, rango, libranza_credito, entidad, direccion , telefono, celular, ciudad , email, cuenta, banco, numerosolicitud, fecha_solicitud, nombre_padre, nombre_madre, direccion_padres, ciudad_padres, telefono_padres, celular_padres, referencia_compa, celular_compa, valor_anticipo, saldo_pendiente, monto_solicitado, proveedor_inicial  FROM credito_rotativo WHERE cedula =  "' . $_GET["ced2"] . '" and libranza_credito = "'.$_GET["cred"].'"  ');
	if (!$control) {
		die('Invalid query prin: ' . mysql_error());
	}
$num=mysql_num_rows($control); 
list($cedula, $apellidos, $nombres, $grado, $rango, $cred, $entidad, $direccion, $telefono, $celular, $ciudad, $email, $cuenta, $banco, $numerosolicitud, $fecha_solicitud, $nompadre, $nommadre, $direcpadres, $ciudadpadres, $telpadres, $celpadres, $refcompa, $celcompa, $valor_anticipo, $saldo_pendiente, $montosolicitado, $proveedor_inicial) = mysql_fetch_row($control);

$fullnombre = $apellidos ." ".$nombres; 

/*$solicitudes = mysql_query('SELECT cedula, MAX(numerosolicitud), solicitud1, fecha1, desembolso1 FROM credito_rotativo_solicitud WHERE cedula = "'.$cedula.'" and numerocontrato = "'.$numcon.'" and id = "'.$_GET["ix"].'" ');
list($cedula_soli, $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;

/*$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; cursor:pointer;}
	.aprobado:hover{background-color:#296411; color:#FFF; padding:4px;}
	.denegado{background-color:#BE161B; color:#FFF; padding:4px; cursor:pointer;}
	.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;}
	.hit{background-color: #47547C; color: #fff; padding: 2px; text-align: center; font-size: 12px; font-weight: 900;}
</style>



<script>

function Verificar() {
	
	if (document.form1.mess.value == 00)
  	{
		alert("Seleccione El Mes");
		formulario.mess.focus();
		return (false);
  	}
	
	if (document.form1.diass.value == 00)
  	{
		alert("Seleccione El Dia");
		formulario.diass.focus();
		return (false);
  	}
	
	if (document.form1.entidad.value == ""){
		alert("Seleccione Entidad")
		document.form1.entidad.focus()
		return (false);
	}
	
	if (document.form1.escuela.value == ""){
		alert("Seleccione Escuela")
		document.form1.escuela.focus()
		return (false);
	}
	
	if (document.form1.proveedor.value == ""){
		alert("Seleccione Proveedor")
		document.form1.proveedor.focus()
		return (false);
	}
	
	/*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);
	}
	*/
	if (document.form1.creditolibranza.value == "")
	{
		alert("Digite El Credito Libranza");
		document.form1.creditolibranza.focus()
		return (false);
	}
	
	if (document.form1.estadoanticipo.value == "")
	{
		alert("¿ TIENE ANTICIPO ?");
		document.form1.estadoanticipo.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" onSubmit="return Verificar()" name="form1"  id="form1">

<table width="900" border="2"  cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
	<td class="tdder">Fecha Solicitud :</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="tdizq"><input name="fecha" type="text" class="Estilo66" id="fecha" value="<?php echo $fecha_solicitud; ?>" size="10" maxlength="10" /></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="4" maxlength="4" readonly/>
    <input name="rango" type="text" class="rojo" id="rango" value="<?php echo $rango ?>" size="8" maxlength="8" 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">Grado :</td>
    <td class="tdizq"><input name="grado" type="text" class="Estilo66" id="grado" value="<?php echo $grado; ?>" size="12" maxlength="10"/></td>
</tr>


<tr>
	<td class="tdder">Apellidos:</td> 
	<td class="tdizq"><input name="apellidos" type="text" class="Estilo66" id="apellidos" value="<?php echo $apellidos ?>" size="45" maxlength="45"/></td>
	<td class="tdder">Nombres:</td>
    <td class="tdizq"><input name="nombres" type="text" class="Estilo66" id="nombres" value="<?php echo $nombres ?>" size="45" maxlength="45"/></td> 
</tr>


<tr>
	<td class="tdder">Direccion</td>
    <td class="tdizq"><input name="direccion" type="text" class="Estilo66" id="direccion" value="<?php echo $direccion ?>" size="55" maxlength="55" /></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="45" maxlength="45"/></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="30" maxlength="30"/></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" /></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">Celular :</td>
    <td class="tdizq"><input name="celular" type="text" class="Estilo66" id="celular" value="<?php echo $celular ?>" size="20" maxlength="20" /></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">Unidad :</td>
    <td class="tdizq"><input name="unidad" type="text" class="Estilo66" id="unidad" value="<?php echo $unidad ?>" size="7" maxlength="7" /> - Promocion <input name="promocion" type="text" class="Estilo66" id="promocion" value="<?php echo $promocion ?>" readonly size="7" maxlength="7" /></td>
    
   </tr>
   
   




<!--<tr>
	
	<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>
</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="900" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
  <td class="fecha" colspan="6">INFORMACION COMPLEMENTARIA</td>
</tr>
<tr>
    
    
    
</tr>

<tr>
	<td class="tdder">Nombre Padre o Nombre Madre</td>
    <td class="tdizq" colspan="2"><input name="nom_padre" type="text"  id="nom_padre" value="<?php echo $nompadre ?>" size="45" maxlength="45" /></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="45" maxlength="45"  /></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="45" maxlength="45" /></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="45" maxlength="45" /></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="45" maxlength="45" /></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="45" maxlength="45" /></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="45" maxlength="45" /></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="45" maxlength="45" /></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="45" maxlength="45" /></td>
    <td class="tdder">BANCO</td>
    <td class="tdizq" colspan="2"><input name="banco" type="text"  id="banco" value="<?php echo $banco ?>" size="45" maxlength="45" /></td>
</tr>
	  
<tr>
<td class="tdrojad">Libranza Credito:</td>
    <td class="tdizq" colspan="2"><input name="creditolibranza" type="text" class="rojo" id="creditolibranza" value="<?php echo $cred ?>" size="14" maxlength="20"/></td>
	
	<td class="tdrojad">Proveedor inicial:</td>
    <!--<td class="tdizq" colspan="2"><input name="proveedor" type="text" class="rojo" id="proveedor" value="<?php echo $proveedor_inicial ?>" size="14" maxlength="20"/></td>-->
	
	<td class="tdizq" colspan="2">
		<select name="proveedor" id="proveedor">
			<option value="">SELECCIONE</option>
			<option value="Interasjudinet">Interasjudinet</option>
			<option value="Coomanufacturas">Coomanufacturas</option>
		</select>
	</td>
	
    <!--<td class="tdrojad">&iquest; ANTICIPO ?</td>
    <td class="tdizq">
    	<select name="estadoanticipo">
        	<option value="">Seleccione</option>
        	<option value="SI">SI</option>
        	<option value="NO">NO</option>
        </select>
    </td>-->
</tr>






<!--AGREGO ESTO DESPUES DE MIL CAMBIOS. esto esta en otro archivo-->
<!--<tr>
	<td class="tdrojad" >CUPO ASIGNADO</td>
    <td class="tdizq" colspan="2"><input name="monto_solicitado" type="text"  id="monto_solicitado" value="<?php echo $montosolicitado ?>" size="40" maxlength="40" readonly/></td>
    <td class="tdrojad">SALDO PENDIENTE</td>
    <td class="tdizq" colspan="2"><input name="saldo_pendiente" type="text"  id="saldo_pendiente" value="<?php echo $saldo_pendiente ?>" size="40" maxlength="40" readonly/></td>
</tr>-->


<!--<tr>
	<td class="tdder" >ENTIDAD</td>
    <td class="tdizq" colspan="2"><input name="entidad" type="text"  id="entidad" value="<?php echo $entidad ?>" size="45" maxlength="45" disabled/></td>
    <td class="tdder">ESCUELA</td>
    <td class="tdizq" colspan="2"><input name="escuela" type="text"  id="escuela" value="<?php echo $escuela ?>" size="45" maxlength="45" disabled/></td>
</tr>-->

	  

<tr align="center">
<td colspan="6"></td>
	  </TR>
    </table>
    
    
    
    
    
<table width="900" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
	<?php if($entidad == ""){ ?>
	<td class="tdder" >ENTIDAD</td>
    <td class="tdizq">
		<select name="entidad" id="entidad">
           	<option value="">--Seleccione</option>
        	<option value="EJERCITO">EJERCITO</option>
           	<option value="POLICIA">POLICIA</option>
            <!--<option value="ARMADA">ARMADA</option>
           	<option value="FUERZA AEREA">FUERZA AEREA</option>-->
     	</select>
	</td>
	<?php } else{ ?>
	<td class="tdizq" colspan="2"><input name="entidad" type="text"  id="entidad" value="<?php echo $entidad ?>" size="45" maxlength="45" /></td>
	<?php } ?>
    <td class="tdder">ESCUELA DE FORMACION</td>
    <td class="tdizq">
		<select name="escuela">
        	<option value="">--SELECCIONE ESCUELA</option>
            <option value="RAFAEL MUÑEZ">RAFAEL MUÑEZ</option>
            <option value="ANTONIO NARIÑO">ANTONIO NARIÑO</option>
            <option value="VELEZ SANTANDER">VELEZ SANTANDER</option>
            <option value="SIMON BOLIVAR">SIMON BOLIVAR</option>
            <option value="EDUARDO CUEVAS">EDUARDO CUEVAS</option>
            <option value="GABRIEL GONZALEZ">GABRIEL GONZALEZ</option>
            <option value="CARLOS E RESTREPO">CARLOS E RESTREPO</option>
            <option value="RAFAEL REYES">RAFAEL REYES</option>
            <option value="SUMAPAZ">SUMAPAZ</option>
            <option value="CARABINEROS FACA">CARABINEROS FACA</option>
            <option value="METROPOLITANA DE BOGOTA">METROPOLITANA DE BOGOTA</option>
            <option value="ESPRO NILO">ESPRO NILO</option>
            <option value="INOCENCIO CHINCA">INOCENCIO CHINCA</option>
            <option value="SUOFICIALES FUERZA AEREA">SUBOFICIALES FUERZA AEREA</option>
            <option value="ALEJANDRO GUITIERREZ">ALEJANDRO GUITIERREZ</option>
			<option value="BASE DE ENTRENAMIENTO BEIM">BASE DE ENTRENAMIENTO BEIM</option>
			<option value="BASE DE ENTRENAMIENTO DE INFANTERIA DE MARINA">BASE DE ENTRENAMIENTO DE INFANTERIA DE MARINA</option>
        </select>
	</td>
</tr>

<tr>
   <td class="tdder">FECHA ANTICIPO 1</td>
	<td class="tdizq">
    <input name="anoss" type="text" value="<?php echo date("Y") ?>" size="4" maxlength="4">-<select name="mess" class="sel3">
 	  	   <option value="00">00</option>
           <option value="01">01</option> 
           <option value="02">02</option>
		   <option value="03">03</option>
		   <option value="04">04</option>
		   <option value="05">05</option>   
		   <option value="06">06</option>
		   <option value="07">07</option>
		   <option value="08">08</option>
		   <option value="09">09</option>
		   <option value="10">10</option>
		   <option value="11">11</option>
		   <option value="12">12</option>
           </select>-<select name="diass" class="sel3">
		   <option value="00">00</option>
           <option value="01">01</option>
           <option value="02">02</option>
		   <option value="03">03</option>
		   <option value="04">04</option>
		   <option value="05">05</option>
		   <option value="06">06</option>
		   <option value="07">07</option>
		   <option value="08">08</option>
		   <option value="09">09</option>
		   <option value="10">10</option>
		   <option value="11">11</option>
		   <option value="12">12</option>
		   <option value="13">13</option>
           <option value="14">14</option>
		   <option value="15">15</option>
		   <option value="16">16</option>
		   <option value="17">17</option>
		   <option value="18">18</option>
		   <option value="19">19</option>
		   <option value="20">20</option>
		   <option value="21">21</option>
		   <option value="22">22</option>
		   <option value="23">23</option>
		   <option value="24">24</option>
		   <option value="25">25</option>
		   <option value="26">26</option>
		   <option value="27">27</option>
		   <option value="28">28</option>
		   <option value="29">29</option>
		   <option value="30">30</option>
		   <option value="31">31</option>
      </select>
    </td>
   </tr>



<tr>
  <td class="fecha" colspan="4">ACTUACION</td>
</tr>
<!--<tr>
    <td class="tdd" colspan="2">FECHA A REPORTAR</td>
    <td class="tdi" colspan="2"><input name="fechareporte" type="text" class="Estilo66" id="fechareporte" value="<?php echo $fecha_reporte ?>" size="20" maxlength="20" /><span class="rojo">YYYY-mm-dd</span></td>
</tr>-->

<tr>
	<td colspan="4" class="tdc"><textarea name="actuacion" id="actuacion" cols="90" rows="5"></textarea></td>
</tr>





</table>    
    
    
    
    
<p align="center">
<label>
<input name="aprobado" type="submit" class="aprobado" id="aprobado" value="APROBADO"  />&nbsp;&nbsp;
<input name="denegado" type="submit" class="denegado" id="denegado" value="DENEGADO"  />&nbsp;&nbsp;
<!--<input name="pendiente" type="submit" class="pendiente" id="pendiente" value="PENDIENTE"  />-->
<br><br>
   <input name="button" type="button" class="boton1" onclick="window.location.href='credito_rotativo_listado_solicitud_desembolso.php'" value="Volver">
   <!--<a href="credito_consulta_cartera.php">volver</a>-->
  
      </label>
    </p>

</form>

<form action="" method="post" name="form2">
<p align="center"><input name="imprimir" type="submit" class="imprimir" id="imprimir" value="IMPRIMIR"  /></p>
</form>
</body>
</html>


<?php
$fechast = date("Y-m-d");

if(isset($_POST["aprobado"]))
{
	
	
	
	if($valor_anticipo == 0 || $valor_anticipo == "0")
	{
		$fechas_desembolso1 = "";	
	}
	
	else
	{
		$fechas_desembolso1 = $_POST["anoss"].'-'.$_POST["mess"].'-'.$_POST["diass"] ;
		
		if( ($_POST["mess"] == 00 || $_POST["diass"] == 00) and $valor_anticipo!=0 ){
			echo "<script>alert('Revise la fecha!');</script>";
			exit();
		}
	}
	
	
		
	/*if($_POST["fechareporte"] < $fechast)
	{
		echo "<script>alert('Escriba una fecha posterior a Reportar');</script>";	
	}
	else
	{	*/
	
		//Agrego esto para quitar las solicitud de desembolso y dejar el saldo pendiente en 0 (estaba en saldo_pendiente = "'.$_POST["montosolicitado"].'",)
		//$saldo_pendiente = 0;
		//DEJO el campo anticipo en si para siempre generar un pago fijo el estado original es 1,
		$gestion = mysql_query('UPDATE credito_rotativo SET apellidos = "'.$_POST["apellidos"].'", nombres = "'.$_POST["nombres"].'", grado = "'.$_POST["grado"].'", unidad = "'.$_POST["unidad"].'", direccion = "'.$_POST["direccion"].'", telefono = "'.$_POST["telefono"].'", celular = "'.$_POST["celular"].'", ciudad = "'.$_POST["ciudad"].'", email = "'.$_POST["email"].'", nombre_padre = "'.$_POST["nom_padre"].'", ciudad_padres = "'.$_POST["ciudad_padres"].'", telefono_padres = "'.$_POST["tel_padres"].'", celular_padres = "'.$_POST["cel_padres"].'", referencia_compa = "'.$_POST["ref_compa"].'", celular_compa = "'.$_POST["cel_compa"].'", cuenta = "'.$_POST["num_cuenta"].'", banco = "'.$_POST["banco"].'", fecha_anticipo = "'.$fechas_desembolso1.'",
		
		entidad = "'.$_POST["entidad"].'", escuela = "'.$_POST["escuela"].'", libranza_credito = "'.$_POST["creditolibranza"].'", actuacion = "'.$_POST["actuacion"].'", aprobado = "SI", fecha_aproba = "'.$fechast.'", proveedor_inicial = "'.$_POST["proveedor"].'", 
		
		estado = "1"  WHERE cedula = "'.$_GET["ced2"].'" and libranza_credito = "'.$_GET["cred"].'" ');
		/*
		$gestion = mysql_query('UPDATE credito_rotativo SET apellidos = "'.$_POST["apellidos"].'", nombres = "'.$_POST["nombres"].'", grado = "'.$_POST["grado"].'", direccion = "'.$_POST["direccion"].'", telefono = "'.$_POST["telefono"].'", celular = "'.$_POST["celular"].'", ciudad = "'.$_POST["ciudad"].'", email = "'.$_POST["email"].'", nombre_padre = "'.$_POST["nom_padre"].'", nombre_madre = "'.$_POST["nom_madre"].'", direccion_padres = "'.$_POST["dir_padres"].'", ciudad_padres = "'.$_POST["ciudad_padres"].'", telefono_padres = "'.$_POST["tel_padres"].'", celular_padres = "'.$_POST["cel_padres"].'", referencia_compa = "'.$_POST["ref_compa"].'", celular_compa = "'.$_POST["cel_compa"].'",
		
		entidad = "'.$_POST["entidad"].'", escuela = "'.$_POST["escuela"].'", fecha_reporte = "'.$_POST["fechareporte"].'", libranza_credito = "'.$_POST["creditolibranza"].'", actuacion = "'.$_POST["actuacion"].'", aprobado = "SI", fecha_aproba = "'.$fechast.'", saldo_pendiente = "'.$saldo_pendiente.'", anticipo = "SI", estado = "1"  WHERE cedula = "'.$_GET["ced2"].'" ');*/
		if(!$gestion){
			die('Invalid query 1: ' . mysql_error());
		}
		
		
		
		$actualizaconsultorio = mysql_query('UPDATE `consultorio_creditos_policia` SET direccion_residencia = "'.$_POST["direccion"].'", telefono = "'.$_POST["telefono"].'", ciudad_residencia = "'.$_POST["ciudad"].'", celular = "'.$_POST["celular"].'", email = "'.$_POST["email"].'", nombre_padre = "'.$_POST["nom_padre"].'", ciudad_padres = "'.$_POST["ciudad_padres"].'", celular_familia = "'.$_POST["cel_padres"].'", telefono_familia = "'.$_POST["tel_padres"].'", exportado = "exportado", estado = "7" WHERE cedula = "'.$_POST["cedula"].'" ');
		if(!$actualizaconsultorio){
			die('Invalid query consultorioo : ' .mysql_error());
		}
		
		
		
		
		
		//AGREGO ESTO QUE ESTABA EN EL OTRO ARCHIVO(formulario_ingresar_credito_inter.php) DESPUES DE CAMBIOS
		///Ingresa el anticipo en estado de aprobacion 2 pero arriba dejo en 1
		/*$inserta = mysql_query('INSERT INTO credito_rotativo_solicitud (cedula, apellidos, nombres, grado, rango, cuenta, banco, libranza_credito, numerosolicitud, tipoo, solicitud1, fecha1, desembolso1, actuaciones, aprobado, fecha_aproba, fecha_reporte, estado, fecha_transaccion) VALUES ("'.$_POST["cedula"].'", "'.$_POST["apellidos"].'", "'.$_POST["nombres"].'", "'.$_POST["grado"].'", "'.$rango.'", "'.$_POST["num_cuenta"].'", "'.$_POST["banco"].'", "'.$_POST["creditolibranza"].'", "'.$numerosolicitud.'","ANTICIPO", "SI", "'.$fechast.'", "'.$montosolicitado.'", "'.$_POST["actuacion"].'", "SI", "'.$fechast.'", "'.$_POST["fechareporte"].'", "1", "'.$fechast.'")');
		if (!$inserta) {
			die('Invalid quer en el insert: ' . mysql_error());
		}*/
		
		
		//reporte
		/*$reporte = mysql_query('UPDATE credito_rotativo_solicitud SET reportada = "NO",  fecha_reporte = "'.$_POST["fechareporte"].'" WHERE cedula = "'.$_GET["ced2"].'" and numerocontrato = "'.$_GET["numcon"].'" ');
		if(!$reporte){
			die('Invalid query reporte: ' . mysql_error());
		}
		
		
		
		
		if($saldo_pendiente != 0)
		{
			$actualice_estado = mysql_query('UPDATE credito_rotativo SET estado = "1" WHERE cedula = "'.$_GET["ced2"].'" and numerocontrato = "'.$_GET["numcon"].'"')	;
			if(!$actualice_estado){
				die('Invalid query actualiza estado: ' . mysql_error());
			}
	
		}
	
		else
		{
			if($saldo_pendiente==0)
			{
				echo "<script>alert('SE APROBÓ EL COMPLETO DEL MONTO SOLICITADO');</script>";
				$actualiza_full = mysql_query('UPDATE credito_rotativo SET desembolso_total="SI", estado = 10 WHERE cedula = "'.$_GET["ced2"].'" and numerocontrato = "'.$_GET["numcon"].'" ');
			}
	
		}
	*/
		/*$actualizafecha = mysql_query('UPDATE credito_rotativo_solicitud set fecha_reporte = "'.$_POST["fechareporte"].'" WHERE cedula = "'.$_GET["ced2"].'" and numerocontrato = "'.$_GET["numcon"].'" ');*/
	
		echo "<script>alert('APROBADO!');</script>";
		echo "<script languaje='javascript' type='text/javascript'>window.location.href = 'credito_rotativo_listado_solicitud_desembolso.php';</script>";
	//}
	
	
	
}	






if(isset($_POST["denegado"]))
{
	$saldo_pendiente = $saldo_pendiente + $desembolso1;
	$gestion = mysql_query('UPDATE credito_rotativo SET fecha_reporte = "'.$_POST["fechareporte"].'", libranza_credito = "'.$_POST["creditolibranza"].'", actuacion = "'.$_POST["actuacion"].'", aprobado="NO", fecha_aproba = "'.$fechast.'",  estado = "9"  WHERE cedula = "'.$_GET["ced2"].'" and libranza_credito = "'.$_GET["cred"].'" ');
	if(!$gestion){
		die('Invalid query DENEGADO: ' . mysql_error());
	}
	
	/*//reporte
	$reporte = mysql_query('UPDATE credito_rotativo_solicitud SET reportada = "NO" WHERE cedula = "'.$_GET["ced2"].'" and numerocontrato = "'.$_GET["numcon"].'" ');
	if(!$reporte){
		die('Invalid query reporte: ' . mysql_error());
	}
	
	$actualizarvalores = mysql_query('UPDATE credito_rotativo SET saldo_pendiente =  "'.$saldo_pendiente.'", estado = "1"  WHERE cedula = "'.$_GET["ced2"].'" and numerocontrato = "'.$_GET["numcon"].'" ');
	if(!$actualizarvalores){
		die('Invalid query DENEGADO: ' . mysql_error());
	}
	
	echo "<script>alert('DENGADO');</script>";
	echo "<script languaje='javascript' type='text/javascript'>window.location.href = 'credito_rotativo_listado_solicitud_desembolso.php';</script>";
	*/
}


if(isset($_POST["imprimir"]))
{
	echo "<script languaje='javascript' type='text/javascript'>window.location.href = 'credito_rotativo_formulario_imprimir.php?ced2=$cedula';</script>";
}

?>






<?php
/*
$result = mysql_query('SELECT id, cedula, apellidos, nombres, libranza_credito, numerosolicitud, solicitud1, fecha1, desembolso1, actuaciones, aprobado, fecha_aproba, fecha_denega FROM credito_rotativo_solicitud WHERE cedula = "'.$_GET["ced2"].'" ');

if (!$result) {
	die('Error de consulta: ' . mysql_error());
}

if(mysql_num_rows($result) != 0)
{
	echo "<center><table width=850 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='400'>Actuaci&oacute;n</td>
    <td width='75' class='tdtitulo'>Fecha_aprobado</td>
	<td width='75' class='tdtitulo'>Fecha Denegado</td>
	<td width='75' class='tdtitulo'>Aprobado</td>
  	</tr></center>";

   	while(list($id_a,$cedula_a,$apellidos_a,$nombres_a,$cred_a,$numerosolicitud_a,$solicitud_a,$fechasolicitud_a,$desembolso_a,$actuacion_a,$apro_a,$fecha_a, $fecha_d) = 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'>$fecha_d</td>
		<td class='tdfull'>$apro_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 estado = "5" ');

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>
		";
*/
?>