File: /home/asjudine/public_html/cartera_modificar_datos_financiera.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("Conectarse.php");
$dis = date("d");
$mes = date("m");
$anos = date("Y");
$fechamodificada = $anos.'-'.$mes.'-'.$dis ;
$control = mysql_query('SELECT cedula, codigo_militar, nombre, grado, numerocontrato, tipocontrato , numero_libranza , tipo_afiliado, codigo_sucursal, direccion , telefono, celular, ciudad , email, cuenta, banco, entidad_laboral, unidad_descuento, codigo_descuento, entidad_recaudo, fecha_nacimiento, fecha_afiliacion, valorcontrato, numerocuotas, valorcuota, fecha_inicio_contrato, fecha_termino_contrato, fecha_ultimo_registro, mes_inicio, ano_inicio, mes_termino, ano_termino, saldoanteior, cuotaspendientes, cuotasdescontadas, saldonuevo, vendedor, director, renovacion, causal_terminacion, fecha_terminacion FROM cartera_serviasjudinet WHERE cedula = "' . $_GET["ced2"] . '" and numerocontrato = "' . $_GET["numcon"] . '" ');
if (!$control) {
die('Invalid query 1: ' . mysql_error());
}
$num=mysql_num_rows($control);
list($cedula, $codi, $apes, $grad, $numcont, $plan, $num_lib, $titular, $codigosu, $dire, $tele, $celul, $ciud, $email, $cue, $ban, $enti, $unides, $codides, $entre, $fecna, $fechafil, $valcon, $numcuo, $valcuo, $fechainicio, $fechatermino, $fechaul, $mesini, $anoini, $mesfin, $anofin, $salant, $cuopen, $cudesc, $salnue, $ven, $director, $renova, $causal, $fechater) = mysql_fetch_row($control);
$inipag = $anoini.'-'.$mesini;
if ($causal > 0)
{
$control = mysql_query('SELECT concepto FROM descuentos WHERE codigo = "' . $causal. '" and (unidad = "' . $unides. '" || unidad = "" )');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($control)== 0))
{
$control = mysql_query('SELECT concepto FROM descuentos WHERE codigo = "' . $causal. '" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
}
list($causal) = mysql_fetch_row($control);
}
$control = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "' . "$codigosu". '" ');
if (!$control) {
die('Invalid query 1: ' . mysql_error());
}
list($codigosu) = mysql_fetch_row($control);
$cont10 = mysql_query('SELECT nombre FROM entidad_laboral WHERE codigo = "' . "$enti". '"');
if (!$cont10) {
die('Invalid query 2: ' . mysql_error());
}
list($enti) = mysql_fetch_row($cont10);
$cont10 = mysql_query('SELECT nombre FROM director_ventas WHERE codigo = "' . "$director". '"');
if (!$cont10) {
die('Invalid query 3: ' . mysql_error());
}
list($director) = mysql_fetch_row($cont10);
$cont10 = mysql_query('SELECT concepto FROM descuentos WHERE id = "' . "$entre". '"');
if (!$cont10) {
die('Invalid query 11: ' . mysql_error());
}
list($entre) = mysql_fetch_row($cont10);
$cont10 = mysql_query('SELECT vendedor FROM vendedores WHERE codigo = "' . "$ven". '" ');
if (!$cont10) {
die('Invalid query 12: ' . mysql_error());
}
list($ven) = mysql_fetch_row($cont10);
if ($plan > 0)
{
$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "' . "$plan". '" ');
if (!$cont10) {
die('Invalid query 42: ' . mysql_error());
}
list($plan) = mysql_fetch_row($cont10);
}
if(isset($_POST["guardar"]))
{
$dis = date("d");
$mes = date("m");
$anos = date("Y");
$fechamodi = $fechater;
$mt = floor(($mes_inicio + $numcuo)/12);
$submt = (($mes_inicio + $numcuo)%12)-1;
$at = $mt + $ano_inicio;
if($submt==0)
{
$submt = 12;
$at = $at-1;
}
if ($_POST[codigo_sucursal] == ""){
$control = mysql_query('SELECT codigo FROM sucursal WHERE nombre = "' . $_POST[codigosu] . '"');
if (!$control) {
die('Invalid query 1: ' . mysql_error());
}
list($codigosu) = mysql_fetch_row($control);
}else{
$control = mysql_query('SELECT codigo FROM sucursal WHERE codigo = "' . $_POST[codigo_sucursal] . '"');
if (!$control) {
die('Invalid query 1: ' . mysql_error());
}
list($codigosu) = mysql_fetch_row($control);
}
if ($_POST[entis]== ""){
$cont10 = mysql_query('SELECT codigo FROM entidad_laboral WHERE nombre = "' . $_POST[enti] . '"');
if (!$cont10) {
die('Invalid query 2: ' . mysql_error());
}
list($enti) = mysql_fetch_row($cont10);
}else{
$cont10 = mysql_query('SELECT codigo FROM entidad_laboral WHERE codigo = "' . $_POST[entis] . '"');
if (!$cont10) {
die('Invalid query 2: ' . mysql_error());
}
list($enti) = mysql_fetch_row($cont10);
}
if ($_POST[cod_dir] == ""){
$cont10 = mysql_query('SELECT codigo FROM director_ventas WHERE nombre = "' . $_POST[direc] . '"');
if (!$cont10) {
die('Invalid query 3: ' . mysql_error());
}
list($director) = mysql_fetch_row($cont10);
}else{
$cont10 = mysql_query('SELECT codigo FROM director_ventas WHERE codigo = "' . $_POST[cod_dir] . '"');
if (!$cont10) {
die('Invalid query 3: ' . mysql_error());
}
list($director) = mysql_fetch_row($cont10);
}
if ($_POST[unidt2] == ""){
$unides = $_POST[unidet];
}else{
$unides = $_POST[unidt2] ;
if ($causal != "")
{
$fechamodi = $anos.'-'.$mes.'-'.$dis ;
}
}
if ($_POST[codigo3] == ""){
$codides = $_POST[codidet];
}else{
$codides = $_POST[codigo3];
}
if ($_POST[entrec] == ""){
$cont10 = mysql_query('SELECT id FROM descuentos WHERE concepto = "' . $_POST[entre] . '" ');
if (!$cont10) {
die('Invalid query 11: ' . mysql_error());
}
list($entre) = mysql_fetch_row($cont10);
}else{
$cont10 = mysql_query('SELECT id FROM descuentos WHERE id = "' . $_POST[entrec] . '" ');
if (!$cont10) {
die('Invalid query 11: ' . mysql_error());
}
list($entre) = mysql_fetch_row($cont10);
}
if ($_POST[ase] == ""){
$cont10 = mysql_query('SELECT codigo FROM vendedores WHERE vendedor = "' . $_POST[vendedor] . '" ');
if (!$cont10) {
die('Invalid query 12: ' . mysql_error());
}
list($ven) = mysql_fetch_row($cont10);
}else{
$cont10 = mysql_query('SELECT codigo FROM vendedores WHERE codigo = "' . $_POST[ase] . '" ');
if (!$cont10) {
die('Invalid query 12: ' . mysql_error());
}
list($ven) = mysql_fetch_row($cont10);
}
if ($_POST[planc] == ""){
$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo_contrato = "' . $_POST[plan] . '" ');
if (!$cont10) {
die('Invalid query 42: ' . mysql_error());
}
list($plan) = mysql_fetch_row($cont10);
}else{
$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo_contrato = "' . $_POST[planc] . '" ');
if (!$cont10) {
die('Invalid query 42: ' . mysql_error());
}
list($plan) = mysql_fetch_row($cont10);
}
if ($_POST[causal2] == ""){
$cont10 = mysql_query('SELECT id, codigo, unidad, concepto FROM descuentos WHERE concepto = "' . $_POST[causal] . '" ');
if (!$cont10) {
die('Invalid query 11: ' . mysql_error());
}
list($id, $codicau, $unidest, $causal) = mysql_fetch_row($cont10);
}else{
$cont10 = mysql_query('SELECT id, codigo, unidad, concepto FROM descuentos WHERE id = "' . $_POST[causal2] . '" ');
if (!$cont10) {
die('Invalid query 11: ' . mysql_error());
}
list($id, $codicau, $unidest, $causal) = mysql_fetch_row($cont10);
if($id == "47" and $codicau == "1")
{
$codides = "1";
}
if($id == "60" and $codicau == "11")
{
$unides = "CCPP";
}
if($id == "63" and $codicau == "14")
{
$unides = $unides;
$codides = "14";
}
if($id == "50" and $codicau == "4")
{
$unides = "MCPE";
}
$dis = date("d");
$mes = date("m");
$anos = date("Y");
$fechamodi = $anos.'-'.$mes.'-'.$dis ;
echo $fechamodi;
}
$mssql3 = mysql_query("UPDATE cartera_serviasjudinet set cedula = '" . $_POST[cedb] . "', codigo_militar = '" . $_POST[cod] . "', nombre = '" . $_POST[apenom] . "', grado = '" . $_POST[gra] . "', numerocontrato = '" . $_POST[numcont] . "', tipocontrato = '" .$plan. "', numero_libranza = '" . $_POST[num_lib] . "', codigo_sucursal = '" .$codigosu."', direccion = '" . $_POST[dire] . "', telefono = '" . $_POST[tel] . "', celular = '" . $_POST[cel] . "', ciudad = '" . $_POST[ciud] . "', email = '" . $_POST[email] . "', cuenta = '" . $_POST[cue] . "', banco = '" . $_POST[ban] . "', entidad_laboral = '" .$enti. "', unidad_descuento = '" .$unides. "', codigo_descuento = '" .$codides. "', entidad_recaudo = '" .$entre."', fecha_nacimiento = '" . $_POST[fecna] . "', fecha_afiliacion = '" . $_POST[fechas] . "', valorcontrato = '" . $_POST[valcon] . "', numerocuotas = '" . $_POST[numcuo] . "' , valorcuota = '" . $_POST[valcuo] . "', fecha_inicio_contrato = '" . $_POST[fechainicio] . "', fecha_termino_contrato = '" . $_POST[fechatermino] . "', saldoanteior = '" . $_POST[salant] . "', cuotaspendientes = '" . $_POST[cuopen] . "', saldonuevo = '" . $_POST[salnue] . "', vendedor = '" .$ven. "', director = '" .$director. "', causal_terminacion = '" .$causal. "', fecha_terminacion = '" .$fechamodi. "', fecha_ultima_modificacion = '".$fechamodificada."' WHERE cedula = '" . $_GET[ced2] . "' and numerocontrato = '" . $_GET[numcon] . "' ");
$mssqjjj = mysql_query("UPDATE cobranzas set unidad = '" .$unides. "' WHERE cedula = '" . $_GET[ced2] . "' and numero = '" . $_GET[numcon] . "'");
if (!$mssqjjj) {
die('Invalid query mssqjjj mssqjjj: ' . mysql_error());
}
/*
$tyuuu77 = mysql_query("UPDATE comisiones_ventas set cedula = '" . $_POST[cedb] . "', codigo = '" . $_POST[cod] . "' WHERE cedula = '" . $_GET[ced2] . "' ");
if (!$tyuuu77) {
die('Invalid query tyuuu77 : ' . mysql_error());
}
$port658 = mysql_query("UPDATE procesos set cedula = '" . $_POST[cedb] . "' WHERE cedula = '" . $_GET[ced2] . "' and numero_contrato = '" . $_GET[numcon] . "' ");
if (!$port658) {
die('Invalid query port658: ' . mysql_error());
}
$mss999 = mysql_query("UPDATE actuaciones set cedula = '" . $_POST[cedb] . "' WHERE cedula = '" . $_GET[ced2] . "' ");
if (!$mss999) {
die('Invalid query mss999: ' . mysql_error());
}
$mssq655 = mysql_query("UPDATE beneficiarios set cedula_titular = '" . $_POST[cedb] . "' WHERE cedula_titular = '" . $_GET[ced2] . "' ");
if (!$mssq655) {
die('Invalid query mssqjjj mssq655: ' . mysql_error());
}
$mssql3 = mysql_query("UPDATE cartera_estado_contable set cedula = '" . $_POST[cedb] . "', contrato = '" . $_POST[numcont] . "', contratotipo = '" .$plan. "' WHERE cedula = '" . $_GET[ced2] . "' and contrato = '" . $_GET["numcon"] . "'");
if (!$mssql3) {
die('Invalid query cartera_estado_contable MODIFICAR: ' . mysql_error());
}
*/
echo "<script>alert('La informacion fue modificada correctamente');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
$sql = mysql_query('SELECT * FROM entidad_laboral order by nombre ');
if (!$sql) {
die('Invalid query: ' . mysql_error());
}
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql);
$sql2 = mysql_query('SELECT * FROM descuentos order by unidad ');
if (!$sql2) {
die('Invalid query: ' . mysql_error());
}
$row_sql2 = mysql_fetch_assoc($sql2);
$totalRows_sql2 = mysql_num_rows($sql2);
$sql3 = mysql_query('SELECT * FROM descuentos order by unidad ');
if (!$sql3) {
die('Invalid query: ' . mysql_error());
}
$row_sql3 = mysql_fetch_assoc($sql3);
$totalRows_sql3 = mysql_num_rows($sql3);
$sql4 = mysql_query('SELECT * FROM vendedores WHERE estado = "1" order by vendedor');
if (!$sql4) {
die('Invalid query: ' . mysql_error());
}
$row_sql4 = mysql_fetch_assoc($sql4);
$totalRows_sql4 = mysql_num_rows($sql4);
$sql5 = mysql_query('SELECT * FROM sucursal order by nombre ');
if (!$sql5) {
die('Invalid query: ' . mysql_error());
}
$row_sql5 = mysql_fetch_assoc($sql5);
$totalRows_sql5 = mysql_num_rows($sql5);
$sql6 = mysql_query('SELECT * FROM descuentos order by concepto ');
if (!$sql6) {
die('Invalid query: ' . mysql_error());
}
$row_sql6 = mysql_fetch_assoc($sql6);
$totalRows_sql6 = mysql_num_rows($sql6);
$sql7 = mysql_query('SELECT * FROM director_ventas WHERE estado = "1" order by nombre');
if (!$sql7) {
die('Invalid query: ' . mysql_error());
}
$row_sql7 = mysql_fetch_assoc($sql7);
$totalRows_sql7 = mysql_num_rows($sql7);
$sql8 = mysql_query('SELECT * FROM planes_contratos order by codigo ');
if (!$sql8) {
die('Invalid query: ' . mysql_error());
}
$row_sql8 = mysql_fetch_assoc($sql8);
$totalRows_sql8 = mysql_num_rows($sql8);
$sql9 = mysql_query('SELECT * FROM descuentos group by unidad order by unidad ');
if (!$sql9) {
die('Invalid query: ' . mysql_error());
}
$row_sql9 = mysql_fetch_assoc($sql9);
$totalRows_sql9 = mysql_num_rows($sql9);
//////////////////////////////////////////////////////////////////////David: Se realizo la modificacion se cambio la variable !$sql9 por una vuena variable !$sql10 //////////////////////////
$sql10 = mysql_query('SELECT * FROM descuentos order by unidad ');
if (!$sql10) {
die('Invalid query: ' . mysql_error());
}
$row_sql10 = mysql_fetch_assoc($sql10);
$totalRows_sql9 = mysql_num_rows($sql10);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>INGRESAR SOLICITUD CARTERA</title>
<style type="text/css">
<!--
.est_cont5 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-style: normal;
font-weight: normal;
background-color: #EDFAF4;
margin: 2px;
padding: 2px;
height: auto;
width: auto;
border: thin groove #E9AAF0;
color: #C72350;
}
.color_fondo_sc {
background-color: #DCE0E4;
}
.Estilo1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 16px;
font-style: normal;
font-weight: bold;
background-color: #D6ECFE;
margin: 2px;
padding: 2px;
height: auto;
width: auto;
border: thin groove #E9AAF0;
color: #C72350;
}
.Estilo2 {
font-size: 14px;
font-weight: bold;
}
.est_cont2 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
color: #2B39EC;
background-color: #F0F5CF;
height: 18px;
width: auto;
border: thin solid #FABF85;
}
.est_cont6 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 11px;
font-style: normal;
font-weight: normal;
color: #006262;
background-color: #EDFED3;
margin: 1px;
padding: 1px;
height: auto;
width: auto;
border: thin solid #D9B6F8;
}
.Estilo3 {
color: #C72350;
font-weight: bold;
}
.sol_cre1 {
font-family: "Times New Roman", Times, serif;
font-size: 13px;
font-style: normal;
font-weight: normal;
color: #0B3495;
background-color: #E6FAFF;
margin: 1px;
padding: 1px;
height: 18px;
width: auto;
border: thin outset #56AD95;
}
.col_cre2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: bold;
color: #F92F0B;
background-color: #B3D9F0;
height: auto;
width: auto;
border: medium groove #FC9227;
}
.Estilo50 {color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.Estilo52 {color: #FF6633;
font-size: 16px;
}
.Estilo53 {color: #2492FF;
font-weight: bold;
}
.recaudo {font-family: "Courier New", Courier, monospace;
font-size: 12px;
font-style: normal;
font-weight: bold;
font-variant: normal;
color: #000000;
background-color: #B6CBDC;
margin: 4px;
padding: 8px;
width: auto;
border: medium outset #339966;
}
.Estilo54 {
color: #7DD096;
font-weight: bold;
}
.campo1 {background-color: #B7FFFF;
border: thin dashed #B6B6B6;
}
.campo1 {font-family: "Courier New", Courier, monospace;
font-size: 16px;
font-style: normal;
font-weight: bold;
background-color: #E1EFFD;
border: thin doble #009999;
}
.campo1 { font-family: "Courier New", Courier, monospace;
font-size: 11px;
color: #5151FF;
background-color: #C4E4FD;
border: thin solid #009999;
height: 18px;
width: auto;
}
.datos1 {font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 16px;
font-style: normal;
text-decoration: blink;
background-color: #CCFFCC;
margin: 5px;
padding: 7px;
height: auto;
width: auto;
border: thin solid #0099FF;
}
.datos1 {font-family: Georgia, "Times New Roman", Times, serif;
font-size: 16px;
background-color: #FDE0C1;
margin: 2px;
padding: 3px;
border: medium doble #DBAED7;
}
.datos1 { font-family: Georgia, "Times New Roman", Times, serif;
font-size: 11px;
font-weight: normal;
background-color: #B8F5E8;
margin: 4px;
padding: 5px;
border: thin outset #009999;
}
.datos2 { font-family: "Courier New", Courier, monospace;
font-size: 10px;
font-style: normal;
font-weight: normal;
color: #0033FF;
background-color: #FFE2C6;
margin: 2px;
padding: 3px;
border: medium doble #EEBFEB;
}
.datos3 { font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-style: normal;
font-weight: normal;
color: #FF3300;
background-color: #A6ECD7;
margin: 4px;
padding: 4px;
border: medium groove #CCCCFF;
}
.go { font-family: "Times New Roman", Times, serif;
font-size: 9px;
font-style: normal;
color: #FF6633;
background-color: #FBDCBD;
padding: 1px;
height: auto;
width: auto;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
}
.Estilo64 {
font-size: 8px;
font-weight: bold;
color: #000000;
}
.Estilo65 {color: #C72350}
.Estilo66 {
font-size: 12px;
font-weight: bold;
}
.label {background-color: #FFFFCC; font-size: 16px; font-family: Arial; color:#0000CC; display: block;}
-->
</style>
<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>")
}
function Valida_Fecha(formulario)
{
if (formulario.orden_t.value == "")
{
alert("Falta Ingresar Orden De Trabajo");
formulario.orden_t.focus();
return (false);
}
if (formulario.tipopro.value == "")
{
alert("Falta Ingresar Tipo De Proceso");
formulario.tipopro.focus();
return (false);
}
if (formulario.numero_carpeta.value == "")
{
alert("Falta Ingresar número carpeta-");
formulario.numero_carpeta.focus();
return (false);
}
if (formulario.clase_negocio.value == "")
{
alert("Falta Ingresar Clase De Negocio");
formulario.clase_negocio.focus();
return (false);
}
if (formulario.podfec.value == "")
{
alert("Falta Ingresar Fecha Autenticacion");
formulario.podfec.focus();
return (false);
}
if (formulario.sucursal.value == "")
{
alert("Falta Ingresar Sucursal");
formulario.sucursal.focus();
return (false);
}
if (formulario.calidad_afiliado.value == "")
{
alert("Falta Ingresar Calidad Afiliado");
formulario.calidad_afiliado.focus();
return (false);
}
if (formulario.calidad_afiliado.value == "")
{
alert("Falta Ingresar Calidad Afiliado");
formulario.calidad_afiliado.focus();
return (false);
}
if (formulario.codigo_abogado.value == "")
{
alert("Falta Seleccionar Abogado");
formulario.codigo_abogado.focus();
return (false);
}
return (true);
}
var timerID = null;
var timerRunning = false;
var id,pause=0,position=0;
function stopclock ()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime ()
{
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " pm" : " am"
document.formulario.Hora_Envio.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock ()
{
stopclock ();
showtime ();
}
//--></script>
<script Language="JavaScript">
function validarEntero(valor){
//intento convertir a entero.
//si era un entero no le afecta, si no lo era lo intenta convertir
valor = parseInt(valor)
//Compruebo si es un valor numérico
if (isNaN(valor)) {
//entonces (no es numero) devuelvo el valor cadena vacia
return ""
}else{
//En caso contrario (Si era un número) devuelvo el valor
return valor
}
}
function valida_envia(){
//valido LOS APELLIDOS
if (document.form1.ape.value.length==0){
alert("Tiene que escribir sus apellidos")
document.form1.ape.focus()
return (false);
}
//valido el nombre
if (document.form1.noms.value.length==0){
alert("Tiene que escribir sus nombres")
document.form1.noms.focus()
return (false);
}
//valido la cedula
if (document.form1.ced.value.length==0){
alert("Tiene que escribir el numero de cedula")
document.form1.ced.focus()
return (false);
}
return (true);
}
</script>
</head>
<body >
<form action="" method="post" onsubmit="return valida_envia()" enctype="multipart/form-data" name="form1" class="color_fondo_sc" id="form1">
<div align="center">
<div class="Estilo1">SOLICITUD CARTERA JURIDICA</div>
<table width="710" border="2" cellpadding="1" cellspacing="1" class="sol_cre1">
<caption>
<div align="center"><br />
<span class="Estilo2">MODIFICAR DATOS CARTERA</span><br />
</div>
</caption>
<tr>
<th width="64" scope="col"> </th>
<th width="93" scope="col"><div align="right">
<div align="right"><strong>Fecha Afiliacion :</strong></div>
</div></th>
<th width="99" scope="col"><div align="left">
<input name="fechas" type="text" class="Estilo66" id="fechas" value="<?php echo $fechafil ?>" size="10" maxlength="10" />
</div></th>
<th><div align="right"><strong>Sucursal :</strong></div></th>
<th colspan="3" scope="col"><div align="left">
<input name="codigosu" type="text" class="Estilo66" id="codigosu" value="<?php echo $codigosu ?>" size="20" maxlength="20" readonly=""/>
<select name="codigo_sucursal" class="Estilo66">
<option value="">--SELECCIONE SUCURSAL--</option>
<?php
do {
?>
<option value="<?php echo $row_sql5['codigo'];?>"><?php echo $row_sql5['nombre']?></option>
<?php
} while ($row_sql5 = mysql_fetch_assoc($sql5));
$rows5 = mysql_num_rows($sql5);
if($rows5 > 0) {
mysql_data_seek($sql5, 0);
$row_sql5 = mysql_fetch_assoc($sql5);
}
?>
</select>
</div></th>
</tr>
<tr>
<td align="right"><strong>Apellidos y Nombres:</strong></td>
<td colspan="3" align="left"><input name="apenom" type="text" class="Estilo66" id="apenom" value="<?php echo $apes ?>" size="60" maxlength="65" readonly="readonly" /> </td>
<td width="112" height="21"><div align="right"><strong>Cedula No:</strong></div></td>
<td width="205" ><div align="left">
<input name="cedb" type="text" class="Estilo66" id="cedb" value="<?php echo $cedula ?>" size="20" maxlength="20" readonly="readonly" />
</div></td>
</tr>
<tr>
<td><div align="right"><strong>Cogido Militar :</strong></div></td>
<td ><div align="left">
<input name="cod" type="text" class="Estilo66" id="cod" value="<?php echo $codi ?>" size="14" maxlength="20" readonly="readonly"/>
</div></td>
<td><div align="right"><strong>Grado :</strong></div></td>
<td width="102"><div align="left">
<input name="gra" type="text" class="Estilo66" id="gra" value="<?php echo $grad ?>" size="12" maxlength="10" />
</div></td>
<td align="right"><strong>Fecha Nacimiento :</strong></td>
<td align="left"><input name="fecna" type="text" class="Estilo66" id="fecna" value="<?php echo $fecna ?>" size="6" maxlength="6" />
<span class="Estilo64">DIA-MES</span> </td>
</tr>
<tr>
<td><div align="right"><strong>Cuidad :</strong></div></td>
<td><div align="left">
<input name="ciud" type="text" class="Estilo66" id="ciud" value="<?php echo $ciud ?>" size="14" maxlength="20" />
</div></td>
<td><div align="right"><strong>Direccion :</strong></div></td>
<td colspan="2"><input name="dire" type="text" class="Estilo66" id="dire" value="<?php echo $dire ?>" size="43" maxlength="43" /> </td>
</tr>
<tr>
<td><div align="right"><strong>Telefono :</strong></div></td>
<td><div align="left">
<input name="tel" type="text" class="Estilo66" id="tel" value="<?php echo $tele ?>" size="10" maxlength="20" />
</div></td>
<td><div align="right"><strong>Celular :</strong></div></td>
<td><div align="left">
<input name="cel" type="text" class="Estilo66" id="cel" value="<?php echo $celul ?>" size="20" maxlength="20" />
</div></td>
<td><div align="right"><strong>E-mail :</strong></div></td>
<td colspan="2"><div align="left">
<input name="email" type="text" class="Estilo66" id="email" value="<?php echo $email ?>" size="35" maxlength="35" />
</div></td>
</tr>
<tr>
<td><div align="right"><strong>Plan :</strong></div></td>
<td><input name="plan" type="text" class="Estilo66" id="plan" value="<?php echo $plan ?>" size="5" maxlength="5" />
<select name="planc" class="Estilo66" id="planc">
<option value="">-PLAN-</option>
<?php
do {
?>
<option value="<?php echo $row_sql8['codigo_contrato'];?>"><?php echo $row_sql8['codigo_contrato']?></option>
<?php
} while ($row_sql8 = mysql_fetch_assoc($sql8));
$rows8 = mysql_num_rows($sql8);
if($rows8 > 0) {
mysql_data_seek($sql8, 0);
$row_sql8 = mysql_fetch_assoc($sql8);
}
?>
</select> </td>
<td><div align="right"><strong>Cuenta No :</strong></div></td>
<td><div align="left">
<input name="cue" type="text" class="Estilo66" id="cue" value="<?php echo $cue ?>" size="20" maxlength="20" />
</div></td>
<td><div align="right"><strong>Banco :</strong></div></td>
<td colspan="2"><div align="left">
<input name="ban" type="text" class="Estilo66" id="ban" value="<?php echo $ban ?>" size="20" maxlength="20" />
</div></td>
</tr>
<tr>
<td height="28"><div align="right"><strong>Numero Contrato :</strong></div></td>
<td><div align="left">
<input name="numcont" type="text" class="Estilo66" id="numcont" value="<?php echo $numcont ?>" size="12" maxlength="10" readonly="" />
</div></td>
<td><div align="right"><strong>Numero libranza:</strong></div></td>
<td ><div align="left">
<input name="num_lib" type="text" class="Estilo66" id="num_lib" value="<?php echo $num_lib ?>" size="12" maxlength="12" readonly=""/>
</div></td>
<td><div align="right"><strong>Vendedor :</strong></div></td>
<td align="left" ><input name="vendedor" type="text" class="Estilo66" id="ven" value="<?php echo $ven ?>" size="30" maxlength="30" readonly=""/>
<select name="ase" class="Estilo66" id="ase">
<option value="">-SELECCIONE VENDEDOR-</option>
<?php
do {
?>
<option value="<?php echo $row_sql4['codigo'];?>"><?php echo $row_sql4['vendedor']?></option>
<?php
} while ($row_sql4 = mysql_fetch_assoc($sql4));
$rows4 = mysql_num_rows($sql4);
if($rows4 > 0) {
mysql_data_seek($sql4, 0);
$row_sql4 = mysql_fetch_assoc($sql4);
}
?>
</select> </td>
</tr>
<tr>
<td height="28"><div align="right"><strong>Valor Contrato :</strong></div></td>
<td><div align="left">
<input name="valcon" type="text" class="Estilo66" id="valcon" value="<?php echo $valcon ?>" size="12" maxlength="10" readonly/>
</div></td>
<td><div align="right"><strong>Numero de Cuotas:</strong></div></td>
<td ><div align="left">
<input name="numcuo" type="text" class="Estilo66" id="numcuo" value="<?php echo $numcuo ?>" size="12" maxlength="12" readonly />
</div></td>
<td align="center"><strong>Valor Cuota:</strong></td>
<td align="left">
<input name="valcuo" type="text" class="Estilo66" id="valcuo" value="<?php echo $valcuo ?>" size="12" maxlength="12" readonly />
</td>
</tr>
<tr>
<td height="28"><div align="right"><strong>Cuotas Pendientes:</strong></div></td>
<td><div align="left">
<input name="cuopen" type="text" class="Estilo66" id="cuopen" value="<?php echo $cuopen ?>" size="12" maxlength="10" readonly />
</div></td>
<td><div align="right"><strong>Saldo Nuevo:</strong></div></td>
<td ><div align="left">
<input name="salnue" type="text" class="Estilo66" id="salnue" value="<?php echo $salnue ?>" size="12" maxlength="12" readonly/>
</div></td>
<td><div align="right"><strong>Saldo Anterior:</strong></div></td>
<td ><div align="left">
<input name="salant" type="text" class="Estilo66" id="salant" value="<?php echo $salant ?>" size="12" maxlength="12" readonly/>
</div></td>
</tr>
<tr>
<td height="54"><div align="right"><strong>Fecha Inicio Contrato:</strong></div></td>
<td><div align="left">
<input name="fechainicio" type="text" class="Estilo66" id="fechainicio" value="<?php echo $fechainicio ?>" size="10" maxlength="14" />
</div></td>
<td><div align="right"><strong>Fecha Termino Contrato:</strong></div></td>
<td ><div align="left">
<input name="fechatermino" type="text" class="Estilo66" id="fechatermino" value="<?php echo $fechatermino ?>" size="10" maxlength="14" />
</div></td>
<td height="54"><div align="right"><strong>Fecha Inicio Pagos:</strong></div></td>
<td align="left"><input name="iniciopag" type="text" class="Estilo66" id="iniciopag" value="<?php echo $inipag ?>" size="5" maxlength="5" />
<strong>Fecha Termino Pagos:</strong>
<input name="iniciopag" type="text" class="Estilo66" id="iniciopag" value="<?php echo $finpag ?>" size="5" maxlength="5"/> </td>
</tr>
<tr>
<td><div align="center" class="Estilo56">
<div align="right" class="Estilo12"><strong>Entidad Recaudo :</strong></div>
</div></td>
<td colspan="3" align="left"><input name="entre" type="text" class="Estilo66" id="entre" value="<?php echo $entre ?>" size="60" maxlength="65" readonly="" />
<select name="entrec" class="Estilo66" id="entrec">
<option value="">--SELECIONE ENTIDAD--</option>
<?php
do {
?>
<option value="<?php echo $row_sql6['id'];?>"><?php echo $row_sql6['concepto']?></option>
<?php
} while ($row_sql6 = mysql_fetch_assoc($sql6));
$rows6 = mysql_num_rows($sql6);
if($rows6 > 0) {
mysql_data_seek($sql6, 0);
$row_sql6 = mysql_fetch_assoc($sql6);
}
?>
</select> </td>
<td><div align="center" class="Estilo55">
<div align="right"> <strong>Entidad Laboral: </strong></div>
</div></td>
<td colspan="2" align="left"><input name="enti" type="text" class="Estilo66" id="enti" value="<?php echo $enti ?>" size="40" maxlength="40" readonly=""/>
<select name="entis" class="Estilo66" id="entis">
<option value="">--SELECCIONE ENTIDAD--</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>
<tr>
<td height="31" class="Estilo12"><div align="center" class="Estilo12">
<div align="right"><strong>Unidad Descuento :</strong></div>
</div></td>
<td align="left"><input name="unidet" type="text" class="Estilo66" id="unidet" value="<?php echo $unides ?>" size="5" maxlength="5" readonly="" />
<select name="unidt2" class="Estilo66" id="unidt2">
<option value="">--SELECIONE CODIGO--</option>
<?php
do {
?>
<option value="<?php echo $row_sql9['unidad'];?>"><?php echo $row_sql9['unidad']?></option>
<?php
} while ($row_sql9 = mysql_fetch_assoc($sql9));
$rows9 = mysql_num_rows($sql9);
if($rows9 > 0) {
mysql_data_seek($sql9, 0);
$row_sql9 = mysql_fetch_assoc($sql9);
}
?>
</select> </td>
<td height="31" class="Estilo12"><div align="center" class="Estilo12">
<div align="right"><strong>Codigo Descuento :</strong></div>
</div></td>
<td align="left">
<input name="codidet" type="text" class="Estilo66" id="codides" value="<?php echo $codides ?>" size="4" maxlength="4" readonly=""/>
<select name="codigo3" class="Estilo66" id="codigo3">
<option value="">--SELECIONE CODIGO--</option>
<?php
do {
?>
<option value="<?php echo $row_sql3['codigo'];?>"><?php echo $row_sql3['codigo']?></option>
<?php
} while ($row_sql3 = mysql_fetch_assoc($sql3));
$rows3 = mysql_num_rows($sql3);
if($rows3 > 0) {
mysql_data_seek($sql3, 0);
$row_sql3 = mysql_fetch_assoc($sql3);
}
?>
</select> </td>
<td><div align="right"><strong>Director :</strong></div></td>
<td align="left" ><input name="direc" type="text" class="Estilo66" id="direc" value="<?php echo $director ?>" size="30" maxlength="30" readonly="" />
<select name="cod_dir" class="Estilo66" id="cod_dir">
<option value="">-SELECCIONE DIRECTOR-</option>
<?php
do {
?>
<option value="<?php echo $row_sql7['codigo'];?>"><?php echo $row_sql7['nombre']?></option>
<?php
} while ($row_sql7 = mysql_fetch_assoc($sql7));
$rows7 = mysql_num_rows($sql7);
if($rows7 > 0) {
mysql_data_seek($sql7, 0);
$row_sql7 = mysql_fetch_assoc($sql7);
}
?>
</select> </td>
</tr>
<td colspan="2"><div align="right"><strong>Causal terminacion :</strong></div></td>
<td align="left" colspan="2"><input name="causal" type="text" class="Estilo66" id="causal" value="<?php echo $causal ?>" size="50" maxlength="50" readonly="" />
<select name="causal2" class="Estilo66" id="causal2">
<option value="">--SELECIONE CAUSAL--</option>
<?php
do {
?>
<option value="<?php echo $row_sql10['id'];?>"><?php echo $row_sql10['concepto']?></option>
<?php
} while ($row_sql10 = mysql_fetch_assoc($sql10));
$rows10 = mysql_num_rows($sql10);
if($rows10 > 0) {
mysql_data_seek($sql10, 0);
$row_sql10 = mysql_fetch_assoc($sql10);
}
?>
</select> </td>
<td ><div align="right"><strong>Fecha Anulación :</strong></div></td>
<td align="left" ><input name="fechater" type="text" class="Estilo66" id="fechater" value="<?php echo $fechater ?>" size="14" maxlength="14" /></td>
</tr>
</table>
<p>
<label>
<input name="guardar" type="submit" class="Estilo53" id="guardar" value="Modificar" />
</label>
</p>
</div>
</form>
</body>
</html>
<?
echo'<table width="850" border="0" cellspacing="2" cellpadding="2" align = "center">
<tr align="center">
<td colspan="6"><font face="Georgia, Times New Roman, Times, serif" color="#006600"><b align = "center">PAGOS EFECTUADOS</b></font></td>
</tr>
<tr align="center" bgcolor="#DDDDDD">
<td width="90" align="center"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Valor cuota</font></td>
<td bgcolor="#DDDDDD" width="55" ><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099"># cuotas</font></td>
<td width="100"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099" align="center">Mes</font></td>
<td width="100"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099" align="center">Año</font></td>
<td width="140"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Fecha pago</font></td>
<td width="300" ><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Entidad</font></td>
<td width="140"><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="#000099">Fecha registro</font></td>
</tr>';
$control = mysql_query('SELECT * FROM cartera_estado_contable WHERE cedula = "' . $_GET["ced2"] . '" and contrato = "' . $_GET["numcon"] . '" ORDER BY cuota ASC ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
while(list($id, $cedula, $nombre, $contrato, $tipo, $cuota, $mescuota, $anocuota, $valorcuota, $fecha_registro, $fecha_nomina, $codesc, $unidesc) = mysql_fetch_row($control))
{
if ($estado== "HISTORICO")
{
$control5 = mysql_query('SELECT * FROM descuentos WHERE codigo = "' ."$codesc". '" ');
if (!$control5) {
die('Invalid query: ' . mysql_error());
}
list($idr, $codigo, $unidad, $concepto) = mysql_fetch_row($control5);
}
else{
$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='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>$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='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>$fecha_registro</a></td></tr>");
}
echo "</table>";
?>