File: /home/asjudine/public_html/credito_rotativo_formulario_consulta_estado_pruebas.php
<?php
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("Conectarse.php");
/////////////////////////////////////
// INFORMACION DE CREDITO ROTATIVO //
/////////////////////////////////////
/*$consultaconsultorio = mysql_query('SELECT unidad, promocion FROM consultorio_creditos_policia WHERE cedula = "' . $_GET["ced2"] . '"');
list($unidad, $promocion) = mysql_fetch_row($consultaconsultorio);*/
/*$consultacredito = mysql_query('SELECT unidad, promocion FROM credito_rotativo WHERE cedula = "' . $_GET["ced2"] . '" and libranza_credito = "'.$_GET["cred"].'" ');
list($unidad, $promocion) = mysql_fetch_row($consultacredito);*/
$consulta_datos_cartera_credito = mysql_query("SELECT cedula FROM credito_rotativo_inter WHERE cedula = '".$_GET["ced2"]."' and credito_libranza = '".$_GET["cred"]."' ");
if (!$consulta_datos_cartera_credito) {
die('Invalid query 188: ' . mysql_error());
}
$existe_en_cartera = mysql_num_rows($consulta_datos_cartera_credito);
//if($existe_en_cartera == 0){
$control = mysql_query('SELECT cedula, apellidos, nombres, grado, rango, libranza_credito, direccion , telefono, celular, ciudad , email, cuenta, banco, entidad, escuela, numerosolicitud, fecha_solicitud, nombre_padre, nombre_madre, direccion_padres, ciudad_padres, telefono_padres, celular_padres, referencia_compa, celular_compa, fecha_anticipo0, valor_anticipo0, fecha_anticipo, valor_anticipo, fecha_anticipo2, valor_anticipo2, fecha_anticipo3, valor_anticipo3, fecha_anticipo4, valor_anticipo4, saldo_pendiente, monto_solicitado, permanencia, valor_cuotas, cedula_codeudor, nombre_codeudor, celular_codeudor, telefono_codeudor, direccion_codeudor, ciudad_codeudor, email_codeudor, unidad, promocion, planilla0, proveedor0, planilla, proveedor, planilla2, proveedor2, planilla3, proveedor3, planilla4, proveedor4, fecha_corte_temporal, interes_muerto, asesor_comercial, proveedor_inicial, causal_retiro, estado FROM credito_rotativo WHERE cedula = "' . $_GET["ced2"] . '" and libranza_credito = "'.$_GET["cred"].'" ');
if (!$control) {
die('Invalid query prin: ' . mysql_error());
}
$num=mysql_num_rows($control);
list($cedula, $apellidos, $nombres, $grado, $rango, $cred, $direccion, $telefono, $celular, $ciudad, $email, $cuenta, $banco, $entidad, $escuela, $numerosolicitud, $fecha_solicitud, $nompadre, $nommadre, $direcpadres, $ciudadpadres, $telpadres, $celpadres, $refcompa, $celcompa, $fecha_anticipo0, $valor_anticipo0, $fecha_anticipo, $valor_anticipo, $fecha_anticipo2, $valor_anticipo2, $fecha_anticipo3, $valor_anticipo3, $fecha_anticipo4, $valor_anticipo4, $saldo_pendiente, $monto_solicitado, $numero_cuotas, $valor_cuota, $cedula_codeudor, $nombre_codeudor, $celular_codeudor, $telefono_codeudor, $direccion_codeudor, $ciudad_codeudor, $email_codeudor, $unidad, $promocion, $planilla0, $proveedor0, $planilla, $proveedor, $planilla2, $proveedor2, $planilla3, $proveedor3, $planilla4, $proveedor4, $fecha_corte_temporal, $interes_muerto, $asesor_comercial, $proveedor_inicial, $causal_retiro, $estado_credito) = mysql_fetch_row($control);
$fullnombre = $apellidos ." ".$nombres;
//ojo con el numero de cuotas
//}
//else{
$control_int = mysql_query('SELECT cedula, credito_libranza, fecha_corte, fecha_credito, valor_credito, cuotas_credito, fecha_refinanciacion, cuotas_refinanciacion, cuotas_antesde_refinanciacion, valor_cuota, fecha_ultimo_descuento, mes_inicio, ano_inicio, saldo_anterior , cuotas_pendientes, cuotas_descontadas, saldo_nuevo, dia_inicio, mes_inicio, ano_inicio, dia_termino, mes_termino, ano_termino, cifin, estado, causal, fecha_terminacion, liquidacion_credito_reporte, fecha_liquidacion_reporte, unidad_descuento FROM credito_rotativo_inter WHERE cedula = "' . $_GET["ced2"] . '" and credito_libranza = "' . $_GET["cred"] . '"');
if (!$control_int) {
die('Invalid query 188: ' . mysql_error());
}
$num=mysql_num_rows($control_int);
$numero_row = mysql_num_rows($control_int);
list($cedula, $cred, $fecha_corte, $fecha_ingreso_credito, $monto_solicitado, $numero_cuotas, $fecha_refinanciacion, $cuotas_refinanciacion, $cuotas_antesde_refinanciacion, $valor_cuota, $fecha_ultimo_descuento, $mes_inicio, $ano_inicio, $saldo_anterior, $cuotas_pendientes, $cuotas_descontadas, $saldo_nuevo, $dia_inicio, $mes_inicio, $ano_inicio, $dia_termino, $mes_termino, $ano_termino, $cifin, $estado, $causal, $fecha_terminacion, $liquidacion_credito_reporte, $fecha_liquidacion_reporte, $unidad_descuento) = mysql_fetch_row($control_int);
if($estado == 0){
$vigencia = "HISTORICO";
}elseif($estado == 1){
$vigencia = "VIGENTE";
}
$fecha_inicio_credito = $ano_inicio."-".$mes_inicio."-".$dia_inicio;
$fecha_termino_credito = $ano_termino."-".$mes_termino."-".$dia_termino;
//}
$busca_unidad_descuento = mysql_query("SELECT unidad, codigo FROM descuentos WHERE id = '".$unidad_descuento."' ");
list($unidad_descuento_cartera, $codigo_descuento_cartera)= mysql_fetch_row($busca_unidad_descuento);
//$permanencia = 24;
if($existe_en_cartera == 0){
$consulta_num_cedula = mysql_query("SELECT cedula, rango, libranza_credito, saldo_pendiente, monto_solicitado, permanencia FROM credito_rotativo WHERE cedula = '".$_GET["ced2"]."' and libranza_credito = '".$_GET["cred"]."' ");
if (!$consulta_num_cedula) {
die('Invalid query 188: ' . mysql_error());
}
list($cedula, $rango, $cred, $saldo_pendiente, $monto_solicitado, $numero_cuotas) = mysql_fetch_row($consulta_num_cedula);
}else{
$consulta_num_cedula = mysql_query("SELECT cedula, cuotas_credito FROM credito_rotativo_inter WHERE cedula = '".$_GET["ced2"]."' and credito_libranza = '".$_GET["cred"]."' ");
if (!$consulta_num_cedula) {
die('Invalid query 188: ' . mysql_error());
}
list($cedula, $numero_cuotas) = mysql_fetch_row($consulta_num_cedula);
}
/*
if($_GET["fecha_corte"] != ""){
$fecha_hoy = $_GET["fecha_corte"];
}else{
$fecha_hoy = $fecha_corte;
if(empty($fecha_corte)){
$fecha_hoy = $fecha_corte_temporal;
}
}
*/
if($_GET["fecha_corte"] != ""){
$fecha_hoy = $_GET["fecha_corte"];
}else{
if($fecha_corte){
$fecha_hoy = $fecha_corte;
}
//else{ $fecha_hoy = $fecha_corte_temporal; }
if(($fecha_corte_temporal!="0000-00-00") && ($numero_row == 0)){
$fecha_hoy = $fecha_corte_temporal;
}
if(($fecha_corte_temporal=="0000-00-00") && ($numero_row == 0)){
$fecha_hoy = date("Y-m-d");
}
//}
}
if(isset($_POST["calcular"])){
if($rango == "POLICIA"){
//$fecha_hoy = $_POST["fecha_corte"];
$fecha_hoy = $_POST["fecha_corte_temporal"];
$interes = 2.5/100;
$gastos_financieros = 0.5/100;
//$fecha_hoy = date("Y-m-d");
$dias_anticipo1=(strtotime($fecha_anticipo)-strtotime($fecha_hoy))/86400;
$dias_anticipo1=abs($dias_anticipo1);
$dias_anticipo1=round($dias_anticipo1);
$valor_diario_interes1 = round(($valor_anticipo*$interes)/30);
$valor_diario_gastos1 = round(($valor_anticipo*$gastos_financieros)/30);
$total_interes_uno1 = round($valor_diario_interes1*$dias_anticipo1);
$total_interes_dos1 = round($valor_diario_gastos1*$dias_anticipo1);
//$gastos_financieros1 = $valor_anticipo * $gastos_financieros;
//$valor_total1 = ceil((($total_interes_anticipo1+$gastos_financieros)+$valor_anticipo));
$valor_total1 = round($total_interes_uno1 + $total_interes_dos1);
$dias_anticipo2=(strtotime($fecha_anticipo2)-strtotime($fecha_hoy))/86400;
$dias_anticipo2=abs($dias_anticipo2);
$dias_anticipo2=round($dias_anticipo2);
$valor_diario_interes2 = round(($valor_anticipo2*$interes)/30);
$valor_diario_gastos2 = round(($valor_anticipo2*$gastos_financieros)/30);
$total_interes_uno2 = round($valor_diario_interes2*$dias_anticipo2);
$total_interes_dos2 = round($valor_diario_gastos2*$dias_anticipo2);
$valor_total2 = round($total_interes_uno2 + $total_interes_dos2);
$dias_anticipo3=(strtotime($fecha_anticipo3)-strtotime($fecha_hoy))/86400;
$dias_anticipo3=abs($dias_anticipo3);
$dias_anticipo3=round($dias_anticipo3);
$valor_diario_interes3 = round(($valor_anticipo3*$interes)/30);
$valor_diario_gastos3 = round(($valor_anticipo3*$gastos_financieros)/30);
$total_interes_uno3 = round($valor_diario_interes3*$dias_anticipo3);
$total_interes_dos3 = round($valor_diario_gastos3*$dias_anticipo3);
$valor_total3 = round($total_interes_uno3 + $total_interes_dos3);
$dias_anticipo4=(strtotime($fecha_anticipo4)-strtotime($fecha_hoy))/86400;
$dias_anticipo4=abs($dias_anticipo4);
$dias_anticipo4=round($dias_anticipo4);
$valor_diario_interes4 = round(($valor_anticipo4*$interes)/30);
$valor_diario_gastos4 = round(($valor_anticipo4*$gastos_financieros)/30);
$total_interes_uno4 = round($valor_diario_interes4*$dias_anticipo4);
$total_interes_dos4 = round($valor_diario_gastos4*$dias_anticipo4);
$valor_total4 = round($total_interes_uno4 + $total_interes_dos4);
$total_pagar_capital = round($valor_anticipo + $valor_anticipo2 + $valor_anticipo3 + $valor_anticipo4);
$total_pagar_interes = round($valor_total1 + $valor_total2 + $valor_total3 + $valor_total4);
//$total_mensual = ceil($total_pagar / $numero_cuotas);
//NUEVO 2020-06-12
//$total_pagar_con_interes = (($total_pagar_capital + $total_pagar_interes) * 0.03);
//$total_meses = $total_pagar_con_interes * $numero_cuotas;
//$total_mas_capital = $total_meses + $total_pagar_capital;
//$total_pagos_mensuales = $total_mas_capital / $numero_cuotas;
//$total_pagar_mensual = round($total_pagos_mensuales);
//$credito_total_pagar = $total_pagar_mensual * $numero_cuotas;
//echo $total_pagar_mensual;
//NUEVO 2020-07-06
$total_suma_capita_interes = round($total_pagar_capital + $total_pagar_interes);
$total_interes_proyectado = round(($total_suma_capita_interes * 0.03)*$numero_cuotas);
$total_proyectado = round($total_suma_capita_interes + $total_interes_proyectado);
$total_cuota_mensual = round($total_proyectado/$numero_cuotas);
$saldo_sin_interes = round(($total_suma_capita_interes/$numero_cuotas)*$cuotas_pendientes);
//echo "<br> capital ".$total_pagar_capital;
//echo "<br> interes ".$total_pagar_interes;
//echo "<br> Nuevo a Liquidar".$total_suma_capita_interes;
//echo "<br> interes Proyectado ".$total_interes_proyectado;
//echo "<br> total Proyectado ".$total_proyectado;
//echo "<br> Valor Cuota Mensual ".$total_cuota_mensual;
//echo "<br> Cuotas Pagadas ".$cuotas_descontadas;
//echo "<br> Cuotas Pendientes ".$cuotas_pendientes;
//echo "<br> Saldo Sin interes ".$saldo_sin_interes;
echo "<SCRIPT LANGUAGE='javascript'>window.location.href='credito_rotativo_formulario_consulta_estado.php?ced2=$cedula&cred=$cred&fecha_corte=$fecha_hoy'</SCRIPT>";
}
if($rango == "EJERCITO"){
$fecha_hoy = $_POST["fecha_corte_temporal"];
$interes = 2.5/100;
$gastos_financieros = 0.5/100;
//$fecha_hoy = date("Y-m-d");
//$valor_total0 = round($valor_anticipo0);
//$valor_total0 = round($total_interes_uno0*$dias_anticipo0);
$dias_anticipo0=(strtotime($fecha_anticipo0)-strtotime($fecha_hoy))/86400;
$dias_anticipo0=abs($dias_anticipo0);
$dias_anticipo0=round($dias_anticipo0);
$valor_diario_interes0 = round(($valor_anticipo0*$interes)/30);
//$valor_diario_gastos0 = round(($valor_anticipo0*$gastos_financieros)/30);
$total_interes_uno0 = round($valor_diario_interes0*$dias_anticipo0);
//$total_interes_dos0 = round($valor_diario_gastos0*$dias_anticipo0);
$valor_total0 = round($total_interes_uno0);
$dias_anticipo1=(strtotime($fecha_anticipo)-strtotime($fecha_hoy))/86400;
$dias_anticipo1=abs($dias_anticipo1);
$dias_anticipo1=round($dias_anticipo1);
$valor_diario_interes1 = round(($valor_anticipo*$interes)/30);
//$valor_diario_gastos1 = round(($valor_anticipo*$gastos_financieros)/30);
$total_interes_uno1 = round($valor_diario_interes1*$dias_anticipo1);
//$total_interes_dos1 = round($valor_diario_gastos1*$dias_anticipo1);
//$valor_total1 = round($total_interes_uno1*$total_interes_uno1);
$valor_total1 = round($total_interes_uno1);
$dias_anticipo2=(strtotime($fecha_anticipo2)-strtotime($fecha_hoy))/86400;
$dias_anticipo2=abs($dias_anticipo2);
$dias_anticipo2=round($dias_anticipo2);
$valor_diario_interes2 = round(($valor_anticipo2*$interes)/30);
//$valor_diario_gastos2 = round(($valor_anticipo2*$gastos_financieros)/30);
$total_interes_uno2 = round($valor_diario_interes2*$dias_anticipo2);
//$total_interes_dos2 = round($valor_diario_gastos2*$dias_anticipo2);
$valor_total2 = round($total_interes_uno2);
$dias_anticipo3=(strtotime($fecha_anticipo3)-strtotime($fecha_hoy))/86400;
$dias_anticipo3=abs($dias_anticipo3);
$dias_anticipo3=round($dias_anticipo3);
$valor_diario_interes3 = round(($valor_anticipo3*$interes)/30);
//$valor_diario_gastos3 = round(($valor_anticipo3*$gastos_financieros)/30);
$total_interes_uno3 = round($valor_diario_interes3*$dias_anticipo3);
//$total_interes_dos3 = round($valor_diario_gastos3*$dias_anticipo3);
$valor_total3 = round($total_interes_uno3);
$dias_anticipo4=(strtotime($fecha_anticipo4)-strtotime($fecha_hoy))/86400;
$dias_anticipo4=abs($dias_anticipo4);
$dias_anticipo4=round($dias_anticipo4);
$valor_diario_interes4 = round(($valor_anticipo4*$interes)/30);
//$valor_diario_gastos4 = round(($valor_anticipo4*$gastos_financieros)/30);
$total_interes_uno4 = round($valor_diario_interes4*$dias_anticipo4);
//$total_interes_dos4 = round($valor_diario_gastos4*$dias_anticipo4);
$valor_total4 = round($total_interes_uno4);
$total_pagar_capital = round($interes_muerto + $valor_anticipo0 + $valor_anticipo + $valor_anticipo2 + $valor_anticipo3 + $valor_anticipo4);
$total_pagar_interes = round($valor_total0 + $valor_total1 + $valor_total2 + $valor_total3 + $valor_total4);
//$total_mensual = ceil($total_pagar / $numero_cuotas);
//NUEVO 2020-06-12 ESTO ESTA MAL
//$total_pagar_con_interes = ($total_pagar_capital + $total_pagar_interes) * 0.03;
//$total_meses = $total_pagar_con_interes * $numero_cuotas;
//$total_mas_capital = $total_meses + $total_pagar_capital;
//$total_pagos_mensuales = $total_mas_capital / $numero_cuotas;
//$total_pagar_mensual = round($total_pagos_mensuales);
//$credito_total_pagar = $total_pagar_mensual * $numero_cuotas;
//echo $total_pagar_mensual;
//NUEVO 2020-07-06
$total_suma_capita_interes = round($total_pagar_capital + $total_pagar_interes);
$total_interes_proyectado = round(($total_suma_capita_interes * 0.03)*$numero_cuotas);
//OJO
if($valor_anticipo == 0 || $valor_anticipo == "0" || $valor_anticipo == ""){
$total_proyectado = $monto_solicitado;
}else{
$total_proyectado = round($total_suma_capita_interes + $total_interes_proyectado);
}
$total_cuota_mensual = round($total_proyectado/$numero_cuotas);
//$saldo_sin_interes = round(($total_suma_capita_interes/$numero_cuotas)*$cuotas_pendientes);
//Comprobar si exite o no en la tabla credito_rotativo_inter
if($filas_credito_rotativo_cartera){
$saldo_sin_interes = round(($total_suma_capita_interes/$numero_cuotas)*$cuotas_pendientes);
}
else{
$saldo_sin_interes = $total_suma_capita_interes;
}
//echo "<br> capital ".$total_pagar_capital;
//echo "<br> interes ".$total_pagar_interes;
//echo "<br> Nuevo a Liquidar".$total_suma_capita_interes;
//echo "<br> interes Proyectado ".$total_interes_proyectado;
//echo "<br> total Proyectado ".$total_proyectado;
//echo "<br> Valor Cuota Mensual ".$total_cuota_mensual;
//echo "<br> Cuotas Pagadas ".$cuotas_descontadas;
//echo "<br> Cuotas Pendientes ".$cuotas_pendientes;
//echo "<br> Saldo Sin interes ".$saldo_sin_interes;
echo "<SCRIPT LANGUAGE='javascript'>window.location.href='credito_rotativo_formulario_consulta_estado.php?ced2=$cedula&cred=$cred&fecha_corte=$fecha_hoy'</SCRIPT>";
}
}
/*
if($_GET["fecha_corte"] != ""){
$fecha_hoy = $_GET["fecha_corte"];
}else{
$fecha_hoy = $fecha_corte;
if(empty($fecha_corte)){
$fecha_hoy = $fecha_corte_temporal;
}
}
*/
/*
else{
//$fecha_hoy = date("Y-m-d");.
$fecha_hoy = "2020-06-30";
}
*/
if($rango == "POLICIA"){
//$fecha_hoy = $_POST["fecha_corte"];
$interes = 2.5/100;
$gastos_financieros = 0.5/100;
//$fecha_hoy = date("Y-m-d");
//Interes Muerto
$dias_anticipo=(strtotime($fecha_anticipo)-strtotime($fecha_hoy))/86400;
$dias_anticipo=abs($dias_anticipo);
$dias_anticipo=round($dias_anticipo);
$valor_diario_interes = round(($interes_muerto*$interes)/30);
$valor_diario_gastos = round(($interes_muerto*$gastos_financieros)/30);
$total_interes_uno = round($valor_diario_interes*$dias_anticipo);
$total_interes_dos = round($valor_diario_gastos*$dias_anticipo);
$valor_total_interes_muerto = round($total_interes_uno + $total_interes_dos);
//Anticipo mano/mayor
$dias_anticipo0=(strtotime($fecha_anticipo0)-strtotime($fecha_hoy))/86400;
$dias_anticipo0=abs($dias_anticipo0);
$dias_anticipo0=round($dias_anticipo0);
$valor_diario_interes0 = round(($valor_anticipo0*$interes)/30);
$valor_diario_gastos0 = round(($valor_anticipo0*$gastos_financieros)/30);
$total_interes_uno0 = round($valor_diario_interes0*$dias_anticipo0);
$total_interes_dos0 = round($valor_diario_gastos0*$dias_anticipo0);
$valor_total0 = round($total_interes_uno0 + $total_interes_dos0);
//$valor_total0 = 0;
$dias_anticipo1=(strtotime($fecha_anticipo)-strtotime($fecha_hoy))/86400;
$dias_anticipo1=abs($dias_anticipo1);
$dias_anticipo1=round($dias_anticipo1);
$valor_diario_interes1 = round(($valor_anticipo*$interes)/30);
$valor_diario_gastos1 = round(($valor_anticipo*$gastos_financieros)/30);
$total_interes_uno1 = round($valor_diario_interes1*$dias_anticipo1);
$total_interes_dos1 = round($valor_diario_gastos1*$dias_anticipo1);
//$gastos_financieros1 = $valor_anticipo * $gastos_financieros;
//$valor_total1 = ceil((($total_interes_anticipo1+$gastos_financieros)+$valor_anticipo));
$valor_total1 = round($total_interes_uno1 + $total_interes_dos1);
$dias_anticipo2=(strtotime($fecha_anticipo2)-strtotime($fecha_hoy))/86400;
$dias_anticipo2=abs($dias_anticipo2);
$dias_anticipo2=round($dias_anticipo2);
$valor_diario_interes2 = round(($valor_anticipo2*$interes)/30);
$valor_diario_gastos2 = round(($valor_anticipo2*$gastos_financieros)/30);
$total_interes_uno2 = round($valor_diario_interes2*$dias_anticipo2);
$total_interes_dos2 = round($valor_diario_gastos2*$dias_anticipo2);
$valor_total2 = round($total_interes_uno2 + $total_interes_dos2);
$dias_anticipo3=(strtotime($fecha_anticipo3)-strtotime($fecha_hoy))/86400;
$dias_anticipo3=abs($dias_anticipo3);
$dias_anticipo3=round($dias_anticipo3);
$valor_diario_interes3 = round(($valor_anticipo3*$interes)/30);
$valor_diario_gastos3 = round(($valor_anticipo3*$gastos_financieros)/30);
$total_interes_uno3 = round($valor_diario_interes3*$dias_anticipo3);
$total_interes_dos3 = round($valor_diario_gastos3*$dias_anticipo3);
$valor_total3 = round($total_interes_uno3 + $total_interes_dos3);
$dias_anticipo4=(strtotime($fecha_anticipo4)-strtotime($fecha_hoy))/86400;
$dias_anticipo4=abs($dias_anticipo4);
$dias_anticipo4=round($dias_anticipo4);
$valor_diario_interes4 = round(($valor_anticipo4*$interes)/30);
$valor_diario_gastos4 = round(($valor_anticipo4*$gastos_financieros)/30);
$total_interes_uno4 = round($valor_diario_interes4*$dias_anticipo4);
$total_interes_dos4 = round($valor_diario_gastos4*$dias_anticipo4);
$valor_total4 = round($total_interes_uno4 + $total_interes_dos4);
$total_pagar_capital = round($interes_muerto + $valor_anticipo0 + $valor_anticipo + $valor_anticipo2 + $valor_anticipo3 + $valor_anticipo4);
$total_pagar_interes = round($valor_total_interes_muerto + $valor_total0 + $valor_total1 + $valor_total2 + $valor_total3 + $valor_total4);
//$total_mensual = ceil($total_pagar / $numero_cuotas);
//NUEVO 2020-06-12
//$total_pagar_con_interes = (($total_pagar_capital + $total_pagar_interes) * 0.03);
//$total_meses = $total_pagar_con_interes * $numero_cuotas;
//$total_mas_capital = $total_meses + $total_pagar_capital;
//$total_pagos_mensuales = $total_mas_capital / $numero_cuotas;
//$total_pagar_mensual = round($total_pagos_mensuales);
//$credito_total_pagar = $total_pagar_mensual * $numero_cuotas;
//echo $total_pagar_mensual;
//NUEVO 2020-07-06
$total_suma_capita_interes = round($total_pagar_capital + $total_pagar_interes);
$total_interes_proyectado = round(($total_suma_capita_interes * 0.03)*$numero_cuotas);
$total_proyectado = round($total_suma_capita_interes + $total_interes_proyectado);
$total_cuota_mensual = round($total_proyectado/$numero_cuotas);
$saldo_sin_interes = round(($total_suma_capita_interes/$numero_cuotas)*$cuotas_pendientes);
//echo "<br> capital ".$total_pagar_capital;
//echo "<br> interes ".$total_pagar_interes;
//echo "<br> Nuevo a Liquidar".$total_suma_capita_interes;
//echo "<br> interes Proyectado ".$total_interes_proyectado;
//echo "<br> total Proyectado ".$total_proyectado;
//echo "<br> Valor Cuota Mensual ".$total_cuota_mensual;
//echo "<br> Cuotas Pagadas ".$cuotas_descontadas;
//echo "<br> Cuotas Pendientes ".$cuotas_pendientes;
//echo "<br> Saldo Sin interes ".$saldo_sin_interes;
//REFINANCIACION
//recorrer cantidad de cuotas pagadas
$interes_tres_porciento = 3/100;
$busca_cuotas_pagadas = mysql_query("SELECT id FROM credito_rotativo_estado_contable WHERE cedula = '".$_GET["ced2"]."' and credito_libranza = '".$_GET["cred"] ."' ");
if (!$busca_cuotas_pagadas) {
die('Invalid query update 4747: ' . mysql_error());
}
while(list($id_contable) = mysql_fetch_row($busca_cuotas_pagadas)){
$coutas_pagadas_suma = $coutas_pagadas_suma +1;
}
$valores1 = (($total_interes_proyectado + $total_suma_capita_interes)/$numero_cuotas);
$valores2 = (($total_interes_proyectado + $monto_solicitado)/$numero_cuotas);
$valores3 = $valores1 - $valores2;
//$valores4 = $valores3 * $coutas_pagadas_suma;
$valores4 = $valores3 * $cuotas_antesde_refinanciacion;
$cuotas_capital_cobradas_antesde_refinanciacion = ((($total_suma_capita_interes)/$numero_cuotas)*$cuotas_antesde_refinanciacion);
$total_mas_dejado_de_cobrar = $total_suma_capita_interes - $cuotas_capital_cobradas_antesde_refinanciacion + $valores4;
$total_interes_cuotas_pendientes = (($total_mas_dejado_de_cobrar * 0.03)*$cuotas_pendientes);
$suma_capital_mas_intereses_proyectados = $total_mas_dejado_de_cobrar + $total_interes_cuotas_pendientes;
}
if($rango == "EJERCITO"){
$interes = 2.5/100;
$gastos_financieros = 0.5/100;
$interes_global = 3/100;
//$fecha_hoy = date("Y-m-d");
//$valor_total0 = round($valor_anticipo0);
//$valor_total0 = round($total_interes_uno0*$dias_anticipo0);
/*if($interes_muerto != ""){
$fecha_anticipoDiff = $fecha_anticipo0;
}else{
$fecha_anticipoDiff = $fecha_anticipo;
}*/
if($interes_muerto != ""){
if($fecha_anticipo0 != 0000-00-00){
$fecha_anticipoDiff = $fecha_anticipo0;
}
elseif($fecha_anticipo != 0000-00-00 && $fecha_anticipo0 == 0000-00-00){
$fecha_anticipoDiff = $fecha_anticipo;
}
}
//Interes Muerto
$dias_anticipo=(strtotime($fecha_anticipoDiff)-strtotime($fecha_hoy))/86400;
$dias_anticipo=abs($dias_anticipo);
$dias_anticipo=round($dias_anticipo);
$valor_diario_interes = round(($interes_muerto*$interes)/30);
$valor_diario_gastos = round(($interes_muerto*$gastos_financieros)/30);
$total_interes_uno = round($valor_diario_interes*$dias_anticipo);
$total_interes_dos = round($valor_diario_gastos*$dias_anticipo);
$valor_total_interes_muerto = round($total_interes_uno + $total_interes_dos);
//Anticipo mano/mayor
$dias_anticipo0=(strtotime($fecha_anticipo0)-strtotime($fecha_hoy))/86400;
$dias_anticipo0=abs($dias_anticipo0);
$dias_anticipo0=round($dias_anticipo0);
$valor_diario_interes0 = round(($valor_anticipo0*$interes)/30);
$valor_diario_gastos0 = round(($valor_anticipo0*$gastos_financieros)/30);
$total_interes_uno0 = round($valor_diario_interes0*$dias_anticipo0);
$total_interes_dos0 = round($valor_diario_gastos0*$dias_anticipo0);
//$valor_total0 = round($total_interes_uno0);
$valor_total0 = round($total_interes_uno0 + $total_interes_dos0);
$dias_anticipo1=(strtotime($fecha_anticipo)-strtotime($fecha_hoy))/86400;
$dias_anticipo1=abs($dias_anticipo1);
$dias_anticipo1=round($dias_anticipo1);
$valor_diario_interes1 = round(($valor_anticipo*$interes)/30);
$valor_diario_gastos1 = round(($valor_anticipo*$gastos_financieros)/30);
$total_interes_uno1 = round($valor_diario_interes1*$dias_anticipo1);
$total_interes_dos1 = round($valor_diario_gastos1*$dias_anticipo1);
$valor_total1 = round($total_interes_uno1*$total_interes_uno1);
//$valor_total1 = round($total_interes_uno1);
$valor_total1 = round($total_interes_uno1 + $total_interes_dos1);
$dias_anticipo2=(strtotime($fecha_anticipo2)-strtotime($fecha_hoy))/86400;
$dias_anticipo2=abs($dias_anticipo2);
$dias_anticipo2=round($dias_anticipo2);
$valor_diario_interes2 = round(($valor_anticipo2*$interes)/30);
$valor_diario_gastos2 = round(($valor_anticipo2*$gastos_financieros)/30);
$total_interes_uno2 = round($valor_diario_interes2*$dias_anticipo2);
$total_interes_dos2 = round($valor_diario_gastos2*$dias_anticipo2);
//$valor_total2 = round($total_interes_uno2);
$valor_total2 = round($total_interes_uno2 + $total_interes_dos2);
$dias_anticipo3=(strtotime($fecha_anticipo3)-strtotime($fecha_hoy))/86400;
$dias_anticipo3=abs($dias_anticipo3);
$dias_anticipo3=round($dias_anticipo3);
$valor_diario_interes3 = round(($valor_anticipo3*$interes)/30);
$valor_diario_gastos3 = round(($valor_anticipo3*$gastos_financieros)/30);
$total_interes_uno3 = round($valor_diario_interes3*$dias_anticipo3);
$total_interes_dos3 = round($valor_diario_gastos3*$dias_anticipo3);
$valor_total3 = round($total_interes_uno3);
$dias_anticipo4=(strtotime($fecha_anticipo4)-strtotime($fecha_hoy))/86400;
$dias_anticipo4=abs($dias_anticipo4);
$dias_anticipo4=round($dias_anticipo4);
$valor_diario_interes4 = round(($valor_anticipo4*$interes)/30);
$valor_diario_gastos4 = round(($valor_anticipo4*$gastos_financieros)/30);
$total_interes_uno4 = round($valor_diario_interes4*$dias_anticipo4);
$total_interes_dos4 = round($valor_diario_gastos4*$dias_anticipo4);
$valor_total4 = round($total_interes_uno4);
if($promocion == "64E" || $promocion == ""){
$total_pagar_capital = round($valor_anticipo0 + $valor_anticipo + $valor_anticipo2 + $valor_anticipo3 + $valor_anticipo4);
$total_pagar_interes = round($valor_total0 + $valor_total1 + $valor_total2 + $valor_total3 + $valor_total4);
//$total_mensual = round($total_pagar / $numero_cuotas);
}
elseif ($promocion == "65E" || $promocion == ""){
$total_pagar_capital = round($interes_muerto + $valor_anticipo0 + $valor_anticipo + $valor_anticipo2 + $valor_anticipo3 + $valor_anticipo4);
$total_pagar_interes = round($valor_total_interes_muerto + $valor_total0 + $valor_total1 + $valor_total2 + $valor_total3 + $valor_total4);
//$total_mensual = round($total_pagar / $numero_cuotas);
}
//NUEVO 2020-06-12 ESTO ESTA MAL
//$total_pagar_con_interes = ($total_pagar_capital + $total_pagar_interes) * 0.03;
//$total_meses = $total_pagar_con_interes * $numero_cuotas;
//$total_mas_capital = $total_meses + $total_pagar_capital;
//$total_pagos_mensuales = $total_mas_capital / $numero_cuotas;
//$total_pagar_mensual = round($total_pagos_mensuales);
//$credito_total_pagar = $total_pagar_mensual * $numero_cuotas;
//echo $total_pagar_mensual;
//NUEVO 2020-07-06
$total_suma_capita_interes = round($total_pagar_capital + $total_pagar_interes);
$total_interes_proyectado = round(($total_suma_capita_interes * 0.03)*$numero_cuotas);
$total_proyectado = round($total_suma_capita_interes + $total_interes_proyectado);
$total_cuota_mensual = round($total_proyectado/$numero_cuotas);
$saldo_sin_interes = round(($total_suma_capita_interes/$numero_cuotas)*$cuotas_pendientes);
//OJO
/*if($valor_anticipo == 0 || $valor_anticipo == "0" || $valor_anticipo == ""){
$total_proyectado = $monto_solicitado;
}else{
$total_proyectado = round($total_suma_capita_interes + $total_interes_proyectado);
}*/
$total_cuota_mensual = round($total_proyectado/$numero_cuotas);
//$saldo_sin_interes = round(($total_suma_capita_interes/$numero_cuotas)*$cuotas_pendientes);
//Comprobar si exite o no en la tabla credito_rotativo_inter
if($filas_credito_rotativo_cartera){
$saldo_sin_interes = round(($total_suma_capita_interes/$numero_cuotas)*$cuotas_pendientes);
}
else{
$saldo_sin_interes = $total_suma_capita_interes;
}
//echo "<br> capital ".$total_pagar_capital;
//echo "<br> interes ".$total_pagar_interes;
//echo "<br> Nuevo a Liquidar".$total_suma_capita_interes;
//echo "<br> interes Proyectado ".$total_interes_proyectado;
//echo "<br> total Proyectado ".$total_proyectado;
//echo "<br> Valor Cuota Mensual ".$total_cuota_mensual;
//echo "<br> Cuotas Pagadas ".$cuotas_descontadas;
//echo "<br> Cuotas Pendientes ".$cuotas_pendientes;
//echo "<br> Saldo Sin interes ".$saldo_sin_interes;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>APROBACION CREDITO ROTATIVO</title>
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
*{margin: 0;padding: 0;}
body{background-color:#EAEAEA;font-family:Verdana, Geneva, sans-serif;}
header {background-color: #B7271F; text-align: center;}
.titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
.divirmenu{text-align: center;}
.irmenu{width: 200px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
.irmenu:hover{background-color: #67a0d9; color: #000;}
.direcciona{width: 200px;background-color: #D4090C;color: #fff; padding: 4px;border-radius: 3px;}
.direcciona:hover{background-color: #67a0d9; color: #000;}
.fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
td{padding: 1px; border: 1px solid #a0a0a0;}
.td{background-color: #e5e5e5; padding: 1px 30px;color: #00135F;font-size: 14px;font-weight: 600; text-align: center;}
.boton1{width:30%;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:10px;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
input[type=text],select{border-radius: 5px; padding: 3px;background-color: #FFF;}
.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
.tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 12px;}
.botonnew{width: 90px; background-color: #e3dec0;color: #b20606;padding: 1px;border-radius:5px;}
.botonnew:hover{width: 90px; background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
.tdizq{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
.tdcen{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: center;}
.tdder{background-color: #e5e5e5; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
.tddered{background-color: #e5e5e5; padding: 1px 2px;color: #D40609;font-size: 12px;font-weight: 600; text-align: right;}
.tdbono{background-color: #FFFFCC; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
/*Estilo Complementario*/
.tdi{background-color: #F9FBC8; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
.tdc{background-color: #F9FBC8; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: center;}
.tdd{background-color: #F9FBC8; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
.tdrojad{background-color: #EEE; color: #8A0002; padding: 1px 4px;font-size: 12px;font-weight: 600; text-align: right;}
.tdrojai{background-color: #EEE; color: #8A0002; padding: 1px 4px;font-size: 12px;font-weight: 600; text-align: left;}
.rojo{color:#C60000;}
.aprobado{background-color:#2CA316; color:#FFF; padding:4px; cursor:pointer;}
.aprobado:hover{background-color:#296411; color:#FFF; padding:4px;}
.denegado{background-color:#BE161B; color:#FFF; padding:4px; cursor:pointer;}
.denegado:hover{background-color:#A42023; color:#FFF; padding:4px;}
.pendiente{background-color:#5170EC; color:#FFF; padding:4px;}
.pendiente:hover{background-color:#1B3A8D; color:#FFF; padding:4px;}
.valida{background-color:#A41518; color:#FFF;}
.hit{background-color: #47547C; color: #fff; padding: 2px; text-align: center; font-size: 12px; font-weight: 900;}
.der{text-align: right;}
</style>
<script>
function Verificar() {
/*
if (document.form1.entidad.value == ""){
alert("Seleccione Entidad")
document.form1.entidad.focus()
return (false);
}
if (document.form1.escuela.value == ""){
alert("Seleccione Escuela")
document.form1.escuela.focus()
return (false);
}
*/
/*if (document.form1.fechareporte.value == "0000-00-00")
{
alert("Verifique FECHA A REPORTAR");
document.form1.fechareporte.focus()
return (false);
}
if (document.form1.fechareporte.value == "")
{
alert("Verifique FECHA A REPORTAR");
document.form1.fechareporte.focus()
return (false);
}
*/
if (document.form1.creditolibranza.value == "")
{
alert("Digite El Credito Libranza");
document.form1.creditolibranza.focus()
return (false);
}
if (document.form1.estadoanticipo.value == "")
{
alert("¿ TIENE ANTICIPO ?");
document.form1.estadoanticipo.focus()
return (false);
}
/*var dt = new Date();
if (document.form1.fechareporte.value < dt)
{
alert("Verifique Fecha De Reporte");
document.form1.fechareporte.focus()
return (false);
}
if (document.form1.actuacion.value == "")
{
alert("Escriba Una Gestion");
document.form1.actuacion.focus()
return (false);
}*/
return(true);
}
</script>
</head>
<body>
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">CONSULTA CREDITO ROTATIVO</h3>
<form action="" method="post" name="form1" onSubmit="return Verificar()">
<table width="900" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<?php if($estado_credito == 9){ ?>
<tr>
<td colspan="4" align="center"><h4>NO APROBADO/DENEGADO</h4></td>
</tr>
<tr>
<td colspan="4"><textarea name="" id="" cols="120" rows="2"><?php echo $causal_retiro; ?></textarea></td>
</tr>
<?php } ?>
<?php if($existe_en_cartera == 0){ ?>
<tr>
<td colspan="4" align="center"><h2>AUN NO INGRESA A CARTERA</h2></td>
</tr>
<?php }else{ ?>
<tr>
<td class="tdrojad" colspan="2">Fecha Ingreso Cartera Credito</td>
<td class="tdizq" colspan="2"><input name="fecha_ingreso_cartera" type="text" id="fecha_ingreso_cartera" value="<?php echo $fecha_ingreso_credito ?>" size="13" maxlength="13" /></td>
</tr>
<?php } ?>
<tr>
<td class="tdder">Fecha Solicitud :</td>
<!--<td class="tdizq"><input name="fecha" type="text" class="Estilo66" id="fecha" value="<?php echo date("Y-m-d"); ?>" size="10" maxlength="10" /></td>-->
<td class="tdizq"><input name="fecha" type="text" class="Estilo66" id="fecha" value="<?php echo $fecha_solicitud; ?>" size="10" maxlength="10" /></td>
<td class="tdder">Credito Numero :</td>
<td class="tdizq"><input name="credito_numero" type="text" class="rojo" id="credito_numero" value="<?php echo $numerosolicitud ?>" size="4" maxlength="4" readonly/>
<input name="rango" type="text" class="rojo" id="rango" value="<?php echo $rango ?>" size="8" maxlength="8" readonly/>
<input name="vigencia" type="text" class="rojo" id="vigencia" value="<?php echo $vigencia ?>" size="8" maxlength="8" readonly/>
</td>
</tr>
<tr>
<td class="tdder">Cedula No:</td>
<td class="tdizq"><input name="cedula" type="text" class="Estilo66" id="cedula" value="<?php echo $cedula ?>" size="40" maxlength="40" readonly/></td>
<td class="tdder">Grado :</td>
<td class="tdizq"><input name="grado" type="text" class="Estilo66" 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" class="Estilo66" id="apellidos" value="<?php echo $apellidos ?>" size="40" maxlength="40"/></td>
<td class="tdder">Nombres:</td>
<td class="tdizq"><input name="nombres" type="text" class="Estilo66" 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" class="Estilo66" id="direccion" value="<?php echo $direccion ?>" size="40" maxlength="40" /></td>
<td class="tdder">E-mail :</td>
<td class="tdizq" colspan="2"><input name="email" type="text" class="Estilo66" id="email" value="<?php echo $email ?>" size="40" maxlength="40"/></td>
</tr>
<tr>
<td class="tdder">Ciudad :</td>
<td class="tdizq"><input name="ciudad" type="text" class="Estilo66" id="ciudad" value="<?php echo $ciudad ?>" size="40" maxlength="40"/></td>
<td class="tdder"><h3>Telefono :</h3></td>
<td class="tdizq"><input name="telefono" type="text" class="Estilo66" id="telefono" value="<?php echo $telefono ?>" size="40" maxlength="40" /></td>
</tr>
<tr>
<td class="tdrojad">MONTO SOLICITADO:</td>
<td class="tdizq"><input name="montosolicitado" type="text" class="rojo" id="montosolicitado" value="<?php echo $monto_solicitado ?>" size="40" maxlength="40" readonly/></td>
<td class="tdder">Celular :</td>
<td class="tdizq"><input name="celular" type="text" class="Estilo66" id="celular" value="<?php echo $celular ?>" size="40" maxlength="40" /></td>
<!--<td class="tdder">Nº SOLICITUD:</td>
<td class="tdizq"><input name="numero_solicitud" type="text" class="rojo" id="numero_solicitud" value="<?php echo $numero_solicitud ?>" size="14" maxlength="20" readonly/></td>-->
</tr>
<tr>
<td class="tdder">VALOR ANTICIPO</td>
<td class="tdizq"><input name="valor_anticipo" type="text" class="rojo" id="valor_anticipo" value="<?php echo $valor_anticipo ?>" size="40" maxlength="40" readonly/>
</td>
<td class="tdder">Unidad :</td>
<td class="tdizq"><input name="unidad" type="text" class="Estilo66" id="unidad" value="<?php echo $unidad ?>" size="6" maxlength="6" />
<input name="unidad_descuento" type="text" class="Estilo66" id="unidad_descuento" value="<?php echo $unidad_descuento_cartera ?>" size="6" maxlength="6" />
<input name="unidad_descuento" type="text" class="Estilo66" id="unidad_descuento" value="<?php echo $codigo_descuento_cartera ?>" size="6" maxlength="6" />
</td>
</tr>
<tr>
<td class="tdder" >Nº CUENTA</td>
<td class="tdizq"><input name="num_cuenta" type="text" id="num_cuenta" value="<?php echo $cuenta ?>" size="40" maxlength="40" /></td>
<td class="tdder">BANCO</td>
<td class="tdizq" colspan="2"><input name="banco" type="text" id="banco" value="<?php echo $banco ?>" size="40" maxlength="40" /></td>
</tr>
<tr>
<td class="tdrojad">Libranza Credito:</td>
<td class="tdizq"><input name="creditolibranza" type="text" class="rojo" id="creditolibranza" value="<?php echo $cred ?>" size="40" maxlength="40"/></td>
<td class="tdrojad">N° Cuotas:</td>
<td class="tdizq" colspan="2">
<input name="numcuotas" type="text" class="rojo" id="numcuotas" value="<?php echo $numero_cuotas ?>" size="40" maxlength="40"/>
</td>
</tr>
<tr>
<td class="tdder">Cuotas Pendientes:</td>
<td class="tdizq"><input name="cuotas_pendientes" type="text" class="rojo" id="cuotas_pendientes" value="<?php echo $cuotas_pendientes ?>" size="40" maxlength="40"/></td>
<td class="tdder">Cuotas Descontadas:</td>
<td class="tdizq" colspan="2"><input name="cuotas_descontadas" type="text" class="rojo" id="cuotas_descontadas" value="<?php echo $cuotas_descontadas ?>" size="40" maxlength="40"/></td>
</tr>
<tr>
<td class="tdder">Saldo Anterior:</td>
<td class="tdizq"><input name="saldo_anterior" type="text" id="saldo_anterior" value="<?php echo $saldo_anterior ?>" size="40" maxlength="40"/></td>
<td class="tdrojad">Nuevo Saldo:</td>
<td class="tdizq" colspan="2"><input name="saldo_nuevo" type="text" class="rojo" id="saldo_nuevo" value="<?php echo $saldo_nuevo ?>" size="40" maxlength="40"/></td>
</tr>
<tr>
<td class="tdder" >Valor Cuota</td>
<td class="tdizq"><input name="cuomes" type="text" id="cuomes" value="<?php echo $valor_cuota ?>" size="40" maxlength="40" /></td>
<td class="tdder" >PROMOCIÓN</td>
<td class="tdizq"><input name="promocion" type="text" id="promocion" value="<?php echo $promocion ?>" size="40" maxlength="40" /></td>
</tr>
<tr>
<td class="tdder" >ENTIDAD</td>
<td class="tdizq"><input name="entidad" type="text" id="entidad" value="<?php echo $entidad ?>" size="40" maxlength="40" /></td>
<td class="tdder">ESCUELA</td>
<td class="tdizq" colspan="2"><input name="escuela" type="text" id="escuela" value="<?php echo $escuela ?>" size="40" maxlength="40" /></td>
</tr>
<tr>
<td class="tdrojad" >Saldo Pendiente</td>
<td class="tdizq"><input name="saldo_pendiente" class="rojo" type="text" id="saldo_pendiente" value="<?php echo $saldo_pendiente ?>" size="40" maxlength="40" /></td>
<?php
if($cifin == true){ ?>
<td class="tdrojad" >CIFIN</td>
<td><input name="cifin" class="rojo" type="text" id="cifin" value="<?php echo $cifin ?>" size="40" maxlength="40" /></td>
<?php } ?>
</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" /></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" /></td>
</tr>
<tr>
<td class="tdrojad" >Fecha Inicio</td>
<td class="tdizq"><input name="fecha_inicio_credito" type="text" id="fecha_inicio_credito" value="<?php echo $fecha_inicio_credito ?>" size="40" maxlength="40" /></td>
<td class="tdrojad" >Fecha Termina</td>
<td><input name="fecha_termino_credito" type="text" id="fecha_termino_credito" value="<?php echo $fecha_termino_credito ?>" size="40" maxlength="40" /></td>
</tr>
<?php if($interes_muerto != ""): ?>
<tr>
<td class="tdrojad">Interes Muerto</td>
<td class="tdizq"><input name="interes_muerto" type="text" id="interes_muerto" value="<?php echo $interes_muerto ?>" size="30" maxlength="30" />
</td>
</tr>
<?php endif; ?>
<?php if($fecha_anticipo0 != "" || $fecha_anticipo0 != 0000-00-00): ?>
<tr>
<td class="tdder" >Valor Anticipo M</td>
<td class="tdizq"><input name="valor_anticipo0" type="text" id="valor_anticipo0" value="<?php echo $valor_anticipo0 ?>" size="10" maxlength="10" /> -
Planilla - <input name="planilla0" type="text" id="planilla0" value="<?php echo $planilla0 ?>" size="4" maxlength="4" /></td>
<td class="tdder">Fecha Anticipo M</td>
<td class="tdizq" colspan="2"><input name="fecha_anticipo0" type="text" id="fecha_anticipo0" value="<?php echo $fecha_anticipo0 ?>" size="10" maxlength="10" /> -
provee 1 <input name="proveedor0" type="text" id="proveedor0" value="<?php echo $proveedor0 ?>" size="10" maxlength="10" /></td>
</tr>
<?php endif; ?>
<?php if($fecha_anticipo != "" || $fecha_anticipo != 0000-00-00): ?>
<tr>
<td class="tdder" >Valor Anticipo 1</td>
<td class="tdizq"><input name="valor_anticipo" type="text" id="valor_anticipo" value="<?php echo $valor_anticipo ?>" size="10" maxlength="10" /> -
Planilla - <input name="planilla" type="text" id="planilla" value="<?php echo $planilla ?>" size="4" maxlength="4" /></td>
<td class="tdder">Fecha Anticipo 1</td>
<td class="tdizq" colspan="2"><input name="fecha_anticipo" type="text" id="fecha_anticipo" value="<?php echo $fecha_anticipo ?>" size="10" maxlength="10" /> -
provee 1 <input name="proveedor" type="text" id="proveedor" value="<?php echo $proveedor ?>" size="10" maxlength="10" /></td>
</tr>
<?php endif; ?>
<?php if($fecha_anticipo2 != "" || $fecha_anticipo2 != 0000-00-00): ?>
<tr>
<td class="tdder" >Valor Anticipo 2</td>
<td class="tdizq"><input name="valor_anticipo2" type="text" id="valor_anticipo2" value="<?php echo $valor_anticipo2 ?>" size="10" maxlength="10" /> -
Planilla - <input name="planilla2" type="text" id="planilla2" value="<?php echo $planilla2 ?>" size="4" maxlength="4" /></td>
<td class="tdder">Fecha Anticipo 2</td>
<td class="tdizq" colspan="2"><input name="fecha_anticipo2" type="text" id="fecha_anticipo2" value="<?php echo $fecha_anticipo2 ?>" size="10" maxlength="10" /> -
provee 2 <input name="proveedor2" type="text" id="proveedor2" value="<?php echo $proveedor2 ?>" size="10" maxlength="10" /></td>
</tr>
<?php endif; ?>
<?php if($fecha_anticipo3 != "" || $fecha_anticipo3 != 0000-00-00): ?>
<tr>
<td height="38" class="tdder" >Valor Anticipo 3</td>
<td class="tdizq"><input name="valor_anticipo3" type="text" id="valor_anticipo3" value="<?php echo $valor_anticipo3 ?>" size="10" maxlength="10" /> -
Planilla - <input name="planilla3" type="text" id="planilla3" value="<?php echo $planilla3 ?>" size="4" maxlength="4" /></td>
<td class="tdder">Fecha Anticipo 3</td>
<td class="tdizq" colspan="2"><input name="fecha_anticipo3" type="text" id="fecha_anticipo3" value="<?php echo $fecha_anticipo3 ?>" size="10" maxlength="10" /> -
provee 3 <input name="proveedor3" type="text" id="proveedor3" value="<?php echo $proveedor3 ?>" size="10" maxlength="10" /></td>
</tr>
<?php endif; ?>
<?php if($fecha_anticipo4 != "" || $fecha_anticipo4 != 0000-00-00): ?>
<tr>
<td height="38" class="tdder" >Valor Anticipo 4</td>
<td class="tdizq"><input name="valor_anticipo4" type="text" id="valor_anticipo4" value="<?php echo $valor_anticipo4 ?>" size="10" maxlength="10" /> -
Planilla - <input name="planilla4" type="text" id="planilla4" value="<?php echo $planilla4 ?>" size="4" maxlength="4" /></td>
<td class="tdder">Fecha Anticipo 4</td>
<td class="tdizq" colspan="2"><input name="fecha_anticipo4" type="text" id="fecha_anticipo4" value="<?php echo $fecha_anticipo4 ?>" size="10" maxlength="10" /> -
provee 4 <input name="proveedor4" type="text" id="proveedor4" value="<?php echo $proveedor4 ?>" size="10" maxlength="10" /></td>
</tr>
<?php endif; ?>
<!--<tr>
<td class="tdder">SALDO PENDIENTE</td>
<td class="tdizq"><input name="saldo_pendiente" type="text" class="rojo" id="saldo_pendiente" value="<?php echo $saldo_pendiente ?>" size="12" maxlength="10" readonly/>
<td class="tdder">DESEMBOLSO</td>
<td class="tdizq"><input name="valor_desembolso" type="text" class="rojo" id="valor_desembolso" value="<?php echo $desembolso1 ?>" size="30" maxlength="30" readonly/></td>
</tr>
-->
<!--<tr >
<td class="tdroja">Cuenta No :</td>
<td bgcolor="#F7FFE1"><div align="left" class="Estilo70">
<input name="cuenta" type="text" class="Estilo66" id="cuenta" value="<?php echo $cuenta ?>" size="25" maxlength="25" />
</div></td>
<td class="tdroja">Banco :</td>
<td bgcolor="#F7FFE1" ><div align="left" class="Estilo70">
<input name="banco" type="text" class="Estilo66" id="banco" value="<?php echo $banco ?>" size="20" maxlength="20" />
</div></td>
</tr>
</tr>-->
<?php if($causal != "" and $estado == 0): ?>
<tr>
<td class="tdrojad">Causal Terminacion</td>
<td class="tdizq"><input name="causal" type="text" id="causal" value="<?php echo $causal ?>" size="45" maxlength="45" /></td>
<td class="tdder"></td>
<td class="tdizq"></td>
</tr>
<?php endif; ?>
<?php if($liquidacion_credito_reporte): ?>
<tr>
<td class="tdrojad">Liquidacion Credito Para Reporte</td>
<td class="tdizq"><input name="liquidacion_credito_reporte" type="text" id="liquidacion_credito_reporte" value="<?php echo $liquidacion_credito_reporte ?>" size="45" maxlength="45" /></td>
<td class="tdder"></td>
<td class="tdizq"></td>
</tr>
<?php endif; ?>
</table>
<br>
<table width="900" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
<td class="fecha" colspan="6">INFORMACION COMPLEMENTARIA</td>
</tr>
<tr>
</tr>
<tr>
<td class="tdder">Nombre Padre o Nombre Madre</td>
<td class="tdizq" colspan="2"><input name="nom_padre" type="text" id="nom_padre" value="<?php echo $nompadre ?>" size="30" maxlength="45" /></td>
<!--<td class="tdder">Nombre Madre</td>
<td class="tdizq" colspan="2"><input name="nom_madre" type="text" id="nom_madre" value="<?php echo $nommadre ?>" size="45" maxlength="45" /></td>-->
<td class="tdder">Ciudad</td>
<td class="tdizq" colspan="2"><input name="ciudad_padres" type="text" id="ciudad_padres" value="<?php echo $ciudadpadres ?>" size="30" maxlength="45" /></td>
</tr>
<tr>
<!--<td class="tdder">Direccion de Padres</td>
<td class="tdizq" colspan="2"><input name="dir_padres" type="text" id="dir_padres" value="<?php echo $direcpadres ?>" size="45" maxlength="45" /></td>-->
</tr>
<tr>
<td class="tdder">Telefono Padres</td>
<td class="tdizq" colspan="2"><input name="tel_padres" type="text" id="tel_padres" value="<?php echo $telpadres ?>" size="30" maxlength="45" /></td>
<td class="tdder">Celular Padres</td>
<td class="tdizq" colspan="2"><input name="cel_padres" type="text" id="cel_padres" value="<?php echo $celpadres ?>" size="30" maxlength="45" /></td>
</tr>
<tr>
<td class="tdder" >Referencia <br> COMPAÑERO</td>
<td class="tdizq" colspan="2"><input name="ref_compa" type="text" id="ref_compa" value="<?php echo $refcompa ?>" size="30" maxlength="45" /></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 $celcompa ?>" size="30" maxlength="45" /></td>
</tr>
<!--AGREGO ESTO DESPUES DE MIL CAMBIOS. esto esta en otro archivo-->
<!--<tr>
<td class="tdrojad" >CUPO ASIGNADO</td>
<td class="tdizq" colspan="2"><input name="monto_solicitado" type="text" id="monto_solicitado" value="<?php echo $monto_solicitado ?>" size="40" maxlength="40" readonly/></td>
<td class="tdrojad">SALDO PENDIENTE</td>
<td class="tdizq" colspan="2"><input name="saldo_pendiente" type="text" id="saldo_pendiente" value="<?php echo $saldo_pendiente ?>" size="40" maxlength="40" readonly/></td>
</tr>-->
<!--<tr>
<td class="tdder" >ENTIDAD</td>
<td class="tdizq" colspan="2"><input name="entidad" type="text" id="entidad" value="<?php echo $entidad ?>" size="45" maxlength="45" disabled/></td>
<td class="tdder">ESCUELA</td>
<td class="tdizq" colspan="2"><input name="escuela" type="text" id="escuela" value="<?php echo $escuela ?>" size="45" maxlength="45" disabled/></td>
</tr>-->
<tr align="center">
<td height="5" colspan="6"></td>
</TR>
</table>
<!-- codeudor -->
<?php if($rango == "EJERCITO"): ?>
<br>
<table width="900" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
<td class="fecha" colspan="6">DATOS CODEUDOR</td>
</tr>
<tr>
</tr>
<tr>
<td class="tdder">Cedula Codeudor</td>
<td class="tdizq" colspan="2"><input name="cedula_codeudor" type="text" id="cedula_codeudor" value="<?php echo $cedula_codeudor ?>" size="40" maxlength="40" /></td>
<td class="tdder">Nombre Completo</td>
<td class="tdizq" colspan="2"><input name="nombre_codeudor" type="text" id="nombre_codeudor" value="<?php echo $nombre_codeudor ?>" size="40" maxlength="40" /></td>
</tr>
<tr>
<td class="tdder">Celular</td>
<td class="tdizq" colspan="2"><input name="celular_codeudor" type="text" id="celular_codeudor" value="<?php echo $celular_codeudor ?>" size="40" maxlength="40" /></td>
<td class="tdder" >Telefono</td>
<td class="tdizq" colspan="2"><input name="telefono_codeudor" type="text" id="telefono_codeudor" value="<?php echo $telefono_codeudor ?>" size="40" maxlength="40" /></td>
</tr>
<tr>
<td class="tdder">Direccion</td>
<td class="tdizq" colspan="2"><input name="direccion_codeudor" type="text" id="direccion_codeudor" value="<?php echo $direccion_codeudor ?>" size="40" maxlength="40" /></td>
<td class="tdder">Ciudad</td>
<td class="tdizq" colspan="2"><input name="ciudad_codeudor" type="text" id="ciudad_codeudor" value="<?php echo $ciudad_codeudor ?>" size="40" maxlength="40" /></td>
</tr>
<tr>
<td class="tdder" >Email</td>
<td class="tdizq" colspan="2"><input name="email_codeudor" type="text" id="email_codeudor" value="<?php echo $email_codeudor ?>" size="40" maxlength="40" /></td>
<td class="tdder" colspan="2"></td>
</tr>
<tr align="center">
<td colspan="6"></td>
</tr>
</table>
<?php endif; ?>
<?php if($cuotas_refinanciacion != 0) { ?>
<br><br>
<h3 align="center">REFINANCIACION</h3>
<table width="900" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
<td class="tdder">Fecha Refinanciacion</td>
<td class="tdizq" colspan="2"><input name="fecha_refinanciacion" type="text" id="$fecha_refinanciacion" value="<?php echo $fecha_refinanciacion ?>" readonly size="30" maxlength="30" /></td>
<td class="tdder">Cuotas Refinanciación</td>
<td class="tdizq" colspan="2"><input name="$cuotas_refinanciacion" type="text" id="$cuotas_refinanciacion" value="<?php echo $cuotas_refinanciacion ?>" readonly size="30" maxlength="30" /></td>
</tr>
<tr>
<td class="tdder">N° Cuotas cobrados antes de refinanciacion</td>
<td class="tdizq" colspan="2"><input name="cuotas_antesde_refinanciacion" type="text" id="cuotas_antesde_refinanciacion" value="<?php echo $cuotas_antesde_refinanciacion ?>" readonly size="30" maxlength="30" /></td>
<td class="tdder">CUOTAS DE CAPITAL COBRADAS ANTES DE LA REFINANCIACION</td>
<td class="tdizq" colspan="2"><input name="cuotas_capital_cobradas_antesde_refinanciacion" type="text" id="cuotas_capital_cobradas_antesde_refinanciacion" value="<?php echo $cuotas_capital_cobradas_antesde_refinanciacion ?>" readonly size="30" maxlength="30" /></td>
</tr>
<tr>
<td class="tdder">Menor Valor Cobrado</td>
<td class="tdizq" colspan="2"><input name="menor_valor_cobrado" type="text" id="menor_valor_cobrado" value="<?php echo $valores4 ?>" size="30" maxlength="30" /></td>
</tr>
</table>
<br><br>
<?php } ?>
<!--NUEVVO-->
<div align="center">
<p>Fecha Corte<input type="text" name="fecha_corte_temporal" id="fecha_corte_temporal" value="0000-00-00">
<input type="submit" value="CALCULAR" name="calcular" id="calcular"/></p>
</div>
<div align="center">
<table width="900" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<tr>
<td class="fecha" colspan="9">DATOS LIQUIDACION</td>
</tr>
<?php if($fecha_corte){ ?>
<tr>
<td colspan="9">FECHA CORTE CARTERA<input type="text" name="fecha_corte" value="<?php echo $fecha_corte?>" size="8" readonly/></td>
</tr>
<?php }else{ ?>
<?php if($fecha_corte_temporal != "0000-00-00" && $numero_row == 0){ ?>
<tr>
<td colspan="9">FECHA CORTE TEMPORAL <input type="text" name="fecha_corte" value="<?php echo $fecha_corte_temporal ?>" size="8" readonly/></td>
</tr>
<?php } if($fecha_corte_temporal == "0000-00-00" && $numero_row == 0){ ?>
<tr>
<td colspan="9">FECHA CORTE HOY <input type="text" name="fecha_corte" value="<?php echo date("Y-m-d") ?>" size="8" readonly/></td>
</tr>
<?php } ?>
<?php } ?>
<tr>
<td class="tdtitulo">N°</td>
<td class="tdtitulo">ANTICIPOS</td>
<td class="tdtitulo">FECHA INICIO</td>
<td class="tdtitulo">N° DIAS</td>
<td class="tdtitulo">INTERES</td>
<td class="tdtitulo">GASTOS FINANCIEROS</td>
<td class="tdtitulo">VALOR TOTAL</td>
</tr>
<?php
//if($rango == "EJERCITO")
//{
?>
<?php
if($interes_muerto != ""){ ?>
<?php if($fecha_anticipo0 != 0000-00-00){
$fecha_anticipoDiff = $fecha_anticipo0;
$dias_diff = $dias_anticipo0;
}else {
$fecha_anticipoDiff = $fecha_anticipo;
$dias_diff = $dias_anticipo1;
}
?>
<?php if($promocion == "65E"){ ?>
<tr>
<td class="tdfull"><?php echo "INTERES"; ?></td>
<td class="tdfull"><?php echo $interes_muerto; ?></td>
<td class="tdfull"><?php echo $fecha_anticipoDiff ?></td>
<td class="tdfull"><?php echo $dias_diff; ?></td>
<td class="tdfull"><?php echo $total_interes_uno; ?></td>
<td class="tdfull"><?php echo $total_interes_dos; ?></td>
<td class="tdfull"><?php echo $valor_total_interes_muerto; ?></td>
</tr>
<?php } ?>
<?php } ?>
<?php
/*if($fecha_anticipo0 != "" and $valor_anticipo0 != ""){ ?>
<tr>
<td class="tdfull"><?php echo "0"; ?></td>
<td class="tdfull"><?php echo $valor_anticipo0; ?></td>
<td class="tdfull"><?php echo $fecha_anticipo0; ?></td>
<td class="tdfull"><?php echo "." ?></td>
<td class="tdfull"><?php echo "." ?></td>
<td class="tdfull"><?php echo "." ?></td>
<td class="tdfull"><?php echo "." ?></td>
</tr>
<?php }*/ ?>
<?php
//}
?>
<?php
if($fecha_anticipo0 != 0000-00-00){ ?>
<tr>
<td class="tdfull"><?php echo "0"; ?></td>
<td class="tdfull"><?php echo $valor_anticipo0; ?></td>
<td class="tdfull"><?php echo $fecha_anticipo0; ?></td>
<td class="tdfull"><?php echo $dias_anticipo0; ?></td>
<td class="tdfull"><?php echo $total_interes_uno0; ?></td>
<td class="tdfull"><?php echo $total_interes_dos0; ?></td>
<td class="tdfull"><?php echo $valor_total0; ?></td>
</tr>
<?php } ?>
<?php
if($fecha_anticipo != ""){ ?>
<tr>
<td class="tdfull"><?php echo "1"; ?></td>
<td class="tdfull"><?php echo $valor_anticipo; ?></td>
<td class="tdfull"><?php echo $fecha_anticipo; ?></td>
<td class="tdfull"><?php echo $dias_anticipo1; ?></td>
<td class="tdfull"><?php echo $total_interes_uno1; ?></td>
<td class="tdfull"><?php echo $total_interes_dos1; ?></td>
<td class="tdfull"><?php echo $valor_total1; ?></td>
</tr>
<?php } ?>
<?php
if($fecha_anticipo2 != ""){ ?>
<tr>
<td class="tdfull"><?php echo "2"; ?></td>
<td class="tdfull"><?php echo $valor_anticipo2; ?></td>
<td class="tdfull"><?php echo $fecha_anticipo2; ?></td>
<td class="tdfull"><?php echo $dias_anticipo2; ?></td>
<td class="tdfull"><?php echo $total_interes_uno2; ?></td>
<td class="tdfull"><?php echo $total_interes_dos2; ?></td>
<td class="tdfull"><?php echo $valor_total2; ?></td>
</tr>
<?php } ?>
<?php
if($fecha_anticipo3 != ""){ ?>
<tr>
<td class="tdfull"><?php echo "3"; ?></td>
<td class="tdfull"><?php echo $valor_anticipo3; ?></td>
<td class="tdfull"><?php echo $fecha_anticipo3; ?></td>
<td class="tdfull"><?php echo $dias_anticipo3; ?></td>
<td class="tdfull"><?php echo $total_interes_uno3; ?></td>
<td class="tdfull"><?php echo $total_interes_dos3; ?></td>
<td class="tdfull"><?php echo $valor_total3; ?></td>
</tr>
<?php } ?>
<?php
if($fecha_anticipo4 != ""){ ?>
<tr>
<td class="tdfull"><?php echo "4"; ?></td>
<td class="tdfull"><?php echo $valor_anticipo4; ?></td>
<td class="tdfull"><?php echo $fecha_anticipo4; ?></td>
<td class="tdfull"><?php echo $dias_anticipo4; ?></td>
<td class="tdfull"><?php echo $total_interes_uno4; ?></td>
<td class="tdfull"><?php echo $total_interes_dos4; ?></td>
<td class="tdfull"><?php echo $valor_total4; ?></td>
</tr>
<?php } ?>
<tr>
<td class="tdtitulo" colspan=""></td>
<td class="tdtitulo" colspan=""><?php echo $total_pagar_capital ?></td>
<td class="tdtitulo" colspan="4"></td>
<td class="tdtitulo"><?php echo $total_pagar_interes; ?></td>
</tr>
<!--
<tr>
<td class="tdtitulo" colspan="2">NUMERO CUOTAS</td>
<td class="tdfull" colspan="2"><?php echo $numero_cuotas; ?></td>
<td class="tdtitulo" colspan="2">VALOR MENSUAL</td>
<td class="tdfull"><?php echo $total_mensual; ?></td>
</tr>
-->
<tr>
<td class="tdfull" colspan="5"></td>
<td class="tdtitulo">NUEVO A LIQUIDAR</td>
<td class="tdfull"><?php echo $total_suma_capita_interes; ?></td>
</tr>
<tr>
<td class="tdfull" colspan="5"></td>
<td class="tdtitulo">INTERES PROYECTADO</td>
<td class="tdfull"><?php echo $total_interes_proyectado; ?></td>
</tr>
<tr>
<td class="tdfull" colspan="5"></td>
<td class="tdtitulo">TOTAL PROYECTADO</td>
<td class="tdfull"><?php echo $total_proyectado; ?></td>
</tr>
<tr>
<td class="tdfull" colspan="5"></td>
<td class="tdtitulo">VALOR CUOTA MENSUAL</td>
<td class="tdfull"><?php echo $total_cuota_mensual; ?></td>
</tr>
<tr>
<td class="tdfull" colspan="5"></td>
<td class="tdtitulo">SALDO SIN INTERES</td>
<td class="tdfull"><?php echo $saldo_sin_interes; ?></td>
</tr>
<?php if($cuotas_refinanciacion != 0){ ?>
<tr>
<td class="" colspan="8" height="25px"></td>
</tr>
<tr>
<td colspan="8">REFINANCIACION</td>
</tr>
<!--
<tr>
<td class="tdfull" colspan="5"></td>
<td class="tdtitulo der">CUOTAS COBRADAS ANTES DE LA REFINANCIACION</td>
<td class="tdfull"><?php echo $cuotas_antesde_refinanciacion; ?></td>
</tr>
<!--
<tr>
<td class="tdfull" colspan="5"></td>
<td class="tdtitulo der">CUOTAS DE CAPITAL COBRADAS ANTES DE LA REFINANCIACION</td>
<td class="tdfull"><?php echo $cuotas_capital_cobradas_antesde_refinanciacion; ?></td>
</tr>
<tr>
<td class="tdfull" colspan="5"></td>
<td class="tdtitulo der">MENOR VALOR COBRADO</td>
<td class="tdfull"><?php echo $valores4; ?></td>
</tr>
-->
<tr>
<td class="tdfull" colspan="5"></td>
<td class="tdtitulo der">SUMA CAPITAL MAS INTERESES GENERADOS MÁS VALOR DEJADO DE COBRAR</td>
<td class="tdfull"><?php echo $total_mas_dejado_de_cobrar; ?></td>
</tr>
<tr>
<td class="tdfull" colspan="5"></td>
<td class="tdtitulo der">TOTAL POR MESES PENDIENTES</td>
<td class="tdfull"><?php echo $total_interes_cuotas_pendientes; ?></td>
</tr>
<tr>
<td class="tdfull" colspan="5"></td>
<td class="tdtitulo der">SUMA CAPITAL, MAS INTERESES GENERADOS, MÁS INTERESES PROYECTADOS</td>
<td class="tdfull"><?php echo $suma_capital_mas_intereses_proyectados; ?></td>
</tr>
<?php } ?>
</table>
</div>
</form>
</body>
</html>
<?php
$sqlrevisionno = mysql_query("SELECT reportado FROM credito_rotativo WHERE cedula = '".$cedula."' and libranza_credito = '".$cred."' and reportado != '' ");
if (!$sqlrevisionno) {
die('Invalid query: ' . mysql_error());
}
list($reportado) = mysql_fetch_row($sqlrevisionno);
if($reportado != "")
{
echo'<table width="800" border="1" cellspacing="2" cellpadding="2" align = "center">
<tr align="center">
<td colspan="7"><font face="Georgia, Times New Roman, Times, serif" color="#000066"><b align = "center">PAGOS EFECTUADOS</b></font></td>
</tr>
<tr align="center" bgcolor="#FFFFCC">
<td width="260" align="center"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000066">Valor cuota</font></td>
<td bgcolor="#FFFFCC" width="55" ><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000066"># cuotas</font></td>
<td width="100"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000066" align="center">Mes</font></td>
<td width="100"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000066" align="center">Año</font></td>
<td width="260"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000066">Fecha pago</font></td>
<td width="400" ><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000066">Entidad</font></td>
<td width="260"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000066">Fecha registro</font></td>
</tr>';
$control = mysql_query('SELECT id, cedula, nombre, numero_libranza, credito_libranza, numero_cuota, mes_cuota, ano_cuota, valor_cuota, fecha_nomina, fecha_registro, codigo_descuento, unidad_descuento FROM credito_rotativo_estado_contable WHERE cedula = "' . $_GET["ced2"] . '" and credito_libranza = "' . $_GET["cred"] . '" ORDER BY numero_cuota ASC ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
while(list($id, $cedula, $nombre, $numlib, $libranza_credito, $cuota, $mescuota, $anocuota, $valorcuota, $fecha_nomina, $fecha_registro, $codesc, $unidesc) = mysql_fetch_row($control))
{
$control5 = mysql_query('SELECT * FROM descuentos WHERE codigo = "' ."$codesc". '" and unidad = "' ."$unidesc". '" ');
if (!$control5) {
die('Invalid query: ' . mysql_error());
}
list($idr, $codigo, $unidad, $concepto) = mysql_fetch_row($control5);
printf ("<tr align='center' bgcolor='#f4f4f4'>
<td width='100'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\">$valorcuota</a></td>
<td width='100'> <font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$cuota</a></td><td width='100'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$mescuota</a></td>
<td width='100'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$anocuota</a></td>
<td width='120'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=120,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$fecha_nomina</a></td>
<td width='750'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=250,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$concepto</a></td>
<td width='120'><font face='Geneva, Arial, Helvetica, san-serif' size='2' color=#993300'><a window.location.href=\"cartera_modificar_estado.php?id=$id\" top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$fecha_registro</a></td></tr>");
}
echo "</table>";
}
else{
die();
}
?>