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/ingresar_creditos_sol.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;

function Conectarse()
	{
	   if (!($link=@mysql_connect("localhost","asjudine","as2006")))
	   {
		  echo "Error conectando con el servidor.";
		  exit();
	   }
	   $dbname = "asjudinet";
	   if (!@mysql_select_db($dbname,$link))
	   {
		  echo "Error seleccionando la base de datos.";
		  exit();
	   }
	   return $link;
	}
	Conectarse();	
	
$interes2=0.03;
$interes=0.04;
$temp1=0;
$val_mensual=0;
$temp2=0;
$val_neto=0;
$num_dias=0;
$cap_end=0;
$int_ded=0;
$salario_min=480000;
$vmt=0;


/*	$sqlnoms = "select cedula, ced_ciudad, nombre, direccion, ciudad, telefono, celular, email, devengado, descuentos, neto, unidad, monto_solicitado, numero_cuenta, banco, codigo_asesor, codigo_militar, grado, codigo_sucursal, numero_libranza, cuotas_credito, con_valor_mensual, con_valor_total, fecha_nac from solicitud_credito where cedula = '$ced2'";
		$controls = mysql_query($sqlnoms, $dbi) or die(mysql_error());	*/ 
		
$resul = mysql_query('SELECT cedula, ced_ciudad, nombre, direccion, ciudad, telefono, celular, email, devengado, descuentos, neto, unidad, monto_solicitado, numero_cuenta, banco, codigo_asesor, codigo_militar, grado, codigo_sucursal, numero_libranza, cuotas_credito, con_valor_mensual, con_valor_total, fecha_nac FROM solicitud_credito WHERE cedula = "' . $HTTP_GET_VARS["ced2"] . '" ');

			if (!$resul) {
				die('Invalid query: ' . mysql_error());
			}
		list($cc, $ced_ciudad, $ape, $dir, $ciu, $tel, $cel, $em, $deven, $desc, $sala, $uni, $mon, $cuent, $banc, $codigo_asesor, $cod, $grad, $cod_suc, $num_lib, $num_cuotas2, $vmt, $val_ment, $fecna) = mysql_fetch_row($resul);
				
$resd = mysql_query('SELECT grado FROM solicitud_credito WHERE cedula = "' ."$cc". '" ');
		if (!$resd) {
				die('Invalid query: ' . mysql_error());
		}	 
		list( $gre) = mysql_fetch_row($resd);
/*		$sqlnoms3 = "select nombre from sucursal where codigo = '$cod_suc'";
		$controls3 = mysql_query($sqlnoms3, $dbi) or die(mysql_error());*/	
$controls3 = mysql_query('SELECT  *  FROM sucursal WHERE codigo = "' ."$cod_suc". '" ');
			if (!$controls3) {
				die('Invalid query: ' . mysql_error());
			} 
		list($codid, $nombre_sucursal, $direc, $celu, $tio) = mysql_fetch_row($controls3);
		
	
			$temp1 = (($mon * $interes) * $num_cuotas2);
			$templ = (int) $temp1;
			$val_mensual = (($mon + $temp1)/ $num_cuotas2);
			$val_mensual = (int) $val_mensual;
			

