Viewing file: modificar.php (8.7 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include("../usuarios/include/session.php");
/**
* UserEdit.php
*
* This page is for users to edit their account information
* such as their password, email address, etc. Their
* usernames can not be edited. When changing their
* password, they must first confirm their current password.
*
* Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
* Last Updated: August 26, 2004
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Modulo Administración</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="../../images/favicon.ico">
<link rel="stylesheet" type="text/css" href="../css/default.css"/>
<title>Actos Administrativos</title>
<script type="text/javascript" src="../js/jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="../js/jquery.functions.js"></script>
<script type="text/javascript" src="../js/nicEdit-latest.js"></script>
<script>
function rellenar(quien,que){
cadcero='';
for(i=0;i<(4-que.length);i++){
cadcero+='0';
quien.value=cadcero+que;
}
if (quien.value == '0000'){
quien.value='';
}
}
</script>
<script type="text/javascript">
//<![CDATA[
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
//]]>
</script>
<SCRIPT LANGUAGE="JavaScript">
function popup(page) {
window.open(page,'popup','width=800,height=600,toolbar=false,scrollbars=yes,top=0,left=10');
}
</SCRIPT>
</head>
<body>
<?php
/**
* User has submitted form without errors and user's
* account has been edited successfully.
*/
if(isset($_SESSION['useredit'])){
unset($_SESSION['useredit']);
echo "<h1>Cuenta editada satisfactoriamente!</h1>";
echo "<p><b>$session->username</b>, tu cuenta ha sido actualizada satisfactoriamente. "
."<a href=\"index.php\">Inicio</a>.</p>";
}
else{
?>
<?php
/**
* If user is not logged in, then do not display anything.
* If user is logged in, then display the form to edit
* account information, with the current email address
* already in the field.
*/
if($session->logged_in){
?>
<?php include("../../conex.php");
//echo $file;
if ($_POST['tipo'] == 'AUTO')
{
$tabla = 'AUTOS';
}
else{
$tabla = 'RESOLUCIONES';
}
$created_date = date("Y-m-d H:i:s");
if( $_POST['consulta'] ){
$sql = "select * from $tabla where id ='$_POST[id]'";
$cursor = mysql_query( $sql, $conexion );
if( $row = mysql_fetch_array( $cursor ) ){
$no = $row["no"];
$fecha = $row["fecha"];
$resuelve = $row["resuelve"];
$sector = $row["sector"];
$subsector = $row["subsector"];
$usuario = $row["usuario"];
$expediente = $row["expediente"];
$abogado = $row["abogado"];
$direccion = $row["direccion"];
$id = $row["id"];
$tipo = $row["tipo"];
$fijacion = $row["fijacion"];
$desfijacion = $row["desfijacion"];
}
}
if( $_POST['modifica'] ){
$sql = "update $tabla set no='$_POST[no]',fecha='$_POST[fecha]',resuelve='$_POST[resuelve]',sector='$_POST[sector]',subsector='$_POST[subsector]',usuario='$_POST[usuario]',expediente='$_POST[expediente]',abogado='$_POST[abogado]',direccion='$_POST[direccion]',tipo='$_POST[tipo]',fijacion='$_POST[fijacion]',desfijacion='$_POST[desfijacion]',username='$session->username',fech_insercion='$created_date' where id = '$_POST[id]'";
//echo $sql;
if(mysql_query($sql,$conexion)){
echo "<script language='JavaScript' type='text/javascript'>
alert('Registro modificado correctamente') </script>";
}
else
echo "<script language='JavaScript' type='text/javascript'>
alert('Error al modificar registro') </script>";
}
?>
<form id="f1" name="f1" onsubmit="return validar(this)" action="" method="post" class="register" enctype="multipart/form-data">
<h1>Modificar</h1>
<input name="id" type="hidden" class="iceReadOnly" id="id" style="" onFocus="setFocus(this.id);" onBlur="setFocus('');" onKeyPress="iceSubmit(form,this,event);" value="<?php echo $id; ?>" size="5" maxlength="5" readonly="readonly">
<fieldset class="row1">
<legend>Información General </legend>
<p>
<label>No*<img src="../../images/search.gif" width="20" height="20" border="0" onClick="popup('mostrar.php')"/>
</label>
<input name="no" type="text" id="no" onBlur="rellenar(this,this.value)" value="<?php echo $no; ?>" size="16" maxlength="4"/>
<label>Fecha *
</label>
<input name="fecha" type="date" id="fecha" value="<?php echo $fecha; ?>"/>
</p>
<p>
<label>Tipo*
</label>
<input name="tipo" type="text" id="tipo" value="<?php echo $tipo; ?>" />
<label> Dependencia *
</label>
<input name="direccion" cols="60" type="text" id="direccion" value="<?php echo $direccion; ?>"/>
</p>
</fieldset>
<fieldset class="row2">
<legend>Información Detallada
</legend>
<p>
<label>Titulo *
</label>
<textarea name="resuelve" cols="50" class="long" id="resuelve"><?php echo $resuelve; ?></textarea>
</p>
<p>
<label>Usuario *
</label>
<input name="usuario" type="text" id="usuario" value="<?php if( $_POST['consulta'] || $_POST['modifica'] ){ echo $row["usuario"]; }?>" maxlength="150"/>
</p>
<p>
<label class="optional">Subsector
</label>
<input name="subsector" type="text" class="long" id="subsector" value="<?php echo $subsector; ?>" maxlength="10"/>
</p>
<p>
<label class="optional">Expediente
</label>
<input name="expediente" type="text" class="long" value="<?php echo $expediente; ?>" maxlength="50"/>
</p>
<p>
<label class="optional">Abogado
</label>
<input name="abogado" type="text" class="long" value="<?php echo $abogado; ?>" maxlength="200"/>
</p>
<p>
<label>Sector *
</label>
<select name="sector" size="1" id="sector" tabindex="5">
<option value="<?php echo strtoupper($sector);?>" selected='selected'><?php echo strtoupper($sector);?></option>
<option value=""></option>
<option value="Competencia-Estructura">Competencia-Estructura</option>
<option value="SILVICULTURA">Silvicultura</option>
<option value="VERTIMIENTOS">Vertimientos</option>
<option value="PEV">Publicidad Exterior Visual</option>
<option value="AIRE">Aire</option>
<option value="RUIDO">Ruido</option>
<option value="RESIDUOS">Residuos</option>
<option value="MINERIA">Minería</option>
<option value="FLORA">Flora</option>
<option value="FAUNA">Fauna</option>
<option value="INFRAESTRUCTURA">Infraestructura</option>
</select>
</p>
</fieldset><p> </p><p> </p>
<fieldset class="row3">
<legend></legend>
<div class="infobox">
<h4> InformaCión IMPORTANTE</h4>
<p>En caso de eliminar un archivo favor comuniquese con Sistemas.</p>
<p> </p>
</div>
</fieldset>
<div>
<input name="consulta" class="button" type="submit" id="consulta" value="Consultar »" style="color:#FFF">
<input name="modifica" class="button" type="submit" id="modifica" value="Modificar »" style="color:#FFF">
<input name="limpia" class="button" type="reset" id="limpia" value="Limpiar »" style="color:#FFF">
<button name="vuelve" class="button" id="vuelve" ><a href="../admin.php" style="color:#FFF">Volver »</a></button></div>
</form>
<?php
}
}
?>
</body>
</html>
|