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/requerimiento_respuesta_callcenter_histoser.php
<?PHP
require_once("mainfile.php");
require_once("Conectarse.php");
include ("config.php");
global $dbi;


	
//$sql= sql_query("select Id from correspondencias ORDER BY Id DESC LIMIT 1",$dbi)

$res = mysql_query('SELECT id FROM requerimientos_callcenter  ORDER BY id DESC LIMIT 1');
			if (!$res) {
				die('Invalid query: ' . mysql_error());
			}
list($Conta) = mysql_fetch_row($res);
  

$rest = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE Cedula = "' . $_POST[cedula] . '" ');
			if (!$rest) {
				die('Invalid query: ' . mysql_error());
			}  
if($rest){list($Nom) = mysql_fetch_row($rest);    }

$resta = mysql_query('SELECT * FROM  Dependencias ORDER BY Nombre ');
			if (!$resta) {
				die('Invalid query: ' . mysql_error());
			} 
$row_Recordset1 = mysql_fetch_assoc($resta);
$totalRows_Recordset1 = mysql_num_rows($resta);



 $contr = mysql_query('SELECT id,numradica,identificacion,nombre_completo,fecha_envio,hora_envio, codigo_funcionario_recibe,funcionario_requiere FROM requerimientos_callcenter WHERE identificacion = "'.$_GET["cedula"]. '" and id = "'.$_GET["id"].'" and numradica = "'.$_GET["radica"].'" and estado = "0" ');
		  if (!$contr) {
				die('Invalid query 1: ' . mysql_error());
			}
	list($id, $radica, $lacedula, $elnombre, $fechaen, $horare, $funre, $funexpi) = mysql_fetch_row($contr); 


$sql = mysql_query('SELECT * FROM Usuarios ORDER BY Nombre_Completo ');
			if (!$sql) {
				die('Invalid query: ' . mysql_error());
			}  
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql);  


?>   

<html>
<head>
<title>Registro de Formulario Juridico</title>
<style type="text/css">

