MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/public_html/direc_novedades.php
<?PHP extract($_POST,EXTR_SKIP);  ?>

<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;

   require_once("Conectarse.php");
	
	$sql = mysql_query('SELECT * FROM sucursal  WHERE codigo != "24" and codigo != "5" and codigo != "20" and codigo != "25" and codigo != "28" and codigo != "31" and codigo != "41" and codigo != "42" 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 Usuarios  WHERE (Cargo = "DISER ARAUCA" || Cargo = "DISER BARRANQUILLA" || Cargo = "DISER BOGOTA" || Cargo = "DISER BUCARAMANGA" || Cargo = "DISER CALI" || Cargo = "DISER CARTAGENA" || Cargo = "DISER FLORENCIA" || Cargo = "DISER IBAGUE" || Cargo = "DISER MEDELLIN" || Cargo = "DISER MELGAR" || Cargo = "DISER MOCOA" || Cargo = "DISER MONTERIA" || Cargo = "DISER NEIVA" || Cargo = "DISER NEIVA" || Cargo = "DISER PEREIRA" || Cargo = "DISER VALLEDUPAR" || Cargo = "DISER VILLAVICENCIO"  ) and estado = 1 order by Nombre_Completo');
		  if (!$sql2) {
				die('Invalid query 12: ' . mysql_error());  
			}
	$row_sql2 = mysql_fetch_assoc($sql2);
	$totalRows_sql2 = mysql_num_rows($sql2); 
	
	
	if ($_GET["id"] == "ARAUCA")
	{
	$dir = "DISER ARAUCA";
	}
	
	if ($_GET["id"] == "BOGOTA")
	{
	$dir = "DISER BOGOTA";
	}
	if ($_GET["id"] == "BARRANQUILLA")
	{
	$dir = "DISER BARRANQUILLA";
	}
		if ($_GET["id"] == "BUCARAMANGA")
	{
	$dir = "DISER BUCARAMANGA";
	}
		if ($_GET["id"] == "CALI")
	{
	$dir = "DISER CALI";
	}
	
	if ($_GET["id"] == "CUCUTA")
	{
	$dir = "DISER CUCUTA";
	}
		
	if ($_GET["id"] == "CARTAGENA")
	{
	$dir = "DISER CARTAGENA";
	}
	if ($_GET["id"] == "FLORENCIA")
	{
	$dir = "DISER FLORENCIA";
	}
	if ($_GET["id"] == "IBAGUE")
	{
	$dir = "DISER IBAGUE";
	}
	if ($_GET["id"] == "MEDELLIN")
	{
	$dir = "DISER MEDELLIN";
	}
	if ($_GET["id"] == "MELGAR")
	{
	$dir = "DISER MELGAR";
	}
	if ($_GET["id"] == "MOCOA")
	{
	$dir = "DISER MOCOA";
	}
	if ($_GET["id"] == "MONTERIA")
	{
	$dir = "DISER MONTERIA";
	}
	if ($_GET["id"] == "NEIVA")
	{
	$dir = "DISER NEIVA";
	}
	if ($_GET["id"] == "PEREIRA")
	{
	$dir = "DISER PEREIRA";
	}
	if ($_GET["id"] == "POPAYAN")
	{
	$dir = "DISER POPAYAN";
	}
	
	if ($_GET["id"] == "VALLEDUPAR")
	{
	$dir = "DISER VALLEDUPAR";
	}
	
    if ($_GET["id"] == "TUNJA")
	{
	$dir = "DISER TUNJA";
	}
	
	   if ($_GET["id"] == "PASTO")
	{
	$dir = "DISER PASTO";
	}
	
	
if ($_GET["id"] == "VILLAVICENCIO")
	{
	$dir = "DISER VILLAVICENCIO";
	}

if ($_GET["id"] == "SANTA_MARTA")
	{
	$dir = "DISER SANTA_MARTA";
	}
	
if ($_GET["id"] == "YOPAL")
	{
	$dir = "DISER YOPAL";
	}	

$directt = mysql_query('SELECT Cedula, Nombre_Completo FROM Usuarios  WHERE estado = 1 and Cargo = "' ."$dir". '" ');
		  if (!$directt) {
				die('Invalid query directt: ' . mysql_error());
			}
	list($cedirec, $direcc) = mysql_fetch_row($directt);


	$sql3 = mysql_query('SELECT * FROM Usuarios where estado = 1 order by Nombre_Completo');
		  if (!$sql3) {
				die('Invalid query 12sss: ' . mysql_error());
			}
	$row_sql3 = mysql_fetch_assoc($sql3);
	$totalRows_sql3 = mysql_num_rows($sql3); 
	
	
	
	
