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



$Recordset2 = mysql_query('SELECT * FROM sucursal order by nombre'); 
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
//////////////// 

$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);

if( $grado == "SLP")
{
	$montosolicitado = "500000";
	?>
	<script languaje="javascript">
	function proba(){
		var bono6 = document.getElementById("bono6").disabled = true;
		var bono7 = document.getElementById("bono7").disabled = true;
		var bono8 = document.getElementById("bono8").disabled = true;
		var bono9 = document.getElementById("bono9").disabled = true;
		var bono10 = document.getElementById("bono10").disabled = true;
		var bono11 = document.getElementById("bono11").disabled = true;
		var bono12 = document.getElementById("bono12").disabled = true;
		var bono13 = document.getElementById("bono13").disabled = true;
		var bono14 = document.getElementById("bono14").disabled = true;
		var bono15 = document.getElementById("bono15").disabled = true;
		var bono16 = document.getElementById("bono16").disabled = true;
		var bono17 = document.getElementById("bono17").disabled = true;
		var bono18 = document.getElementById("bono18").disabled = true;
		var bono19 = document.getElementById("bono19").disabled = true;
		var bono20 = document.getElementById("bono20").disabled = true;
		
	}
	</script><?php
}

elseif($grado == "AL" || $grado == "PT")
{
	$montosolicitado = "1000000";
	?>
	<script languaje="javascript">
	function proba(){
		var bono11 = document.getElementById("bono11").disabled = true;
		var bono12 = document.getElementById("bono12").disabled = true;
		var bono13 = document.getElementById("bono13").disabled = true;
		var bono14 = document.getElementById("bono14").disabled = true;
		var bono15 = document.getElementById("bono15").disabled = true;
		var bono16 = document.getElementById("bono16").disabled = true;
		var bono17 = document.getElementById("bono17").disabled = true;
		var bono18 = document.getElementById("bono18").disabled = true;
		var bono19 = document.getElementById("bono19").disabled = true;
		var bono20 = document.getElementById("bono20").disabled = true;
		
	}
	</script><?php
}

elseif($grado == "C3" || $grado == "CS" || $grado == "CP" || $grado == "SS" || $grado == "SV" || $grado == "SB" || $grado == "SP" || $grado == "SM")
{
	$montosolicitado = "1500000";
	?>
	<script languaje="javascript">
	function proba(){
		var bono16 = document.getElementById("bono16").disabled = true;
		var bono17 = document.getElementById("bono17").disabled = true;
		var bono18 = document.getElementById("bono18").disabled = true;
		var bono19 = document.getElementById("bono19").disabled = true;
		var bono20 = document.getElementById("bono20").disabled = true;
		
	}
	</script><?php
}

elseif($grado == "ST" || $grado == "TE" || $grado == "CP")
{
	$montosolicitado = "2000000";
	?>
	<script languaje="javascript">
	function proba(){
	
	}
	</script><?php
}



//ver bonos
$revisionbonos = mysql_query("SELECT libranza_credito, reportada, entidad, bono1, bono2, bono3, bono4, bono5, bono6, bono7, bono8, bono9, bono10, bono11, bono12, bono13, bono14, bono15, bono16, bono17, bono18, bono19, bono20, numero_cuenta, banco, fecha_reporte, redbono1  FROM redimir_bonos WHERE cedula = '".$_GET["ced2"]."' ");
list($libranza_cre, $reportada, $entidad, $bono1, $bono2, $bono3,$bono4, $bono5, $bono6,$bono7, $bono8, $bono9, $bono10, $bono11, $bono12, $bono13, $bono14, $bono15, $bono16, $bono17, $bono18, $bono19, $bono20, $cuenta, $banco, $muestrafechareporte, $redbono1) = mysql_fetch_row($revisionbonos);