<!--
img {border: 0}
body,td {font-family: Verdana,Arial; font-size: 8pt; color: #000000}
input,select {font-family: Verdana,Arial; font-size: 7.5pt}
a:link, a:visited {text-decoration: none; color: #2030F0}
a:hover, a:active {text-decoration: underline; color: #D02010}
body table tr td table tr td form table {
	font-size: 14px;
	font-family: Georgia, "Times New Roman", Times, serif;
}
body table tr td table tr td form table tr td div strong {
	font-size: 10pt;
}
body table tr td table tr td form table tr td div strong {
	font-size: 9pt;
}
body table tr td table tr td form table tr td b {
	font-size: 9pt;
}
body table tr td table tr td form table tr td div {
	font-size: 7pt;
}
.polici {background-color: #FFCC66; font-size: 14px; font-family: Arial; color: #000099; width:10px display: block;}

.polici2 {background-color: #306090; font-size: 14px; font-family: Arial; color: #FFFFFF; width:10px display: block;}

.polici3 {background-color: #FFFFFF; font-size: 14px; font-family: Arial; color: #000000; width:10px display: block;}
-->
</style>

<script languaje="JavaScript">
function validar_campos(formulario)
{
  if (formulario.sucursal.value == "")
  {
    alert("Seleccione La Sucursal");
    formulario.sucursal.focus();
    return (false);
  }
  
  
   if (formulario.funcionario.value == "")
  {
    alert("Seleccione El Funcionario");
    formulario.funcionario.focus();
    return (false);
  }
  
   if (formulario.seguimiento.value == "")
  {
    alert("Describa La Actividad");
    formulario.seguimiento.focus();
    return (false);
  }
  

if (formulario.tipo_actividad.value == "")
  {
    alert("Seleccione Tipo Actividad");
    formulario.tipo_actividad.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);
}




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) ? " p.m." : " a.m."
            document.formulario.hora_envio.value = timeValue;
            timerID = setTimeout("showtime()", 1000);
            timerRunning = true;
        }

        function startclock() {
            stopclock();
            showtime();
        }

//-->
</script>


</head>
 
<body OnLoad="startclock()" topmargin="0" rightmargin="0" marginheight="0" marginwidth="0">
<!--<body onload="document.formulario.numero.focus()"  topmargin="0">-->
<form name="formulario" method="post" action="" enctype="multipart/form-data" onSubmit="return validar_campos(this)">

<table width="100%" height="75%" bgcolor="#FFFFFF" border="0" cellspacing="0" cellpadding="0">
         
  
  <tr>
    <td align="center">
 
      <table width="102%" bgcolor="#EFEFEF" align="center" border="5" cellspacing="0" cellpadding="6">
 <tr>
   <td align="center" bgcolor="#306090"><big style="color:#FFFFFF"><b>INGRESAR RESPUESTA REQUERIMIENTOS</b></big></td>
   
 </tr>
 
 <tr>
   <td align="center" colspan="2">
 

    <table border="3" bgcolor="#EFEFEF" cellspacing="5">
    <tr bgcolor="#ECE9D8">
    <td height="29" align="right" bgcolor="#EFEFEF"><b>Digite el n&uacute;mero de radicaci&oacute;n:</b></td>
 <td colspan="2" bgcolor="#EFEFEF"><b>RADICACION</b> <input name="numradica" type="text" size="5" maxlength="5" value="<?php echo $radica ?>" readonly=""><b>-ID</b><input name="Iden" type="text" size="5" maxlength="5" value="<?php echo $id ?>" readonly="" ></td> 
   </tr>
       
    <tr>
    <td align="right" bgcolor="#EFEFEF"><b>Identificacion</b></div></td>
    <td colspan="2" bgcolor="#EFEFEF"><input name='Identificacion' id='Identificacion' type='text' size='15' maxlength='15' value="<?php echo $lacedula; ?>" readonly="">
	</td>
  </tr>
 
  <tr>
    <td align="right" bgcolor="#EFEFEF"><b>Funcionario Requerido</b></td>
    <td colspan="2"><input name="Nombre_Completo" type="text" size="50" maxlength="50" value="<?php echo $elnombre; ?>"></td>
  </tr>
       
 
 <tr>
    <td  align="right"><b>Dependencia que Recibe:</b></td>
    <td ><input name="funre" type="text" size="50" maxlength="50" value="<?php echo $funre; ?>" readonly=""></td>
    </tr>
 
 
 <tr>
     <td  align="right"><b>Funcionario que envio Requerimiento:</b></td>
    <td ><input name="funexpi" type="text" size="50" maxlength="50" value="<?php echo $funexpi; ?>" readonly=""></td>
    </tr>
 
 <tr>
    <td align="right"><b>Fecha y Hora expedido el requerimiento:</b></td>
    <td ><input name="recibo" type="text" size="12" maxlength="12" value="<?php echo $fechaen; ?>" readonly="">-<input name="horare" type="text" size="12" maxlength="12" value="<?php echo $horare; ?>" readonly=""> </td>
    </tr>
 
 <tr bgcolor="#ECE9D8">
    <td align="right" bgcolor="#EFEFEF"><b>Fecha Respuesta Requerimiento: </b></td>
    <td colspan="2" bgcolor="#EFEFEF"><input name="enviofec" type="text" size="12" maxlength="12" value="<?php echo date("Y"); ?>-<?php echo date("m"); ?>-<?php echo date("d"); ?>" readonly="">      </td>
    </tr>
 
 
 <tr bgcolor="#ECE9D8">
    <td align="right" bgcolor="#EFEFEF"><b>Hora Respuesta Requerimiento:  </b></td>
    <td colspan="2" bgcolor="#EFEFEF"><input name="hora_envio" type="text" size="11" maxlength="11"></td>
  </tr>
  
  
    <tr bgcolor="#ECE9D8">
    <td bgcolor="#EFEFEF"><div align="right" class="Estilo17"><strong><span class="Estilo7">Asunto:</span></strong></div></td>
    <td colspan="2" bgcolor="#EFEFEF"><input name="Asunto" type="text" size="50" maxlength="50"></td>
  </tr>
  <tr bgcolor="#7897DD">
    <td colspan="3"><div align="left"><span class="Estilo7">Emita una instrucci&oacute;n y acciones a seguir del archivo adjunto: </span></div></td>
    </tr>
  <tr bgcolor="#ECE9D8" bordercolordark="#000000">
    <td colspan="3" bgcolor="#EFEFEF"><p align="right">
       <textarea name="Contenido" cols="70" rows="4"></textarea>
</p>      </td>
    </tr>
  <tr bgcolor="#ECE9D8">
   <td bgcolor="#EFEFEF"><B>Funcionario que Elabor&oacute; el Documento:</B></td>
   <td colspan="2" bgcolor="#EFEFEF"><select name="elabora">
            <option value="">--SELECCIONE FUNCIONARIO--</option>
            <?php
     do {  
?>
            <option value="<?php echo $row_sql['Nombre_Completo'];?>"><?php echo $row_sql['Nombre_Completo']?></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 align="right"><b>SUBIR ARCHIVO:</b></td>
 <td colspan="3" bgcolor="#EFEFEF"><input name="archivito" type="file" class="polici3" size="40" maxlength="40"></td>
  </tr>
 
     
   </table><br>
 

 	 
     
     
 
   <input name="guardar" type="submit" class="polici2" id="guardar" value="GUARDAR"/>
 
     
     
     </form> 
 
   </td>
 </tr>
     <br>
 
    </td>
  </tr>
 
 
  <td height="22" colspan="2" bgcolor="#EFEFEF" class="fecha"><div align="center">
   
   
    <input name="button" type="button" class="polici"onClick="window.location.href='reque_pendientes_callcenter_histoser.php'"  value="REGRESAR AL LISTADO">

</div></td> 
 <br>

</body> 
</html>

<?
		

if(isset($_POST["guardar"]))
{

 $archivo = $_FILES["archivito"]["tmp_name"]; 
 $tamanio = $_FILES["archivito"]["size"];
 $tipo    = $_FILES["archivito"]["type"];
 $nombre  = $_FILES["archivito"]["name"];
 	
	$fechas = $_POST[anoss].'-'.$_POST[mess].'-'.$_POST[diass] ;
	$fechast = date("y").'-'.date("m").'-'.date("d");
	

	
if ( $archivo != "none"  )

  {
      $fp = fopen($archivo, "rb");
      $contenido = fread($fp, $tamanio);
      $contenido = addslashes($contenido);
      fclose($fp); 
	  


$mss = mysql_query("UPDATE  requerimientos_callcenter set fecha_respuesta = '" . $_POST[enviofec] . "',  hora_respuesta   = '" . $_POST[hora_envio] . "', asunto_respuesta   = '" . $_POST[Asunto] . "', funcionario_respuesta  = '" . $_POST[elabora] . "', mesaje_respuesta = '" . $_POST[Contenido] . "', estado = '1' WHERE identificacion = '" . $_GET[cedula] . "' and id = '" . $_GET[id] . "' and numradica = '" . $_GET[radica] . "' and estado = '0'");
            if (!$mss ) {
				die('Invalid query cartera_estado_contable MODIFICAR: ' . mysql_error());
			}  			
		
			

			
$mssql3 = mysql_query("UPDATE archivos_requerimientos_callcenter set nombre2 = '".$nombre."',contenido2 = '".$contenido."',tipo2= '".$tipo."' WHERE registro = '". $_POST["numradica"] ."' " );
           
            if (!$mssql3) {   
				die('Invalid query cartera_serviasjudinet MODIFICAR: ' . mysql_error());
		}   
  

    echo "<script>alert('Su respuesta ha sido enviada con éxito')</script>";  
	echo "<SCRIPT LANGUAGE='javascript'>window.location.href='reque_consulta_respu_administrativos.php'</SCRIPT>"; 
  } 	
}    


?>
</table>