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_modificar_informacion_todadespuesdecartera.php
<?php 
require_once("Conectarse.php");

global $dbi;
$espacio = ' ';
$linea = '-';
 

/*$control = mysql_query('SELECT cedula, codigo_militar, nombre, grado, numerocontrato,   tipocontrato , numero_libranza , tipo_afiliado, codigo_sucursal, direccion , telefono, celular, ciudad , email, cuenta, banco, entidad_laboral, unidad_descuento, codigo_descuento, entidad_recaudo, fecha_nacimiento, fecha_afiliacion, valorcontrato, numerocuotas, valorcuota,  fecha_inicio_contrato, fecha_termino_contrato, fecha_ultimo_registro, mes_inicio, ano_inicio, mes_termino, ano_termino, saldoanteior, cuotaspendientes, cuotasdescontadas, saldonuevo, vendedor, director,  beneficiarios, renovacion, causal_terminacion, fecha_terminacion, estado FROM cartera_serviasjudinet WHERE cedula =  "' . $_GET["ced2"] . '" and numerocontrato =  "' . $_GET["numcon"] . '" ');
	if (!$control) {
		die('Invalid query 1: ' . mysql_error());
	}
$num=mysql_num_rows($control); 
list($cedula, $codi, $apes, $grad, $numcont, $plan, $num_lib, $titular, $codigosu, $dire, $tele, $celul, $ciudad, $email, $cue, $ban, $enti, $unides, $codides, $entre, $fecna, $fechafil, $valcon, $numcuo, $valcuo, $fechainicio, $fechatermino, $fechaul, $mesini, $anoini, $mesfin, $anofin, $salant, $cupen, $cudesc, $salnue, $ven, $director,   $bene, $renova, $causal, $fechater, $esta) = mysql_fetch_row($control);
$inipag = $anoini.'-'.$mesini; 



$control = mysql_query('SELECT nombre FROM sucursal  WHERE codigo = "' . "$codigosu". '" ');
if (!$control) {
	die('Invalid query 1: ' . mysql_error());
}
list($codigosu) = mysql_fetch_row($control);
*/



//////////////////////////////////
// INFORMACION DE CREDITO ROTATIVO
//////////////////////////////////
/*
$consultar_rotativo = mysql_query('SELECT cedula, libranza_credito, fecha_inscripcion, nombre_padre, nombre_madre, direccion_padres, ciudad_padres, telefono_padres, celular_padres, referencia_compa, celular_compa, cuenta, banco, valor_anticipo, saldo_pendiente, monto_solicitado FROM credito_rotativo WHERE cedula = "'.$_GET["ced2"].'" ');
if (!$consultar_rotativo) {
	die('Invalid query: ' . mysql_error());
}

list($cedula_consulta, $cred, $fecha_inscribio, $nompadre, $nommadre, $direcpadres, $ciudadpadres, $telpadres, $celpadres, $refcompa, $celcompa, $cuenta, $banco, $valor_anticipo, $saldo_pendiente, $monto_solicitado)=mysql_fetch_row($consultar_rotativo);

if($cedula_consulta!=0)
{
	$cre = "SI";
}
else
{
	$cre = "NO";
}
*/








$control = mysql_query('SELECT cedula, apellidos, nombres, grado, unidad, celular, telefono, email, grado, unidad, direccion_residencia, ciudad_residencia, nombre_padre, nombre_madre, direccion_padres, barrio_padres, ciudad_padres, depto_padres, celular_familia, telefono_familia, promocion FROM consultorio_creditos_soldados WHERE  cedula = "'.$_GET["ced2"].'" ');
if (!$control) {
	die('Invalid query 1: ' . mysql_error());
}
list($cedula, $apellidos, $nombres, $grad, $unidad, $celular, $telefono, $email, $grado, $direccion, $ciudad, $nombre_padre, $nombre_madre, $direccion_padres, $barrio_padres, $ciudad_padres, $depto_padres, $celular_familia, $telefono_padres, $promocion) = mysql_fetch_row($control);











//NUEVO
$consulta_tabla_ejercito = mysql_query("SELECT cedula, fecha_nacimiento, unidad_origen, brigada, curso FROM db_curso_ejercito WHERE cedula = '".$_GET["ced2"]."' ");
if (!$consulta_tabla_ejercito) {
	die('Invalid query 111: ' . mysql_error());
}
list($cedula_ejercito, $fecha_nacimiento, $unidad_origen, $brigada, $promocion) = mysql_fetch_row($consulta_tabla_ejercito);