?>
<!DOCTYPE html>
<html>
<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: #F00;
	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;



	text-align: left;
}
.Estilo71 {font-size: 10px; font-weight: bold; color: #000066; }
.Estilo72 {
	color: #FF0000;
	font-weight: bold;
}
.Estilo73 {color: #FF0000; }
.tdroja{background-color:#F7FFE1; color:#AB1F22; text-align:right; font-size:14px;}
.rojo{color:#E94347}
</style>


<script languaje="javascript">
function proba(){
	if(document.getElementById("final_reporte").value!="" ){
		document.getElementById("fechareporte").disabled = true;
	}
	else
	{
		document.getElementById("fechareporte").disabled = false;
	}
	
	if(document.getElementById("reportada").value!=""){
		document.getElementById("nombre").disabled = true;
	}
	else
	{
		document.getElementById("nombre").disabled = false;
	}
	
	
}
</script>



<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 
      } 
}
</script>

<script Language="JavaScript">
	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 Ingresar Numero 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 Direccion")
		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);
	}   
	
	
		if (document.form1.devengado.value == ""){
		alert("Falta Digitar El Total Devengado")
		document.form1.devengado.focus()
		return (false);
	}
	
	
		if (document.form1.descuento.value == ""){
		alert("Falta Digitar Total Descuentos")
		document.form1.descuento.focus()
		return (false);
	}
	
	
		if (document.form1.salario.value == ""){
		alert("Falta Digitar Salario Neto")
		document.form1.salario.focus()
		return (false);
	}
	
		if (document.form1.fechareporte.value == "0000-00-00"){
		alert("Digite la Fecha de Reporte")
		document.form1.fechareporte.focus()
		return (false);
	}
	
	if (document.form1.cuenta.value == ""){
		alert("Digite numero cuenta")
		document.form1.cuenta.focus()
		return (false);
	}
	
	if (document.form1.banco.value == ""){
		alert("Digite Banco")
		document.form1.banco.focus()
		return (false);
	}
	
	
	
	
	
	

	return (true);
}
</script>

<script>

function Verificar() {
	if (document.form1.cuenta.value == "")
	{
		alert("Falta Numero Cuenta");
		document.form1.cuenta.focus()
		return (false);
	}
	
	if (document.form1.banco.value == "")
	{
		alert("Falta Escribir El Banco");
		document.form1.banco.focus()
		return (false);
	}
	
	if (document.form1.fechareporte.value == "0000-00-00")
	{
		alert("Falta Fecha De Reporte");
		document.form1.fechareporte.focus()
		return (false);
	}
	
	if (document.form1.libranza_credito.value == "")
	{
		alert("Falta Numero Libranza Credito");
		document.form1.libranza_credito.focus()
		return (false);
	}
	
	if (document.form1.reportada.value == ""){
		alert("Seleccione estado de Reportada")
		document.form1.reportada.focus()
		return (false);
	}
	
	if (document.form1.entidad_militar.value == ""){
		alert("Seleccione Entidad Militar")
		document.form1.entidad_militar.focus()
		return (false);
	}
	
	
	
	return(true);
	
	
	
}
</script>





</head>


<body onload="proba()">



<form action="" method="post" name="form1" onSubmit="return Verificar()">
  <div align="center">
    <div class="Estilo50 Estilo67">CONSULTAR-INGRESAR INFORMACION BONOS </div>
	<br />
	<table width="782" border="2"  cellpadding="1" cellspacing="1" class="sol_cre1">
      <tr bgcolor="#F7FFE1" >
        <td width="60" bgcolor="#F7FFE1" scope="col"><div align="right" class="Estilo70">
            <div align="right"><strong>Fecha Solicitud :</strong></div>
        </div></td>
        <th width="130" 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>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" readonly/>        </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="60" height="21" bgcolor="#F7FFE1"><div align="right" class="Estilo70">
          <div align="right"><strong>Cedula No:</strong></div>
        </div></td>
        <td width="130" bgcolor="#F7FFE1" ><div align="left" class="Estilo70">
            <input name="cedula" type="text" class="Estilo66" id="cedula" value="<?php echo $cedula ?>" size="20" maxlength="20" readonly/>
        </div></td>
        <td width="90" bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Cogido Militar :</strong></div></td>
        <td width="161" bgcolor="#F7FFE1" ><div align="left" class="Estilo70">
            <input name="codigo" type="text" class="Estilo66" id="codigo" value="<?php echo $codigo ?>" size="14" maxlength="20" readonly/>
        </div></td>
        <td width="134" 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" readonly/>
        </div></td>
      </tr>
      <tr>
        <td bgcolor="#F7FFE1"><div align="right" class="Estilo70">
          <div align="right"><strong>Direccion :</strong></div>
        </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" readonly/>
        </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" readonly/>
        </div></td>
      </tr>
      <tr>
        <td bgcolor="#F7FFE1"><div align="right" class="Estilo70">
          <div align="right"><strong>Ciudad :</strong></div>
        </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" readonly/>
        </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" readonly/>
        </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" readonly =""/>
        </div></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>
	    <th width="134" bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Sucursal :</strong></div></th>
        <th bgcolor="#F7FFE1" scope="col"><div align="left" class="Estilo70">
            <SELECT NAME="sucursal">
            <OPTION value="">BOGOTA</OPTION>
            <!--<OPTION value="">--Sucursal--</OPTION>
            <?php