if(isset($_POST["guardar"]))
{
        	if($cedula!='')
			{
			
			//$mssql9 = mysql_query("select * from creditos where cedula = '$cedula'",$dbi);
		$resulte = mysql_query('SELECT  *  FROM creditos WHERE cedula = "' . $_POST[cedula] . '" ');
			if (!$resulte) {
				die('Invalid query: ' . mysql_error());
			} 
	    	$num=mysql_num_rows($resulte); 
			if($num==0)
			{
			 //operaciones para hallar el valor mensual 
			$temp1 = (($mon * $interes) * $num_cuotas2);
			$templ = (int) $temp1;
			$val_mensual = (($mon + $temp1)/ $num_cuotas2);
			$val_mensual = (int) $val_mensual;
			
			
			//calcular el numero de dias
			
			$sql8 ="SELECT DATEDIFF('$fecha','$fecha_inicio') dias"; 
			$result=mysql_query($sql8);  
			$num2=mysql_num_rows($result);  
			$data = mysql_fetch_row($result);
			$num_dias = abs($data['dias']); 

		
		
			//operaciones para hallar valor neto a consignar
			
			$temp2 = (($monto_sol*$interes2)/30);//interes deducible	
			$temp2 = (int) $temp2;
		 	$val_neto = ($monto_sol-($temp2*$num_dias));
			$val_neto = (int) $val_neto;
			
			
			//hallar el interes deducible
			
			$int_ded = $temp2*$num_dias;
			$int_ded = (int) $int_ded;
			 //hallar capacidad de endeudamiento
			
			$cap_end = $salario-$salario_min;
			$cap_end = (int) $cap_end;
			
			//hallar descuento mensual total
			$vmt = $val_mensual + $val_jur;
			$vmt = (int) $vmt;
			
			//calcula mes termino y año termino
			   $mt = floor(($mi + $num_cuotas)/12);
			   $mt = (int) $mt;
				
				$submt = (($mi + $num_cuotas)%12)-1;
				$submt = (int) $submt;
				
				$at = $mt + $ai;
				$at = (int) $at;
				if($submt==0)
				{
					$submt = 12;
					$at = $at-1;
				}
				if($submt=='-1')
				{
					$submt = 11;
					$at = $at-1;
				}
			  
			 //guarda procesos
	        
mysql_query("INSERT INTO creditos(ciudad, fecha, nombres, cedula, codigo, grado,  direccion_envio, ciudad_envio, telefono, celular, email, monto_solicitado, salario, numero_cuotas, valor_mensual,  cuenta_ahorros,  banco_cuenta, valor_jur, neto_consignar, interes_deducible, inicio_pagos, numero_libranza, tipo_credito, mes_inicio, ano_inicio, mes_termino, ano_termino, empresa, proveedor) VALUES ('" . $_POST["ciudad"]  . "','" . $_POST["fecha"]  . "','" . $_POST["apellidos"]  . "','" . $_POST["cedula"]  . "','" . $_POST["codigo"]  . "','" . $_POST["grado"]  . "','" . $_POST["direccion_envio"]  . "','" . $_POST["ciudad_envio"]  . "','" . $_POST["telefono"]  . "','" . $_POST["celular"]  . "','" . $_POST["email"]  . "','" . $_POST["monto_sol"]  . "','" . $_POST["salario"]  . "','" . $_POST["num_cuotas"]  . "','" . $_POST["val_mensual"]  . "','" . $_POST["cuenta_aho"]  . "','" . $_POST["banco_cuenta"]  . "','" . $_POST["val_jur"]  . "','$val_neto','$int_ded','" . $_POST["fecha_inicio"]  . "','" . $_POST["numero_libranza"]  . "','N','" . $_POST["mi"]  . "','" . $_POST["ai"]  . "','$submt','$at','" . $_POST["emp"]  . "','" . $_POST["proved"]  . "')");
	
			//$sqlnom6 = "select cod_desc from empresas where codigo = '$emp'";
     		//$control6 = mysql_query($sqlnom6, $dbi) or die(mysql_error());
$resu = mysql_query('SELECT cod_desc  FROM empresas WHERE codigo = "' . $_POST[emp] . '" ');
			if (!$resu) {
				die('Invalid query: ' . mysql_error());
			}	 
    		list($codemp) = mysql_fetch_row($resu);
			
mysql_query("INSERT INTO reporte_mindefensa(cedula, codigo, nombre, grado, cod_desc, libranza, fecha_libranza, tipo_doc, valor_descuento, cuotas, pagaduria, mes_inicio, ano_inicio, mes_termino, ano_termino, proveedor) VALUES ('" . $_POST["cedula"]  . "','" . $_POST["codigo"]  . "','" . $_POST["apellidos"]  . "','" . $_POST["grado"]  . "','" . $_POST["codemp"]  . "','" . $_POST["numero_libranza"]  . "','" . $_POST["fecha"]  . "','LIB','" . $_POST["val_mensual"]  . "','" . $_POST["num_cuotas"]  . "','" . $_POST["emp"]  . "','" . $_POST["mi"]  . "','" . $_POST["ai"]  . "','$submt','$at','COOMANUFACTURAS')"); 
			  
				 //('$cedula', '$codigo', '$apellidos', '$grado', '$codemp', '$numero_libranza', '$fecha','LIB', '$val_mensual','$num_cuotas', '$emp', '$mi', '$ai','$submt', '$at', 'COOMANUFACTURAS')";
         
			
			$salant=$num_cuotas*$val_mensual;
			$salant = (int) $salant;
			
			 mysql_query("INSERT INTO estado_contable(codigo, saldo_ant, cuotas_pend, nuevo_saldo, cuotas_desc, fecha_udesc, tipo_pago) VALUES ('" . $_POST["cedula"]  . "','$salant','" . $_POST["num_cuotas"]  . "','$salant','0','','CRE')"); 		
            
			//$mssqlsol = "update solicitud_credito set estado='2' where cedula = '$cedula' ";
			//mysql_query($mssqlsol, $dbi) or die(mysql_error()); 	 
            
			$mssqlsol  = mysql_query("UPDATE solicitud_credito set estado = '2' WHERE cedula = '" . $_POST[cedula] . "' ");
			if (! $mssqlsol ) {
				die('Invalid query: ' . mysql_error());
			}
              
	  
/*		 $sqlnom3 = "select ciudad, nombres, cedula, codigo, grado, direccion_envio, ciudad_envio, telefono, celular, email, monto_solicitado, salario, valor_mensual ,cuenta_ahorros, banco_cuenta, valor_jur, neto_consignar, inicio_pagos, numero_libranza from creditos where cedula = '$cedula'";
		 $control3 = mysql_query($sqlnom3, $dbi) or die(mysql_error());	 */
		 
$resu2 = mysql_query('SELECT ciudad, nombres, cedula, codigo, grado, direccion_envio, ciudad_envio, telefono, celular, email, monto_solicitado, salario, valor_mensual ,cuenta_ahorros, banco_cuenta, valor_jur, neto_consignar, inicio_pagos, numero_libranza FROM creditos WHERE cedula = "' ."$cedula". '" ');
			if (!$resu2) {
				die('Invalid query: ' . mysql_error());
			}	
				 list($ciu,  $ape, $cc, $cod, $grad, $dir, $ciu, $tel, $cel, $em, $mon, $sala, $val_mensual, $cuent, $banc, $vj, $consig, $inicio_pag, $num_lib) = mysql_fetch_row($resu2);
		 

		// $sqlnom5 = "select devengado, descuento, neto, unidad from datos_credito where cedula = '$codigo'";
     	//$control5 = mysql_query($sqlnom5, $dbi) or die(mysql_error());
		$resu5 = mysql_query('SELECT devengado, descuento, neto, unidad FROM datos_credito WHERE cedula = "' . $_POST[codigo] . '" ');
			if (!$resu5) {
				die('Invalid query: ' . mysql_error());
			}		 
    	list($deven, $desc, $sala, $uni) = mysql_fetch_row($resu5);
		
	//$sqlnom7 = "select tipo_solicitud from solicitud_credito where cedula = '$cedula'";
	//$control7 = mysql_query($sqlnom7, $dbi) or die(mysql_error());	
		$resu7 = mysql_query('SELECT tipo_solicitud FROM solicitud_credito WHERE cedula = "' . $_POST[cedula] . '" ');
			if (!$resu7) {
				die('Invalid query: ' . mysql_error());
			} 
		list($tip_sol) = mysql_fetch_row($resu7);
		if($tip_sol==1)
		{
			echo "<SCRIPT LANGUAGE='javascript'>window.location.href='info_serviasjudinet_sol.php?ced2=$cedula'</SCRIPT>";
		}
		if($tip_sol==2)
		{
			$mssqlsol2 = 'UPDATE solicitud_credito set estado="3"  WHERE cedula = "' . $_POST[cedula] . '"';
			if (! $mssqlsol2) {
				die('Invalid query: ' . mysql_error());
			}
			
		//$mssqlsol2 = "update solicitud_credito set estado='3' where cedula = '$cedula' ";
		//mysql_query($mssqlsol2, $dbi) or die(mysql_error());
		}
			echo "<script>alert('Los datos fueron grabados correctamente');</script>";	
		}else{

				echo "<script>alert('Tiene un credito vigente');</script>";
			 }	
	}else{
			echo "<script>alert('Debe ingresar numero de cedula, para continuar');</script>";
	}
}

	
//$query_sql = "SELECT * FROM empresas order by nombre";
//$sql = mysql_query($query_sql, $dbi) or die(mysql_error());
$sql = mysql_query('SELECT * FROM empresas order by nombre ');
			if (!$sql) {
				die('Invalid query: ' . mysql_error());
			}	
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql); 

