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

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

$control = mysql_query('SELECT cedula, numero_proceso, tipo_proceso, numero_contrato, tipo_contrato, codigo_sucursal, clase_negocio, despacho_judicial, ciudad_despacho, calidad_juridica_afiliado, tipo_orden, numero_carpeta, ultimo_folio, codigo_abogado, fecha_actuacion, actividad_proceso, estado_proceso, fecha_diagnostico FROM procesos WHERE cedula =  "' . $_GET["cedula"]  . '" and numero_proceso =  "' . $_GET["proceso"]  . '"');
if (!$control) {
	die('Error de consulta: ' . mysql_error());
}
	 
list($cedula, $numero_proceso, $tipo_proceso, $numero_contrato, $tipo_contrato, $codigo_sucursal, $clase_negocio, $despacho_judicial, $ciudad_despacho, $calidad_juridica_afiliado, $tipo_orden, $numero_carpeta, $ultimo_folio, $codigo_abogado, $fecha_actuacion, $actividad_proceso, $estado_proceso, $fd) = mysql_fetch_row($control);
	 
$control = mysql_query('SELECT nombre, numerocontrato, tipocontrato FROM cartera_serviasjudinet  WHERE cedula = "'.$cedula.'" ');
if (!$control) {
	die('Invalid query: ' . mysql_error());
}  
list($nombre_completo, $numero_contrato, $tipo_contrato) = mysql_fetch_row($control);
	 
if((mysql_num_rows($control)==0)) 
{
	$control = mysql_query('SELECT nombre,numero_contrato_titular,tipo_contrato_titular FROM beneficiarios WHERE cedula = "'.$cedula.'" ');
	if (!$control) {
		die('Invalid query: ' . mysql_error());
	}  
    list($nombre_completo, $numero_contrato, $tipo_contrato) = mysql_fetch_row($control);
}


//--------------------  Aca es para traer el consecutivo que sigue
$datosconsecutivo = mysql_query('SELECT id FROM requerimientos_directores   ORDER BY id DESC LIMIT 1');
if (!$datosconsecutivo) {
	die('Invalid query: ' . mysql_error());
}  
if($datosconsecutivo){list($elId) = mysql_fetch_row($datosconsecutivo);    }


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


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


?>   

