File: /home/asjudine/www/acalidad/requerimiento_respuesta_direc.php
<?PHP
require_once("../Conectarse.php");
$res = mysql_query('SELECT id FROM requerimientos_directores 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_directores 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;
}
header {background-color: #B7271F; text-align: center;}
.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;}
.titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
-->
</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 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>
<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>
</head>
<body OnLoad="startclock()" topmargin="0" rightmargin="0" marginheight="0" marginwidth="0">
<form name="formulario" method="post" action="" enctype="multipart/form-data" onSubmit="return validar_campos(this)">
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<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>
<h3 class="titulo">INGRESAR RESPUESTA REQUERIMIENTOS</h3>
</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úmero de radicació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ó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ó 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='menu_requerimientos_pendientes_gerencia.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_directores 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_directores 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_pendientes_directores_gerencia.php'</SCRIPT>";
}
else {
$mss = mysql_query("UPDATE requerimientos_directores 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());
}
echo "<script>alert('Su respuesta ha sido enviada con éxito')</script>";
}
}
?>
</table>