//$query_sql2 = "SELECT * FROM proveedores order by nombre";
//$sql2 = mysql_query($query_sql2, $dbi) or die(mysql_error());
$sql2 = mysql_query('SELECT * FROM proveedores order by nombre ');
			if (!$sql2) {
				die('Invalid query: ' . mysql_error());
			}
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2); 

//$query_sql8 = "SELECT * FROM sucursal order by nombre";
//$sql8 = mysql_query($query_sql8, $dbi) or die(mysql_error());
$sql8 = mysql_query('SELECT * FROM sucursal order by nombre ');
			if (!$sql8) {
				die('Invalid query: ' . mysql_error());
			}
$row_sql8 = mysql_fetch_assoc($sql8);
$totalRows_sql8 = mysql_num_rows($sql8); 		

?>
<html>
<head>
<title>INGRESAR CREDITOS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
<!--
.titulos {font: 16px; color: red; font-family:Arial; font-weight:bold}
.boton {  background-color: #FFCCCC; color:#FFFFFF; width:150px; border: 4px solid #0000CC; font-family:Arial; color:#990000;}
.texto {background-color: #CCFFCC; font-size: 13px; font-family: Arial; color:#0000CC; display: block;}
.fecha {background-color: #CCFFCC; font-size: 12px; font-family: Arial; color: #000099; width:10px display: block;}
.campo {background-color: #FFFFCC; border:1px solid #990000; font-family:Arial;  font-size:11px; height: inherit}
.lista { background-color:#99FFFF; font-family: Arial; font-size: 11px;	color: #990000;}
.label {background-color: #00CCFF ; font-size: 14px; font-family: Arial; color:#0000CC; display: block;}
.area {background-color: #CCFFCC; font-size: 13px; width:40px font-family: Arial; color:#0000CC; display: block;}
.variables {background-color: #CCFFCC; font-size: 12px; font-family: Arial; color: #003333 ; width:10px display: block; border: 2px solid #006633;}
.sel { background-color:#DDFFFF; width:400px; border: 1px solid #0099FF; font-family:Arial; font-style:italic; color:#990000 }
.sel2{ background-color:#DDFFFF; border: 1px solid #0099FF; font-family:Arial; font-style:italic; font-weight:bold; color:#990000 }
.seleccion { background-color: #CCFFCC; width:340px; border: 1px solid #0099FF; font-family:Arial; color:#990000;}
.boton2 {font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid; }
.letras {background-color: #99CCFF; font-size: 10px; font-family: Arial; color:#0000CC; display: block;}
.campo2 {background-color: #99CCCC; border:1px solid #0066FF; font-family:Arial; font-size:10px; height: inherit}
.sel3{ background-color:#DDFFFF; font-family:Arial; font-size:10px; color: #000066 }
body {
	background-image: url(fondo_argollado.gif);
}
.Estilo11 {
	font-size: 16px;
	font-weight: bold;
	color: #3333FF;
}
.Estilo12 {font-size: 24px}
.Estilo14 {background-color: #CCFFCC; font-size: 13px; font-family: Arial; color: #0000CC; display: block; font-weight: bold; }
.Estilo50 {color: #CC3333;
	font-family: "Arial Narrow";
	font-weight: bold;
}
.campo1 {background-color:#FFFFAA; width: 100px; border:2px solid #990000;}
.Estilo2 {
	font-family: Arial;
	font-size: 16px;
	color: #990000;
	font-weight: bold;
	font-style: italic;
}
.boton1 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
-->
</style>

<SCRIPT LANGUAGE="JavaScript">
function valida_envia(){
    //valido el nombre
    if (document.formulario.apellidos.value.length==0){
       alert("Tiene que escribir su nombre")
       document.formulario.apellidos.focus()
       return 0;
    } 
</SCRIPT>

<script languaje="JavaScript">
function Mostrar_Fecha()
{
         var mydate=new Date()
         var year=mydate.getYear()
         if (year < 1000)
                 year+=1900
                 var day=mydate.getDay()
                 var month=mydate.getMonth()
                 var daym=mydate.getDate()
                 if (daym<10)
                    daym="0"+daym
                    var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
                    var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
                    document.write("<b><font face='Arial, Helvetica, sans-serif'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></b>")
}					
</script>
<script Language="JavaScript">
<!--
function validar()
{

  if (formulario.folio2.value == "")
  {
    alert("Falta ingresar el Folio2");
    formulario.folio2.focus();
    return (false);
  }   

	if(formulario.folio2.value < pf)
	{	 
     	   alert('El folio2 no debe ser menor que el folio1');
           formulario.folio2.focus();
           return (false);	
	}	

  if (formulario.actuacion.value == "")
  {
    alert("Falta ingresar la actuación");
    formulario.actuacion.focus();
    return (false);
  }

  if (formulario.codigo_funcionario.value == "")
  {
    alert("Falta seleccionar el nombre del funcionario");
    formulario.codigo_funcionario.focus();
    return (false);
  }

return (true);
}
//--></script>

<SCRIPT LANGUAGE='JavaScript'>
var default1 = "INGRESO DE CREDITOS"; // only shown once at page load
var text1 = "El primer encabezado muestra en detalle los datos del proceso seleccionado";
var text2 = "la segunda parte muestra el formulario para el ingreso de revistas";
var text3 = "No se le olvide tener en cuenta el número del folio que se entrega en el juzgado";
var changeRate = 3000; // 1000 = 1 second
var messageNumber = 0;

function changeStatus()
{
  if (messageNumber == 0) {
     window.status=default1;
     document.title=default1;
    }
  else if (messageNumber == 1) {
     window.status=text1;
    }
  else if (messageNumber == 2) {
     window.status=text2;
     }
  else if (messageNumber == 3) {
     window.status=text3;
     messageNumber = 0;
     }
  messageNumber++;
  setTimeout("changeStatus();",changeRate);
}
changeStatus(); // leave here to run right away
// -->
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="document.formulario.folio1.focus()">
<form name="formulario" action="" method="post" onSubmit="return validar(this)">
<table width="752" height="398" border="0" align="center" cellpadding="2" cellspacing="2">
  <tr bgcolor="#FFFFCC">
    <td width="666" class="titulos"><div align="center" class="Estilo12"><img src="ELEMENTOS/cabezote_servi_2.jpg" width="772" height="103"></div></td>
  </tr>
  <tr bgcolor="#FFFFCC">
    <td width="666" class="titulos"><div align="center" class="Estilo12">INGRESO CREDITOS EXTRA RAPIDO </div></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td height="8" class="fecha"><div align="center">
      <p>
        <script languaje="JavaScript">Mostrar_Fecha()</script>
        <span class="Estilo11">SOLICITUD DE CREDITO </span></p>
      <p>&nbsp;</p>
      </div></td>
  </tr>
  <tr bgcolor="#FFCC99">
    <td height="260" bgcolor="#FFFFFF"><fieldset>
   <legend><span class="Estilo14">Datos del cliente:</span></legend>
   <table width="744" height="219" border="0" align="center" cellpadding="0" cellspacing="1">
     <tr bgcolor="#FFFFFF">
       <td width="147"><div align="center"><span class="label">Sucursal:</span></div></td>
       <td><label>
       <input name="ciudad" type="text" class="campo" id="ciudad" value="<?php echo $nombre_sucursal ?>" size="35" maxlength="35">
       </label></td>
       <td width="95"><div align="center"><span class="label">Fecha:</span></div></td>
       <td width="230"><input name="fecha" type="text" class="campo" id="fecha" value="<?php echo date ( "Y-n-j" ) ?>" size="15" maxlength="10" readonly=""> </td>
       </tr>
     <tr bgcolor="#FFFFFF">
       <td><div align="center"><span class="label">Apellidos y Nombres:</span></div></td>
       <td colspan="3"><input name="apellidos" type="text" class="campo" id="apellidos" value="<?php echo $ape ?>" size="50" maxlength="50" > </td>
	   </tr>
	   
	   
	   	   
	   
     <tr bgcolor="#FFFFFF">
       <td><div align="center"><span class="label">C.C No :</span></div></td>
       <td><input name="cedula" type="text" class="campo" id="cedula" value="<?php echo $cc ?>" size="25" maxlength="25" readonly="" ></td>
       <td><div align="center"><span class="label">Codigo:</span></div></td>
       <td><input name="codigo" type="text" class="campo" id="codigo" value="<?php echo $cod ?>" size="25" maxlength="25" readonly=""></td>
     </tr>
     <tr bgcolor="#FFFFFF">
       <td><div align="center"><span class="label">Grado:</span></div></td>
       <td><input name="grado" type="text" class="campo" id="grado" value="<?php echo $gre ?>" size="35" maxlength="35"></td>
	   <td><div align="center"></div></td>
       <td colspan="3">&nbsp;</td>
     </tr>
     <tr bgcolor="#FFFFFF">
       <td><div align="center"><span class="label">Direccion  envio de documentos  :</span></div></td>
       <td><input name="direccion_envio" type="text" class="campo" id="despacho_judicial4" value="<?php echo $dir ?>" size="50" maxlength="60"></td>
       <td><div align="center"><span class="label">Ciudad:</span></div></td>
       <td><input name="ciudad_envio" type="text" class="campo" id="ciudad_envio" value="<?php echo $ciu ?>" size="35" maxlength="35" ></td>
     </tr>
     <tr bgcolor="#FFFFFF">
       <td><div align="center"><span class="label">Telefono:</span></div></td>
       <td><input name="telefono" type="text" class="campo" id="telefono" value="<?php echo $tel ?>" size="35" maxlength="35"></td>
       <td><div align="center"><span class="label">Celular:</span></div></td>
       <td><input name="celular" type="text" class="campo" id="celular" value="<?php echo $cel ?>" size="35" maxlength="35"></td>
     </tr>
     <tr bgcolor="#FFFFFF">
       <td><div align="center"><span class="label">Email:</span></div></td>
       <td><input name="email" type="text" class="campo" id="email" value="<?php echo $em ?>" size="35" maxlength="35"></td>
       <td><div align="center"><span class="label">Unidad:</span></div></td>
       <td><input name="unidad" type="text" class="campo" id="unidad" value="<?php echo $uni ?>" size="50" maxlength="50" readonly=""></td>
     </tr>
   </table> 
   </fieldset></td>
   <table width="882" height="219" border="0" align="center" cellpadding="2" cellspacing="2">
  
  
  <tr bgcolor="#FFCC99">
    <td width="874" height="215" bgcolor="#FFFFFF"><fieldset>
   <legend><span class="Estilo14">Datos del credito:</span></legend>
   <table width="869" height="263" border="0" align="center" cellpadding="0" cellspacing="1">
     <tr bgcolor="#FFFFFF">
       <td height="33" colspan="2"><div align="center"><span class="label">Monto Solicitado $ :</span></div></td>
       <td colspan="2"><input name="monto_sol" type="text" class="campo" id="monto_sol" value="<?php echo $mon ?>" size="35" maxlength="35" ></td>
       <td width="187"><div align="center"><span class="label">Total Devengado   $:</span></div></td>
       <td width="289"><input name="devengado" type="text" class="campo" id="devengado" value="<?php echo $deven ?>" size="35" maxlength="35" readonly=""></td>
       </tr>
     <tr bgcolor="#FFFFFF">
       <td height="23" colspan="2"><div align="center"><span class="label">Numero de Cuotas :</span></div></td>
       <td colspan="2"><input name="num_cuotas" type="text" class="campo2" id="num_cuotas" value="<?php echo $num_cuotas2 ?>" size="5" maxlength="3" ></td>
	   <td><div align="center"><span class="label">Total Descuento $:</span></div></td>
	   <td width="289"><input name="descuento" type="text" class="campo" id="descuento" value="<?php echo $desc ?>" size="35" maxlength="35" readonly=""></td>
     </tr>
	   
     <tr bgcolor="#FFFFFF">
       <td height="31" colspan="2"><div align="center"><span class="label">Valor Mensual $ :</span></div></td>
       <td colspan="2"><input name="val_mensual" type="text" class="campo" id="val_mensual" value="<?php echo $val_mensual ?>" size="35" maxlength="35" readonly=""></td>
       <td><div align="center"><span class="label">Salario Neto  $:</span></div></td>
       <td><input name="salario" type="text" class="campo" id="salario" value="<?php echo $sala ?>" size="35" maxlength="35" readonly=""></td>
     </tr>
     <tr bgcolor="#FFFFFF">
       <td height="31" colspan="2"><div align="center"><span class="label">Neto a Consignar  $   :</span></div></td>
       <td colspan="2"><input name="val_neto" type="text" class="campo" id="val_neto" value="<?php echo $consig ?>" size="35" maxlength="35" readonly=""></td>
       <td><div align="center"><span class="label">Capacidad Endeudamiento   $:</span></div></td>
       <td><input name="capacidad" type="text" class="campo" id="capacidad" value="<?php echo $cap_end ?>" size="35" maxlength="35" readonly=""></td>
     </tr>
     <tr bgcolor="#FFFFFF">
       <td height="27" colspan="2"><div align="center"><span class="label">Primer Descuento   $  :</span></div></td>
       <td colspan="2"><input name="fecha_inicio" type="text" class="campo" id="fecha_inicio" value="0000-00-00" size="13" maxlength="10" >
         -
           <input name="fec_ini" type="text" class="campo2" id="fec_ini" value="<?php echo $inicio_pag ?>" size="15" maxlength="10"  readonly=""></td>
       <td><div align="center"><span class="Estilo14">Valor Mensual Juridica    $:</span></div></td>
       <td><input name="val_jur" type="text" class="campo" id="val_jur" value="<?php echo $vj ?>" size="35" maxlength="35"></td>
     </tr>
     <tr bgcolor="#FFFFFF">
       <td height="27" colspan="2"><div align="center"><span class="label">Dias Pendientes   :</span></div></td>
       <td colspan="2"><input name="diasno" type="text" class="campo2" id="diasno" value="<?php echo $num_dias ?>" size="5" maxlength="3" readonly=""></td>
       <td><div align="center"><span class="Estilo14">Valor Mensual TOTAL    $:</span></div></td>
       <td><input name="val_men_tot" type="text" class="campo" id="val_men_tot" value="<?php echo $vmt ?>" size="35" maxlength="35" readonly=""></td>
     </tr>
     <tr bgcolor="#FFFFFF">
       <td height="27" colspan="2"><div align="center"><span class="label">Numero Libranza    :</span></div></td>
       <td colspan="2"><input name="numero_libranza" type="text" class="campo" id="numero_libranza" value="<?php echo $num_lib ?>" size="35" maxlength="35" ></td>
       <td><div align="center"><span class="label">Cuenta ahorros No :</span></div></td>
       <td><input name="cuenta_aho" type="text" class="campo" id="cuenta_aho" value="<?php echo $cuent ?>" size="35" maxlength="35"></td>
     </tr>
     
     <tr bgcolor="#FFFFFF">
       <td width="83" height="27"><div align="center">
         <div align="center"><span class="label">Mes inicio :</span></div>
       </div></td>
       <td width="81"><input name="mi" type="text" class="campo" id="mi" value="<?php echo $mesi ?>" size="2" maxlength="2" ></td>
       <td width="89"><div align="center"><span class="label">A&ntilde;o Inicio :</span></div></td>
       <td width="133"><input name="ai" type="text" class="campo" id="ai" value="<?php echo $añoi ?>" size="4" maxlength="4" ></td>
       <td><div align="center"><span class="label">Banco :</span></div></td>
       <td><input name="banco_cuenta" type="text" class="campo" id="banco_cuenta" value="<?php echo $banc ?>" size="35" maxlength="35" ></td>
     </tr>
     <tr bgcolor="#FFFFFF">
       <td height="27" colspan="2"><div align="center"><span class="label">Proveedor    :</span></div></td>
       <td colspan="2"><select name="proved" id="proved">
         <option value="">--SELECCIONE PROVEEDOR--</option>
         <?php
     do {  
?>
         <option value="<?php echo $row_sql2['codigo'];?>"><?php echo $row_sql2['nombre']?></option>
         <?php
} while ($row_sql2 = mysql_fetch_assoc($sql2));
  $rows2 = mysql_num_rows($sql);
  if($rows2 > 0) {
      mysql_data_seek($sql2, 0);
       $row_sql2 = mysql_fetch_assoc($sql2);
  }
?>
       </select></td>
       <td><div align="center"><span class="label">Empresa :</span></div></td>
       <td><select name="emp" id="emp">
         <option value="">--SELECCIONE LA EMPRESA--</option>
         <?php
     do {  
?>
         <option value="<?php echo $row_sql['codigo'];?>"><?php echo $row_sql['nombre']?></option>
         <?php
} while ($row_sql = mysql_fetch_assoc($sql));
  $rows = mysql_num_rows($sql);
  if($rows > 0) {
      mysql_data_seek($sql, 0);
       $row_sql = mysql_fetch_assoc($sql);
  }
?>
       </select></td>
     </tr>
   </table> 
   </fieldset></td>
  </tr>
</table>
<p align="center">
  <input name = "guardar" type="submit" class="boton2" onClick= "valida_envia();" value="Guardar datos">
</p>
<p align="center">&nbsp;</p>
</form>
</body>
</html>