File: /home/asjudine/public_html/consulta_morosos_cifin.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
require_once("Conectarse.php");
$control = mysql_query('SELECT tipo_identificacion,numero_identificacion,nombre_tercero,numero_obligacion,codigo_sucursal, calidad,estado_obligacion,edad_mora,fecha_corte,fecha_inicio,fecha_terminacion,tipo_pago,periodicidad,cuotas_pagadas,cuotas_pactadas,cuotas_mora,valor_inicial,valor_mora,valor_saldo,valor_cuota,valor_cargo_fijo,linea_credito,clausula_permanencia,tipo_contrato,estado_contrato,vigencia_contrato,
obligacion_reestructurada,direccion_casa_tercero,telefono_casa,codigo_ciudad_casa_tercero,ciudad_casa_tercero,codigo_departamento_tercero,departamento_casa_tercero,nombre_empresa,estado FROM negativos_cifin WHERE numero_identificacion = "' . $_GET["id"] . '" and numero_obligacion = "' . $_GET["contrato"] . '"');
if (!$control) {
die('Invalid query 4 aqui: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
list($tipo_identificacion, $numero_identificacion,$nombre_tercero,$numero_obligacion, $codigo_sucursal, $calidad, $estado_obligacion, $edad_mora, $fecha_corte, $fecha_inicio, $fecha_terminacion, $tipo_pago,$periodicidad,$cuotas_pagadas,$cuotas_pactadas,$cuotas_mora,$valor_inicial,$valor_mora,$valor_saldo,$valor_cuota,$valor_cargo_fijo,$linea_credito,$clausula_permanencia,$tipo_contrato,$estado_contrato,$vigencia_contrato,$obligacion_reestructurada,$direccion_casa_tercero,$telefono_casa,$codigo_ciudad_casa_tercero,$ciudad_casa_tercero,$codigo_departamento_tercero,$departamento_casa_tercero,$nombre_empresa,$estado) = mysql_fetch_row($control);
//////DIVISION DE LA FECHA
$separarfinicio = explode('-',$fecha_nacimiento);
$separarfinicio[0];
$separarfinicio[1];
$dianacimi=$separarfinicio[0];
$mesnacimi=$separarfinicio[1];
/////FINALIZA DIVISION FECHA
}
//
if(isset($_POST["guardar"]))
{
$fecha_asignac = date("Y")."-".date("m")."-".date("d");
$conttre = mysql_query('SELECT numero_identificacion FROM negativos_cifin WHERE numero_identificacion = "'. $_POST["cedulac"]. '" ');
if (!$conttre) {
die('Invalid query 42: ' . mysql_error());
}
if ((mysql_num_rows($conttre)!=0))
{
echo "<script>alert('La Cedula Ya Se Encuentra Reportada ');</script>";
}
else {
$fecha1=$_POST["fecha_corte"];
$fechasnacim = $_POST[dia].'-'.$_POST[mes] ;
// SEPARACION DE LA FECHA DE CORTE
$separar = explode('-',$fecha1);
// RESULTADO
$separar[0];
$separar[1];
$separar[2];
$fechaguarda=$separar[0].$separar[1].$separar[2];
// SEPARACION DE LA FECHA DE INICIO
$fecha2=$_POST["fecha_inicio_contrato"];
$separar2 = explode('-',$fecha2);
// RESULTADO
$separar2[0];
$separar2[1];
$separar2[2];
$fechaguarda2=$separar2[0].$separar2[1].$separar2[2];
// SEPARACION DE LA FECHA TERMINACION
$fecha3=$_POST["fecha_termina"];
$separar3 = explode('-',$fecha3);
// RESULTADO
$separar3[0];
$separar3[1];
$separar3[2];
$fechaguarda3=$separar3[0].$separar3[1].$separar3[2];
$registro = mysql_query("INSERT INTO negativos_cifin (tipo_identificacion,numero_identificacion,nombre_tercero,numero_obligacion,codigo_sucursal, calidad,estado_obligacion,edad_mora,fecha_corte,fecha_inicio,fecha_terminacion,tipo_pago,periodicidad,cuotas_pagadas,cuotas_pactadas,cuotas_mora,valor_inicial,valor_mora,valor_saldo,valor_cuota,valor_cargo_fijo,linea_credito,clausula_permanencia,tipo_contrato,estado_contrato,vigencia_contrato,
obligacion_reestructurada,direccion_casa_tercero,telefono_casa,codigo_ciudad_casa_tercero,ciudad_casa_tercero,codigo_departamento_tercero,departamento_casa_tercero,nombre_empresa,estado) VALUES ('".$_POST["tipo_identifi"]."','".$_POST["cedulac"]."','".$_POST["nombrec"]."','".$_POST["numeroobligacion"] . "','".$_POST["codigo_sucur"]."','".$_POST["calidad"]."','".$_POST["estado_obliga"]."','".$_POST["edad_mora"]."','".$fechaguarda."','".$fechaguarda2."','".$fechaguarda3."','".$_POST["tipo_pago"]."','".$_POST["periodicidad"]."','".$_POST["cuotas_pagadas"]."','".$_POST["cuotas_pactadas"]."','".$_POST["cuotas_mora"]."','".$_POST["valor_contrato"]."','".$_POST["valor_mora"]."','".$_POST["valor_saldo"]."','".$_POST["valor_cuota"]."','".$_POST["valor_cargo_fijo"]."','".$_POST["linea_credito"]."','".$_POST["clausula_permanencia"]."','".$_POST["tipo_contrato"]."','".$_POST["estado_contrato"]."','".$_POST["vigencia_contrato"]."','".$_POST["reestructurada"]."','".$_POST["direccionc"]."','".$_POST["telefonoc"]."','".$_POST["codigo_ciudad"]."','".$_POST["ciudad_tercero"]."','".$_POST["codigo_tercero"]."','".$_POST["departamento_casa_tercero"]."','".$_POST["nom_empresa"]."','0')");
if (!$registro) {
die('Invalid query update aprova: ' . mysql_error());
}
echo "<script>alert('La información se ha enviado correctamente ');</script>";
/* $msql = mysql_query("UPDATE cartera_serviasjudinet set grado = '". $_POST[grado]."',direccion = '". $_POST[direccionc]."',telefono = '". $_POST[telefonoc]. "',celular = '". $_POST[celularc]."',ciudad='".$_POST[ciudadc]."',email = '".$_POST[emailc]."',fecha_nacimiento = '".$fechasnacim."' WHERE cedula = '" . $_GET["id"] . "' ");
if (!$msql) {
die('Invalid query 1 update: ' . mysql_error());
}
$misql = mysql_query('SELECT cedula, nombre, direccion, telefono, celular, ciudad, email FROM cartera_serviasjudinet WHERE cedula = "' . $_GET["id"] . '" ');
if (!$misql) {
die('Invalid query 4 aqui: ' . mysql_error());
}
list($ced, $nom, $direccion, $telefono, $celular, $ciudad, $email) = mysql_fetch_row($misql);
$id = $_GET[id] ;
$numcon = $_GET[numcon] ;
echo "<script>alert('Los datos fueron modificados correctamente');</script>";
/* echo "<script>alert('La información se ha enviado correctamente ');</script>";*/
}
}
?>
<html>
<head>
<title>VENTANA PARA MODIFICAR DATOS DEL USUARIO</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.titulos {font: 16px; color: red; font-family:Arial; font-weight:bold}
.boton { background-color: #FFCCCC; color:#FFFFFF; width:150px; border: 4px solid #0000CC; font-family:Arial; color:#990000;}
.texto {background-color: #CCFFCC; font-size: 13px; font-family: Arial; color:#0000CC; display: block;}
.fecha {background-color: #CCFFCC; font-size: 12px; font-family: Arial; color: #000099; width:10px display: block;}
.campo {background-color: #FFFFCC; border:1px solid #990000; font-family:Arial; font-size:11px; height: inherit}
.lista { background-color:#99FFFF; font-family: Arial; font-size: 11px; color: #990000;}
.label {background-color: #00CCFF ; font-size: 14px; font-family: Arial; color:#0000CC; display: block;}
.area {background-color: #CCFFCC; font-size: 13px; width:40px font-family: Arial; color:#0000CC; display: block;}
.variables {background-color: #CCFFCC; font-size: 12px; font-family: Arial; color: #003333 ; width:10px display: block; border: 2px solid #006633;}
.sel { background-color:#DDFFFF; width:400px; border: 1px solid #0099FF; font-family:Arial; font-style:italic; color:#990000 }
.sel2{ background-color:#DDFFFF; border: 1px solid #0099FF; font-family:Arial; font-style:italic; font-weight:bold; color:#990000 }
.seleccion { background-color: #CCFFCC; width:340px; border: 1px solid #0099FF; font-family:Arial; color:#990000;}
.boton2 {font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid; }
.letras {background-color: #99CCFF; font-size: 10px; font-family: Arial; color:#0000CC; display: block;}
.campo2 {background-color: #99CCCC; border:1px solid #0066FF; font-family:Arial; font-size:10px; height: inherit}
.sel3{ background-color:#DDFFFF; font-family:Arial; font-size:10px; color: #000066 }
.Estilo10 {font-size: 11px; font-family: Arial, Helvetica, sans-serif; }
.Estilo11 {
font-size: 14px;
color: #0066FF;
font-weight: bold;
font-family: "Times New Roman", Times, serif;
}
.Estilo12 {
font-size: 14px;
color: red;
font-weight: bold;
font-family: "Times New Roman", Times, serif;
}
body {
background-image: url(ELEMENTOS/lila.jpg);
}
-->
</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>")
}
</script>
<script Language="JavaScript">
<!--
function validar()
{
if (formulario.folio2.value == "")
{
alert("Falta ingresar el Folio2");
formulario.folio2.focus();
return (false);
}
if(formulario.folio2.value < pf)
{
alert('El folio2 no debe ser menor que el folio1');
formulario.folio2.focus();
return (false);
}
if (formulario.actuacion.value == "")
{
alert("Falta ingresar la actuación");
formulario.actuacion.focus();
return (false);
}
if (formulario.codigo_funcionario.value == "")
{
alert("Falta seleccionar el nombre del funcionario");
formulario.codigo_funcionario.focus();
return (false);
}
return (true);
}
//--></script>
<SCRIPT LANGUAGE='JavaScript'>
var default1 = "VENTANA PARA EL INGRESO DE ACTUACIONES"; // only shown once at page load
var text1 = "El primer encabezado muestra en detalle los datos del proceso seleccionado";
var text2 = "la segunda parte muestra el formulario para el ingreso de revistas";
var text3 = "No se le olvide tener en cuenta el número del folio que se entrega en el juzgado";
var changeRate = 3000; // 1000 = 1 second
var messageNumber = 0;
function changeStatus()
{
if (messageNumber == 0) {
window.status=default1;
document.title=default1;
}
else if (messageNumber == 1) {
window.status=text1;
}
else if (messageNumber == 2) {
window.status=text2;
}
else if (messageNumber == 3) {
window.status=text3;
messageNumber = 0;
}
messageNumber++;
setTimeout("changeStatus();",changeRate);
}
changeStatus(); // leave here to run right away
// -->
function Mostrar_Fecha()
{
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
document.write("<b><font face='Arial, Helvetica, sans-serif'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></b>")
}
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="document.formulario.folio1.focus()">
<form name="formulario" action="" method="post" onSubmit="return validar(this)">
<input name="codigo_funcionario" type="hidden" value="<?php echo $codigo_funcionario; ?>">
<center> <img src="ELEMENTOS\CABEZOTE SERVIASJUDINET.jpg" WIDTH=82% > </center>
<br>
<table width="950" border="5" align="center" cellpadding="2" cellspacing="2">
<tr bgcolor="#ECE9D8">
<td height="3" bgcolor="#ECE9D8" class="titulos"><div align="center" class="Estilo10">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<tr bgcolor="#FFCC99">
<td height="20" bgcolor="#FFFFFF"><fieldset>
<p>
<legend><span #ECE9D8>Datos Del Cliente:</span></legend>
</p>
<table width="950" border="10" align="center" cellpadding="2" cellspacing="4" bordercolor="#777777">
<tr bgcolor="#FFFFFF">
<td width="204" bgcolor="#FFFFFF"><span class="Estilo11">Cédula Cliente:</span></td>
<td colspan="2" bgcolor="#FFFFFF"><input name="cedulac" type="text" class="Estilo10" id="cedulac" value="<?php echo $numero_identificacion; ?>" size="15" maxlength="15" readonly>
<td width="72" bgcolor="#FFFFFF"><span class="Estilo11">Nombre:</span></td>
<td width="211" bgcolor="#FFFFFF"><input name="nombrec" type="text" class="Estilo10" id="nombrec" value="<?php echo $nombre_tercero ?>" size="35" maxlength="35" readonly> </td>
<td width="72" bgcolor="#FFFFFF"><span class="Estilo11">Numero Obligacion:</span></td>
<td width="211" bgcolor="#FFFFFF"><input name="numeroobligacion" type="text" class="Estilo10" id="numeroobligacion" value="<?php echo $numero_obligacion ?>" size="35" maxlength="35" readonly>
</tr>
<tr bgcolor="#FFFFFF">
<td width="204"><span class="Estilo11">Cuotas Pagadas:</span></td>
<td colspan="2"><input name="cuotas_pagadas" type="text" class="Estilo10" id="cuotas_pagadas" value="<?php echo $cuotas_pagadas; ?>" size="15" maxlength="15" readonly>
<input name="projuridico" type="hidden" class="campo" id="projuridico" value="<?php echo $np ?>" size="6" maxlength="6"></td>
<td width="72"><span class="Estilo11">Cuotas Pactadas:</span></td>
<td width="211"><input name="cuotas_pactadas" type="text" class="Estilo10" id="cuotas_pactadas" value="<?php echo $cuotas_pactadas?>" size="35" maxlength="35" readonly> </td>
<td width="72"><span class="Estilo11">Cuotas Mora:</span></td>
<td width="211"><input name="cuotas_mora" type="text" class="Estilo10" id="cuotas_mora" value="<?php echo $cuotas_mora; ?>" size="35" maxlength="35">
</tr>
<tr bgcolor="#FFFFFF">
<td width="204"><span class="Estilo11">Valor Contrato:</span></td>
<td colspan="2"><input name="valor_contrato" type="text" class="Estilo10" id="valor_contrato" value="<?php echo $valor_inicial; ?>" size="15" maxlength="15" readonly>
<td width="72"><span class="Estilo11">Valor Mora:</span></td>
<td width="211"><input name="valor_mora" type="text" class="Estilo10" id="valor_mora" value="<?php echo $valor_mora ?>" size="35" maxlength="35"> </td>
<td width="72"><span class="Estilo11">Valor Cuota:</span></td>
<td width="211"><input name="valor_cuota" type="text" class="Estilo10" id="valor_cuota" value="<?php echo $valor_cuota ?>" size="35" maxlength="35" readonly>
</tr>
<tr bgcolor="#FFFFFF">
<td width="204"><span class="Estilo11">Fecha Inicio Contrato:</span></td>
<td colspan="2"><input name="fecha_inicio_contrato" type="text" class="Estilo10" id="fecha_inicio_contrato" value="<?php echo $fecha_inicio; ?>" size="15" maxlength="15" readonly>
<td width="72"><span class="Estilo11">Codigo Sucursal:</span></td>
<td width="211"><input name="codigo_sucur" type="text" class="Estilo10" id="codigo_sucur" value="<?php echo $codigo_sucursal; ?>" size="35" maxlength="35"> </td>
<td width="72"><span class="Estilo11">Tipo Identificacion:</span></td>
<td width="211"><input name="tipo_identifi" type="text" class="Estilo10" id="tipo_identifi" value="<?php echo $tipo_identificacion; ?>" size="35" maxlength="35" readonly>
</tr>
<tr bgcolor="#FFFFFF">
<td width="204"><span class="Estilo11">Fecha Corte:</span></td>
<td colspan="2"><input name="fecha_corte" type="text" class="Estilo10" id="fecha_corte" value="<?php echo $fecha_corte ?>" size="15" maxlength="15">
<td width="72"><span class="Estilo11">Fecha Terminacion:</span></td>
<td width="211"><input name="fecha_termina" type="text" class="Estilo10" id="fecha_termina" value="<?php echo $fecha_terminacion?>" size="35" maxlength="35"> </td>
<td width="72"><span class="Estilo11">Tipo Pago:</span></td>
<td width="211"><input name="tipo_pago" type="text" class="Estilo10" id="tipo_pago" value="<?php echo $tipo_pago?>" size="35" maxlength="35" readonly>
</tr>
<tr bgcolor="#FFFFFF">
<td width="204"><span class="Estilo11">Periodicidad:</span></td>
<td colspan="2"><input name="periodicidad" type="text" class="Estilo10" id="periodicidad" value="<?php echo $periodicidad;?>" size="15" maxlength="15" readonly>
</td>
<td width="72"><span class="Estilo11">Estado Obligacion:</span></td>
<td width="211"><input name="estado_obliga" type="text" class="Estilo10" id="estado_obliga" value="<?php echo $estado_obligacion;?>" size="35" maxlength="35" readonly> </td>
<td width="72"><span class="Estilo11">Edad Mora:</span></td>
<td width="211"><input name="edad_mora" type="text" class="Estilo10" id="edad_mora" value="<?php echo $edad_mora;?>" size="35" maxlength="35" >
</tr>
<tr bgcolor="#FFFFFF">
<td width="204"><span class="Estilo11">Valor Saldo:</span></td>
<td colspan="2"><input name="valor_saldo" type="text" class="Estilo10" id="valor_saldo" value="<?php echo $valor_saldo ?>" size="15" maxlength="15">
</td>
<td width="72"><span class="Estilo11">Valor Cargo Fijo:</span></td>
<td width="211"><input name="valor_cargo_fijo" type="text" class="Estilo10" id="valor_cargo_fijo" value="<?php echo $valor_cuota ?>" size="35" maxlength="35" readonly> </td>
<td width="72"><span class="Estilo11">Linea De Credito:</span></td>
<td width="211"><input name="linea_credito" type="text" class="Estilo10" id="linea_credito" value="3" size="35" maxlength="35" readonly>
</tr>
<tr bgcolor="#FFFFFF">
<td width="204"><span class="Estilo11">Clausula de Permanencia:</span></td>
<td colspan="2"><input name="clausula_permanencia" type="text" class="Estilo10" id="clausula_permanencia" value="<?php echo $clausula_permanen ?>" size="15" maxlength="15" readonly>
</td>
<td width="72"><span class="Estilo11">Tipo Contrato:</span></td>
<td width="211"><input name="tipo_contrato" type="text" class="Estilo10" id="tipo_contrato" value="5" size="35" maxlength="35" readonly> </td>
<td width="72"><span class="Estilo11">Estado Contrato:</span></td>
<td width="211"><input name="estado_contrato" type="text" class="Estilo10" id="estado_contrato" value="1" size="35" maxlength="35" readonly>
</tr>
<tr bgcolor="#FFFFFF">
<td width="204"><span class="Estilo11">Termino O Vigencia Del Contrato:</span></td>
<td colspan="2"><input name="vigencia_contrato" type="text" class="Estilo10" id="vigencia_contrato" value="2" size="15" maxlength="15" readonly>
</td>
<td width="72"><span class="Estilo11">Obligacion Reestructurada:</span></td>
<td width="211"><input name="reestructurada" type="text" class="Estilo10" id="reestructurada" value="2" size="35" maxlength="35" readonly> </td>
<td width="72"><span class="Estilo11">Codigo Ciudad Casa Del Tercero:</span></td>
<td width="211"><input name="codigo_ciudad" type="text" class="Estilo10" id="codigo_ciudad" value="<?php echo $codigo_ciudad ?>" size="35" maxlength="35" readonly>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="Estilo11">Direccion:</span></td>
<td colspan="4"><input name="direccionc" type="text" class="Estilo10" id="direccionc" value="<?php echo $direccion ?>" size="50" maxlength="50" >
</td>
<td><span class="Estilo11">Telefono:</span></td>
<td colspan="4"><input name="telefonoc" type="text" class="Estilo10" id="telefonoc" value="<?php echo $telefono ?>" size="35" maxlength="35"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="Estilo11">Ciudad Casa Del Tercero:</span></td>
<td colspan="4"><input name="ciudad_tercero" type="text" class="Estilo10" id="ciudad_tercero" value="<?php echo $nombre_ciudad?>" size="50" maxlength="50" >
</td>
<td><span class="Estilo11">Codigo Departamento del Tercero:</span></td>
<td colspan="4"><input name="codigo_tercero" type="text" class="Estilo10" id="codigo_tercero" value="<?php echo $codigo_departamento ?>" size="35" maxlength="35"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="Estilo11">Nombre Empresa:</span></td>
<td colspan="4"><input name="nom_empresa" type="text" class="Estilo10" id="nom_empresa" value="<?php echo $entidad_laboral ?>" size="35" maxlength="35"></td>
<td><span class="Estilo11">Calidad:</span></td>
<td colspan="4"><input name="calidad" type="text" class="Estilo10" id="calidad" value="<?php echo $calidad?>" size="25" maxlength="25"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="Estilo11">Departamento Casa Del Tercero:</span></td>
<td colspan="4"><input name="departamento_casa_tercero" type="text" class="Estilo10" id="departamento_casa_tercero" value="<?php echo $nombre_departamento ?>" size="50" maxlength="50"></td>
<td><span class="Estilo11">Fecha De Registro:</span></td>
<td colspan="4"><input name="fecha_de_registro" type="text" class="Estilo10" id="fecha_de_registro" value="<?php echo $fecha_asignac ?>" size="25" maxlength="25"></td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
<p align="center" >
<input name="button2" type="button"onClick="javascript:window.close()" value="Cerrar Ventana">
</p>
</form>
</body>
</html>