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/modificar_datos_atencion.php
<?php
global $dbi;

require_once("../Conectarse.php");
//$sql2 = "select cedula, nombre, numerocontrato, tipocontrato,  direccion, ciudad, telefono, celular, email, codigo_sucursal  from asjudinet_cartera where cedula = $id";
//$control2 = mysql_query($sql2, $dbi) or die(mysql_error());	

$control2 = mysql_query('SELECT cedula, nombre, numerocontrato, tipocontrato,  direccion, ciudad, telefono, celular, email, codigo_sucursal FROM cartera_serviasjudinet  WHERE cedula = "' . $HTTP_GET_VARS["id"]  . '" ');
if (!$control2) {
	die('Invalid query: ' . mysql_error());
} 

if ((mysql_num_rows($control2)!=0)) 
{	 
  	list($cedula, $nombre, $contrato, $tipo, $direccion, $ciudad, $telefono, $celular, $email, $sucursal ) = mysql_fetch_row($control2);
	$id=$cedula; 
}

	 // $msql = "select id, cedula, numero_atencion, fecha_servicio, hora_servicio, sucursal, nombre_funcionario, tipo from record_servicios where cedula = $id and numero_atencion = $atencion";
    //  $misql = mysql_query($msql, $dbi) or die(mysql_error());	 
$misql = mysql_query('SELECT id, cedula, numero_atencion, fecha_servicio, hora_servicio, sucursal, nombre_funcionario, tipo FROM record_servicios WHERE cedula = "'.$_GET["id"].'" and numero_atencion = "'.$_GET["atencion"].'" ');
if (!$misql) {
	die('Invalid query: ' . mysql_error());
}

list($idn, $cc, $na, $fs, $hs, $su, $nf, $ts) = mysql_fetch_row($misql);
	
$misql2 = mysql_query('SELECT Cedula   FROM Usuarios WHERE Nombre_Completo  = "' ."$nf". '" ');
if (!$misql2) {
	die('Invalid query: ' . mysql_error());
}

list($cedu) = mysql_fetch_row($misql2);

// $msql5 = "select nombre from sucursal where codigo = $su";
//  $misql5 = mysql_query($msql5, $dbi) or die(mysql_error());
$misql5 = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "' ."$su". '" ');
if (!$misql5) {
	die('Invalid query: ' . mysql_error());
}	 
list($nomsuc) = mysql_fetch_row($misql5);
	
		
//$query_sql = "SELECT * FROM sucursal order by nombre";
//	$sql = mysql_query($query_sql, $dbi) or die(mysql_error());
$sql = mysql_query('SELECT * FROM sucursal order by nombre');
if (!$sql) {
	die('Invalid query: ' . mysql_error());
}
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql);  	

//  $msql6 = "select numero_orden, tipo_orden, concepto_servicio from accion_tomada where cedula_afiliado = $id and numero_atencion = $atencion";
//  $misql6 = mysql_query($msql6, $dbi) or die(mysql_error());	 

$misql6 = mysql_query('SELECT numero_orden, tipo_orden, concepto_servicio FROM accion_tomada WHERE cedula_afiliado = "' . $_GET["id"]  . '" and numero_atencion = "' . $_GET["atencion"]  . '" ');
if (!$misql6) {
	die('Invalid query: ' . mysql_error());
}

list($num_orden, $tipo_orden, $concepto_servi) = mysql_fetch_row($misql6);