$sql4 = mysql_query('SELECT * FROM asjudinet_abogados WHERE sucursal = "'.$_GET["id"].'" and vigentes = "1" and codigo_abogado != "1" and estado = "0" order by Nombre_Completo ');
		  if (!$sql4) {
				die('Invalid query 12sss: ' . mysql_error());
			}
	$row_sql4 = mysql_fetch_assoc($sql4);
	$totalRows_sql4 = mysql_num_rows($sql4); 


	$ggag = mysql_query('SELECT codigo  FROM sucursal WHERE estado = 1 and nombre  = "' . $_GET["id"]  . '" ');
		  if (!$ggag) {
				die('Invalid query sucursalll: ' . mysql_error());
			}
	list($suuuu) = mysql_fetch_row($ggag); 
	
	
	$fecha1 = date("D");

if($fecha1 == "Mon")
{
$dias = 3;
}else
{
$dias = 1;
}
$fecha2= date("Y-m-d", strtotime("$fecha -$dias day")); 
//echo $fecha2;

$sql5 = mysql_query('SELECT * FROM record_servicios WHERE sucursal = "'.$suuuu.'" and (estado != "4" and estado != "5") and fecha_servicio = "'.$fecha2.'" order by numero_atencion ');
		  if (!$sql5) {
				die('Invalid query sql5: ' . mysql_error());
			}
	$row_sql5 = mysql_fetch_assoc($sql5);
	$totalRows_sql5 = mysql_num_rows($sql5); 
	
$sql6 = mysql_query('SELECT * FROM record_servicios WHERE sucursal = "'.$suuuu.'" and (estado = "4" || estado = "5") and fecha_servicio = "'.$fecha2.'" order by numero_atencion ');
		  if (!$sql6) {
				die('Invalid query sql5: ' . mysql_error());
			}
	$row_sql6 = mysql_fetch_assoc($sql6);
	$totalRows_sql6 = mysql_num_rows($sql6); 

?>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Novedades Diarias</title>

