} if (isset($_POST["cmbPertenece1"])) { $pertenece1 = $_POST["cmbPertenece1"]; } else { $pertenece1 = ""; } if (isset($_POST["cmbPertenece2"])) { $pertenece2 = $_POST["cmbPertenece2"]; } else { $pertenece2 = ""; } //VARIABLES IDUSUARIO $idSesion = new Sesion(); $idses = $idSesion->getVariableSession("idusua"); $dirses = new Sesion(); $d = $dirses->getVariableSession("direc"); /********************************************/ if ($_POST["accion"] == 'UPD') { $query = NULL; $error = NULL; $objMysql = new Mysql(); try { $query = "UPDATE " . DB_PREFIJO . "_sistema set convocatoria='{$nSwMostrar2}', contactenos='{$nSwMostrar1}'" . ", directorio='{$nSwMostrar3}', menu1='{$pertenece1}', menu2='{$pertenece2}' " . "where idsistema=1;"; $rs = $objMysql->ejecutar($query); $error = 1; } catch (PDOException $exc) { $error = 0; } } if ($error == 1) { header("Location: UPDSistema.php?idmenu=1;");
$nId = $_POST["txhId"]; } else { $nId = ""; } if (isset($_POST["txtnombre"])) { $sNombre = $_POST["txtnombre"]; } else { $sNombre = ""; } if (isset($_POST["cmbEnlace"])) { $sEnlace = $_POST["cmbEnlace"]; } else { $sEnlace = ""; } $dirses = new Sesion(); $dir = $dirses->getVariableSession("dir"); include "DAOServicio.php"; $objServicio = new EntidadServicio(); $objServicio->setIdservicio($nId); $objServicio->setUrl($sEnlace); $objServicio->setDescripcion($sNombre); if ($dir == "") { $objMysql = new Mysql(); $query = "select foto from cms_servicio where idservicio=" . $nId; $rs = $objMysql->ejecutar($query); $res = $rs->fetch(PDO::FETCH_ASSOC); $dir = $res["foto"]; $objServicio->setFoto($dir); } else { $objServicio->setFoto('imgs_servicio/' . $dir); }
<?php header('Cache-Control: no-cache'); header('Pragma: no-cache'); include "../_util/Sesion.php"; $objSesion = new Sesion(); $valses = $objSesion->getVariableSession("username"); //echo $valses; if (!isset($valses)) { echo "<script>window.location='../login/logout.php';</script>"; } include "../_util/Datos.php"; $objDatos = new Datos(); $vFila = $objDatos->getConsulta(array("f_pagina", $_GET["id"])); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MODIFICAR PAGINA </title> <script src="../ckeditorFull/ckeditor.js" type="text/javascript"></script> <script src="../ckfinder/ckfinder.js" type="text/javascript"></script> <script type="text/javascript" src="../javascripts/jquery.js"></script> <script type="text/javascript" src="../javascripts/parsley.js"></script> <link rel="stylesheet" type="text/css" href="../stylesheets/bootstrap.css"/> <link rel="stylesheet" type="text/css" href="../stylesheets/forms.css"/> <!-- fin include para formulario --> <link rel="stylesheet" type="text/css" href="../stylesheets/styles.css" />
<?php include "../_util/Sesion.php"; $objSesion = new Sesion(); $username = $objSesion->getVariableSession("username"); $userid = $objSesion->getVariableSession("userid"); if (!isset($username) && !isset($userid)) { include "../_util/Mysql.php"; $objMysql = new Mysql(); try { $sql = "SELECT usuario,clave,idusuario FROM " . DB_PREFIJO . "_usuarios WHERE usuario='" . $_POST['login_username'] . "' && clave='" . md5($_POST['login_userpass']) . "' LIMIT 0,1"; $rs = $objMysql->ejecutar($sql); $num_rows = $rs->rowCount(); if ($num_rows == 1) { $user = $rs->fetch(PDO::FETCH_ASSOC); $objSesion->setVariableSession("username", $user['usuario']); $objSesion->setVariableSession("userid", $user['idusuario']); echo 1; } else { echo 0; } } catch (PDOException $exc) { print $exc->__toString(); echo 0; } } else { echo 0; }