File: /home/asjudine/www/apostventas/formulario_terminacion_contratos_uno.php
<?php
require_once("../Conectarse.php");
/*
$Recordset1 = mysql_query('SELECT * FROM Usuarios WHERE (codigo="472" || codigo="555" || codigo="642" || codigo="668" || codigo="695" || codigo="564" || codigo="565") ORDER BY Nombre_Completo '); */
$Recordset1 = mysql_query('SELECT * FROM Usuarios WHERE (codigo = 733 || codigo = 734 || codigo = 735 || codigo= 736 || codigo= 738 || codigo= 749 || codigo= 759) ORDER BY Nombre_Completo');
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$Recordset3 = mysql_query('SELECT * FROM Usuarios WHERE (Cargo="ABOGADO") ');
$row_Recordset3 = mysql_fetch_assoc($Recordset3);
$totalRows_Recordset3 = mysql_num_rows($Recordset3);
$Recordset2 = mysql_query('SELECT * FROM sucursal order by nombre');
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
$control = mysql_query('SELECT cedula, nombre, numerocontrato, tipocontrato, fecha_afiliacion 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, $nombre, $numerocontrato,$tipocontrato, $fechaafilia) = mysql_fetch_row($control);
//AQUIIIIIII
$controlinterno = mysql_query('SELECT id,fecha_radicacion,motivo_terminacion, acciones_fidelizacion FROM control_terminaciones_contratos WHERE cedula = "'.$_GET["ced2"].'" and id = "'.$_GET["id"].'" ');
if (!$controlinterno) {
die('Invalid query Fidelizacion uno: ' . mysql_error());
}
list($id, $fecharadicacion, $gestion_ci, $gestion_cero) = mysql_fetch_row($controlinterno);
?>
<html>
<head>
<title>Registro de Formulario Juridico</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:Geneva, Arial, Helvetica, sans-serif;}
header {background-color: #B7271F; text-align: center;}
.cerrarsesion:hover{background-color: #ffffff;color: #000;}
.titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
table{margin: 0 auto; 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;}
.fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center; border: 1px solid #B95F61; font-size: 13px;}
.tdizq{background-color: #EEE; padding: 1px 4px;color: #00135F;font-size: 14px;font-weight: 600; text-align: left;}
.tdcen{background-color: #EEE; padding: 1px 4px;color: #00135F;font-size: 14px;font-weight: 600; text-align: center;}
.tdder{background-color: #EEE; padding: 1px 4px;color: #00135F;font-size: 14px;font-weight: 600; text-align: right;}
.exp{color:#8A0000; font-size:12px;}
.boton1{width:150px;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:4px;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
input[type=text]{border-radius: 5px; padding: 3px;background-color: #FFFEF4; font-weight: 400;}
.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 1px; text-align: center; font-size: 11px; font-weight: 700}
.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;}
.subtitulo{background-color: #DFBF63; color: #403AC9; padding: 2px; }
.textarea{background-color: #FFF; color: #000000; font-weight: 300; font-size: 14px; padding:5px;}
.roja{color:#910407; font-size: 14px;font-weight: 600; text-align:right;padding: 1px 4px;}
</style>
<script languaje="JavaScript">
function validar_campos(formulario)
{
if (formulario.funcionario.value == "")
{
alert("Seleccione El Funcionario");
formulario.funcionario.focus();
return (false);
}
if (formulario.archivito.value == "")
{
alert("Seleccione Un Archivo");
formulario.archivito.focus();
return (false);
}
if (formulario.funcionario.value == "")
{
alert("Seleccione El Funcionario");
formulario.funcionario.focus();
return (false);
}
if (formulario.archivito.value == "")
{
alert("Anexe Un Archivo");
formulario.archivito.focus();
return (false);
}
if (confirm("Los datos de la consulta son correctos"))
{
return (true);
}
else
{
return (false);
}
return (true);
}
//-->
</script>
</head>
<body onLoad="document.formulario.numero.focus()" topmargin="0">
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">TERMINANCION CONTRATOS</h3>
<form name="formulario" method="post" action="" enctype="multipart/form-data" onSubmit="return validar_campos(this)">
<table align="center" cellspacing="0" cellpadding="6">
<!--<tr>
<td align="center" bgcolor="#306090"><big style="color:#FFFFFF"><b>TERMINACION CONTRATOS</b></big></td>
</tr>-->
<tr>
<td class="tdder">Cedula de Ciudadania:</td>
<td class="tdizq"><input type="text" name="ced" value="<? echo $cedula?>"size="50" maxlength="40" readonly></td>
</tr>
<tr>
<td class="tdder">Nombres:</td>
<td class="tdizq"><input type="text" name="nombre" value="<? echo $nombre?>"size="50" maxlength="40" readonly></td>
</tr>
<tr>
<td class="tdder">Numero Contrato:</td>
<td class="tdizq"><input type="text" name="ced" value="<? echo $numerocontrato?>"size="50" maxlength="40" readonly></td>
</tr>
<tr>
<td class="tdder">Tipo Contrato:</td>
<td class="tdizq"><input type="text" name="ced" value="<? echo $tipocontrato?>"size="50" maxlength="40" readonly></td>
</tr>
<tr>
<td class="tdder">Fecha de Afiliacion:</td>
<td class="tdizq"><input type="text" name="ced" value="<? echo $fechaafilia?>"size="50" maxlength="40" readonly></td>
</tr>
<tr>
<td class="roja">Fecha de Radicacion:</td>
<td class="tdizq"><input type="text" name="ced" value="<? echo $fecharadicacion?>"size="50" maxlength="40" readonly></td>
</tr>
<tr>
<td colspan="2" class="subtitulo" align="center">Motivo de Desafiliacion </td>
</tr>
<tr>
<td colspan="2" align="center"><?php
echo "<textarea name='Contenido' class='textarea' cols='70' rows='4' title='RESPUESTA ENVIADA' readonly>\n";
echo htmlspecialchars($gestion_ci)."\n";
echo "</textarea>"; ?><br><br></td>
</tr>
<tr>
<td class="fecha">ARCHIVO</td>
<td class="fecha"><?php
echo "<a href='descargar_archivos_fidelizacion.php?id=$id'>Realizar Descarga</a>"?>
</td>
</tr>
<tr>
<td colspan="2" class="subtitulo">Accion de Fidelizacion </td>
</tr>
<tr>
<td colspan="2" align="center"><?php
echo "<textarea name='Contenido' class='textarea' cols='70' rows='4' title='RESPUESTA ENVIADA' readonly>\n";
echo htmlspecialchars($gestion_cero)."\n";
echo "</textarea>"; ?><br><br></td>
</tr>
<tr>
<td class="subtitulo" colspan="2">Promocion Otorgada </td>
</tr>
<tr>
<td colspan="2" align="center"><textarea name="mensaje2" cols="70" class="textarea" rows="5"></textarea><br><br></td>
</tr>
<!--
<td align="right"><b>Funcionario:</b></td>
<td><SELECT NAME="funcionario">
<OPTION value="">--Nombre Funcionario--</OPTION>
<?php
do {
?>
<option value="<?php echo $row_Recordset1['codigo']?>"><?php echo $row_Recordset1['Nombre_Completo']?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>
</SELECT>
</td>
-->
</table>
<p align="center">
<input name="guardar" type="submit" class="boton1" id="guardar" value="GUARDAR"/>
</p>
</form>
</td>
</tr>
</td>
</tr>
<td height="22" colspan="2" bgcolor="#EFEFEF" class="fecha"><div align="center">
<input name="button" type="button" class="irmenu" onClick="javascript:window.close()" value="REGRESAR AL LISTADO">
</div></td>
<br>
</body>
</html>
<?
if(isset($_POST["guardar"]))
{
$accionfidelizacion = mysql_query("UPDATE control_terminaciones_contratos set promocion_otorgada = '".$_POST['mensaje2']."', estado = '2' WHERE cedula = '".$_GET[ced2]."' and numero_contrato = '".$_GET[numcon]."' ");
if (!$accionfidelizacion ) {
die('Invalid query Fidelizacion: ' . mysql_error());
}
echo "<script>alert('Los datos fueron Guardados');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
?>