do {  
?>
        <option value="<?php echo $row_Recordset2['codigo']?>"><?php echo $row_Recordset2['nombre']?></option>
            <?php
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
  $rows = mysql_num_rows($Recordset2);
  if($rows > 0) {
      mysql_data_seek($Recordset2, 0);
	  $row_Recordset2 = mysql_fetch_assoc($Recordset2);
  }
?>
-->
          </SELECT>
        </div></th>
      </tr>
      <tr>
        <!--<td bgcolor="#F7FFE1"><div align="right" class="Estilo70">
          <div align="right"><strong>Numero libranza:</strong></div>
        </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 $montosolicitado ?>" size="12" maxlength="10" readonly/>
        </div></td>
		 <td bgcolor="#F7FFE1"><div align="right" class="Estilo70"><strong>Permanecia:</strong></div></td>
        <td bgcolor="#F7FFE1" ><div align="left" class="Estilo70">
            <input name="numcuo" type="text" class="Estilo66" id="numcuo" value="<?php echo $permanencia ?>" size="12" maxlength="12" />
        </div></td>
        <td class="tdroja">Fecha a reportar</td>
        <td bgcolor="#F7FFE1" ><div align="left" class="Estilo70">
        
        <?php //if($muestrafechareporte == "0000-00-00") {?>
        <input name="fechareporte" type="text" class="Estilo66" id="fechareporte" value="0000-00-00" size="12" maxlength="12" />
        <?php //}else{ ?>
            <input name="final_reporte" type="text" class="rojo" id="final_reporte" value="<?php echo $muestrafechareporte; ?>" size="12" maxlength="12" readonly/>
            <?php //} ?>
        </div></td>
      </tr>
      
      
      <tr>
      <td class="tdroja">Libranza credito  :</td>
        <td bgcolor="#F7FFE1"><div align="left" class="Estilo70">
          <input name="libranza_credito" type="text" class="Estilo66" id="libranza_credito" value="<?php echo $libranza_cre ?>" size="12" maxlength="10"/>
        </div></td>
		 <td class="tdroja">REPORTADA:</td>
        <td bgcolor="#F7FFE1" ><div align="left" class="Estilo70">
            <select name="repo" id="repo">
            	<option>--Seleccione--</option>
                <option value="SI">SI</option>
                <option value="NO">NO</option>
            </select>
            
            <input name="reportada" type="text" class="rojo" id="reportada" value="<?php echo $reportada; ?>" size="12" maxlength="10"/>
        </div></td>
        <td class="tdroja">ENTIDAD</td>
        <td bgcolor="#F7FFE1" ><div align="left" class="Estilo70">
        	<select name="entidad_militar" id="entidad_militar">
            	<option>Seleccione Unidad</option>
                <option value="EJERCITO">EJERCITO</option>
                <option value="POLICIA">POLICIA</option>
                <option value="FUERZA ARMADA">FUERZA ARMADA</option>
                <option value="FUERZA AEREA">FUERZA AEREA</option>
            </select>
        </div>
        </td>
      </tr>
      
      
     <!-- <tr>
       
        <td bgcolor="#F7FFE1" ><div align="right" class="Estilo70">
          <div align="right"><strong>Valor Mensual:</strong></div>
        </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">
          <div align="left">
            <input name="interes" type="text" class="Estilo66" id="interes" value="<?php echo $interes ?>" size="12" maxlength="12" />      
          </div>
      </tr>


	  <tr>
       
        <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">
          <div align="right">Total Devengado :</div>
        </div></td>
        <td bgcolor="#F7FFE1"><div align="left" class="Estilo73">
            <input name="devengado" type="text" class="Estilo66" id="devengado" value="<?php echo $devengado ?>" size="12" maxlength="12" />
        </div></td>
		     <td bgcolor="#F7FFE1" ><div align="right" class="Estilo73"><strong>Total Desccuento :</strong></div></td>
        <td bgcolor="#F7FFE1"><div align="left" class="Estilo73">
            <input name="descuento" type="text" class="Estilo66" id="descuento" value="<?php echo $descuento ?>" size="12" maxlength="12" />
        </div></td>
		   <td bgcolor="#F7FFE1" ><div align="right" class="Estilo73"><strong>Salario Neto :</strong></div></td>
        <td bgcolor="#F7FFE1">
          <div align="left">
            <input name="salario" type="text" class="Estilo66" id="salario" value="<?php echo $salario ?>" size="12" maxlength="12" />          
          </div>
      </tr>
      
      -->
      
      <br />
<tr>  
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono1</div></td>
      <td><div align="left"><input name="bono1" type="text" class="Estilo66" id="bono1" value="<?php echo $bono1 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono2</div></td>
      <td><div align="left"><input name="bono2" type="text" class="Estilo66" id="bono2" value="<?php echo $bono2 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono3</div></td>
      <td><div align="left"><input name="bono3" type="text" class="Estilo66" id="bono3" value="<?php echo $bono3 ?>" size="12" maxlength="12" /></div></td>
</tr>

<tr>  
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono4</div></td>
      <td><div align="left"><input name="bono4" type="text" class="Estilo66" id="bono4" value="<?php echo $bono4 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono5</div></td>
      <td><div align="left"><input name="bono5" type="text" class="Estilo66" id="bono5" value="<?php echo $bono5 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono6</div></td>
      <td><div align="left"><input name="bono6" type="text" class="Estilo66" id="bono6" value="<?php echo $bono6 ?>" size="12" maxlength="12" /></div></td>
</tr>

<tr>  
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono7</div></td>
      <td><div align="left"><input name="bono7" type="text" class="Estilo66" id="bono7" value="<?php echo $bono7 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono8</div></td>
      <td><div align="left"><input name="bono8" type="text" class="Estilo66" id="bono8" value="<?php echo $bono8 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono9</div></td>
      <td><div align="left"><input name="bono9" type="text" class="Estilo66" id="bono9" value="<?php echo $bono9 ?>" size="12" maxlength="12" /></div></td>
</tr>


<tr>  
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono10</div></td>
      <td><div align="left"><input name="bono10" type="text" class="Estilo66" id="bono10" value="<?php echo $bono10 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono11</div></td>
      <td><div align="left"><input name="bono11" type="text" class="Estilo66" id="bono11" value="<?php echo $bono11 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono12</div></td>
      <td><div align="left"><input name="bono12" type="text" class="Estilo66" id="bono12" value="<?php echo $bono12 ?>" size="12" maxlength="12" /></div></td>
</tr>

<tr>  
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono13</div></td>
      <td><div align="left"><input name="bono13" type="text" class="Estilo66" id="bono13" value="<?php echo $bono13 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono14</div></td>
      <td><div align="left"><input name="bono14" type="text" class="Estilo66" id="bono14" value="<?php echo $bono14 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono15</div></td>
      <td><div align="left"><input name="bono15" type="text" class="Estilo66" id="bono15" value="<?php echo $bono15 ?>" size="12" maxlength="12" /></div></td>
</tr>

<tr>  
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono16</div></td>
      <td><div align="left"><input name="bono16" type="text" class="Estilo66" id="bono16" value="<?php echo $bono16 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono17</div></td>
      <td><div align="left"><input name="bono17" type="text" class="Estilo66" id="bono17" value="<?php echo $bono17 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono18</div></td>
      <td><div align="left"><input name="bono18" type="text" class="Estilo66" id="bono18" value="<?php echo $bono18 ?>" size="12" maxlength="12" /></div></td>
</tr>

<tr>  
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono19</div></td>
      <td><div align="left"><input name="bono19" type="text" class="Estilo66" id="bono19" value="<?php echo $bono19 ?>" size="12" maxlength="12" /></div></td>
      
      <td bgcolor="#F7FFE1" ><div align="right" class="Estilo72">Nº Bono20</div></td>
      <td><div align="left"><input name="bono20" type="text" class="Estilo66" id="bono20" value="<?php echo $bono20 ?>" size="12" maxlength="12" /></div></td>
      
</tr>
      
      
    </table>
	<p>
      <label>
  <input name="guardar" type="submit" class="Estilo53" id="guardar" value="Guardar" onClick="return valida_envia()"  />
   <br><br>
   <input name="button" type="button" class="volver" onclick="window.location.href='consulta_cedula_credito_rotativo.php'" value="Volver">
   <!--<a href="credito_consulta_cartera.php">volver</a>-->
  
      </label>
    </p>

 

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


<?php
if(isset($_POST["guardar"]))
{
	
	/*if($_POST["cuenta"] == ""){echo "<script>alert('Digite Numero de Cuenta');</script>";die();}
	if($_POST["banco"] == ""){echo "<script>alert('Digite Nombre Banco');</script>";die();}
	if($_POST["fechareporte"]=="0000-00-00"){echo "<script>alert('Digite la fecha a Reportar');</script>";die();}*/
	
	
	
	$con = mysql_query('SELECT cedula FROM redimir_bonos WHERE cedula   = "' . $_POST[cedula] . '"  ');
	if (!$con) {
		die('Invalid query: ' . mysql_error());
	} 
	list($cedulaverifica) = mysql_fetch_row($con);
	
	if($cedulaverifica==0)
	{
		$inserta_credito = mysql_query("INSERT INTO redimir_bonos(cedula, codigo_militar, nombre, fecha, direccion, ciudad, telefono, celular, email, unidad, numero_cuenta, banco, grado, reportada entidad, codigo_sucursal, monto_solicitado, permanencia, fecha_reporte, libranza_credito, bono1, bono2, bono3, bono4, bono5, bono6, bono7, bono8, bono9, bono10, bono11, bono12, bono13, bono14, bono15, bono16, bono17, bono18, bono19, bono20, estado) VALUES ('".$cedula."', '".$codigo."', '".$nombre."', '".$_POST["fecha"]."', '".$direccion."', '".$ciudad."', '".$telefono."','".$celular."', '".$email."', '".$unidad."', '".$_POST["cuenta"]."', '".$_POST["banco"]."', '".$grado."', '".$_POST["reportada"]."', '".$_POST["entidad"]."', '1', '".$montosolicitado."', '".$permanencia."', '".$_POST["fechareporte"]."', '".$_POST["libranza_credito"]."', '".$_POST["bono1"]."', '".$_POST["bono2"]."', '".$_POST["bono3"]."', '".$_POST["bono4"]."', '".$_POST["bono5"]."', '".$_POST["bono6"]."', '".$_POST["bono7"]."', '".$_POST["bono8"]."', '".$_POST["bono9"]."', '".$_POST["bono10"]."', '".$_POST["bono11"]."', '".$_POST["bono12"]."', '".$_POST["bono13"]."', '".$_POST["bono14"]."', '".$_POST["bono15"]."', '".$_POST["bono16"]."', '".$_POST["bono17"]."', '".$_POST["bono18"]."', '".$_POST["bono19"]."', '".$_POST["bono20"]."' , '0' )");
		
		if (!$inserta_credito) {
				die('Invalid query inserta err: ' . mysql_error());
		}
		//actializa estado de la tabla credito rotativo 
		$actualiza_credito_rotativo = mysql_query('UPDATE credito_rotativo set estado = 1 WHERE cedula = "'.$_GET["ced2"].'" ');
		if (!$actualiza_credito_rotativo) {
				die('Invalid query update credit err: ' . mysql_error());
		}
		
		echo "<script>alert('Los datos fueron grabados correctamente');</script>";
		echo "<script>window.location='credito_consulta_cartera.php';</script>";
	}
	
	else
 	{/*
		if($bono1 != "")
		$actualiza = mysql_query("UPDATE redimir_bonos set bono1='".$_POST["bono1"]."', bono2='".$_POST["bono2"]."', bono3='".$_POST["bono3"]."', bono4='".$_POST["bono4"]."', bono5='".$_POST["bono5"]."', bono6='".$_POST["bono6"]."', bono7='".$_POST["bono7"]."', bono8='".$_POST["bono8"]."', bono9='".$_POST["bono9"]."', bono10='".$_POST["bono10"]."', bono11='".$_POST["bono11"]."', bono12='".$_POST["bono12"]."', bono13='".$_POST["bono13"]."', bono14='".$_POST["bono14"]."', bono15='".$_POST["bono15"]."', bono16='".$_POST["bono16"]."', bono17='".$_POST["bono17"]."', bono18='".$_POST["bono18"]."', bono19='".$_POST["bono19"]."', bono20='".$_POST["bono20"]."'  WHERE cedula ='".$_GET["ced2"]."' ");
		*/		
	 	echo "<script>alert('Ya tiene un credito');</script>";
	
 	}
	
}	

?>