Viewing file: modificar.php (12.44 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 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html class="noI firefox" xmlns="http://www.w3.org/1999/xhtml"><head>
<link rel="shortcut icon" href="../../images/favicon.ico">
<title>Modulo Administración</title>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META http-equiv=content-script-type content=text/JScript>
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
<link href="../index_files/style.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
function popup(page) {
window.open(page,'popup','width=800,height=600,toolbar=false,scrollbars=yes,top=0,left=10');
}
</SCRIPT>
<script>
function validar(formulario){
if(document.forms.f1.no.value =="")
{
window.alert('Debe ingresar el numero del acto administrativo');
f1.no.focus();
return(false);
}
if(document.forms.f1.fecha.value =="")
{
window.alert('Debe ingresar la fecha');
f1.fecha.focus();
return(false);
}
if(document.forms.f1.imagen.value =="")
{
window.alert('Debe adjuntar un archivo');
f1.imagen.focus();
return(false);
}
if(document.forms.f1.usuario.value =="")
{
window.alert('Debe ingresar el usuario');
f1.usuario.focus();
return(false);
}
if(document.forms.f1.sector.value =="")
{
window.alert('Debe ingresar el sector');
f1.sector.focus();
return(false);
}
if(document.forms.f1.direccion.value =="")
{
window.alert('Debe ingresar la dependencia que lo proyecto');
f1.direccion.focus();
return(false);
}
}
</script>
<style type="text/css">
<!--
.Estilo2 {font-family: Georgia, "Times New Roman", Times, serif}
.Estilo5 { font-family: Verdana;
font-size: 8pt;
}
-->
</style>
<!-- CSS -->
<link rel="stylesheet" href="../css/dynamic.css" type="text/css">
<link rel="stylesheet" href="../css/creation.css" type="text/css">
<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>
</head><body id="creation">
<script type="text/javascript">
//<![CDATA[
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
//]]>
</script>
<?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){
?>
<div id="container" class="clearfix">
<?php include("../../conex.php");
$ano = substr($_POST['nombre'],-4);
echo $url;
if( $_POST['consulta'] ){
$sql = "select * from doc_imp where id ='$_POST[id]'";
$cursor = mysql_query( $sql, $conexion );
if( $row = mysql_fetch_array( $cursor ) ){
$id = $row["id"];
$nombre = $row["nombre"];
$tipo = $row["tipo"];
$firma = $row["firma"];
$titulo = $row["titulo"];
}
}
if( $_POST['modifica'] ){
$sql = "update doc_imp set nombre='$_POST[nombre]',tipo='$_POST[tipo]',firma='$_POST[firma]',titulo='$_POST[titulo]' 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>";
}
?>
<div id="container">
<div id="header">
<div align="center"><img src="../../images/cabezote BLEGAL.jpg" width="837" height="145" border="0" usemap="#Map">
</div>
</div>
<div>
<FORM id=f1 name=f1 method=post onSubmit="return validar(this)" enctype="multipart/form-data">
<TABLE width="798" height="447" border=2 cellPadding=0
cellSpacing=0
style="BORDER-LEFT-COLOR: green; BORDER-BOTTOM-COLOR: green; BORDER-TOP-COLOR: green; BORDER-RIGHT-COLOR: green">
<TBODY>
<TR>
<TD width="792" height="437"
colSpan=3 style="FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana" border=2><TABLE width="751">
<TBODY>
<TR>
<TD width="743"
align=middle
style="FONT-SIZE: 10pt; COLOR: black; HEIGHT: 18px; BACKGROUND-COLOR: #cccccc"><strong>Formulario de Ingreso Documentos Importantes: <span class="Estilo5">L</span></strong><span style="FONT-SIZE: 8pt; FONT-FAMILY: Verdana"><strong>os campos con * deben ser
diligenciados (obligatorios)</strong></span> <BR></TD>
</TR>
<TR>
<TD style="COLOR: white; BACKGROUND-COLOR: #1C3606"><TABLE width="100%">
<TBODY>
<TR>
<TD style="HEIGHT: 15px"
align=middle> </TD>
<TD style="HEIGHT: 15px"
align=right><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"></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD
style="FONT-SIZE: 12pt; COLOR: red; BACKGROUND-COLOR: gainsboro; TEXT-ALIGN: center"><p><SPAN
style="FONT-SIZE: 10pt">Si usted ya se encuentra en este modulo es porque tiene acceso a el. El ingreso de información no autorizada a este modulo está prohibido y puede estar sujeto a acciones civiles y penales.</SPAN> </p></TD>
</TR>
<TR>
<TD
style="FONT-SIZE: 8pt; COLOR: white; BACKGROUND-COLOR: #1C3606"><TABLE width="100%">
<TBODY>
<TR>
<TD style="HEIGHT: 15px"
align=middle><div align="left">Documentos Importantes</div></TD>
<TD style="HEIGHT: 15px" align=right><A
id=linAyudaNombre
title="">Ayuda</A></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD
style="HEIGHT: 42px; BACKGROUND-COLOR: activeborder; TEXT-ALIGN: center; background-color:#fff"><TABLE width="100%" height="76">
<TBODY>
<TR>
<td width="103" colspan="2" bgcolor="#D4D0C8" style="HEIGHT: 15px ; BACKGROUND-COLOR: activeborder "><strong>Nombre</strong>* </td>
<TD width="310" bgcolor="#D4D0C8" style="HEIGHT: 15px ; BACKGROUND-COLOR: activeborder "><strong>Tipo* </strong></TD>
<TD width="314" colspan="2" bgcolor="#D4D0C8" style="HEIGHT: 15px ; BACKGROUND-COLOR: activeborder "><strong>Firma*</strong></TD>
</TR>
<TR>
<TD
align=middle bgcolor="#B4B4B4" style="WIDTH: 198px; HEIGHT: 26px"><input name="nombre" type="text" class="fundamentals" id="nombre" tabindex="2" value="<?php echo $nombre; ?>" size="40" maxlength="80" /></TD>
<TD
align=middle bgcolor="#B4B4B4" style="WIDTH: 198px; HEIGHT: 26px"><img src="../../images/search.gif" alt="" width="20" height="20" border="0" onclick="popup('mostrar.php')"/></TD>
<td height="51" align="middle" bgcolor="#B4B4B4" style="HEIGHT: 26px"><select
name="tipo" class="fundamentals"
id="tipo" tabindex="1" value="" maxlength="200">
<option value="<?php echo $tipo; ?> "><?php echo $tipo; ?> </option>
<option value="Directivas">Directivas</option>
<option value="Circulares">Circulares</option>
</select></td>
<TD width="314" colspan="2" bgcolor="#D4D0C8" style="HEIGHT: 15px ; BACKGROUND-COLOR: activeborder "><span style="WIDTH: 198px; HEIGHT: 26px">
<input name="firma" class="fundamentals" id="firma" tabindex="3" value="<?php echo $firma; ?> " size="35"
maxlength="150" />
</span></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<tr>
<td
style="FONT-SIZE: 8pt; COLOR: white; BACKGROUND-COLOR: #1C3606"><table width="92%">
<tbody>
<tr>
<td style="HEIGHT: 15px"
align="middle"><div align="left"></div></td>
<td style="HEIGHT: 15px" align="right"><a
id="linAyudaNombre2"
title="">Ayuda</a></td>
</tr>
</tbody>
</table></td>
</tr>
<TR>
<TD
style="HEIGHT: 42px; BACKGROUND-COLOR: activeborder; TEXT-ALIGN: center; background-color:#FFFFFF"><TABLE width="100%" height="61">
<TBODY>
<TR>
<TD width="261" bgcolor="#D4D0C8" style="HEIGHT: 15px ; BACKGROUND-COLOR: activeborder "><strong>Titulo*</strong></TD>
</TR>
<TR>
<TD
align=middle style="WIDTH: 214px; HEIGHT: 26px"><span style="HEIGHT: 26px">
<textarea name="titulo" cols="97" id="titulo" tabindex="4" ><?php echo $titulo; ?> </textarea>
</span></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD height="56" style="TEXT-ALIGN: center"><TABLE width="100%">
<TBODY>
<TR>
<TD width="282"
style="WIDTH: 250px; BACKGROUND-COLOR: activeborder"></TD>
<TD width="238"
style="WIDTH: 211px; BACKGROUND-COLOR: activeborder"><span>
<input name="consulta" type="submit" id="consulta" value="Consultar" >
<input name="modifica" type="submit" id="modifica" value="Modificar" >
<input type="button" name="limpiar" value="Limpiar" onClick="location.href='modificar.php'"></span></TD>
<TD width="295"
colSpan=2 style="BACKGROUND-COLOR: activeborder"><input type="button" name="limpiar2" value="Volver al menu principal" onClick="location.href='../admin.php'" tabindex="8"></TD>
</TR>
</TBODY>
</TABLE> </TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
</form>
</div>
</div>
<?php
}
}
?>
<div class="footer">
<i class="c1">·</i>
Copyright © 2011
<i class="c1">·</i><strong>Secretaria de Ambiente </strong><b>.</b>
<i class="c1">·</i>Todos los derechos reservados <i class="c1">·</i></div>
</div><!--container-->
</body></html>
|