File: /home/asjudine/public_html/afinanciera/cartera_consulta_causales_inter.php
<?php include("b.php"); ?>
<?php
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("../Conectarse.php");
$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);
?>
<!DOCTYPE html>
<html>
<head>
<title>Consulta Causales de Terminación Interasjudinet</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{width: auto;background-color: #DBD8C9;color: #000;font-size: 13px;position:absolute;top: 15px;right:10px;z-index:0;padding: 10px;border-radius: 10px;cursor: pointer;}
.cerrarsesion:hover{background-color: #ffffff;color: #000;}
.titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
.subtitulos{width: 100%;text-align: center;color: #b20606;padding: 2px 0;font-size: 14px;}
table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
.divirmenu{text-align: center;}
.irmenu{width: 170px;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;}
td{}
.tdizq{background-color: #EEE; padding: 1px 1px;color: #00135F;font-size: 13px;font-weight: 300; text-align: left;}
.tdcen{background-color: #EEE; padding: 1px 1px;color: #00135F;font-size: 13px;font-weight: 300; text-align: center;}
.tdder{background-color: #EEE; padding: 1px 1px;color: #00135F;font-size: 13px;font-weight: 300; text-align: right;}
.tdroja{background-color: #EEE; padding: 1px 1px;color: #CC0005;font-size: 13px;font-weight: 600; text-align: right;}
.exp{color:#8A0000; font-size:10px;}
.fuerte{font-weight:400;}
.boton1{width:170px;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:5px;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
input[type=text]{border-radius: 2px; padding: 3px;background-color: #FFFEF4;}
.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 600}
.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;}
.btncontrato{width:auto; padding: 2px 5px; background:#F5F1C2; color:#000;}
.btncontrato:hover{background-color:#716D04; color:#fff;}
</style>
<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">CONSULTA CAUSALES TERMINACION INTERASJUDINET</h3>
<?php echo "<div class='cerrarsesion' onclick='location.href=\"../cerrar_session.php\"'>CERRAR SESION</div>";?>
<form action="" method="post" name="form1" class="provd" id="form1">
<div align="center">
<table width="655" border="3" cellpadding="2" cellspacing="2">
<!--<tr>
<td colspan="4" bgcolor="#CCCCCC"><div align="center" class="Estilo50">CONSULTA CAUSALES TERMINACION COASJUDINET</div></td>
</tr>-->
<tr>
<td class="tdcen" width="59">FECHA DESDE</td>
<td class="tdcen" width="80"><input name="fecha1" type="text" id="fecha1" value="0000-00-00" size="10" maxlength="10" /></td>
<td class="tdcen" width="59">FECHA HASTA</td>
<td class="tdcen" width="80"><input name="fecha2" type="text" id="fecha2" value="0000-00-00" size="10" maxlength="10" /></td>
</tr>
</table>
<p>
<input name="menu2" type="button" class="irmenu" id="menu2" onclick="window.location.href='menu_gerencia_financiera.php'" value="IR AL MENU" />
<input name="consultar" id="consultar" type="submit" class="boton1" value="CONSULTAR">
</p>
</div>
</form>
</body>
</html>
<?php
if(isset($_POST["consultar"]))
{
$mssql = mysql_query('SELECT * FROM cartera_serviasjudinet ');
if (!$mssql) {
die('Invalid query 1: ' . mysql_error());
}
if($mssql)
{
$filas = mysql_num_rows($mssql);
if ($filas > 0)
{
$control = mysql_query('SELECT cedula, nombre, numerocontrato, tipocontrato, unidad_descuento, entidad_laboral, valorcuota, causal_terminacion, fecha_terminacion,saldonuevo, estado FROM cartera_serviasjudinet WHERE fecha_terminacion >= "' . $_POST["fecha1"] . '" and fecha_terminacion <= "' . $_POST["fecha2"] . '" and estado = "0" and (tipocontrato = "INT01" || tipocontrato = "INT02" || tipocontrato = "INT03" || tipocontrato = "INT04" || tipocontrato = "INT05") order by causal_terminacion ');
if (!$control) {
die('Invalid query 2: ' . mysql_error());
}
if ((mysql_num_rows($control)!=0))
{
echo "<TABLE width='900' border='2' align='center' cellpadding='8' cellspacing='2'>
<TR>
<TD class='tdtitulo'>CEDULA</TD>
<TD class='tdtitulo' width='280'>NOMBRE</TD>
<TD class='tdtitulo'>N° CONTRATO</TD>
<TD class='tdtitulo'>TIPO </TD>
<TD class='tdtitulo'>UNIDAD</TD>
<TD class='tdtitulo'>ENTIDAD LABORAL</TD>
<TD class='tdtitulo'>CAUSAL</TD>
<TD class='tdtitulo' width='60'>FECHA</TD>
<TD class='tdtitulo'>VALOR CUOTA</TD>
<TD class='tdtitulo'>SALDO NUEVO</TD>
<TD class='tdtitulo'>VIGENTE/HISTORICO </TD>";
while(list($cedula, $nombres , $numcon, $tipo, $unidad_descuento, $entidad_laboral, $valorcuo, $causal, $fecha, $saldonuevo,$estado) = mysql_fetch_row($control))
{
$cont10 = mysql_query('SELECT codigo, nombre FROM entidad_laboral WHERE codigo = "'.$entidad_laboral. '" ');
if(!$cont10) {
die('Invalid query 2: ' . mysql_error());
}
list($codigo_entidad_laboral,$entidad_laboral) = mysql_fetch_row($cont10);
if ($tipo > 0)
{
$cont10 = mysql_query('SELECT codigo_contrato FROM planes_contratos WHERE codigo = "'."$tipo".'" ');
if (!$cont10) {
die('Invalid query 42: ' . mysql_error());
}
list($tipo) = mysql_fetch_row($cont10);
}
/*if ($tipo == "EJC1" || $tipo == "EJC2" || $tipo == "SJ01" || $tipo == "SJ02")
{
$valorcuo = $valorcuo * 24 ;
}
else{
$valorcuo = $valorcuo * 12 ;
}*/
if ($causal > 0)
{
}else
{
$cont10 = mysql_query('SELECT codigo FROM descuentos WHERE concepto = "' . "$causal". '" ');
if (!$cont10) {
die('Invalid query 42: ' . mysql_error());
}
list($causal) = mysql_fetch_row($cont10);
}
if ($estado == 0)
{
$esta = "HISTORICO";
}
else
{
$esta = "VIGENTE";
}
$sum = $sum +1 ;
$valtotal = $valtotal + $valorcuo;
printf("<tr>
<td class='tdfull'>".$cedula."</td>
<td class='tdfull'>".$nombres."</td>
<td class='tdfull'>".$numcon."</td>
<td class='tdfull'>".$tipo."</td>
<td class='tdfull'>".$unidad_descuento."</td>
<td class='tdfull'>".$codigo_entidad_laboral."</td>
<td class='tdfull'>".$causal."</td>
<td class='tdfull'>".$fecha."</td>
<td class='tdfull'>".$valorcuo."</td>
<td class='tdfull'>".$saldonuevo."</td>
<td class='tdfull'>".$esta."</td>");
$valorcuo = 0 ;
}
echo "</table>";
echo "<TABLE width='200' border='1' align='center' cellpadding='1' cellspacing='1'>
<TR>
<TD class='tdtitulo'>TOTAL REGISTROS</TD>
<TD class='tdtitulo'>VALOR TOTAL </TD>";
printf("<tr>
<td class='tdfull'>".$sum."</td>
<td class='tdfull'>".$valtotal."</td>");
}
}
}
echo "</form>";
}
?>