File: /home/asjudine/public_html/mostrar_asesoria.php
<?php
require_once("mainfile.php");
include ("config.php");
global $dbi;
function Conectarse()
{
if (!($link=@mysql_connect("localhost","asjudine","as2006")))
{
echo "Error conectando con el servidor.";
exit();
}
$dbname = "asjudinet";
if (!@mysql_select_db($dbname,$link))
{
echo "Error seleccionando la base de datos.";
exit();
}
return $link;
}
Conectarse();
//$sql2 = "select id, cedula, numero_atencion, fecha_servicio, hora_servicio, sucursal, nombre_funcionario, tipo from record_servicios where cedula = $ced and numero_atencion = $numate ";
//$control2 = mysql_query($sql2, $dbi) or die(mysql_error());
$control2 = mysql_query('SELECT id, cedula, numero_atencion, fecha_servicio, hora_servicio, sucursal, nombre_funcionario, tipo FROM record_servicios WHERE cedula = "' . $HTTP_GET_VARS["ced"] . '" and numero_atencion = "' . $HTTP_GET_VARS["numate"] . '" ');
if (!$control2) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($control2)!=0))
{
list($id, $cedula, $numero_atencion, $fecha_servicio, $hora_servicio, $sucur, $nombre_funcionario, $tipo) = mysql_fetch_row($control2);
// $sqlnom = "select nombre from asjudinet_cartera where cedula = $cedula";
// $control = mysql_query($sqlnom, $dbi) or die(mysql_error());
$control = mysql_query('SELECT nombre FROM cartera_serviasjudinet WHERE cedula = "' ."$cedula". '" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
list($nombre_completo) = mysql_fetch_row($control);
// $sqlnom2 = "select nombre from sucursal where codigo = '$sucur'";
// $control2 = mysql_query($sqlnom2, $dbi) or die(mysql_error());
$control2 = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "' ."$sucur". '" ');
if (!$control2) {
die('Invalid query: ' . mysql_error());
}
list($nomsuc) = mysql_fetch_row($control2);
}
?>
<html>
<head>
<title>MODIFICAR ATENCION</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.titulos {font: 16px; color: red; font-family:Arial; font-weight:bold}
.boton { background-color: #FFCCCC; color:#FFFFFF; width:150px; border: 4px solid #0000CC; font-family:Arial; color:#990000;}
.texto {background-color: #CCFFCC; font-size: 13px; font-family: Arial; color:#0000CC; display: block;}
.fecha {background-color: #CCFFCC; font-size: 12px; font-family: Arial; color: #000099; width:10px display: block;}
.campo {background-color: #FFFFCC; border:1px solid #990000;}
.lista { background-color:#99FFFF; font-family: Arial; font-size: 11px; color: #990000;}
.label {background-color: #00CCFF ; font-size: 14px; font-family: Arial; color:#0000CC; display: block;}
.area {background-color: #CCFFCC; font-size: 13px; width:40px font-family: Arial; color:#0000CC; display: block;}
.variables {background-color: #CCFFCC; font-size: 12px; font-family: Arial; color: #003333 ; width:10px display: block; border: 2px solid #006633;}
.sel { background-color:#DDFFFF; width:400px; border: 1px solid #0099FF; font-family:Arial; font-style:italic; color:#990000 }
.seleccion { background-color: #CCFFCC; width:340px; border: 1px solid #0099FF; font-family:Arial; color:#990000;}
.boton2 {font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid; }
body {
background-image: url(fondo_argollado.gif);
}
.boton11 {background-color: #FFCCCC; color:#FFFFFF; width:90px; height:25; border: 3px solid #0000CC; font-family:Arial; color:#990000;}
-->
</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 validar()
{
var uf, pf, sf=0;
uf = formulario.ultimo_folio.value;
pf = formulario.folio1.value;
sf = parseInt(formulario.ultimo_folio.value)+1;
if(!(pf == uf || pf == sf))
{
alert('El folio ingresado debe ser igual o inmediatamente posterior al último');
formulario.folio1.focus();
return (false);
}
if (formulario.folio2.value == "")
{
alert("Falta ingresar el Folio2");
formulario.folio2.focus();
return (false);
}
if(formulario.folio2.value < pf)
{
alert('El folio2 no debe ser menor que el folio1');
formulario.folio2.focus();
return (false);
}
if (formulario.actuacion.value == "")
{
alert("Falta ingresar la actuación");
formulario.actuacion.focus();
return (false);
}
if (formulario.codigo_funcionario.value == "")
{
alert("Falta seleccionar el nombre del funcionario");
formulario.codigo_funcionario.focus();
return (false);
}
return (true);
}
//--></script>
<SCRIPT LANGUAGE='JavaScript'>
var default1 = "VENTANA PARA VISUALIZAR DATOS DE LA ATENCION SELECCIONADA"; // only shown once at page load
var text1 = "El primer encabezado muestra en detalle los datos de la atencion";
var text2 = "la segunda parte muestra el record de actuaciones";
var changeRate = 3000; // 1000 = 1 second
var messageNumber = 0;
function changeStatus()
{
if (messageNumber == 0) {
window.status=default1;
document.title=default1;
}
else if (messageNumber == 1) {
window.status=text1;
}
else if (messageNumber == 2) {
window.status=text2;
}
else if (messageNumber == 3) {
window.status=text3;
messageNumber = 0;
}
messageNumber++;
setTimeout("changeStatus();",changeRate);
}
changeStatus(); // leave here to run right away
// -->
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="document.formulario.folio1.focus()">
<form name="consulta" action="" method="post">
<table width="671" height="207" border="0" align="center" cellpadding="2" cellspacing="2">
<tr bgcolor="#FFFFCC">
<td width="600" class="titulos"><div align="center">VISUALIZACION DE DATOS DE ATENCION SELECCIONADA </div></td>
</tr>
<tr bgcolor="#ECE9D8">
<td height="19" class="fecha"><div align="center">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<tr bgcolor="#FFCC99">
<td height="42" bgcolor="#FFFFFF"><fieldset>
<legend><span class="texto">Datos del proceso:</span></legend>
<table width="662" border="0" cellspacing="1" cellpadding="0">
<tr bgcolor="#FFFFFF">
<td width="218"><span class="label">Cédula (Titular-Beneficiario):</span></td>
<td width="227" colspan="2"><input name="cedula" type="text" class="campo" id="cedula" value="<?php echo $cedula; ?>" size="15" maxlength="15" readonly=""></td>
<td width="117"><span class="label">Numero Atencion:</span></td>
<td><input name="numero_proceso" type="text" class="campo" id="numero_atencion" value="<?php echo $numero_atencion; ?>" size="6" maxlength="7" readonly=""></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Nombre completo:</span></td>
<td colspan="4"><input name="nombre" type="text" class="campo" id="nombre" value="<?php echo $nombre_completo; ?>" size="50" maxlength="50" readonly=""></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Fecha servicio:</span></td>
<td colspan="2"><input name="tipo_proceso" type="text" class="campo" id="tipo_proceso" value="<?php echo $fecha_servicio; ?>" size="20" maxlength="20" readonly=""></td>
<td><span class="label">Hora servicio:</span></td>
<td><input name="numero_proceso2" type="text" class="campo" id="numero_proceso" value="<?php echo $hora_servicio; ?>" size="12" maxlength="12" readonly=""></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Tipo:</span></td>
<td colspan="2"> <input name="sucursal" type="text" class="campo" id="sucursal" value="<?php echo $tipo; ?>" size="30" maxlength="30" readonly=""></td><td><span class="label">Sucursal:</span></td>
<td colspan="2"> <input name="sucursal2" type="text" class="campo" id="sucursal" value="<?php echo $nomsuc; ?>" size="25" maxlength="25" readonly=""></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><span class="label">Nombre funcionario :</span></td>
<td colspan="4"><input name="clase_negocio" type="text" class="campo" id="clase_negocio" value="<?php echo $nombre_funcionario; ?>" size="50" maxlength="50" readonly=""></td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
<p align="center"> </p>
</form>
<?php
//$msql = "select id, numero_atencion, nombre_funcionario ,asesoria, solucion, documentos_re,documentos_ap, concepto, observaciones from actuaciones_servicios where cedula = $cedula and numero_atencion = '$numero_atencion' ";
//$result = mysql_query($msql, $dbi);
$result = mysql_query('SELECT id, numero_atencion, nombre_funcionario ,asesoria, solucion, documentos_re,documentos_ap, concepto, observaciones FROM actuaciones_servicios WHERE cedula = "' ."$cedula". '" and numero_atencion = "' ."$numero_atencion". '" ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
if(mysql_num_rows($result) != 0)
{ // <td width="600" class="titulos"><div align="center">VISUALIZACION DE DATOS DE ATENCION SELECCIONADA </div></td>
while(list($id, $numero_atencion, $nombre_fun, $asesoria, $solucion, $documentos_re, $documentos_ap, $concepto, $observaciones) = mysql_fetch_row($result))
{
echo "<table width=700 border=1 align=center cellpadding=1 cellspacing=1>
<tr>
<td colspan=8 bgcolor=#ECE9D8><div align=center class='titulos'>ASESORIA SOLICITADA Y SOLUCION</div></td>
</tr>
<tr align=center>
<td width='350' class=fecha>ASESORIA</td>
<td width='350' class=fecha>SOLUCION</td>
</tr>";
echo "<tr class=lista><td><a top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$asesoria</a></td><td><a top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$solucion</a></td></tr>";
echo "<table width=700 border=1 align=center cellpadding=1 cellspacing=1>
<tr>
<td colspan=8 bgcolor=#ECE9D8><div align=center class='titulos'>DOCUMENTOS REQUERIDOS Y APORTADOS</div></td>
</tr>
<tr align=center>
<td width='350' class=fecha>DOCUMENTOS REQUERIDOS</td>
<td width='350' class=fecha>DOCUMENTOS APORTADOS</td>
</tr>";
echo "<tr class=lista><td><a top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$documentos_re</a></td><td><atop=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$documentos_ap</a></td></tr>";
echo "<table width=700 border=1 align=center cellpadding=1 cellspacing=1>
<tr>
<td colspan=8 bgcolor=#ECE9D8><div align=center class='titulos'>CONCEPTO Y OBSERVACIONES</div></td>
</tr>
<tr align=center>
<td width='350' class=fecha>CONCEPTO</td>
<td width='350' class=fecha>OBSERVACIONES</td>
</tr>";
echo "<tr class=lista><td><a top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$concepto</a></td><td><a top=50,left=100,toolbar=no,scrollbars=no,width=790,height=521,status=yes>$observaciones</a></td></tr>";
}
}
?>
</table>