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/www/abogados/requeriemiento_respuesta.php
<?php
global $dbi;
require_once("../Conectarse.php");
error_reporting(E_ALL ^ E_NOTICE);
	
//$sql= sql_query("select Id from correspondencias ORDER BY Id DESC LIMIT 1",$dbi)

$res = mysql_query('SELECT id FROM requerimientos 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);




// esto lo cambie yo

$contr = mysql_query('SELECT id, numradica, identificacion, numero_proceso, nombre_completo, fecha_envio, hora_envio, codigo_funcionario_recibe, funcionario_requiere  FROM requerimientos  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, $numpro, $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);  


?>   


<!DOCTYPE html>
<html>
<head>
<title>Aplicativo de Correspondencia</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>
    *{margin: 0;padding: 0;}
    body{background-image:url(../ELEMENTS/fondo.jpg);font-family:Geneva, Arial, Helvetica, sans-serif;}
    header {background-color: #B7271F; text-align: center;}
    .cerrarsesion{width: auto;height: 20px;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;}
    table{margin: 0 auto;border: 8px solid #bebebe;}
    .divirmenu{text-align: center;}
    .irmenu{width: 200px;background-color: #1c4fa0;color: #fff; padding: 3px;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{padding: 1px; border: 1px solid #a0a0a0;}
    .tdizq{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 14px;font-weight: 600; text-align: left;}
    .tdcen{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 14px;font-weight: 600; text-align: center;}
    .tdder{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 14px;font-weight: 600; text-align: right;}
    .diff{color: #af2323; font-size: 11px;}
    .boton1{width:400px;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:10px;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
    input[type=text]{border-radius: 5px; padding: 3px;background-color: #fffef0;}
    
    .tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
    .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;}
</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>")
}					
</script>



<script Language="JavaScript">
function Valida_Fecha(formulario)
{
    if (formulario.Identificacion.value == "")
    {
        alert("Por favor llenar el campo número de identificación");
        formulario.Identificacion.focus();
        return (false);
    }
    
    if (formulario.codigo.value == "")
    {
        alert("Por favor seleccoine el nombre de la dependencia");
        formulario.codigo.focus();
        return (false);
    }
    
    if (formulario.Nombre_Completo.value == "")
    {
        alert("Por favor llenar el campo con Apellidos y Nombre del Afiliado");
        formulario.Nombre_Completo.focus();
        return (false);
    }
    
    if (formulario.Asunto.value == "")
    {
        alert("Por favor llenar el campo Asunto");
        formulario.Asunto.focus();
        return (false);
    }
    
/*  if (formulario.Contenido.value == "")
    {
        alert("Por favor llenar el campo Respuesta o Contenido del Mensaje");
        formulario.Contenido.focus();
        return (false);
    }
*/

    if (formulario.Quien_Expide.value == "")
    {
        alert("Por favor llenar el campo Quien Expide el Documento");
        formulario.Quien_Expide.focus();
        return (false);
    }

    if (confirm("Es correcta está información"))
    {   
        return (true);
    }
    
    else
    {
    return (false);
    }

  return (true);
}
</script>


<SCRIPT LANGUAGE="JavaScript">
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.iden.value = formulario.Iden.value
   envio.identificacion.value = formulario.Identificacion.value
   envio.contador.value = formulario.radica.value      
   envio.hora_envio.value = formulario.hora_envio.value;   
}
</script>

</head>
<body OnLoad="startclock()">


<header>
    <img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">RESPUESTA REQUERIMIENTO</h3>


<form action="<?php echo $editFormAction; ?>" method="post" name="formulario" onSubmit="return Valida_Fecha(this)">
<table width="669" border="0" align="center" cellpadding="1" cellspacing="0">

<tr>
    <td class="fecha" colspan="3">
        <script languaje="JavaScript">Mostrar_Fecha()</script>
    </td>
</tr>
<tr>
    <td width="305" class="tdder">Digite el número de radicación:</td>
    <td width="332"colspan="2" class="tdizq">RADICACIÓN <input name="numradica" type="text" size="5" maxlength="5" value="<?php echo $radica ?>" readonly=""> - ID : <input name="Iden" type="text" size="5" maxlength="5" value="<?php echo $id ?>" readonly="" ></td> 
</tr>
<tr>
    <td class="tdder">Identificación :</td>
    <td class="tdizq" colspan="2"><input name='Identificacion' id='Identificacion' type='text' size='13' maxlength='13' value="<?php echo $lacedula; ?>" readonly=""><span class="importante"> - Número de Proceso :</span> 
	<input name="numpro" type="text" size="5" maxlength="5" value="<?php echo $numpro; ?>" readonly="">
	</td>
</tr>

<tr>
    <td class="tdder">Funcionario Requerido :</td>
    <td class="tdizq" colspan="2"><input name="Nombre_Completo" type="text" size="47" maxlength="47" value="<?php echo $elnombre; ?>"></td>
</tr>
 
<tr>
    <td class="tdder">Dependencia que Recibe :</td>
    <td class="tdizq" colspan="2"><input name="funre" type="text" size="47" maxlength="47" value="<?php echo $funre; ?>" readonly=""></td>
</tr>
<tr>
    <td class="tdder">Funcionario que envio Requerimiento: </td>
    <td class="tdizq" colspan="2"><input name="funexpi" type="text" size="47" maxlength="47" value="<?php echo $funexpi; ?>" readonly=""></td>
</tr>
<tr>
    <td class="tdder">Fecha y Hora expedido el requerimiento:</td>
    <td class="tdizq" colspan="2"><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>
    <td class="tdder"><span class="importante">Fecha Respuesta Requerimiento:</span></td>
    <td class="tdizq" colspan="2"><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>
    <td class="tdder"><span class="importante">Hora Respuesta Requerimiento:</span></td>
    <td class="tdizq" colspan="2"><input name="hora_envio" type="text" size="13" maxlength="13"></td>
</tr>
<tr>
    <td class="tdder"><span class="importante">Asunto:</span></td>
    <td class="tdizq" colspan="2"><input name="Asunto" id="Asunto" type="text" size="47" maxlength="47"></td>
</tr>
<tr>
    <td class="tdcen" colspan="3">Emita una instrucci&oacute;n y acciones a seguir del archivo adjunto: </td>
</tr>
<tr>
    <td class="tdcen" colspan="3" >
        <div><textarea name="Contenido" id="Contenido" cols="80" rows="4"></textarea></div>
    </td>
</tr>
<tr>
    <td class="tdder">Funcionario que Elaboró el Documento:</td>
    <td class="tdcen" colspan="2">
    <select name="elabora" id="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 colspan="3"></td>
</tr>
<tr>
    <td class="tdcen" colspan="3" >
        <input  class="boton1" name="guardar" type="submit" id = "guardar" value="Enviar Comunicación">
        <input class="irmenu" name="button" type="button" onClick="window.location.href='../menu_admin.php'" value="VOLVER AL MENU">
    </td>
</tr>
</table>
</form>
   
   
    </body>
</html>





<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}

</style>
</head>
<body>
<form enctype="multipart/form-data" action="guardar_respuestareque.php" method="post" name="envio">
  <table width="518" border="0" align="center" cellpadding="3" cellspacing="3">
    <tr>
      <th colspan="2" scope="row" class="titulo">FORMULARIO PARA SUBIR EL ARCHIVO A ENVIAR </th>
    </tr>
    <tr bgcolor="#FFFFCC">
      <th colspan="2" scope="row"><div align="right"></div></th>
    </tr>
    <tr bgcolor="#FFFFCC">
      <th scope="row"></th>
      <td><input name="id" type="hidden" size="15" maxlength="15" value="<?php echo $id; ?>">
	  <input name="identificacion" type="hidden" size="15" maxlength="15" value="<?php echo $lacedula; ?>">
         	  <input name="radica" type="hidden" size="11" maxlength="11" value="<?php echo $radica; ?>"></td>
         	  <input name="hora" type="hidden" size="11" maxlength="11" value="<?php echo $hora_envio; ?>"></td>			  
    </tr>
    <tr bgcolor="#FFFFCC">
      <th width="248" scope="row"><div align="right"><span class="Estilo1">UBICACION DEL ARCHIVO  : </span></div></th>
      <td width="249"><input type="file" name="archivito" size="35" maxlength="35"></td>
    </tr>
    <tr bgcolor="#FFFFCC">
      <th colspan="2" scope="row"><input name="adjuntar" class="boton1" id="adjuntar" type="submit" value="Adjuntar archivo" onClick="update(this.form)"></th>
    </tr>
  </table>
</form>
</body>
</html>



<?php
if ((isset($_POST["guardar"])))
{

    $Quien = strtoupper($Funcionario_Expide);
    $Noti = "N";
    global $dbi;
    
	$con = mysql_query('SELECT Nombre_Completo, Cargo FROM Usuarios WHERE Cedula = "' ."$Cedula". '" ');

			if (!$con) {
				die('Invalid query: ' . mysql_error());
			}  
    if($con){list($Nombre, $Cargo) = mysql_fetch_row($con);}
	
		$mss = mysql_query("UPDATE  requerimientos 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>";  
    echo "<SCRIPT LANGUAGE='javascript'>window.location.href='../menu_admin.php'</SCRIPT>";		
} 	
mysql_free_result($sql);
?>