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/adirectoress/requerimiento_respuesta_direc.php
<?php
require_once("../Conectarse.php");
global $dbi;


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

$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>
<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 type="text/css">
	*{margin: 0;padding: 0;}
    body{background-color:#EAEAEA;font-family:Verdana, Geneva, 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;}
	.subtitulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #0C0C76;padding: 3px 0;font-size: 16px;}
    table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
    .divirmenu{text-align: center;}
    .irmenu{width: 200px;background-color: #1c4fa0;color: #fff; padding: 2px;border-radius: 6px; border:2px solid #C0C0C0;}
    .irmenu:hover{background-color: #67a0d9; color: #000;}
    
    .fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
	td{}
    .tdizq{background-color: #F4F4F4; padding: 1px 10px;color: #454545;font-size: 13px;font-weight: 600; text-align: left;}
    .tdcen{background-color: #F4F4F4; padding: 1px 10px;color: #00135F;font-size: 13px;font-weight: 600; text-align: center;}
    .tdder{background-color: #F4F4F4; padding: 1px 10px;color: #454545;font-size: 13px;font-weight: 600; text-align: right;}
	.exp{color:#8A0000; font-size:11px;}
	.boton1{width:200px;background-color: #FFF;color: #000; padding: 3px; border:2px solid #7D0000;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
	.direcciona{background-color: #B32225;color: #fff; padding: 3px;}
	.direcciona:hover{background-color: #67a0d9; color: #000;}
    input[type=text], select{padding: 2px; color:#000; font-size:13px;}
	.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 500}
    .tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 12px;}
	textarea{font-weight:200; color:#000;}
	.archivo{background-color:#; color:#C70309; font-size:14px;}
	.cargar{background-color: #D9E1FF;}
</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">
<header>
    <img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">INGRESAR RESPUESTA REQUERIMIENTOS</h3>

<!--<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="750" 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  colspan="2">
<table border="3" cellspacing="5">-->
<tr>
	<td class="tdder">Digite el n&uacute;mero de radicaci&oacute;n:</td>
 	<td class="tdizq" colspan="2">RADICACION <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 class="tdder">Identificacion</td>
    <td class="tdizq" colspan="2"><input name='Identificacion' id='Identificacion' type='text' size='15' maxlength='15' value="<?php echo $lacedula; ?>" readonly=""></td>
</tr>
 
<tr>
	<td class="tdder">Funcionario Requerido</td>
    <td class="tdizq" colspan="2"><input name="Nombre_Completo" type="text" size="50" maxlength="50" value="<?php echo $elnombre; ?>"></td>
</tr>
       
 
<tr>
	<td class="tdder">Dependencia que Recibe:</td>
    <td class="tdizq"><input name="funre" type="text" size="50" maxlength="50" value="<?php echo $funre; ?>" readonly=""></td>
</tr>
 
 
<tr>
	<td class="tdder">Funcionario que envio Requerimiento:</td>
    <td class="tdizq"><input name="funexpi" type="text" size="50" maxlength="50" value="<?php echo $funexpi; ?>" readonly=""></td>
</tr>
 
<tr>
	<td class="tdder">Fecha y Hora expedido el requerimiento:</td>
    <td class="tdizq"><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">Fecha Respuesta Requerimiento: </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">Hora Respuesta Requerimiento: </td>
    <td class="tdizq" colspan="2" ><input name="hora_envio" type="text" size="11" maxlength="11"></td>
</tr>
  
<tr>
	<td class="tdder">Asunto:</td>
    <td class="tdizq" colspan="2" bgcolor="#EFEFEF"><input name="Asunto" type="text" size="50" maxlength="50"></td>
</tr>

<tr>
	<td class="subtitulo" colspan="3">Emita una instrucci&oacute;n y acciones a seguir del archivo adjunto:</td>
</tr>

<tr>
	<td colspan="3"><textarea name="Contenido" cols="70" rows="4"></textarea></td>
</tr>

<tr>
	<td class="tdcen">Funcionario que Elabor&oacute; el Documento:</td>
   	<td class="tdizq" 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 class="archivo"><b>SUBIR ARCHIVO:</b></td>
 	<td class="tdizq" colspan="3"><input name="archivito" type="file" class="cargar" size="40" maxlength="40"></td>
</tr>
 
</table><br>
 
<p align="center">
<input name="guardar" type="submit" class="direcciona" id="guardar" value="GUARDAR"/>
</p>
</form> 
 
</td>
</tr>
     <br>
 
</td>
</tr>
 
 
<td height="22" colspan="2" bgcolor="#EFEFEF" class="fecha"><div align="center">
<!--<input name="button" type="button" class="irmenu" onClick="window.location.href='reque_consulta_respu_administrativos.php'"  value="REGRESAR AL LISTADO">-->
<input name="button" type="button" class="irmenu" onClick="window.location.href='reque_consulta_respu_direc.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());
			}  			
		
			/* VALIDAR PARA CUANDO NO SE CARGA ARCHIVO 1

$contat = mysql_query('SELECT registro FROM archivos_requerimientos_directores WHERE registro = "'. $_POST["numradica"] .'"and identificacion = "'.$_GET[cedula] . '" ');
			if (!$contAT) {
				die('Invalid query: ' . mysql_error());
			}
		
    list($numregistr)  = mysql_fetch_row($contat);	
		*/	

			
$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_consulta_respu_administrativos.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>