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/liquidacion_credito.php
<?php

	require_once("mainfile.php");
    include ("config.php");
    global $dbi;


$interes=0.04;
$temp1=0;
$val_mensual=0;
$cap_end=0;
$salario_min=433800;

require_once("Conectarse.php");

if(isset($_POST["consultar"]))
{
 //$mssql = mysql_query("select cedula from datos_credito where cedula = '$cedula'",$dbi);
  $result = mysql_query('SELECT cedula FROM datos_credito WHERE cedula = "' . $_POST[cedula] . '"  ');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}
	    $num=mysql_num_rows($result); 
		if($num!=0)
		{
		/*$sqlnom2 = "select cedula, grado, nombre, devengado, descuento, neto, unidad from datos_credito where cedula = '$cedula'";
     		$control2 = mysql_query($sqlnom2, $dbi) or die(mysql_error());	*/ 
 $resul = mysql_query('SELECT cedula, grado, nombre, devengado, descuento, neto, unidad FROM datos_credito WHERE cedula = "' . $_POST[cedula] . '"  ');
			if (!$resul) {
				die('Invalid query: ' . mysql_error());
			}
    	list($cod, $gra, $ape, $deven, $desc, $sala, $uni ) = mysql_fetch_row($resul);
			 
			 //operaciones para hallar el valor mensual 
			 
        	$temp1 = (($monto*$interes)*$num_cuotas);
			$val_mensual = (($monto+$temp1)/$num_cuotas);
			
			 //hallar capacidad de endeudamiento
			
			$cap_end = $sala-$salario_min;
			
			if($cap_end<$val_mensual)
			{
				$cap_end = 'INSUFICIENTE';
				$val_mensual = ' ';
			
			}
			
			
		}else{
			$negado = 'SI';
		}
}
?>
<html>
<head>
<title>Liquidacion Creditos- Directores de Servicio</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:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.texto {background-color: #CCFFCC; font-size: 11px; font-family: Arial; color:#0000CC; display: block;}
.fecha {font-size: 12px; font-family: Arial; color:#990000; display: block; }
.campo {background-color:#FFFFAA; width: 100px; border:2px solid #990000;}
.lista {font-family: Arial; font-size: 11px;	color: #990000;}
.boton2 {font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid; width:70px; height:22px;}
body {
	background-image: url();
}
.Estilo50 {color: #CC3333;
	font-family: "Arial Narrow";
	font-weight: bold;
}
.Estilo52 {
	font-family: Arial;
	font-size: 16px;
	color: #339933;
	font-weight: bold;
}
.Estilo55 {
	font-family: Arial;
	font-size: 16px;
	color: #0066FF;
	font-weight: bold;
}
.Estilo58 {background-color: #CCFFCC; font-size: 11px; font-family: Arial; color: #003399; display: block; }
.campo8 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: bold;
	text-decoration: blink;
	background-color: #AEF4D1;
	padding: 3px;
	height: 25px;
	width: 200px;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	border-top-color: #996699;
	border-right-color: #996699;
	border-bottom-color: #996699;
	border-left-color: #996699;
}
.Estilo59 {font-size: 18px}
-->
</style>

</head>
<body onLoad="document.formulario.cedula.focus()" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="formulario" action="" method="post">
<table width="671" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td><fieldset><table width="669" border="0" align="center" cellpadding="2" cellspacing="2">
  <tr bgcolor="#FFFFCC">
    <td colspan="2" class="titulos"><div align="center" class="Estilo59">LIQUIDACION CREDITO </div></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td height="22" colspan="2" class="fecha"><div align="center">
      <script languaje="JavaScript">Mostrar_Fecha()</script>
    </div></td>
  </tr>
  <tr bgcolor="#FFCC99">
    <td height="42" colspan="2"><fieldset>
   <legend><span class="Estilo58">Ingrese n&uacute;mero de identificaci&oacute;n o codigo:</span></legend>
   <table width="509" border="0" cellspacing="0" cellpadding="0">
     <tr>
       <td>&nbsp;</td>
       <td>&nbsp;</td>
     </tr>
     <tr>
       <td width="255"><span class="Estilo55">C&eacute;dula o Codigo:</span> </td>
       <td width="287"><input name="cedula" type="text" class="campo" id="cedula" value="" size="15" maxlength="15"></td>
     </tr>
   </table>
    <span class="Estilo58">Ingrese Monto Solicitado:</span>
    </fieldset></td></tr>
  <tr bgcolor="#FFCC99">
    <td height="42" colspan="2"><table width="509" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="255"><span class="Estilo55">Monto Solicitado $ :</span> </td>
        <td width="287"><input name="monto" type="text" class="campo" id="monto" size="15" maxlength="15"></td>
      </tr>
    </table>
      <span class="Estilo58"> Seleccione Numero de Cuotas :</span></td>
  </tr>
  <tr bgcolor="#FFCC99">
    <td height="42" colspan="2"><table width="509" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="255"><span class="Estilo55">Numero Cuotas:</span> </td>
        <td width="287"><select name="num_cuotas" id="num_cuotas">
            <option value="6" selected>6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
            <option value="11">11</option>
			<option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
            <option value="15">15</option>
            <option value="16">16</option>
            <option value="17">17</option>
            <option value="18">18</option>
            <option value="19">19</option>
            <option value="20">20</option>
            <option value="21">21</option>
            <option value="22">22</option>
            <option value="23">23</option>
            <option value="24">24</option>
            <option value="25">25</option>
            <option value="26">26</option>
            <option value="27">27</option>
            <option value="28">28</option>
            <option value="29">29</option>
            <option value="30">30</option>
            <option value="31">31</option>
            <option value="32">32</option>
            <option value="33">33</option>
            <option value="34">34</option>
            <option value="35">35</option>
            <option value="36">36</option>
        </select></td>
      </tr>
    </table></td>
  </tr>
  
  <tr bgcolor="#33CCCC">
    <td colspan="2"><div align="center">
      <input name="menu2" type="button" class="Estilo50" id="menu2" onClick="javascript:history.back(1)" value="IR AL MENU">
    </div></td>
  </tr>
  <tr bgcolor="#66CC99">
    <td colspan="2"><div align="center">
      <input name="consultar" id="consultar" type="submit" class="boton" value="Consultar">
    </div></td>
  </tr>
  <tr bgcolor="#CCCCCC">
    <td><div align="center"><span class="Estilo52">Valor Mensual $ :</span></div></td>
    <td><input name="textfield" type="text" class="campo8" value="<?php echo $val_mensual ?>" size="15" maxlength="15" readonly = ""></td>
  </tr>
  <tr bgcolor="#CCCCCC">
    <td><div align="center"><span class="Estilo52">Capacidad de Endeudamiento $:</span></div></td>
    <td><input name="textfield2" type="text" class="campo8" value="<?php echo $cap_end ?>" size="15" maxlength="15" readonly = ""></td>
  </tr>
  <tr bgcolor="#CCCCCC">
    <td><div align="center"><span class="Estilo52">Negado:</span></div></td>
    <td><input name="neg" type="text" class="campo" id="neg" value="<?php echo $negado ?>" size="15" maxlength="15" readonly = ""></td>
  </tr>
</table>
</fieldset></td>
  </tr>
</table>
</form>
</body>
</html>