<style type="text/css">
<!--
.Estilo19 {font-family: "Arial Narrow"; font-weight: bold; }
.Estilo20 {color: #990000}
.Estilo21 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; color: #990000; }
.Estilo13 {font-size: 12px; font-weight: bold; }
.Estilo30 {font-family: "Arial Narrow"; font-weight: bold; color: #FF0000; }
.Estilo42 {color: #000099}
.Estilo48 {color: #000099; font-weight: bold; }
.Estilo50 {font-family: "Arial Narrow"; font-weight: bold; font-size: 18px; color: #0000FF; }
.Estilo51 {color: #F0F0F0}
.Estilo52 {
	color: #FF0000;
	font-weight: bold;
	font-size: 14px;
}
.Estilo54 {color: #FF0000}
-->
</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)
{

/*recep = receptores[]; 
    for (i = 0; checkbox = recep[i]; i++) { 
         if (checkbox.checked ) { 
                return (false); 
            } 
		}*/

  if (formulario.sucursale.value == "")
  {
    alert("Debe seleccionar Sucursal");
    formulario.sucursale.focus();
    return (false);
  }
  
   if (formulario.motivausen.value == "")
  {
    alert("Falta Seleccionar Si Cumplio Jornada");
    formulario.motivausen.focus();
    return (false);
  }
  
  
   if (formulario.motivo.value == "" )
  {
    alert("Escriba el Motivo De Ausencia");
    formulario.motivo.focus();
    return (false);
  }
  
  
  
  if (formulario.reque.value == "")
  {
    alert("Falta seleccionar Respuestas requerimientos");
    formulario.reque.focus();
    return (false);
  }

  if (formulario.entrada.value == "00:00")
  {
    alert("Falta digitar hora de entrada de los funcionarios");
    formulario.entrada.focus();
    return (false);
  }
  
if (formulario.reque.value == "SI")
  {

  if (formulario.funreque.value == "")
  {
    alert("Falta seleccionar Funcionario que requirio");
    formulario.funreque.focus();
    return (false);
  }
}
  if (formulario.ventas.value == "")
  {
    alert("Falta seleccionar Efectuo Ventas");
    formulario.ventas.focus();
    return (false);
  }
  
  if (formulario.ventas.value == "SI")
  {

  if (formulario.cuaven.value == "")
  {
    alert("Falta Digitar Número de ventas");
    formulario.cuaven.focus();
    return (false);
  }
}
    if (formulario.factura.value == "")
  {
    alert("Falta seleccionar si tiene Facturas de Servicios Públicos");
    formulario.factura.focus();
    return (false);
  }

if (formulario.factura.value == "SI")
  {

  if (formulario.infactu.value == "")
  {
    alert("Falta Digitar cuales y su valor");
    formulario.infactu.focus();
    return (false);
  }
}

 if (formulario.sistema.value == "")
  {
    alert("Falta Seleccionar Sistema de Computo Funcionando");
    formulario.sistema.focus();
    return (false);
  }

if (formulario.sistema.value == "NO")
  {

  if (formulario.falsistema.value == "")
  {
    alert("Falta Digitar Unidades u posibles fallas");
    formulario.falsistema.focus();
    return (false);
  }
}

 if (formulario.inventario.value == "")
  {
    alert("Falta Seleccionar inventario de Muebles");
    formulario.inventario.focus();
    return (false);
  }

if (formulario.inventario.value == "NO")
  {

  if (formulario.estainven.value == "")
  {
    alert("Falta Digitar elementos y su estado");
    formulario.estainven.focus();
    return (false);
  }
}


 if (formulario.procesos.value == "")
  {
    alert("Falta Seleccionar a recibido procesos para adelantar en otra sucursal ");
    formulario.procesos.focus();
    return (false);
  }


if (formulario.procesos.value == "SI")
  {

  if (formulario.procesucu.value == "")
  {
    alert("Falta Seleccionar sucursal donde se adlantara el proceso");
    formulario.procesucu.focus();
    return (false);
  }
}

if (formulario.procesos.value == "SI")
  {

  if (formulario.tipo.value == "")
  {
    alert("Falta Seleccionar Tipo de Proceso");
    formulario.tipo.focus();
    return (false);
  }
}

 if (formulario.quejas.value == "")
  {
    alert("Falta Seleccionar a recibido Quejas del Afiliado ");
    formulario.quejas.focus();
    return (false);
  }

if (formulario.quejas.value == "SI")
  {

  if (formulario.accionque.value == "")
  {
    alert("Falta Digitar medio y la accion tomada");
    formulario.accionque.focus();
    return (false);
	}
}

 if (formulario.documen.value == "")
  {
    alert("Falta Seleccionar ha enviado documentos a Bogotá ");
    formulario.documen.focus();
    return (false);
  }

if (formulario.documen.value == "SI")
  {

  if (formulario.plantilla.value == "")
  {
    alert("Falta Digitar número de plantilla");
    formulario.plantilla.focus();
    return (false);
	}
}

 if (formulario.llamada.value == "")
  {
    alert("Falta Seleccionar ha recibido llamadas de Bogotá ");
    formulario.llamada.focus();
    return (false);
  }


if (formulario.llamada.value == "SI")
  {

  if (formulario.horallama.value == "00:00")
  {
    alert("Falta ingresar hora de la Llamada");
    formulario.horallama.focus();
    return (false);
	}
}

if (formulario.llamada.value == "SI")
  {

  if (formulario.funllama.value == "")
  {
    alert("Falta seleccionar el funcionario que lo llamo");
    formulario.funllama.focus();
    return (false);
	}
}

if (formulario.llamada.value == "SI")
  {

  if (formulario.motlla.value == "")
  {
    alert("Falta digitar el motivo de la llamada");
    formulario.motlla.focus();
    return (false);
	}
}


 if (formulario.llamanoc.value == "")
  {
    alert("Falta Seleccionar ha recibido llamadas de Bogotá en horario de la Noche ");
    formulario.llamada.focus();
    return (false);
  }


if (formulario.llamanoc.value == "SI")
  {

  if (formulario.horallamanoc.value == "00:00")
  {
    alert("Falta ingresar hora de la Llamada de la noche");
    formulario.horallamanoc.focus();
    return (false);
	}
}

if (formulario.llamanoc.value == "SI")
  {

  if (formulario.funllamanoc.value == "")
  {
    alert("Falta seleccionar el funcionario que lo llamo en la Noche");
    formulario.funllamanoc.focus();
    return (false);
	}
}

if (formulario.llamanoc.value == "SI")
  {

  if (formulario.motllanoc.value == "")
  {
    alert("Falta digitar el motivo de la llamada en el horario de la noche");
    formulario.motlla.focus();
    return (false);
	}
}


if (formulario.suge.value == "SI")
  {

  if (formulario.sugerencia.value == "")
  {
    alert("Falta Diligenciar sugerencia para la Oficina");
    formulario.sugerencia.focus();
    return (false);
	}
}
  if (confirm("Es correcta está información "))
  {   
    return (true);
  }
  else
  {
   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 update(envio)
{ 
   envio.identificacion.value = formulario.Cedula.value
   envio.contador.value = formulario.Contador.value      
   envio.hora_envio.value = formulario.Hora_Envio.value;   
}
</script>

</SCRIPT> 

<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;
}

function anade() {
/*recep = document.anadir['receptores[]']; 
    for (i = 0; checkbox = recep[i]; i++) { 
         if (checkbox.checked ) { 
            return true; 
            } 
		}*/


}
//-->
</script>


</head>
<body OnLoad="startclock()" topmargin="0" rightmargin="0" marginheight="0" marginwidth="0">
<form action="" method="post" name="formulario" enctype="multipart/form-data" onSubmit="return Valida_Fecha(this)">


  <table width="1100" border="4" align="center" cellpadding="5" cellspacing="5" bordercolor="#000066" bgcolor="#FAFAF5">
    <tr  bgcolor="#0099FF">
      <td  align="right" nowrap bgcolor="#A9D2FC"><div align="center"><span class="Estilo50">INFORME DE NOVEDADES DIARIAS</span></div></td>
    </tr>
    <tr valign="baseline" bgcolor="#FFFFCC">
      <td ><div align="justify">
          <p class="Estilo30">Diligencie el siguiente formulario de acuerdo a las especificaciones correspondientes.</p>
      </div></td>
    </tr>
    <tr valign="baseline" bgcolor="#F2F2E6">
      <td ><table width="852">
          <tr>
            <td ><div align="center"><span class="Estilo19 Estilo20">Fecha dd-mm/aaaa:</span><span class="Estilo21"> <span class="Estilo13">
                <input name="dia" type="text" id="dia2" value="<?php echo date("d"); ?>" size="2" maxlength="2" readonly="">
                <input name="mes" type="text" id="mes2" value="<?php echo date("m"); ?>" size="2" maxlength="2" readonly="">
                <input name="ano" type="text" id="ano2" value="<?php echo date("Y"); ?>" size="4" maxlength="4" readonly="">
            </span></span></div></td>
            <td ><div align="center"><span class="Estilo21">Hora:</span>
                    <input name="Hora_Envio" type="text" size="13" maxlength="13">
            </div></td>
          </tr>
      </table></td>
    </tr>
    <tr valign="baseline" bgcolor="#F2F2E6">
      <td ><div align="right" class="Estilo19 Estilo20">
          <div align="left"></div>
      </div></td>
    </tr>
    <tr  bgcolor="#F2F2E6">
      <td   align="center" nowrap bgcolor="#CCFFCC"><span class="Estilo21">Sucursal:</span>
          <select name="sucursal" onChange="MM_jumpMenu('parent',this,0)">
            <option value="">--Seleccione Sucursal--</option>
            <?php
     do {  
?>
            <option value="../direc_novedades.php?id=<?php echo $row_sql['nombre'];?>&fecha=<?php echo date("Y"); ?>-<?php echo date("m"); ?>-<?php echo date("d"); ?>"><?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>
          <span class="Estilo21">
          <input name="sucursale" type="text" class="Estilo21" id="sucursale" value="<?php echo $_GET["id"]; ?>" size="20" maxlength="20" readonly="" >
            Director:<input name="direcc" type="text" class="Estilo21" id="direcc" value="<?php echo $direcc; ?>" size="60" maxlength="60"  readonly=""> </span>
      
          <span class="Estilo21"> </span></td>
    </tr>
	<tr>
    <tr>
	   <td   bgcolor="#CCFFFF" ><p align="center" class="Estilo30 Estilo42">Seleccione la jornada presencial de los abogados he Indique hora inicio - hora salida y cuantas consultas juridicas atendi&oacute;:    </td>
    </tr>
	</tr>
    <tr  bgcolor="#FFFFCC">
     
      <td width="854" bgcolor="#CCFFFF" class="Estilo42">
	  <table width="1104" border="1" >
	
	<tr><td><div align="right" class="Estilo30">Hora :</div></td>
	<td><div align="left"><span class="Estilo52">
	<input type="text" class="Estilo30" value="Entrada" size="8" readonly> 
	----  <input type="text" class="Estilo30" value="Salida" size="6" readonly> 
    ---   <input type="text" class="Estilo30" value="N° Atenciones" size="14" readonly>  
    --- <input type="text" class="Estilo30" value="Cumplio Jornada" size="15" readonly>
    --- <input type="text"  class="Estilo30" value="Motivos de Ausencia" size="19" readonly></span></div></td>
	</tr>
	    <tr>   <td width="294"  class="Estilo13">
        
          <?php
     do { 
	
?>
	    <tr><TD class="Estilo13">
          <br>
         
  <input   type="checkbox" checked="yes" id="funcionarios" name="receptores[]" value="<?php echo $row_sql4['nombre_completo'];?>"> <?php echo $row_sql4['nombre_completo']?></td>
  
  
  <td width="495" class="Estilo13"> <input name="entrada[]" type="text" class="Estilo21" id="entrada" value="<?php echo $row_sql4['hora_ingreso']?>" size="7" maxlength="7" readonly >
  
        ------
          <input name="salida[]" type="text" class="Estilo21" id="salida" value="<?php echo $row_sql4['hora_salida']?>" size="7" maxlength="7" readonly>
        ---------
        <input name="atencion[]" type="text" class="Estilo21" id="atencion" value="0" size="3" maxlength="3" >
        ---------
            <select name="motivausen">
                  <option value = "">-----</option>
                  <option value = "SI">SI</option>
                  <option value = "NO">NO</option>
              </select>
         ------
        <input name="descrimotivo" type="text" class="Estilo21" id="descrimotivo" value="" size="23" maxlength="80" >        </option>
        
                  
        
        </td></tr><tr> 
        <?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);
  }
?></tr></table>
<TR>
  <td bgcolor="#CCFFFF" class="Estilo48" align="CENTER">
	  <span class="Estilo48">Atenciones Diarias</span>	 <input name="numaten" type="text" class="Estilo21" id="numaten" value="<?php echo $totalRows_sql5 ;?>" size="3" maxlength="3" >
      </td>
</TR>
    <tr>
      <td  bgcolor="#CCFFFF">
	   <table border="1">
	   <tr>
	   <td   align="left">
	    </option>   
            
         
		    <?php
     do {  
?>
        <input type="text" size="5" maxlength="5" value="<?php echo $row_sql5['numero_atencion'];?>">
            <?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);
  }
?>
        

  </td>

	   </tr>
	   </table>
      </td>
    </tr>
          <br>
    <tr  bgcolor="#FFFFCC">
        <td   bordercolor="#000033"  bgcolor="#CCFFCC" ><div align="justify">
            <p align="left" class="Estilo30 Estilo42">Usted dio respuesta a requerimientos:
              <select name="reque">
                  <option value = "">-----</option>
                  <option value = "SI">SI</option>
                  <option value = "NO">NO</option>
              </select>
              Funcionario que Requiri&oacute;
              <select name="funreque">
                <option value = "">----------Seleccione Funcionario-----------</option>
                <option value="JALAL JULIO YAMILE">JALAL JULIO YAMILE</option>
                <option value="RODRIGUEZ GUIO LEIDY JOHANA">RODRIGUEZ GUIO LEIDY JOHANA</option>
                <option value="RODRIGUEZ  MONTOYA ESPERANZA">RODRIGUEZ  MONTOYA ESPERANZA</option>
            </select>            
            <p align="left" class="Estilo30 Estilo42">Efectuó Ventas:
              <select name="ventas">
                <option value = "">-----</option>
                <option value = "SI">SI</option>
                <option value = "NO">NO</option>
              </select>
              Cuantas
              <input name="cuaven" type="text" class="Estilo21" id="cuaven" value="" size="2" maxlength="2" >
            </div></td>
    </tr>
      <tr  bgcolor="#FFFFCC">
        <td bgcolor="#CCFFCC" ><div align="justify">
            <p class="Estilo30 Estilo42"> Tiene Facturas de Servicios públicos por pagar :
              <select name="factura">
                  <option value = "">-----</option>
                  <option value = "SI">SI</option>
                  <option value = "NO">NO</option>
              </select>
            </p>
            <p class="Estilo30 Estilo42">Indique cuales y su valor
              <textarea name="infactu" cols="40" rows="2"></textarea>
            </p>
        </div></td>
      </tr>
      <tr>
        <td bgcolor="#CCFFCC" ><div align="justify">
            <p class="Estilo30 Estilo42">Sistema de Computo Funcionando:
              <select name="sistema">
                  <option value = "">-----</option>
                  <option value = "SI">SI</option>
                  <option value = "NO">NO</option>
              </select>
            </p>
            <p class="Estilo30 Estilo42">Indique Unidades y Posibles Fallas
              <textarea name="falsistema" cols="50" rows="2"></textarea>
            </p>
        </div></td>
      </tr>
      <tr>
        <td bgcolor="#CCFFCC" ><div align="justify">
            <p class="Estilo30 Estilo42">Inventario de Muebles y equipos se encuentra en el  estado en que las recibió:
              <select name="inventario">
                  <option value = "">-----</option>
                  <option value = "SI">SI</option>
                  <option value = "NO">NO</option>
              </select>
            </p>
            <p class="Estilo30 Estilo42">Indique elementos y su estado
              <textarea name="estainven" cols="50" rows="2"></textarea>
            </p>
        </div></td>
      </tr>
      <tr>
        <td bgcolor="#CCFFCC"><div align="justify">
            <p class="Estilo30 Estilo42">Ha recibido procesos para adelantar en otras sucursales:
              <select name="procesos">
                  <option value = "">-----</option>
                  <option value = "SI">SI</option>
                  <option value = "NO">NO</option>
              </select>
            </p>
            <p class="Estilo30 Estilo42">
              Indique
              <select name="procesucu">
                <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>
              y tipo de Proceso
              <select name="tipo">
                <option value="">------Tipo Proceso-----</option>
                <option value="DISCIPLINARIO">DISCIPLINARIO</option>
                <option value="JURIDICO">JURIDICO</option>
                <option value="MEDICINA LABORAL">MEDICINA LABORAL</option>
                <option value="PREJURIDICO">PREJURIDICO</option>
                <option value="SUSTANCIACION">SUSTANCIACION</option>
              </select>
            </p>
        </div></td>
      </tr>
      <tr>
        <td bgcolor="#CCFFCC"  ><div align="justify">
            <p class="Estilo30 Estilo42">Ha recibido quejas por parte del Afiliado:
              <select name="quejas">
                  <option value = "">-----</option>
                  <option value = "SI">SI</option>
                  <option value = "NO">NO</option>
              </select>
            </p>
            <p class="Estilo30 Estilo42">Indique el medio, los datos y su accion tomada
              <textarea name="accionque" cols="50" rows="2"></textarea>
            </p>
        </div></td>
      </tr>
      <tr>
        <td bgcolor="#CCFFCC"  ><div align="justify">
            <p class="Estilo30 Estilo42">Ha enviado Documentación a Bogotá:
              <select name="documen">
                  <option value = "">-----</option>
                  <option value = "SI">SI</option>
                  <option value = "NO">NO</option>
              </select>
              Indique Número de Planilla
              <input name="plantilla" type="text" class="Estilo21" id="plantilla" value="" size="6" maxlength="6" >
            </p>
        </div></td>
      </tr>
      <tr>
        <td bgcolor="#CCFFCC"  ><div align="justify">
            <p class="Estilo30 Estilo42">Ha recibido llamadas de Bogotá:
              <select name="llamada">
                  <option value = "">-----</option>
                  <option value = "SI">SI</option>
                  <option value = "NO">NO</option>
              </select>
			  Indique hora de Llamada
              <input name="horallama" type="text" class="Estilo21" id="horallama" value="00:00" size="7" maxlength="7" >
			  <span class="Estilo54">HORARIO DIA</span>	
            </p>
            <p class="Estilo30 Estilo42">Indique  nombre 
              <select name="funllama">
                <option value="">--Seleccione Funcionario--</option>
                <?php
     do {  
?>
                <option value="<?php echo $row_sql3['Nombre_Completo'];?>"><?php echo $row_sql3['Nombre_Completo']?></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>
            </p>
            <p class="Estilo30 Estilo42">
              Cual fue el Motivo
              <textarea name="motlla" cols="50" rows="2"></textarea>
            </p>
        </div></td>
      </tr>
	  
	     <tr>
        <td bgcolor="#CCFFCC"  ><div align="justify">
          <p class="Estilo30 Estilo42">Ha recibido llamadas de Bogotá:
              <select name="llamanoc">
                  <option value = "">-----</option>
                  <option value = "SI">SI</option>
                  <option value = "NO">NO</option>
              </select>
			  Indique hora de Llamada
              <input name="horallamanoc" type="text" class="Estilo21" id="horallamanoc" value="00:00" size="7" maxlength="7" >
              <span class="Estilo54">HORARIO NOCHE</span>			</p>
			<p class="Estilo30 Estilo42">Indique  nombre 
              <select name="funllamanoc">
                <option value="">--Seleccione Funcionario--</option>
                <?php
     do {  
?>
                <option value="<?php echo $row_sql3['Nombre_Completo'];?>"><?php echo $row_sql3['Nombre_Completo']?></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>
            </p>
            <p class="Estilo30 Estilo42">
              Cual fue el Motivo
              <textarea name="motllanoc" cols="50" rows="2"></textarea>
            </p>
        </div></td>
      </tr>
	  
      <tr>
        <td  bgcolor="#CCFFCC"><p><span class="Estilo48"> Indique solicitudes de elementos u otras necesidades que considere </span><span class="Estilo48">fundamentales para el buen</span></p>
          <p><span class="Estilo48"> funcionamiento de la Oficina: </span>  
            <select name="suge">
              <option value = "">-----</option>
              <option value = "SI">SI</option>
              <option value = "NO">NO</option>
              </select>
          </p></td>
      </tr>
	  
	  
      <tr>
        <td  align="left" bgcolor="#CCFFCC"><span class="Estilo51">
          <textarea name="sugerencia" cols="80" rows="4"></textarea>
        </span> </td>
      </tr>
      
      
       <tr  bgcolor="#CCFFCC">
       <td bgcolor="#CCFFCC"><span class="Estilo48">Envio Documentos Escaneados : 
    </span>
        <input type="file" name="archivito" size="40" maxlength="40"></td>
      </tr>
      
       <tr  bgcolor="#CCFFCC">
       <td bgcolor="#CCFFCC"><span class="Estilo48">Envio Documento Escaneados 2: 
    </span>
        <input type="file" name="archivito2" size="40" maxlength="40"></td>
      </tr>
      
      
      <tr  bgcolor="#CCFFCC">
       <td bgcolor="#CCFFCC"><span class="Estilo48">Envio Documento Escaneados 3: 
    </span>
        <input type="file" name="archivito3" size="40" maxlength="40"></td>
      </tr>
      
      <tr  bgcolor="#F2F2E6">
        <td align="center" nowrap bgcolor="#CCFFCC"><input  name="submit" type="submit" class="Estilo21"   value="ENVIAR">
            <input name="menu2" type="button" class="Estilo48" id="menu2" onClick="window.location.href='menu_admin.php'" value="IR AL MENU" />        </td>
      </tr>
  </table>
  <div align="center">
      <input type="hidden" name="MM_insert" value="formulario">
  </div>
</form>  
</body>
</html>



<?PHP extract($_POST,EXTR_SKIP);  ?>  
<?php

require_once("mainfile.php");
include ("config.php");
global $dbi;


require_once("Conectarse.php");


$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING']))
{
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "formulario"))
{

$dia = date("d");
$mes = date("m"); 
$ano = date("Y");
 $fecha = $_POST[ano]."-".$_POST[mes]."-".$_POST[dia];
 
		$condd = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE estado = 1 and Cedula = "'. $_POST["director"] .'" ');
					if (!$condd) {
						die('Invalid query condd: ' . mysql_error());
					} 
			list($nombress) = mysql_fetch_row($condd);

           
$a=0;
$b=0;
$toaten = 0;
$totalaten = 0;



foreach($_POST['entrada'] as $t => $entra) 
{
		
		if ($_POST['motivo'][$t] != "")
			{
			$funci = $_POST['receptores'][$a]."--->Motivo Ausencia : ".$_POST['motivo'][$t];
			$jornada = $jornada ."        ". $funci;
			$a= $a + 1;
			$b= $b + 1;
			}else
			{
		
		if ($_POST['entrada'][$t] )
			{
						foreach($_POST['receptores'] as $i => $valor ) 
						{
							if ($a == $b)
							{
							$b= $b + 1;	
	//	 echo  $_POST['receptores'][$a]."--->".$_POST['entrada'][$t]."--->".$_POST['salida'][$t]."--->".$_POST['atencion'][$t];
								
				$funci = $_POST['receptores'][$a]."--->Hora Entrada:".$_POST['entrada'][$t]."  --->  Hora Salida:".$_POST['salida'][$t]." ---> Atenciones:".$_POST['atencion'][$t];
				
					$toaten = $toaten + $_POST['atencion'][$t];
					$jornada = $jornada ."      ". $funci;					
							 echo "<br>";	
							
							}
						}
			$a= $a + 1;
						
	}	
		}
			
		
}  


$conta = mysql_query('SELECT Cedula FROM Usuarios WHERE estado = 1 and Nombre_Completo = "' . $_POST["direcc"] . '"  ');
		  if (!$conta) {
				die('Invalid query directt: ' . mysql_error());
			}
	list($cedirec) = mysql_fetch_row($conta);


//////////////



 $archivo = $_FILES["archivito"]["tmp_name"]; 
 $tamanio = $_FILES["archivito"]["size"];
 $tipo    = $_FILES["archivito"]["type"];
 $nombre  = $_FILES["archivito"]["name"];
 
 /////
 
 $archivo2 = $_FILES["archivito2"]["tmp_name"]; 
 $tamanio2 = $_FILES["archivito2"]["size"];
 $tipo2    = $_FILES["archivito2"]["type"];
 $nombre2  = $_FILES["archivito2"]["name"];
 
 ///// ARCHIVO 3
 
 $archivo3 = $_FILES["archivito3"]["tmp_name"]; 
 $tamanio3 = $_FILES["archivito3"]["size"];
 $tipo3    = $_FILES["archivito3"]["type"];
 $nombre3  = $_FILES["archivito3"]["name"];
 

if ( $archivo != "none" || $archivo2 != "none" || $archivo3 != "none")
  {
      $fp = fopen($archivo, "rb");
      $contenido = fread($fp, $tamanio);
      $contenido = addslashes($contenido);
      fclose($fp); 
	  

//////////

 	  $fp2 = fopen($archivo2, "rb");
      $contenido2 = fread($fp2, $tamanio2);
      $contenido2 = addslashes($contenido2);
      fclose($fp2); 


//////////

 	  $fp3 = fopen($archivo3, "rb");
      $contenido3 = fread($fp3, $tamanio3);
      $contenido3 = addslashes($contenido3);
      fclose($fp3); 



$control = mysql_query("INSERT INTO novedades_diarias (cedula,director,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, estado,nombre, contenido, tipo,nombredos,contenidodos,tipodos,nombretres,contenidotres,tipotres,cumplio_horario,motivo_ausencia) VALUES ('" ."$cedirec". "', '" . $_POST["direcc"] . "', '" . $_POST["sucursale"] . "', '" ."$fecha". "', '" . $_POST["Hora_Envio"] . "', '" . "$jornada". "', '" . $_POST["reque"] . "', '" . $_POST["funreque"] . "', '" . $_POST["ventas"] . "', '" . $_POST["cuaven"] . "', '" . $_POST["factura"] . "', '" . $_POST["infactu"] . "', '" . $_POST["sistema"] . "', '" . $_POST["falsistema"] . "', '" . $_POST["inventario"] . "', '" . $_POST["estainven"] . "', '" . $_POST["procesos"] . "', '" . $_POST["procesucu"] . "', '" . $_POST["tipo"] . "', '" . $_POST["quejas"] . "',  '" . $_POST["accionque"] . "', '" . $_POST["documen"] . "', '" . $_POST["plantilla"] . "', '" . $_POST["llamada"] . "', '" . $_POST["horallama"] . "', '" . $_POST["funllama"] . "', '" . $_POST["motlla"] . "', '" . $_POST["llamanoc"] . "', '" . $_POST["horallamanoc"] . "', '" . $_POST["funllamanoc"] . "', '" . $_POST["motllanoc"] . "', '" . $_POST["sugerencia"] . "', '0', '".$nombre."', '" .$contenido. "', '".$tipo."', '".$nombre2."', '" .$contenido2. "', '".$tipo2."', '".$nombre3."', '" .$contenido3. "', '".$tipo3."' , '".$_POST["motivausen"]."','".$_POST["descrimotivo"]."')");
				 
				 if (!$control) {
				die('Invalid query novedades_diarias: ' . mysql_error());
			}	
			
			 echo "<script>alert('Novedades Guardadas Satisfatoriamente');</script>"; 
			
	echo "<SCRIPT LANGUAGE='javascript'>window.location.href='menu_admin.php?ced2=$ced2&numcon=$numcon'</SCRIPT>";
 		
  }
}

  /* <span class="Estilo48">Atenciones Sin Diligenciar Completamente</span>	
		<input name="falta" type="text" class="Estilo21" id="falta" value="<?php echo $totalRows_sql6 ;?>" size="3" maxlength="3" >
	    <select name="ate" >
            <option value="">Listado Atenciones Incompeltas</option>
            <?php
     do {  
?>
            <option value="<?php echo $row_sql6['numero_atencion'];?>"><?php echo $row_sql6['numero_atencion']?></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>*/
?>