File: /home/asjudine/public_html/nove_resumen_diarias_supervisora3.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
$espacio = ' ';
$linea = '-';
require_once("Conectarse.php");
$ced = $_GET["ced"];
$nom = $_GET["nom"];
$cod = $_GET["cod"];
$buscausuario = mysql_query('SELECT Cedula, Nombre_Completo, codigo, sucursal FROM Usuarios WHERE codigo = "'.$cod.'" ');
list($cedula_usu, $nombre_usu, $codigo_usu, $sucursal_usu) = mysql_fetch_row($buscausuario);
/*
$sql = mysql_query('SELECT * FROM sucursal ORDER BY nombre ');
if (!$sql) {
die('Invalid query: ' . mysql_error());
}
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql);
*/
?>
<!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=iso-8859-1" />
<title>Consulta Novedades Diarias</title>
<style type="text/css">
<!--
.titulos {font: 16px; color: red; font-family:Arial; font-weight:bold}
.boton {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.texto {background-color: #CCFFCC; font-size: 13px; font-family: Arial; color:#0000CC; font-weight: bold; display: block;}
.fecha {font-size: 12px; font-family: Arial; color:#990000; display: block; }
.campo {background-color:#FFFFAA; width: 100px; border:2px solid #990000;}
.lista {font-family: Arial; font-size: 12px; color: #000066; font-weight: bold;}
.lista2 {background-color: #FFFFCC; font-size: 12px; font-family: Arial; font-weight: bold; color:#000000; display: block;}
.boton2 {
font-family: Verdana;
font-size: 8 pt;
color: #000080;
background-color: #C0C0C0;
border-style: solid;
width:90px;
height:22px;
}
body {
background-image: url();
}
.Estilo50 {color: #000000;
font-family: "Arial Narrow";
font-weight: bold;
}
.boton1 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.boton11 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
.Estilo54 {color: #333399; font-family: "Arial Narrow"; font-weight: bold; }
.Estilo57 {color: #006600}
.Estilo58 {
color: #000099;
font-weight: bold;
}
-->
</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>
<form action="" method="post" name="form1" class="provd" id="form1">
<div align="center">
<table width="361" border="3" cellpadding="3" cellspacing="3" bgcolor="#CCFFFF">
<tr>
<td colspan="3"><div align="center" class="Estilo50">RESUMEN NOVEDADES DIARIAS POR FECHA</div></td>
</tr>
<!--
<tr>
<td bgcolor="#CCFFFF" ><span class="Estilo54">Seleccione "<span class="Estilo57">Sucursal</span>" para continuar</span></td>
<td bgcolor="#CCFFFF" > <select name="sucursal">
<option value="">--SELECCIONE SUCURSAL--</option>
<?php
do {
?>
<option value="<?php echo $row_sql['nombre'];?>"><?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 bgcolor="#CCFFFF" colspan="2" align="center"><span class="Estilo58">Fecha :
<input name="fecha1" type="text" class="Estilo21" id="fecha1" value="0000-00-00" size="13" maxlength="13" >
</span> </td>
</tr>
</table>
<p>
<!--<input name="menu2" type="button" class="Estilo50" id="menu2" onclick="window.location.href='menu_novedades_supervisora.php'" value="IR AL MENU" />-->
<input name="consultar" id="consultar" type="submit" class="Estilo50" value="CONSULTAR">
<?php
echo"<div class='divirmenu'>
<input type='button' name='menu' id='menu' class='Estilo50' onClick='window.location.href=\"menu_novedades_supervisora3.php?ced=$ced&nom=$nom&cod=$cod\"' value='IR AL MENU'></div>";
?>
</p>
</div>
</form>
</body>
</html>
<?php
if(isset($_POST["consultar"]))
{
$fecha = date("D");
if($fecha == "Mon")
{
$dias = 3;
}else
{
$dias = 1;
}
$fecha2= date("Y-m-d", strtotime("$fecha1 -$dias day"));
if($cod == "753")
{
$control = mysql_query('SELECT id, sucursal, fecha , hora , jornada, respu_requer, funcionario_requi, efectuo_ventas , cuantas, facturas, indique_factu, sistema, fallas_siste, inventario_muebles, estado_mueble, procesos, sucu_proceso, tipo_proceso, quejas, accion_queja, documentacion, num_plantilla, llamadas, horallamada, funcionario_llama, motivo_llama, llamadas_noche, hora_noche, funcionario_noche, motivo_noche, necesidades FROM novedades_diarias WHERE fecha = "'.$_POST["fecha1"].'" AND (sucursal = "CUCUTA" || sucursal = "BUCARAMANGA" || sucursal = "TUNJA" || sucursal = "YOPAL" || sucursal = "VILLAVICENCIO" || sucursal = "MELGAR" || sucursal = "IBAGUE" || sucursal = "NEIVA" || sucursal = "FLORENCIA" || sucursal = "MOCOA") order by sucursal ');
if (!$control) {
die('Invalid query 2: ' . mysql_error());
}
}
/*
$control = mysql_query('SELECT id, sucursal, fecha , hora , jornada, respu_requer, funcionario_requi, efectuo_ventas , cuantas, facturas, indique_factu, sistema, fallas_siste, inventario_muebles, estado_mueble, procesos, sucu_proceso, tipo_proceso, quejas, accion_queja, documentacion, num_plantilla, llamadas, horallamada, funcionario_llama, motivo_llama, llamadas_noche, hora_noche, funcionario_noche, motivo_noche, necesidades FROM novedades_diarias WHERE fecha = "' . $_POST["fecha1"] . '" order by sucursal ');
if (!$control) {
die('Invalid query 2: ' . mysql_error());
}
*/
if ((mysql_num_rows($control)!=0))
{
echo "<table width=500 border=1 align=center cellpadding=1 cellspacing=1>
<tr>
<td colspan=12 bgcolor=#ECE9D8><div align=center class='titulos'>NOVEDADES DIARIAS</div></td>
</tr>
<tr align=center>
</tr> ";
echo "
<td align=center class=lista>$fecha2</td></tr>";
while(list($id, $sucursal, $fecha, $hora, $jorna, $respu, $funre, $ventas, $cuantas, $facturas, $indifac, $sistemas, $fallas, $inventario, $estado, $procesos, $sucupro, $tipo, $quejas, $accion, $documentacion, $plantilla, $llamadas, $horallama, $funllam, $mollama, $llamanoc, $horanoc, $funnoc, $monoc, $necesi) = mysql_fetch_row($control))
{
//print( date("H:i:s", strtotime("$hora")) );
$hora = date("H:i:s", strtotime("$hora"));
$hora1 = "11:59:00";
$hora2 = "12:30:00";
//echo "<br>";
/* if ($tiempo == "manana" and $hora <= $hora1)
{*/
$sum = $sum + 1;
echo "<table width=900 border=1 align=center cellpadding=0 cellspacing=0 >
<tr align=center>
<td width='100' class=texto>SUCURSAL</td>
<td width='100' class=texto>HORA</td>
<td width='600' class=lista2>Jornada Presencial Abogados</td>
<td class=lista2>Atenciones</td></tr>";
echo "<tr class=Estilo50>
<td align=center>$sucursal</td>
<td align=center>$hora</td>
<td align=center class=lista>$jorna</td>
<td ><div align='center' class='Estilo54'><input type='button' value=$sucursal name='sucursal' class=Estilo54 onClick =window.open('sub_listado_histoser.php?sucu=$sucursal&fecha=$fecha2','','top=50,left=100,toolbar=no,scrollbars=yes,width=900,height=400,status=yes')></a></span></div></td>
</tr><br><br>";
echo "<table width=350 border=0 align=center cellpadding= cellspacing=>
<tr align=center>
<td width='70' class=fecha></td></tr>";
echo "<tr class=lista>
<td align=center></td></tr>";
/* echo "<table width=550 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td class=lista2>Jornada Presencial Abogados</td>
<td class=lista2>Atenciones</td></tr>";
echo "<tr class=lista>
<td align=center>$jorna</td>
<td bgcolor='#ECE9D8'><div align='center' class='Estilo54'><input type='button' value=$sucursal name='sucursal' class=Estilo54 onClick =window.open('sub_listado_histoser.php?sucu=$sucursal&fecha=$fecha','','top=50,left=100,toolbar=no,scrollbars=yes,width=900,height=400,status=yes')></a></span></div></td>
</tr>";*/
if ($respu == "SI")
{
echo "<table width=900 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='300' class=lista2>Ha Recibido Requerimientos por</td>";
echo "
<td align=left class=lista>$funre</td></tr>";
}
if ($ventas == "SI")
{
echo "<table width=900 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='300' class=lista2>Ventas Realizadas</td> ";
echo "
<td align=left class=lista>$cuantas</td></tr>";
}
if ($facturas == "SI")
{
echo "<table width=900 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='300' class=lista2>Tiene Facturas de Servicios públicos por pagar :</td> ";
echo "
<td align=left class=lista>$indifac</td></tr>";
}
if ($sistemas == "NO")
{
echo "<table width=900 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='300' class=lista2>Tiene fallas en el Sistema de Computo: Indique Unidades y Posibles Fallas </td> ";
echo "
<td align=left class=lista>$fallas</td></tr>";
}
if ($inventario == "NO")
{
echo "<table width=900 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='300' class=lista2>Inventario de Muebles y equipos se encuentra en el estado en que las recibio:</td>";
echo "
<td align=left class=lista>$estado</td></tr>";
}
if ($procesos == "SI")
{
echo "<table width=900 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='300' class=lista2>Ha recibido procesos para adelantar en otras sucursales:</td> ";
echo "
<td align=left class=lista>$sucupro--$tipo</td></tr>";
}
if ($quejas == "SI")
{
echo "<table width=900 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='300' class=lista2>A recibido quejas por parte del Afiliado:</td>";
echo "
<td align=left class=lista>$accion--$tipo</td></tr>";
}
if ($documentacion == "SI")
{
echo "<table width=900 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='300' class=lista2>Ha enviado Documentación a Bogotá:</td>";
echo "
<td align=left class=lista>SI : Planilla N° $plantilla</td></tr>";
}
if ($llamadas == "SI")
{
echo "<table width=900 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='300' class=lista2>Ha recibido llamadas de Bogotá Durante el Día:</td>";
echo "
<td align=left class=lista>Hora llamada: $horallama ; Funcionario : $funllam ; Motivo Llamada:$mollama</td></tr>";
}
if ($llamanoc == "SI")
{
echo "<table width=900 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='300' class=lista2>Ha recibido llamadas de Bogotá Durante la Noche:</td>";
echo "
<td align=left class=lista>Hora llamada: $horanoc ; Funcionario : $funnoc ; Motivo Llamada:$monoc</td></tr>";
}
if ($necesi != "")
{
echo "<table width=900 border=1 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='300' class=lista2>Indique solicitudes de elementos u otras necesidades que considere fundamentales para el buen funcionamiento de la Oficina: </td>";
echo "
<td align=left class=lista>$necesi</td></tr>";
}
echo "<table width=900 border=0 align=center cellpadding= cellspacing=>
<tr align=center>
<td width='300' class=fecha></td>";
echo "
<td align=center></td></tr><br>";
// <td bgcolor='#DEFEFD'><div align='center' class='lista'><input type='button' value=$id name='id' class=Estilo51 onClick =window.open('nove_consultas.php?id=$id&sucursal=$sucursal','','top=20,left=100,toolbar=no,scrollbars=yes,width=1300,height=800,status=yes')></a></span></div></td>
/*<select name="tiempo">
<option value="manana">Mañana</option>
<option value="tarde">Tarde</option>
</select>*/
}
}
echo "</table>";
echo "<TABLE width='200' border='0' align='center' cellpadding='0' cellspacing='1'>
<TR>
<TD bgcolor='#FFFFCC'><div align='center'><span class='texto'>TOTAL REGISTROS</span></div></TD></TD>";
printf("<tr>
<td bgcolor='#C5D6FC'><div align='center' class='lista'>".$sum."</span></div></td></td>");
echo "</table>";
echo "</form>";
}
?>