if(isset($guardar))
{
	if($ts1!='')
	{
		$tipo_servicio=$ts1;
	}
	if($ssu=='')
	{
		$ssu=$su;
	}
	if($tip_ord2!='')
	{
		$tip_ord=$tip_ord2;
	}
	if($concept_serv2!='')
	{
		$concept_serv=$concept_serv2;
	}
	
	//modifica datos record servicios

					 
	$mssql = mysql_query("UPDATE  record_servicios  set cedula = '" . $_POST[cedula] . "', numero_atencion = '" . $_POST[numero_atencion] . "', fecha_servicio = '" . $_POST[fecha_ser] . "', hora_servicio = '" . $_POST[hora_ser] . "', sucursal  = '" . $_POST[ssu] . "', nombre_funcionario = '" . $_POST[nombre_funcionario] . "', cedula_funcionario = '" . $_POST[cedula_funcionario] . "', tipo = '" . $_POST[tipo_servicio] . "'  WHERE cedula = '" . $_GET["id"]  . "' and numero_atencion = '" . $_GET["atencion"]  . "' ");
	if (!$mssql) {
		die('Invalid query update 1: ' . mysql_error());
	}
			 
	 
	$mssql6 = mysql_query("UPDATE  accion_tomada  set fecha = '$fecha_ser'  WHERE cedula_afiliado = '".$_GET["id"]."' and numero_atencion = '".$_GET["atencion"]."' ");
	if (!$mssql6) {
		die('Invalid query: ' . mysql_error());
	}
	 
	  
 	$mssql = mysql_query("UPDATE  cartera_serviasjudinet   set direccion = '" . $_POST[direcc] . "', telefono = '" . $_POST[tel] . "', celular = '".$_POST[cel]."', ciudad = '".$_POST[ciu]."', email  = '".$_POST[mail]. "'  WHERE cedula = '".$_GET["id"]."' ");
	if (!$mssql) {
		die('Invalid query update 2: ' . mysql_error());
	}
			
	$mssqlr = mysql_query("UPDATE  beneficiarios  set direccion = '" . $_POST[direcc] . "', telefono = '" . $_POST[tel] . "', celular = '" . $_POST[cel] . "', ciudad = '" . $_POST[ciu] . "', email  = '" . $_POST[mail] . "'  WHERE cedula = '" . $_GET["id"]  . "' ");
	if (!$mssqlr) {
		die('Invalid query beneficiarios 2: ' . mysql_error());
	}
	
	  
 	$mssql9 = mysql_query("UPDATE  cartera_datos  set direccion = '" . $_POST[direcc] . "', telefono = '" . $_POST[tel] . "', celular = '" . $_POST[cel] . "', ciudad = '" . $_POST[ciu] . "', email  = '" . $_POST[mail] . "'  WHERE cedula = '" . $_GET["id"]  . "' ");
	if (!$mssql9) {
		die('Invalid query update 3: ' . mysql_error());
	}
	  
	
	//actualiza datos de accion tomada
	$mssql10 = mysql_query("UPDATE  accion_tomada  set numero_atencion = '" . $_POST[numero_atencion] . "', cedula_funcionario = '" . $_POST[cedula_funcionario] . "' , numero_orden = '" . $_POST[num_ord] . "', tipo_orden = '" . $_POST[tip_ord] . "', concepto_servicio = '" . $_POST[concept_serv] . "'  WHERE cedula_afiliado = '" . $_GET["id"]  . "' and numero_atencion = '" . $_GET["atencion"]  . "' ");
	if (!$mssql10) {
		die('Invalid query update 4: ' . mysql_error());
	}
	  
	
	  
	$mssql2 = mysql_query("UPDATE  actuaciones_servicios  set numero_atencion = '" . $_POST[numero_atencion] . "' WHERE cedula = '" . $_GET["id"]  . "' and numero_atencion = '" . $_GET["atencion"]  . "' ");
	if (!$mssql2) {
		die('Invalid query update 4: ' . mysql_error());
	}
	  

	$misql2 = mysql_query('SELECT id, cedula, numero_atencion, fecha_servicio, hora_servicio,  sucursal, nombre_funcionario, tipo FROM record_servicios WHERE cedula = "' . $_POST[cedula] . '" and numero_atencion = "' . $_POST[atencion] . '" ');
	if (!$misql2) {
		die('Invalid query: ' . mysql_error());
	}

	list($idn, $cc, $na, $fs, $hs, $su, $nf, $ts) = mysql_fetch_row($misql2);
	  
	// $msql3 = "select  direccion, telefono, celular, ciudad, email from asjudinet_cartera where cedula = '$cc' ";
    //  $misql3 = mysql_query($msql3, $dbi) or die(mysql_error());
	$misql3 = mysql_query('SELECT  direccion, telefono, celular, ciudad, email FROM cartera_serviasjudinet  WHERE cedula = "' . $_POST[cc] . '" ');
	if (!$misql3) {
		die('Invalid query: ' . mysql_error());
	}	 
	list($direccion, $telefono, $celular, $ciudad, $email) = mysql_fetch_row($misql3);
	  
	// $msql4 = "select nombre from sucursal where codigo = '$su'";
    // $misql4 = mysql_query($msql4, $dbi) or die(mysql_error());	
	$misql4 = mysql_query('SELECT nombre FROM sucursal WHERE codigo = "' ."$su". '" ');
	if (!$misql4) {
		die('Invalid query: ' . mysql_error());
	} 
	list($nomsuc) = mysql_fetch_row($misql4);
	
}	  