$consultar_rotativo = mysql_query("SELECT cedula, apellidos, nombres, grado, unidad, rango, libranza_credito, direccion, telefono, celular, ciudad, email, cuenta, banco, fecha_reporte_nomina, pagaduria, entidad, escuela, numerosolicitud, fecha_solicitud, nombre_padre, telefono_padres, celular_padres, referencia_compa, celular_compa, fecha_anticipo0, valor_anticipo0, fecha_anticipo, valor_anticipo, saldo_pendiente, monto_solicitado, anticipo, permanencia, valor_cuotas, compania, proveedor_inicial, asesor_comercial, solicitud, fecha_corte_temporal, ok1, interes_muerto, planilla0, planilla, cuenta_verificada FROM credito_rotativo WHERE cedula = '".$_GET["ced2"]."' AND libranza_credito = '".$_GET["cred"]."' ");
if (!$consultar_rotativo) {
	die('Invalid query consultar_rotativo: ' . mysql_error());
}

list($cedula, $apellidos, $nombres, $grado, $unidad, $rango, $libranza_credito, $direccion, $telefono, $celular, $ciudad, $email, $cuenta, $banco, $fecha_reporte_nomina, $pagaduria, $entidad_laboral, $escuela, $numerosolicitud, $fecha_solicitud, $nombre_padre, $telefono_padres, $celular_padres, $referencia_compa, $celular_compa, $fecha_anticipo0, $valor_anticipo0, $fecha_anticipo, $valor_anticipo, $saldo_pendiente, $monto_solicitado, $anticipo, $permanencia, $valor_cuotas, $compania, $proveedor_inicial, $asesor_comercial, $solicitud, $fecha_corte_temporal, $ok1, $interes_muerto, $planilla0, $planilla, $cuenta_verificada) = mysql_fetch_row($consultar_rotativo);



//comprueba si ya existe em cartera de creditos
$consulta_cartera_credito = mysql_query("SELECT cedula FROM credito_rotativo_inter WHERE cedula = '".$_GET["ced2"]."' and credito_libranza = '".$_GET["cred"]."' ");
$row_existe_cartera = mysql_num_rows($consulta_cartera_credito);
if (!$consulta_cartera_credito) {
	die('Invalid query consultar_rotativo: ' . mysql_error());
}
if($row_existe_cartera!=0){
	echo "<h4 align='center'>Existe en cartera creditos</h4>";
}



//Promotor
$Recordset7 = mysql_query('SELECT * FROM Usuarios WHERE cargo = "ASESOR COMERCIAL" AND nivel = 2 order by Nombre_Completo'); 
$row_Recordset7 = mysql_fetch_assoc($Recordset7);
$totalRows_Recordset7 = mysql_num_rows($Recordset7);



$Recordset1 = mysql_query('SELECT * FROM Usuarios WHERE Cargo = "ASESOR COMERCIAL" order by Nombre_Completo'); 
if (!$Recordset1)
{die('Invalid query: ' . mysql_error());}
			 
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);


?>


<!DOCTYPE html>
<html>
<head>