<html>
<head>
<title>Ingreso Requerimiento</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:#FFFFFF;font-family:Verdana, Geneva, sans-serif;}
    header {background-color: #B7271F; text-align: center;}
    .cerrarsesion{width: auto;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:#EEE; color:#b20606;padding: 2px 0;font-size: 13px;}
	.subtitulos{width: 100%;text-align: center;color: #b20606;padding: 2px 0;font-size: 13px;}
    table{margin: 0 auto;border: 8px solid #bebebe; text-align: center; 
	-webkit-box-shadow: 10px 10px 10px -4px rgba(0,0,0,0.75);
	-moz-box-shadow: 10px 10px 10px -4px rgba(0,0,0,0.75);
	box-shadow: 10px 10px 10px -4px rgba(0,0,0,0.75);}
    .irmenu{width: 200px;background-color: #1c4fa0;color: #fff; padding: 4px;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{border: #D7D7D7 solid 0.2px; height: 24px;}
    .tdizq{background-color: #EEE; color: #C70000;font-size: 14px;font-weight: 200; text-align: left;}
    .tdcen{background-color: #EEE; color: #00135F;font-size: 14px;font-weight: 200; text-align: center;}
    .tdder{background-color: #EEE; color: #630000;font-size: 14px;font-weight: 200; text-align: right;}
	.tdroja{background-color: #EEE; color: #CC0005;font-size: 14px;font-weight: 400; text-align: right;}
	.tdi{background-color: #; color: #00135F;font-size: 13px;font-weight: 200; text-align: left;}
    .tdc{background-color: #E3DCB0; color: #00135F;font-size: 13px;font-weight: 200; text-align: center;}
    .tdd{background-color: #E3DCB0; color: #00135F;font-size: 13px;font-weight: 200; text-align: right;}
	.tdvd{background-color: #EEE; color: #188409;font-size: 13px;font-weight: 200; text-align: right;}
	.exp{color:#8A0000; font-size:12px;}
    .boton1{background-color: #ffffff;color: #000;padding: 5px;border:1px solid #580000;border-radius:2px;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
	.direcciona{width: 180px; background-color: #8F0E11;color: #fff; padding: 5px;border-radius: 3px;}
	.direcciona:hover{background-color: #67a0d9; color: #000;}
    input[type=text],select{height: 22px; font-size: 12px;}
	/*select{border:solid #191919 0.5px; border-radius: 3px; padding: 1px;background-color: #FFFFFF; font-weight:600px; }*/
	textarea{border:1px solid #5C5C5C;}
	
	.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
    .tdfull{background-color: #fff; color: #000; padding: 5px; text-align: center; font-size: 12px; font-family:Verdana, Geneva, sans-serif;}
	.tdjustify{background-color: #fff; color: #000; padding: 5px; text-align: justify; font-size: 12px;}
    .botonnew{background-color: #C0292E;color: #FFFFFF;padding: 1px;border-radius:5px;}
    .botonnew:hover{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>")
}					

function Valida_Fecha(formulario)
{

  if (formulario.numradica.value == "")
  {
    alert("Por favor llenar el número de radicación");
    formulario.numradica.focus();
    return (false);
  }

  if (formulario.Cedula.value == "")
  {
    alert("Por favor seleccionar el Funcionario que recibirá el documento");
    formulario.Cedula.focus();
    return (false);
  }

  if (formulario.cdr.value == "")
  {
    alert("Por favor selecconar la Dependencia que recibirá el documento");
    formulario.cdr.focus();
    return (false);
  }

  if (formulario.cde.value == "")
  {
    alert("Por favor selecconar la Dependencia que envía el documento");
    formulario.cde.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.Funcionario_Expide.value == "")
  {
    alert("Por favor llenar el campo Quien Expide el Documento");
    formulario.Funcionario_Expide.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) ? " 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">ENVIAR REQUERIMIENTOS ADMINISTRATIVOS DIRECTORES</h3>

<form action="<?php echo $editFormAction; ?>" method="post" name="formulario" onSubmit="return Valida_Fecha(this)">

<table width="680" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#0099FF">
<tr>
	<td><table width="680" border="0" align="center" cellpadding="2" cellspacing="2">
    <!--<tr>
     	<td colspan="3">ENVIAR REQUERIMIENTOS ADMINISTRATIVOS DIRECTORES </div></td>
 	</tr>-->
    
    <tr>
     	<td colspan="3" class="fecha"><div align="center">
            <script languaje="JavaScript">Mostrar_Fecha()</script>
        </div></td>
 	</tr>
    
    <tr>
     	<td width="321" class="tdder">N&uacute;mero de radicaci&oacute;n:</td>
        <td width="300" class="tdizq" colspan="2" bgcolor="#CCFFCC"><input name="numradica" type="text" size="5" maxlength="5" value="<?php echo $elId + 1; ?>" readonly="">
			<input name="Contador" type="hidden" size="5" maxlength="5" value="<?php echo $Conta+1; ?>" readonly=""></td>
  	</tr>
    <tr>
    	<td class="tdder">Referencia:</td>
        <td class="tdizq" colspan="2"><select name="Referencia">
        	<option value="Sr." selected>Se&ntilde;or</option>
            <option value="Sra.">Se&ntilde;ora</option>
            <option value="Dr.">Doctor</option>
            <option value="Dra.">Doctora</option>
      	</select></td>
 	</tr>
    <tr>
    	<td class="tdder">Seleccione Funcionario que  recibir&aacute;:</td>
        <td class="tdizq" colspan="2"><select name="Cedula">
        	<option value="">--SELECCIONE EL NOMBRE DEL DESTINATARIO--</option>
            <?php
     		do {  
			?>
            <option value="<?php echo $row_sql['Cedula'];?>"><?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="tdder">Seleccione la Dependencia que Recibe:</td>
        <td class="tdizq" colspan="2"><select name="cdr">
        <option value="">--SELECCIONE NOMBRE DEPENDENCIA RECIBE--</option>
        <?php
		do {  
		?>
        <option value="<?php echo $row_Recordset1['Nombre']?>"><?php echo $row_Recordset1['Nombre']?></option>
        <?php
		} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
  		$rows = mysql_num_rows($Recordset1);
  		if($rows > 0) {
      	mysql_data_seek($Recordset1, 0);
	  	$row_Recordset1 = mysql_fetch_assoc($Recordset1);
  		}
		?>
        </select></td>
  	</tr>
    
    <tr>
    	<td class="tdder">Seleccione la Dependencia que Env&iacute;a:</td>
        <td class="tdizq" colspan="2"><SELECT NAME="cde">
        	<OPTION value="">--SELECCIONE NOMBRE DEPENDENCIA ENVIA--</OPTION>
			<OPTION value="Director de Histoser">Director De Histoser</OPTION>
    		<OPTION value="Gerencia Administrativa">Gerencia Administrativa</OPTION>
			<OPTION value="Gerencia General">Gerencia General</OPTION>
			<OPTION value="Sub-Gerencia">Sub-Gerencia</OPTION>
			<OPTION value="Director de Actuaciones Diciplinarias">Director de Actuaciones Diciplinarias</OPTION>
			<OPTION value="Directora de Actuaciones Juridicas">Directora de Actuaciones Juridicas</OPTION>
	 		<OPTION value="Directora de Actuaciones Juridicas">Directora de Actuaciones Prejuridicas</OPTION>
     		<OPTION value="Control Interno">Control Interno</OPTION>
		</SELECT></td>
	</tr>
    
    <tr>
     	<td class="tdder">Fecha de Envio de la Correspondencia:</td>
        <td class="tdizq" colspan="2" ><input name="fecha_envio" type="text" size="11" maxlength="11" value="<?php echo date("Y"); ?>-<?php echo date("m"); ?>-<?php echo date("d"); ?>" readonly=""></td>
 	</tr>
    
    <tr>
     	<td class="tdder">Hora de Env&iacute;o:</td>
        <td class="tdizq" colspan="2"><input name="Hora_Envio" type="text" size="13" maxlength="13"></td>
  	</tr>
    
    <tr>
     	<td class="tdder">Asunto:</td>
        <td class="tdizq" colspan="2" ><input name="Asunto" type="text" size="50" maxlength="50"></td>
  	</tr>
    
    <tr>
      	<td colspan="3" class="subtitulos">Emita una instrucci&oacute;n y acciones a seguir del archivo adjunto:</span></div></td>
	</tr>
    
    <tr>
     	<td colspan="3"><textarea name="Contenido" cols="70" rows="5"></textarea></td>
	</tr>
   
   	<tr>
    	<td class="tdcen">Funcionario que firma el documento:</td>
        <td class="tdcen" colspan="2" >
			<SELECT NAME="Funcionario_Expide">
        	<OPTION value="">--SELECCIONE FUNCIONARIO QUE  ENVIA--</OPTION>
        	<OPTION value="RODRIGUEZ MONTOYA ESPERANZA">RODRIGUEZ MONTOYA ESPERANZA</OPTION>
	    	</SELECT>
      	</td>
  	</tr> 
    </table></td>
</tr>
  	
<tr>
	<td><div align="center">
    <input  name="guardar" type="submit" id = "guardar" value="Enviar Comunicaci&oacute;n" class="direcciona">

 	</div></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_archivos_interno.php" method="post" name="envio">-->
<form enctype="multipart/form-data" action="guardar_archivos_requedirec.php" method="post" name="envio">
<table width="600" border="1" align="center" cellpadding="3" cellspacing="3">
<tr>
 	<th colspan="2" scope="row" class="subtitulo">FORMULARIO PARA SUBIR EL ARCHIVO A ENVIAR </th>
</tr>
<input name="identificacion" type="hidden" size="15" maxlength="15" value="">
<input name="contar" type="hidden" size="11" maxlength="11" value=""></td>
<input name="hora_envio" type="hidden" size="11" maxlength="11" value=""></td>			  
<tr>
	<th width="248" class="tdc">UBICACION DEL ARCHIVO  : </span></div></th>
    <td width="249" class="tdc"><input type="file" name="archivito" size="40" maxlength="40"></td>
</tr>

<tr>
	<th colspan="2"><input name="adjuntar" type="submit" class="boton1" id = "adjuntar" 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 = "' .$_POST["Cedula"]. '" ');
	if (!$con) {
		die('Invalid query: ' . mysql_error());
	}  

	list($Nombre, $Cargo) = mysql_fetch_row($con);
		
		
	

 	$grabar =  mysql_query("INSERT INTO requerimientos_directores (numradica,identificacion,codigo_dep_envio, codigo_funcionario_recibe,referencia,nombre_completo,cargo,fecha_envio,hora_envio,asunto,mensaje,funcionario_requiere, estado)  VALUES ('" . $_POST["numradica"] . "', '" . $_POST["Cedula"] . "',  '" . $_POST["cde"] . "', '" . $_POST["cdr"] . "', '" . $_POST["Referencia"] . "', '".$Nombre."', '$Cargo', '" . $_POST["fecha_envio"] . "', '" . $_POST["Hora_Envio"] . "', '" . $_POST["Asunto"] . "', '" . $_POST["Contenido"] . "', '" . $_POST["Funcionario_Expide"] . "', '0')");	
  	if (!$grabar) {
		die('Invalid query requerimientos: ' . mysql_error());
	}  
	
  	
	
    echo "<script>alert('Requerimiento Grabado Correctamente')</script>";  
	echo "<script>history.back()</script>";
}
 	
mysql_free_result($sql);
?>


<?php

if ((isset($_POST["adjuntar"])))
{
	global $dbi;

	$Recordset1 = mysql_query('SELECT * FROM archivos_requerimientos_directores  ');
	if (!$Recordset1) {
		die('Invalid query: ' . mysql_error());
	}  

	$dia = date("d");
	$mes = date("m"); 
	$ano = date("Y");
	$fecha = ($_POST[dia]."-".$_POST[mes]."-".$_POST[ano]);


 	$archivo = $_FILES["archivito"]["tmp_name"]; 
 	$tamanio = $_FILES["archivito"]["size"];
 	$tipo    = $_FILES["archivito"]["type"];
 	$nombre  = $_FILES["archivito"]["name"];
 
	if ( $archivo != "none" )
	{
    	$fp = fopen($archivo, "rb");
    	$contenido = fread($fp, $tamanio);
    	$contenido = addslashes($contenido);
    	fclose($fp); 

		$cons = mysql_query('SELECT max(id) FROM requerimientos_directores  ');
		
		if (!$cons) {
			die('Invalid query: ' . mysql_error());
		}  
    
		list($ide) = mysql_fetch_row($cons);
		
		
		$consult = mysql_query('SELECT max(numradica) FROM requerimientos_directores  ');
		
		if (!$consult) {
			die('Invalid query: ' . mysql_error());
		}  
    
		list($edp) = mysql_fetch_row($consult);
		
		$contar = $ide +1 ; 
		
	  	//--------------------  Aca es para traer el consecutivo que sigue
		$datosconsecutivo = mysql_query('SELECT id FROM requerimientos_directores  ORDER BY Id DESC LIMIT 1');
		if (!$datosconsecutivo) {
			die('Invalid query: ' . mysql_error());
		}  
		if($datosconsecutivo)
		{
			list($elId) = mysql_fetch_row($datosconsecutivo);
		}

		$correinterno = $elId + 1;	

	
		$grbar = mysql_query("INSERT INTO archivos_requerimientos_directores (id,correointerno,nombre,fecha,hora, contenido,tipo,Identificacion,registro,registro_interno) VALUES ( '','".$correinterno."','".$_POST["nombre"] . "','".$_POST["fecha"]."','".$_POST["hora_envio"]."', '".$_POST["contenido"]."','".$_POST["tipo"]."', '".$_POST["identificacion"]."','$contar','$edp')");
   		if (!$grbar) {
			die('Invalid query archivosrequerimientos: ' . mysql_error());
		}
   
 		echo $correinterno;
 		echo 'no';
 
	}
}

?>