?>
<html>
<head>
<title>VENTANA PARA MODIFICAR DATOS DEL SERVICIO</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">-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  
<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: 4px 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{border:0}
    .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:12px;}
	.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: 1px; font-size:12px;}
	.tdtitulo{background-color: #FDF8DB; color: #CE1115; 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;}
</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()
{

  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 MODIFICAR ATENCION"; // only shown once at page load
var text1 = "El primer encabezado muestra en detalle los datos de la atencion seleccionada";
var text2 = "La segunda parte muestra los datos de actuaciones de servicio ";
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()">
<h3 class="titulo">VISUALIZACION DE DATOS DE ATENCION SELECCIONADA</h3>

<form name="formulario" action="" method="post" onSubmit="return validar(this)">
<input name="codigo_funcionario" type="hidden" value="<?php echo $codigo_funcionario; ?>">
<table width="707" align="center" cellpadding="2" cellspacing="2">
  <!--<tr bgcolor="#FFFFCC">
    <td width="699" class="titulos"><div align="center">VISUALIZACION DE DATOS DE LA ATENCION SELECCIONADA</div></td>
  </tr>-->
<tr>
	<td height="3" class="fecha"><div align="center">
      <script languaje="JavaScript">Mostrar_Fecha()</script>
    </div></td>
</tr>


<tr>
<td height="20"><fieldset>
<legend>Datos de la atenci&ograve;n:</legend>
<table width="691" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#ECE9D8">
<tr>
	<td class="tdder">C&eacute;dula (Titular-Beneficiario):</td>
    <td class="tdizq"><input name="cedula" type="text" class="campo" id="cedula" value="<?php echo $cc; ?>" size="15" maxlength="15" readonly="">
         <input name="projuridico" type="hidden" class="campo" id="projuridico" value="<?php echo $na ?>" size="6" maxlength="6"></td>
 	<td class="tdder">N&uacute;mero de Atencion:</td>
    <td class="tdizq"><input name="numero_atencion" type="text" class="campo" value="<?php echo $na ?>" size="15" maxlength="15"> </td>
</tr>


<tr>
	<td class="tdder">Tipo de servicio:</td>
    <td class="tdizq" colspan="3"><input name="tipo_servicio" type="text" class="campo" id="tipo_servicio" value="<?php echo $ts ?>" size="20" maxlength="20" readonly="">
         -
   	<select name="ts1" class="sel3" id="select2">
    <option value="" selected>--TIPO DE SERVICIO--</option>
    <option value="ASESORIA JURIDICA">ASESORIA JURIDICA</option>
    <option value="DISCIPLINARIA">DISCIPLINARIA</option>
   	<option value="SUSTANCIACION">SUSTANCIACION</option>
	<option value="MEDICA LABORAL">MEDICA LABORAL</option>
	<option value="TRAMITE DOCUMENTOS">TRAMITE DOCUMENTOS</option>
	<option value="TELEFONICO">TELEFONICO</option>
   	</select></td>
</tr>


<tr>
 	<td class="tdder">Nombre funcionario :</td>
    <td class="tdizq" colspan="3"><input name="nombre_funcionario" type="text" class="campo" id="clase_negocio" value="<?php echo $nf ?>" size="50" maxlength="50"></td>
</tr>


<tr>
	<td class="tdder">Cedula funcionario :</td>
   	<td class="tdizq" colspan="3"><input name="cedula_funcionario" type="text" class="campo" id="clase_negocio" value="<?php echo $cedu ?>" size="50" maxlength="50"></td>
</tr>

<tr>
	<td class="tdder">Fecha Servicio :</td>
   	<td class="tdizq" colspan="3"><input name="fecha_ser" type="text" class="campo" id="despacho_judicial" value="<?php echo $fs ?>" size="12" maxlength="10"></td>
</tr>


<tr>
	<td class="tdder">Hora Servicio  :</td>
    <td class="tdizq" colspan="3"><input name="hora_ser" type="text" class="campo" id="ciudad_despacho" value="<?php echo $hs ?>" size="12" maxlength="12"></td>
</tr>

<tr>
	<td class="tdder">Sucursal  :</td>
    <td class="tdizq" colspan="3"><input name="suc" type="text" class="campo" id="sucursal" value="<?php echo $nomsuc ?>" size="30" maxlength="30" readonly=""><select name="ssu" class="campo">
  <option value="">--SELECCIONE SUCURSAL--</option>
 	<?php
     do {  
	?>
  	<option value="<?php echo $row_sql['codigo'];?>"><?php echo $row_sql['nombre']?></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">Datos del cliente:</td>
	<td class="tdizq" colspan="3">&nbsp;</td>
</tr>


<tr>
	<td class="tdder">Direccion  :</td>
    <td class="tdizq" colspan="3"><input name="direcc" type="text" class="campo" id="ciudad_despacho" value="<?php echo $direccion ?>" size="50" maxlength="50"></td>
</tr>


<tr>
	<td class="tdder">Telefono  :</td>
    <td class="tdizq" colspan="3"><input name="tel" type="text" class="campo" id="ciudad_despacho" value="<?php echo $telefono ?>" size="25" maxlength="25"></td>
</tr>


<tr>
	<td class="tdder">Celular  :</td>
    <td class="tdizq" colspan="3"><input name="cel" type="text" class="campo" id="ciudad_despacho" value="<?php echo $celular ?>" size="25" maxlength="25"></td>
</tr>


<tr>
	<td class="tdder">Ciudad  :</td>
   	<td class="tdizq" colspan="3"><input name="ciu" type="text" class="campo" id="ciudad_despacho" value="<?php echo $ciudad ?>" size="50" maxlength="50"></td>
</tr>


<tr>
	<td class="tdder">Email  :</td>
    <td class="tdizq" colspan="3"><input name="mail" type="text" class="campo" id="ciudad_despacho" value="<?php echo $email ?>" size="50" maxlength="50"></td>
</tr>


<tr>
	<td class="tdder">Datos Accion Tomada:</td>
	<td class="tdizq" colspan="3">&nbsp;</td>
</tr>


<tr>
	<td class="tdder">Numero Orden   :</td>
	<td class="tdizq" colspan="3"><input name="num_ord" type="text" class="campo" id="direcc" value="<?php echo $num_orden ?>" size="40" maxlength="40"></td>
</tr>

<tr>
	<td class="tdder">Tipo Orden :</td>
	<td class="tdizq" colspan="3"><input name="tip_ord" type="text" class="campo" id="direcc2" value="<?php echo $tipo_orden ?>" size="40" maxlength="40">
		<select name="tip_ord2" class="concep" id="tip_ord2">
        <option value="" selected>--TIPO DE ORDEN--</option>
        <option value="INICIO">INICIO</option>
        <option value="REVISTA">REVISTA</option>
        </select>
  	</td>
</tr>


<tr>
	<td class="tdder">Concepto Servicio   :</td>
	<td class="tdizq" colspan="3"><input name="concept_serv" type="text" class="campo" id="direcc3" value="<?php echo $concepto_servi ?>" size="40" maxlength="40">
		<select name="concept_serv2" class="concep" id="select">
        <option value="" selected>--CONCEPTO DEL SERVICIO--</option>
        <option value="EXCELENTE">EXCELENTE</option>
        <option value="BUENO">BUENO</option>
        <option value="REGULAR">REGULAR</option>
        <option value="MALA">MALA</option>
        <option value="NINGUNA">NINGUNA</option>
        </select>
   	</td>
</tr>
</table> 

</fieldset>
</td>
</tr>



<tr>
	<td height="20"><div align="center">
        <input name = "guardar" type="submit" class="direcciona" value="Modificar datos">
    </div></td>
  </tr>
</table>
</form>
</body>
</html>