<title>Solicitud Credito Rotativo Ejercito</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:#F8F8F8;font-family:Geneva, Arial, Helvetica, sans-serif;}
    header {background-color: #B7271F; text-align: center;}
    .cerrarsesion{width: auto;background-color: #DBD8C9;color: #000;font-size: 13px;position:absolute;top: 15px;right:10px;z-index:0;padding: 10px;border-radius: 10px;cursor: pointer;}
    .cerrarsesion:hover{background-color: #ffffff;color: #000;}
    .titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
    table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
    .divirmenu{text-align: center;}
    .irmenu{width: 200px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
    .irmenu:hover{background-color: #67a0d9; color: #000;}
	.direcciona{width: 200px;background-color: #B7271F;color: #fff; padding: 4px;border-radius: 3px;}
	.direcciona:hover{background-color: #67a0d9; color: #000;}
    
    .fecha{background-color: #d6e08b; padding: 2px;color: #8A0003;font-size: 15px; text-align: center;font-weight:600;}
    
	td{border:#D6D6D6 solid 1px;}
    .tdizq{background-color: #EEE; padding: 0px 4px;color: #00135F;font-size: 13px;font-weight: 600; text-align: left;}
    .tdcen{background-color: #EEE; padding: 0px 4px;color: #00135F;font-size: 13px;font-weight: 600; text-align: center;}
    .tdder{background-color: #EEE; padding: 0px 4px;color: #00135F;font-size: 13px;font-weight: 600; text-align: right;}
	.exp{color:#8A0000; font-size:10px;}
	.rojo{color:#C60000;}
	.fuerte{font-weight:400;}
    .boton1{width:200px;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
    input[type=text], select{padding: 1px 3px; height:22px; background-color: #FFFFFF;}
	
	/*Estilo Complementario*/
	.tdi{background-color: #F9FBC8; padding: 1px 4px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
	.tdc{background-color: #F9FBC8; padding: 1px 4px;color: #00135F;font-size: 12px;font-weight: 600; text-align: center;}
    .tdd{background-color: #F9FBC8; padding: 1px 4px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
	.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;}
	
	
	.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
    .tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 13px;}
    .botonnew{width: 90px; background-color: #e3dec0;color: #b20606;padding: 1px;border-radius:5px;}
    .botonnew:hover{width: 90px; background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
	
	input[type=text].corta{width: 30px;text-align:left;padding: 3px;}
	
	.marquee{padding: 0 30px}
	.marca{width:80%; color:#C24548; text-transform:uppercase;}
</style>


<script>
function Verificar(){
	
	
	if (document.form1.apellidos.value==""){
		alert("Escriba Sus Apellidos")
		document.form1.apellidos.focus()
		return (false);
	}
	
	if (document.form1.nombres.value==""){
		alert("Corte y Pegue Los Nombres")
		document.form1.nombres.focus()
		return (false);
	}
	if (document.form1.cedula.value==""){
		alert("Escriba Su Numero de Cedula")
		document.form1.cedula.focus()
		return (false);
	}
	
	if (document.form1.grado.value==""){
		alert("Escriba Su Grado")
		document.form1.grado.focus()
		return (false);
	}
	
	if (document.form1.direccion.value==""){
		alert("Escriba Su Direccion")
		document.form1.direccion.focus()
		return (false);
	}
	/*
	if (document.form1.telefono.value==""){
		alert("Escriba Su telefono")
		document.form1.direccion.focus()
		return (false);
	}
	*/
	if (document.form1.ciudad.value==""){
		alert("Escriba Su Ciudad")
		document.form1.ciudad.focus()
		return (false);
	}
	
	if (document.form1.celular.value==""){
		alert("Escriba Su Nº Celular")
		document.form1.celular.focus()
		return (false);
	}
	
	/* //SE QUITA LA VVALIDACION POR ORDEN DE EFRAIN FECHA 2020-09-04 */
	/*
	if (document.form1.cuenta.value==""){
		alert("Escriba El Numero de Cuenta")
		document.form1.cuenta.focus()
		return (false);
	}
	
	
	if (document.form1.banco.value==""){
		alert("Escriba El Banco")
		document.form1.banco.focus()
		return (false);
	}
	*/
	/*if (document.form1.email.value==""){
		alert("Escriba Su Correo Electronico")
		document.form1.email.focus()
		return (false);
	}*/
	
	/*
	if (formulario.anoss_anticipo.value == "0000")
  	{
    	alert("Falta digitar Año");
    	formulario.anoss_anticipo.focus();
    	return (false);
  	}
  
    if (formulario.mess_anticipo.value == "00")
  	{
    	alert("Falta seleccionar mes");
    	formulario.mess_anticipo.focus();
    	return (false);
  	}
	
   	if (formulario.diass_anticipo.value == "00")
  	{
    	alert("Falta seleccionar día");
    	formulario.diass_anticipo.focus();
    	return (false);
  	}
	*/
	/*
	if (document.form1.valor_anticipo.value==""){
		alert("Seleccione el valor del Anticipo")
		document.form1.valor_anticipo.focus()
		return (false);
	}
	*/
	
	
	
	
	
	
	
	
	
	
	
	/*
	if (document.form1.monto_solicitado.value==""){
		alert("Escriba el monto del credito")
		document.form1.monto_solicitado.focus()
		return (false);
	}
	*/
	/*
	if (document.form1.numero_cuotas.value==""){
		alert("Seleccion el numero de cuotas")
		document.form1.numero_cuotas.focus()
		return (false);
	}
	*/
	/*
	
	
	*/
	if (document.form1.libranza.value == "")
  	{
    	alert("Falta escribir la libranza");
    	document.form1.libranza.focus();
    	return (false);
  	}
	
	
	
	if (document.form1.monto_solicitado_captura.value == "")
  	{
    	alert("Falta escribir el valor total capital");
    	document.form1.monto_solicitado_captura.focus();
    	return (false);
  	}
	
	/*
	if (document.form1.valor_total_capital.value==""){
		alert("Escriba valor total capital")
		document.form1.valor_total_capital.focus()
		return (false);
	}
	*/
	
	
	
	
	
	
	
	
	if (document.form1.entidad_laboral.value==""){
		alert("Seleccione entidad laboral")
		document.form1.entidad_laboral.focus()
		return (false);
	}
	
	if (document.form1.proveedor.value==""){
		alert("Seleccione Proveedor")
		document.form1.proveedor.focus()
		return (false);
	}
	
	
	
	
	
	
	/*
	if (document.form1.nom_padre.value==""){
		alert("Escriba el nombre de su familiar")
		document.form1.nom_padre.focus()
		return (false);
	}
	
	
	if (document.form1.nom_madre.value==""){
		alert("Escriba el nombre de su familiar")
		document.form1.nom_madre.focus()
		return (false);
	}
	if (document.form1.dir_padres.value==""){
		alert("Escriba la direccion de sus padres")
		document.form1.dir_padres.focus()
		return (false);
	}
	
	if (document.form1.ciudad_padres.value==""){
		alert("Escriba la ciudad donde viven sus padres")
		document.form1.ciudad_padres.focus()
		return (false);
	}
	
	
	if (document.form1.tel_padres.value==""){
		alert("Escriba el telefono fijo de sus padres")
		document.form1.tel_padres.focus()
		return (false);
	}
	
	
	if (document.form1.cel_padres.value==""){
		alert("Escriba el celular de sus padres")
		document.form1.cel_padres.focus()
		return (false);
	}
	*/
	/*
	if (document.form1.ref_compa.value==""){
		alert("Escriba el nombre de un compañero")
		document.form1.ref_compa.focus()
		return (false);
	}
	
	
	if (document.form1.cel_compa.value==""){
		alert("Escriba el celular de su compañero")
		document.form1.cel_compa.focus()
		return (false);
	}
	*/
	
	
	
	
	

	
	
	
	
	
	
	/*if(document.form1.cue.value == document.form1.num_cuenta.value)
	{
			
	}else
	{
		alert("LOS NUMEROS DE CUENTA NO SON IGUALES, MODIFIQUE LOS DATOS DANDO CLICK EN MODIFICAR O VERIFIQUE QUE ESTE BIEN ESCRITOS")
		document.form1.cue.focus()
		return (false);
	}*/
	
	
	
	

	return (true);
}
</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> 



</head>
<body >
<header>
    <img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">SOLICITUD CREDITO ROTATIVO EJERCITO</h3>

	
<?php //if($row_existe_cartera != 0){ 
	//echo "<p align='center'><b>No puede editar porque ya ingreso a cartera de creditos, alguna modificacion directamente con el departamento de sistemas</b></p>";
	//die();
	
//}else{
?>
	
	
<p align="center">Recomendacion: El saldo pendiente debe ser capturado manual porque puede tener anticipo inicial y anticipo que genera planilla, revisar bien cuando realicen los cambios</p>
<form action=""  method="post" onSubmit="return Verificar()" name="form1"  id="form1">
  <!--<div align="center">
    <div class="Estilo1">SOLICITUD CARTERA JURIDICA</div>-->
<table width="900" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
	<tr>
	  <td class="fecha" colspan="6">DATOS</td>
	</tr>


	<tr>
		<td class="tdder">Fecha de Solicitud</td>
		<td class="tdizq"><input class="rojo" name="fecha_solicitud" type="text" id="fecha_solicitud" value="<?php echo $fecha_solicitud ?>" size="40" maxlength="40" readonly/></td>
		<td class="tdizq" colspan="2"></td>
	</tr>


	
	<tr>
		<td class="tdder">Cedula No</td>
		<td class="tdizq"><input name="cedula" type="text"  id="cedula" value="<?php echo $cedula ?>" size="40" maxlength="40" readonly/></td>
		<td class="tdder">Grado</td>
		<td class="tdizq"><input name="grado" type="text"  id="grado" value="<?php echo $grado ?>" size="40" maxlength="40" /></td>
	</tr>
	
	<tr>
		<td class="tdder">Apellidos</td>
		<td class="tdizq"><input name="apellidos" type="text"  id="apellidos" value="<?php echo $apellidos ?>" size="40" maxlength="40"/>
		</td>
		<td class="tdder">Nombres</td>
		<td class="tdizq"><input name="nombres" type="text"  id="nombres" value="<?php echo $nombres ?>" size="40" maxlength="40"/>
		</td>
	</tr>



	<tr>

		<td class="tdder">Direccion </td>
		<td class="tdizq"><input name="direccion" type="text"  id="direccion" value="<?php echo $direccion ?>" size="40" maxlength="40" /></td>
		<td class="tdder">Telefono </td>
		<td class="tdizq"><input name="telefono" type="text"  id="telefono" value="<?php echo $telefono ?>" size="40" maxlength="40" /></td>
	</tr>



	<tr>
		<td class="tdder">Cuidad</td>
		<td class="tdizq"><input name="ciudad" type="text"  id="ciudad" value="<?php echo $ciudad ?>" size="40" maxlength="40" /></td>

		<td class="tdder">Celular</td>
		<td class="tdizq"><input name="celular" type="text"  id="celular" value="<?php echo $celular ?>" size="40" maxlength="40" /></td>

	</tr>


	<tr>
		<td class="tdder">EMAIL</td>
		<td class="tdizq"><input name="email" type="text" id="email" value="<?php echo $email ?>" size="40" maxlength="40" /></td>
		<td class="tdizq" colspan="2"></td> 
	</tr>

	
	
	<?php //if($ok1 == ""){ ?>	
	<tr>
		<td class="tdder">FECHA ANTICIPO 0</td>
		
		<td class="tdizq"><input name="fecha_anticipo0" type="text"  id="fecha_anticipo0" value="<?php echo $fecha_anticipo0 ?>" size="40" maxlength="40" /></td>
		
	
		
		<td class="tdder tdrojad">Valor Anticipo</td>
		
		<td class="tdizq"><input name="valor_anticipo0" type="text"  id="valor_anticipo0" value="<?php echo $valor_anticipo0 ?>" size="40" maxlength="40" /></td> 
		
	</tr>
	<?php// } ?>
</table>
<br><br>
<table width="900" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
	<tr>
		<td class="tdder">N° Libranza</td>
		<td class="tdizq"><input class="rojo" name="libranza" type="text" id="libranza" value="<?php echo $libranza_credito ?>" size="20" maxlength="20" readonly/></td>

		<td class="tdder">Valor total capital</td>
		
		<td class="tdizq"><input name="monto_solicitado" type="text"  id="monto_solicitado" value="<?php echo $monto_solicitado ?>" size="40" maxlength="40" /></td>
		
	</tr>
	
	
	<tr>
		<td height="34" class="tdrojad" >NUMERO DE CUENTA</td>
		<td class="tdizq"><input name="cuenta" type="text"  id="cuenta" value="<?php echo $cuenta ?>" size="40" maxlength="40" /></td>
		<td class="tdrojad">BANCO</td>
		<td class="tdizq"><input name="banco" type="text"  id="banco" value="<?php echo $banco ?>" size="40" maxlength="40"  /></td>
	</tr>
	
	
	
	
	
	<tr>
		<td class="tdder">Fecha Reporte Nomina</td>
		
        <td class="tdizq"><input name="fecha_reporte_nomina" type="text"  id="fecha_reporte_nomina" value="<?php echo $fecha_reporte_nomina ?>" size="40" maxlength="40"  /></td>
		
	
		<td class="tdder" >Pagaduria</td>
		<td class="tdizq"><input name="pagaduria" type="text"  id="pagaduria" value="<?php echo $pagaduria ?>" size="40" maxlength="40"  /></td>
	</tr>
	
	
	<tr>
		<td class="tdder">N° Cuotas</td>
		
    	<td class="tdizq"><input name="permanencia" type="text"  id="permanencia" value="<?php echo $permanencia ?>" size="40" maxlength="40"  /></td>
		
		
		<td class="tdder" >Valor Cuotas</td>
		<td class="tdizq"><input name="valor_cuotas" type="text"  id="valor_cuotas" value="<?php echo $valor_cuotas ?>" size="40" maxlength="40"  /></td>
	</tr>
	






	<tr>
	<td class="tdrojad" >Asesor Comercial</td>
    <td class="tdizq"><input name="asesor_comercial" class="rojo" type="text"  id="asesor_comercial" value="<?php echo $asesor_comercial ?>" size="40" maxlength="40" />
		<SELECT NAME="asesor_comercial_ingreso" id="asesor_comercial_ingreso">
      		<OPTION value="">--Nombre Funcionario--</OPTION>
        	<?php
			do {  
			?>
            <option value="<?php echo $row_Recordset1['Nombre_Completo']?>"><?php echo $row_Recordset1['Nombre_Completo']?></option>
            <?php
			} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
  			$rows = mysql_num_rows($Recordset1);
  			if($rows > 0) {
      		mysql_data_seek($Recordset1, 0);
	  		$row_Recordset1 = mysql_fetch_assoc($Recordset1);
  			}
			?>
    	</SELECT>
	</td>

	<td class="tdrojad" >Proveedor</td>
    <td class="tdizq"><input name="proveedor_inicial" class="rojo" type="text"  id="proveedor_inicial" value="<?php echo $proveedor_inicial ?>" size="40" maxlength="40" />
		<select name="proveedor_inicial_ingreso" id="proveedor_inicial_ingreso">
        <option value="">--SELECCION--</option>
    	<option value="Interasjudinet">Interasjudinet</option>
        <option value="Coomanufacturas">Coomanufacturas</option>
        <option value="Efrain Largo">Efrain Largo</option>
        <option value="Jorge Castro">Jorge Castro</option>
    	</select>
	</td>
</tr>


	<tr>
		<!--
		<td class="tdder">Asesor Comercial</td>
		<?php if($asesor_comercial == ""){ ?>
			<td class="tdizq">
			<select NAME="asesor_comercial_captura" id="asesor_comercial_captura">
				<option value="">--Asesor Comercial--</option>
				<?php
				do {  
				?>
					<option value="<?php echo $row_Recordset7['Nombre_Completo']?>"><?php echo $row_Recordset7['Nombre_Completo']?></option>
							<?php
				} while ($row_Recordset7 = mysql_fetch_assoc($Recordset7));
				  $rows = mysql_num_rows($Recordset7);
				  if($rows > 0) {
					  mysql_data_seek($Recordset7, 0);
					  $row_Recordset7 = mysql_fetch_assoc($Recordset7);
				  }
				?>
			  </select>
		</td>
		
		<?php }else{ ?>
		<td class="tdizq"><input name="asesor_comercial" type="text"  id="asesor_comercial" value="<?php echo $asesor_comercial ?>" size="40" maxlength="40" /></td>
		<?php } ?>
		-->
		
	</tr>


	<tr>
		<td class="tdder">Entidad Laboral</td>
		<td class="tdizq"><input name="entidad_laboral" type="text"  id="entidad_laboral" value="<?php echo $entidad_laboral ?>" size="40" maxlength="40" readonly/></td>
		
		<td class="tdder">Unidad</td>
		<td class="tdizq"><input name="unidad" type="text"  id="unidad" value="<?php echo $unidad ?>" size="40" maxlength="40" readonly/></td>
	</tr>


	<?php if($cedula_ejercito != ""){ ?>
	<tr>
		<td class="tdder">Promoci&oacute;n</td>
		<td class="tdizq"><input name="promocion" type="text"  id="promocion" value="<?php echo $promocion ?>" size="40" maxlength="40" readonly /></td>
		
		<td class="tdder">Unidad Origen</td>
		<td class="tdizq"><input name="unidad_origen" type="text"  id="unidad_origen" value="<?php echo $unidad_origen ?>" size="40" maxlength="40" readonly/></td>
	</tr>
	
	<tr>
		<td class="tdder">Fecha Nacimiento</td>
		<td class="tdizq"><input name="fecha_nacimiento" type="text"  id="fecha_nacimiento" value="<?php echo $fecha_nacimiento ?>" size="40" maxlength="40"  /></td>
		
		<td class="tdder">Brigada</td>
		<td class="tdizq"><input name="brigada" type="text"  id="brigada" value="<?php echo $brigada ?>" size="40" maxlength="40" readonly/></td>
	</tr>
	
	<?php } ?>
	

</table>




<br>




<br>
<table width="900" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
  <td class="fecha" colspan="6">COMPLETE LA SIGUIENTE INFORMACION</td>
</tr>

 	
<tr>
	<td class="tdder">Nombre Padre o Madre</td>
    <td class="tdizq" colspan="2"><input name="nom_padre" type="text"  id="nom_padre" value="<?php echo $nombre_padre ?>" size="40" maxlength="40" /></td>
    
    <!--<td class="tdder">Ciudad Padres</td>
    <td class="tdizq" colspan="2"><input name="ciudad_padres" type="text"  id="ciudad_padres" value="<?php echo $ciudad_padres ?>" size="40" maxlength="40" /></td>-->
    <!--<td class="tdder">Nombre Madre</td>
    <td class="tdizq" colspan="2"><input name="nom_madre" type="text"  id="nom_madre" value="<?php echo $nombre_madre ?>" size="40" maxlength="40" /></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 $direccion_padres ?>" size="40" maxlength="40" /></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 $telefono_padres ?>" size="40" maxlength="40" /></td>
    <td class="tdder">Celular Padres</td>
    <td class="tdizq" colspan="2"><input name="cel_padres" type="text"  id="cel_padres" value="<?php echo $celular_padres ?>" size="40" maxlength="40" /></td>
</tr>

<tr>
	<td class="tdder" >Referencia <br> 
	De Compa&ntilde;ero</td>
    <td class="tdizq" colspan="2"><input name="ref_compa" type="text"  id="ref_compa" value="<?php echo $referencia_compa ?>" size="40" maxlength="40" /></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 $celular_compa ?>" size="40" maxlength="40" /></td>
</tr>


</table>
    
    
	
	
	
	
	
	
<?php //if($ok1 == ""){ ?>	
<table width="900" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
  <td class="fecha" colspan="6">INFORMACION</td>
</tr>	
	
<tr>
   <td class="tdder">FECHA ANTICIPO 1</td>
	
	<td class="tdizq"><input type="text" name="fecha_primer_anticipo" id="fecha_primer_anticipo" value="<?php echo $fecha_anticipo ?>" size="40" maxlength="40"></td>
	
	
	<td class="tdder tdrojad">Valor Anticipo</td>
		
		<td class="tdizq"><input name="valor_anticipo1" type="text"  id="valor_anticipo1" value="<?php echo $valor_anticipo ?>" size="40" maxlength="40" /></td> 
		
</tr>
	
	
	
	
	<tr>
	   <td class="tdder">FECHA CORTE</td>
		
		<td class="tdizq"><input type="text" name="fecha_corte_temporal" id="fecha_corte_temporal" value="<?php echo $fecha_corte_temporal ?>" size="40" maxlength="40"></td>
		
		
	
		<td class="tdder" >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" /></td>
	</tr>
	
	<tr>
	   <td class="tdder">INTERES MUERTO</td>
		<td class="tdizq"><input type="text" name="interes_muerto" id="interes_muerto" value="<?php echo $interes_muerto ?>" size="40" maxlength="40"></td>
		
		<td class="tdder">PLANILLA M</td>
		<td class="tdizq"><input type="text" name="planilla0" id="planilla0" value="<?php echo $planilla0 ?>"   size="40" maxlength="40"></td>
		
	</tr>
	
	
	<tr>
	   <td class="tdder">CUENTA VERIFICADA</td>
		<td class="tdizq"><input type="text" name="cuenta_verificada" id="cuenta_verificada" value="<?php echo $cuenta_verificada ?>" size="40" maxlength="40"></td>
		
		<td class="tdder">PLANILLA 1</td>
		<td class="tdizq"><input type="text" name="planilla" id="planilla" value="<?php echo $planilla ?>"  readonly size="40" maxlength="40"></td>
	</tr>
	
	
	
	
	
	
</table> 

<br/>
<?php //} else { ?>
	<!--<p align="center">NO SE PUEDE EDITAR PORQUE YA FUE GENERADA LA PRIMER PLANILLA, CONSULTA Y REVISAR</p>	   -->
<?php //} ?>
 <br/>  

		
<p align="center">
	<input name="enviar" type="submit" class="direcciona" id="enviar" value="GUARDAR">
	 <!--<input name="menu2" type="button" class="irmenu" id="menu2" onClick="window.location.href='menu_creditos_rotativos.php'" value="IR AL MENU">-->
	  
	</p>
	
<?php //} ?>	

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



<?php
	
if(isset($_POST["enviar"]))
{
	
	require_once("Conectarse.php");
	
	
	
	
	
	//////////////////////
	//   VALIDADCIONES  //
	//////////////////////
	
	
	
	
	
	
	
	
	
	if($_POST["asesor_comercial_ingreso"] == ""){
		$asesor_comercial_guarda = $asesor_comercial;
	}
	else{
		$asesor_comercial_guarda = $_POST["asesor_comercial_ingreso"];
	}
	
	
	if($_POST["proveedor_inicial_ingreso"] == ""){
		$proveedor_inicial_guarda = $proveedor_inicial;
	}
	else{
		$proveedor_inicial_guarda = $_POST["proveedor_inicial_ingreso"];
	}
	
	
	
	
	
	
	
	
	///////////////////////////
	//  FINAL VALIDADCIONES  //
	///////////////////////////
	
	
	
	
	
	$valanticipo = $valor_anticipo_guarda;
	
	if($_POST["valor_anticipo0"] == 0){
		$tieneanticipo	= "NO";
	}
	else{
		$tieneanticipo	= "SI";
	}
	
	//$saldo_pendiente = $monto_solicitado_guarda - $valor_anticipo_guarda;
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
		
	
	
	
	
	
	
	//$saldo_pendiente = $saldo_pendiente - $_POST["valor_anticipo"];
	
	
	
	//if($saldo_pendiente == 0){
	//	$interes_muerto_guarda = 0;
	//}
	//else{
	//	$interes_muerto_guarda = $interes_muerto;
	//}
	
	
	
	
	//if($saldo_pendiente < 0){
	//	echo "<script>alert('Revise valores!');</script>";
	//	exit();
	//}
	
	
	
	
	
	
	
	
		
	$update = mysql_query("UPDATE credito_rotativo SET cedula = '".$_POST["cedula"]."', apellidos = '".$_POST["apellidos"]."', nombres = '".$_POST["nombres"]."', grado = '".$_POST["grado"]."', direccion = '".$_POST["direccion"]."', telefono = '".$_POST["telefono"]."', celular = '".$_POST["celular"]."', ciudad = '".$_POST["ciudad"]."', email = '".$_POST["email"]."', cuenta = '".$_POST["cuenta"]."', banco = '".$_POST["banco"]."', fecha_reporte_nomina = '".$_POST["fecha_reporte_nomina"]."', pagaduria = '".$_POST["pagaduria"]."', 
	
	nombre_padre = '".$_POST["nom_padre"]."', telefono_padres = '".$_POST["tel_padres"]."', celular_padres = '".$_POST["cel_padres"]."', referencia_compa = '".$_POST["ref_compa"]."', celular_compa = '".$_POST["cel_compa"]."',
	
	fecha_anticipo0 = '".$_POST["fecha_anticipo0"]."', valor_anticipo0 = '".$_POST["valor_anticipo0"]."',  monto_solicitado = '".$_POST["monto_solicitado"]."', anticipo = '".$tieneanticipo."', permanencia = '".$_POST["permanencia"]."', valor_cuotas = '".$_POST["valor_cuotas"]."', asesor_comercial = '".$asesor_comercial_guarda."', proveedor_inicial = '".$proveedor_inicial_guarda."', valor_total_capital = '".$_POST["monto_solicitado"]."',
	
	promocion = '".$promocion."', unidad_origen = '".$unidad_origen."',
	
	
	fecha_anticipo = '".$_POST["fecha_primer_anticipo"]."', valor_anticipo = '".$_POST["valor_anticipo1"]."', saldo_pendiente = '".$_POST["saldo_pendiente"]."', fecha_corte_temporal = '".$_POST["fecha_corte_temporal"]."', interes_muerto = '".$_POST["interes_muerto"]."', cuenta_verificada = '".$_POST["cuenta_verificada"]."', planilla0 = '".$_POST["planilla0"]."'
	
	WHERE cedula = '".$_GET["ced2"]."' AND libranza_credito = '".$_GET["cred"]."' ");
		
	if (!$update) {
		die('Invalid query actualiza: ' . mysql_error());
	}
    
    
    
    
    $nombre_completo = $_POST["apellidos"]." ".$_POST["nombres"];
    
    $update2 = mysql_query("UPDATE credito_rotativo_inter SET cedula = '".$_POST["cedula"]."', nombre = '".$nombre_completo."', grado = '".$_POST["grado"]."', direccion = '".$_POST["direccion"]."', telefono = '".$_POST["telefono"]."', celular = '".$_POST["celular"]."', ciudad = '".$_POST["ciudad"]."', email = '".$_POST["email"]."', cuenta_ahorros = '".$_POST["cuenta"]."', banco = '".$_POST["banco"]."', 
	
	WHERE cedula = '".$_GET["ced2"]."' AND credito_libranza = '".$_GET["cred"]."' ");
		
	if (!$update2) {
		die('Invalid query actualiza: ' . mysql_error());
	}
		
		
	echo "<script>alert('Datos Guardados');</script>";
	echo "<script languaje='javascript'>window.close();</script>";
	//echo "<script languaje='javascript' type='text/javascript'>window.location.href = 'menu_creditos_asistente.php';</script>";
}

?>