Viewing file: recibe_modifica_organizaciones_InsInv.php (14.98 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//prevents caching
header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: post-check=0, pre-check=0",false);
session_cache_limiter();
session_start();
require('config.php');
require('functions.php');
//this is group name or username of the group or person that you wish to allow access to
// - please be advise that the Administrators Groups has access to all pages.
$tipousuario=$_SESSION[group1];
if ($tipousuario=="gestores")
{
$regreso="registro_participacion_gestores.php";
} elseif ($tipousuario=="funcionarios") {
$regreso="registro_participacion_funcionarios.php";
} else {
$regreso="registro_experiencias.php";
}
/*
if (allow_access(organizaciones) != "yes")
{
include ('no_access.php');
exit;
}
*/
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML>
<HEAD>
<TITLE>Secretaría Distrital de Ambiente</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1458662-7";
urchinTracker();
</script>
<style type="text/css">
body{ margin:0px; background-color:#EFEEEA;}
a{ text-decoration:none}
a:hover{ text-decoration:underline}
fieldset { -moz-border-radius: 8px; border-radius: px; }
.fuente{ font-family:verdana, Helvetica, sans-serif; font-size:11px; color:#666666; font-weight:normal; padding:4px}
.blanco {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bolder;
color: #FFFFFF;
background-color: #999999;
}
a{ color:#006699;}
a.fuentewhite{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #FFFFFF; text-decoration:none; padding-left:5px; padding-right:5px;
}
a.fuentewhite:hover{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #FFFFcc; text-decoration:underline; padding-left:5px
}
#caja {font-family: verdana, arial; font-size:11px; border:1px solid #999999}
.amarillo{background-image:url(images/yell.jpg); background-repeat:repeat-x}
.style1 {color: #FFFFFF}
.negra1{font-family: verdana, arial; font-size:11px}
fieldset{border: 1px solid #ccc;}
-->
</style>
<link rel="stylesheet" type="text/css" href="http://www.secretariadeambiente.gov.co/sda/libreria/css/tabcontent.css" />
<script type="text/javascript" src="/js/contentslider.js"></script>
<script type="text/javascript" src="http://www.secretariadeambiente.gov.co/sda/libreria/js/tabcontent.js"></script>
</HEAD>
<BODY>
<table border="0" cellpadding="0" cellspacing="0" align="center" width="928"><tr><td style="background-image:url(http://www.secretariadeambiente.gov.co/sda/libreria/jpg/new/fondoleft.jpg); background-repeat:repeat-y" width="14"></td>
<td><TABLE width="900" border=0 align="center" cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD bgColor=#7DB5C6 style="background-image:url(/sda/libreria/jpg/top08.jpg); background-repeat:no-repeat;" width="900" height="90" valign="bottom"><div align="right"><A href="/" class="fuentewhite">Inicio</A>
| <A href="http://www.secretariadeambiente.gov.co/sda/libreria/php/decide.php?patron=00.01" class="fuentewhite">Mapa
del Sitio</A> | <A href="http://192.168.10.3/php/reqintranet.php" class="fuentewhite">Intranet
SDA</A></div></TD>
</TR>
<TR>
<TD align=left vAlign=top bgColor=#000000><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width="73%" bgColor=#669966 background="http://www.secretariadeambiente.gov.co/sda/libreria/jpg/new/bg2.gif"><img src="http://www.secretariadeambiente.gov.co/sda/libreria/gif/bar2.gif" width="518" height="30" border="0" usemap="#Map"></TD>
<form name="form1" method="post" action="http://www.secretariadeambiente.gov.co/sda/libreria/php/frame_buscar.php">
<TD width="27%" bgColor=#669966 background="http://www.secretariadeambiente.gov.co/sda/libreria/jpg/new/bg2.gif">
<input name="buscar" type="text" size="20" id="caja">
<input type="submit" name="Submit" value="Buscar" style="font-size:10px">
<input name="accion" type="hidden" id="accion" value="1"></TD>
</form>
</TR>
<TR>
<TD colspan="2" bgColor=#FFFFFF><table width="900" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="195" valign="top" bgcolor="#F7F7F7">
<?php include("../../php/leftmenu2.php");?>
</td>
<td width="705" valign="top"><table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" class="fuente" style="padding:3px;">
<tr>
<td height="680" align="left" valign="top">
<fieldset> <legend><font color="#990000"><strong><font size="2" face="Geneva, Arial">Oficina OPEL</font></strong></font></legend>
<!-- <p align="right"> <a href="javascript:void(0);" onClick="history.back();">«Regresar</a></p> -->
<!-- <p align="right"> <a href="index.php">«Regresar</a></p> -->
<p align="right"><a href="<?php echo $regreso; ?>">«Regresar</a></p>
<p>
<?php
require_once('conn/conexion.php');
$sql ="SELECT * FROM reg_organizaciones WHERE user = '$_POST[usuario1]'";
$result = @mysql_query($sql,$link) or die(mysql_error());
//get the number of rows in the result set
$num = mysql_num_rows($result);
//checks it see if that username already exists
if ($num == 0){
echo "<P>Lo sentimos ya se encuentra registrado en el sistema</P>";
//echo "<P><a href=\"#\" onClick=\"history.back()\">Regresar</a></p>";
exit;
}else{
$usuarioC=$_SESSION[user_name];
$verif_box = $_POST['verif_box'];
if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){
//putenv('TZ=America/Bogota');
//generales
$fecha = $_POST['fecha'];
$usuario = $_POST['usuario'];
$pass = $_POST['pass'];
$acronimo = $_POST['acronimo'];
$ip = $_SERVER['REMOTE_ADDR'];
$identi = $_POST['identi'];
$nombre = $_POST['nombre'];
$direccion = $_POST['direccion'];
$localidad = $_POST['localidad'];
$territorio = $_POST['territorio'];
$telefono = $_POST['telefono'];
$fax = $_POST['fax'];
$email = $_POST['email'];
$web = $_POST['sitiowebA']."-".$_POST['sitiowebB'];
$aniocreacion = $_POST['aniocreacion'];
//persona
$nombre1 = $_POST['nombre1'];
$apellido = $_POST['apellido'];
$funcion = $_POST['funcion'];
$email2 = $_POST['email2'];
$cargo = $_POST['cargo'];
$comm = $_POST['comentarios'];
//organizacion
$organizacion = $_POST['organizacion'];
$checkboxes=$_POST['temas'];
$url1 = $_POST['url1'];
//$checkboxes = $_POST['temas'];
//$temas = implode($checkboxes,",");
$funcionariocreador=$_POST['funcionariocreador'];
if (isset($_POST['actividades'])){
$checkboxes2 = $_POST['actividades'];
$actividades = implode($checkboxes2,",");
}else{
$actividades = "0";
}
//$actividades = implode($checkboxes2,",");
if (isset($_POST['financiamientos'])){
$checkboxes3 = $_POST['financiamientos'];
$financiamientos = implode($checkboxes3,",");
}else{
$financiamientos = "0";
}
//$checkboxes4 = $_POST['material'];
//$material = implode($checkboxes4,",");
if (isset($_POST['material'])){
$checkboxes4 = $_POST['material'];
$material = implode($checkboxes4,",");
}else{
$material = "0";
}
if (isset($_POST['temas'])){
$checkboxes = $_POST['temas'];
$temas = implode($checkboxes,",");
}else{
$temas = "0";
}
$mision = $_POST['mision'];
$vision = $_POST['vision'];
$id_gestor = $_POST['id_gestor'];
$estado = $_POST['estado'];
$group1 = $_POST['group1'];
$ruta = $_SERVER['SERVER_NAME'];
$url=$_POST['url'];
if (isset($_POST['url'])){
$url = $_POST['url'];
}else{
$url = "0";
}
if (isset($_POST['id_gestor'])){
$id_gestor = $_POST['id_gestor'];
}else{
$id_gestor = "0";
}
if (isset($_POST['otros_temas'])){
$otr1 = $_POST['otros_temas'];
}else{
$otr1 = "0";
}
if (isset($_POST['otros_actividades'])){
$otr2 = $_POST['otros_actividades'];
}else{
$otr2 = "0";
}
if (isset($_POST['otros_financiamientos'])){
$otr3 = $_POST['otros_financiamientos'];
}else{
$otr3 = "0";
}
if (isset($_POST['otros_materiales'])){
$otr4 = $_POST['otros_materiales'];
}else{
$otr4 = "0";
}
if (isset($_POST['estado'])){
$estado = $_POST['estado'];
}else{
$estado = "0";
}
/*
$sql =" INSERT INTO reg_organizaciones (
`id` , `user`, `pass`, `identi` ,`fecha` ,`acronimo` ,`ip` ,`nombre` ,`direccion` ,`localidad` ,`territorio` ,`telefono` ,`fax` ,`email` ,`web` ,`aniocreacion` ,`nombre1` ,`apellido` ,
`funcion` ,`email2` ,`cargo` ,`comm` ,`organizacion` ,`actividades` ,`financiamientos` ,`material` ,`mision` ,`vision` ,`estado` ,
`id_gestor`,`otr1`,`otr2`,`otr3`,`otr4`)
VALUES (
'', '$usuario', '$pass', '$identi', '$fecha', '$acronimo' , '$ip' , '$nombre' , '$direccion' , '$localidad' , '$territorio' ,
'$telefono', '$fax', '$email', '$web', '$aniocreacion' , '$nombre1', '$apellido',
'$funcion', '$email2', '$cargo' , '$comm', '$organizacion', '$actividades' , '$financiamientos' , '$material' , '$mision' , '$vision' , '$estado', '$id_gestor', '$otr1', '$otr2', '$otr3', '$otr4')";
//$resultado=mysql_query($sql);
//UPDATE $curso SET codigo='$Codigo',Nombre='$Nombre',Email='$Email' WHERE codigo=$codigo
*/
$sqlactualiza="UPDATE reg_organizaciones SET pass='$pass', identi='$identi', fecha='$fecha', acronimo='$acronimo' , ip='$ip' , nombre='$nombre' , direccion='$direccion' , localidad='$localidad' , territorio='$territorio' ,
telefono='$telefono', fax='$fax', email='$email', web='$web', aniocreacion='$aniocreacion' , nombre1='$nombre1', apellido='$apellido',
funcion='$funcion', email2='$email2', cargo='$cargo' , comm='$comm', organizacion='$organizacion', actividades='$actividades' , financiamientos='$financiamientos' , material='$material' , mision='$mision' , vision='$vision' , estado='$estado',
id_gestor='$id_gestor', otr1='$otr1', otr2='$otr2', otr3='$otr3', otr4='$otr4', temas='$temas', funcionariocreador='$funcionariocreador' where user='$usuarioC';";
//echo $sqlactualiza;
$resultado=mysql_query($sqlactualiza) or die("error al actualizar reg_organizaciones");
$last_id=mysql_insert_id();
/*
$sql2 ="INSERT INTO authorize (
`firstname` ,
`lastname` ,
`username` ,
`password` ,
`group1` ,
`group2` ,
`group3` ,
`pchange` ,
`email` ,
`redirect` ,
`verified` ,
`last_login`, id
)
VALUES ('$nombre' , '$apellido' , '$usuario' , password('$pass') , '$group1' , NULL , NULL , '0', '$email' , '$url', 0 , NULL, '$last_id')";
echo $sql2;
$resultado2=mysql_query($sql2);
*/
$sqlactualizauthorize="UPDATE authorize SET firstname='$nombre', lastname='$apellido', password=password('$pass'),
group1='$group1', email='$email', redirect='$url1', last_login='$last_id' where username='$usuarioC';";
//echo $sqlactualizauthorize;
$resultado=mysql_query($sqlactualizauthorize) or die("error al actualizar authorize");
$sqlTemas = "select id from temas";
$resultTemas = mysql_query($sqlTemas);
while($rowTemas = mysql_fetch_row($resultTemas)){
$name = 'temas_' . $rowTemas[0];
if (isset($_POST[$name])){
$sqlInsertTema = "insert into registro_temas (id_reg_organizaciones, id_tema)
values ('$last_id', '$rowTemas[0]')";
mysql_query($sqlInsertTema);
}
}
echo "<h3>Registro efectuado exitosamente</h3>";
//echo $sqlactualiza."<br>";
//echo "Sus datos deberan ser verificados para que su cuenta quede activa y pueda ingresar al sistema";
echo "<br><br>";
$mailheaders = "From: Participacion\n";
$mailheaders .= "Su cuenta ha sido creada.\n";
$mailheaders .= "Por favor espere la activación por parte del administrador:\n";
//$mailheaders .= "$base_dir/activate.html\n";
$to = "$email";
$subject = "Verificar cuenta y activar";
/*
mail($to, $subject, $mailheaders, "From: No Responder <mdelgadog@gmail.com>\n");
mail("mdelgadog@gmail.com","Nuevo registro participacion SDA","Se ha efectuado un nuevo registro de organizacion . Por favor verifique la informacion en http://www.secretariadeambiente.gov.co/sda/libreria/php/participacion y active la inscripcion","from:Registro participacion<webmaster@secretariadeambiente.gov.co>");
*/
mysql_close($link);
}
else {
echo ("El código no es valido o su sesión ha excedido el tiempo.");
}
}
?>
</p>
</fieldset></td>
</tr>
</table></td>
</tr>
<tr>
<td height="80" colspan="2" align="center" valign="middle" class="amarillo"><font size="1"><font face="Verdana, Arial"><strong>Secretaría
Distrital de Ambiente</strong></font></span><font face="Verdana, Arial"><br>
Cra. 6 No. 14 - 98 Pisos 2, 5, 6, 7 y 12 Torre A y
piso 3 y 4 Torre B, Edificio Condominio Parque Santander
- Conmutador: 4441030 <br>
Bogotá - Colombia<br>
<a href="mailto:webmaster@secretariadeambiente.gov.co">webmaster@secretariadeambiente.gov.co</a></font></font></td>
</tr>
</table></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE></td><td style="background-image:url(http://www.secretariadeambiente.gov.co/sda/libreria/jpg/new/rightShadow.jpg); background-repeat:repeat-y" width="14"></td></tr></table>
<map name="Map">
<area shape="rect" coords="6,8,77,19" href="http://www.secretariadeambiente.gov.co/sda/libreria/php/decide.php?patron=01." alt="Secretaría de Ambiente">
<area shape="rect" coords="266,6,408,20" href="http://www.secretariadeambiente.gov.co/sda/libreria/php/decide.php?patron=02." alt="Servicios al Ciudadano">
<area shape="rect" coords="98,6,240,21" href="http://www.secretariadeambiente.gov.co/sda/libreria/php/decide.php?patron=03.">
<area shape="rect" coords="433,7,514,20" href="http://www.secretariadeambiente.gov.co/sda/libreria/php/decide.php?patron=05." alt="En línea">
</map></BODY></HTML>
|