Beispiel #1
0
 public function apagar(Perfil $objPerfil)
 {
     $v = $this->_getValidacao();
     $v->setRules($objPerfil->getId(), 'required', 'ID');
     $v->validar();
     return $this->_getRepositorio()->alterar($objPerfil);
 }
Beispiel #2
0
 /**
  * Método constructor
  */
 public function __construct()
 {
     self::$_acl = Acl2::factory('simple');
     $perfil = new Perfil();
     $perfiles = $perfil->getListadoPerfil('acl');
     $this->_setPerfiles($perfiles);
 }
Beispiel #3
0
 public static function evaluarValorEsperado(Perfil $perfil, Percentiles $percentil)
 {
     $criteria = new Criteria();
     $criteria->add(ValoresperadoPeer::ESCALAS_ID, $percentil->getEscalasId());
     $valorEsperados = $perfil->getValoresperados($criteria);
     //        var_dump($perfil);
     //        var_dump($percentil);
     $valorEsperado = $valorEsperados[0];
     //        $valorEsperado = new Valoresperado();
     return ($valorEsperado->getMayorque() <= $percentil->getPercentil() and $valorEsperado->getMenorque() >= $percentil->getPercentil()) ? true : false;
 }
Beispiel #4
0
 public function visualizar(Perfil $objPerfil)
 {
     try {
         $this->_stat = $this->_getConn()->prepare('SELECT * FROM tblperfil WHERE per_id = :per_id AND per_excluido = 0 AND per_status = 1');
         $this->_stat->bindValue(':per_id', $objPerfil->getId(), \PDO::PARAM_INT);
         $this->_stat->execute();
         return $this->_getPerfil($this->_stat->fetch(\PDO::FETCH_ASSOC));
     } catch (\PDOException $e) {
         throw new \model\conexao\Excecao($e->getMessage());
     }
 }
 public function createMaestro($post)
 {
     //Sanitisar los valores enviados por el usuario ( POST )
     $username = filter_var($post['username_input_data'], FILTER_SANITIZE_STRING);
     $mail = filter_var($post['email_input_data'], FILTER_SANITIZE_EMAIL);
     $password = filter_var($post['password_input_data'], FILTER_SANITIZE_STRING);
     $username = strip_tags(htmlspecialchars($username));
     $mail = strip_tags(htmlspecialchars($mail));
     $password = strip_tags(htmlspecialchars($password));
     //Validar el email
     $mail = filter_var($mail, FILTER_VALIDATE_EMAIL);
     $longitudPass = strlen($password);
     $perfil = Perfil::where('email', '=', $mail)->get();
     //Verificar que el email sea valido
     if (!$mail) {
         $this->app->redirect($this->app->urlFor('admin-maestro') . '?attempt=1');
     }
     //Verificar la longitud del password
     if ($longitudPass < 8) {
         $this->app->redirect($this->app->urlFor('admin-maestro') . '?attempt=2');
     }
     //Verificar que el email no exista en la base de datos (Perfil)
     if (count($perfil) > 0) {
         $this->app->redirect($this->app->urlFor('admin-maestro') . '?attempt=3');
     }
     //Verificar que el username no exista en la base de datos
     $perfil = Perfil::where('username', '=', $username)->get();
     if (count($perfil) > 0) {
         $this->app->redirect($this->app->urlFor('join') . '?attempt=4');
     }
     //$user 		= 	Authentication::createUser( $username, $mail, $password, 100 );
     $user = new User();
     $salt = uniqid();
     $pwd = $password . $salt;
     $hash = hash('sha256', $pwd);
     $user->passwd = $hash;
     $user->salt = $salt;
     $user->level_id = 3;
     if ($user->save()) {
         $perfil = new Perfil();
         $perfil->perfil_id = $user->user_id;
         $perfil->email = $mail;
         $perfil->username = $username;
         $maestro = new Maestro();
         $maestro->maestro_id = $user->user_id;
         if ($perfil->save() && $maestro->save()) {
             $action = $this->app->urlFor('admin-maestro');
             $this->app->redirect($action . '?attempt=7');
         }
     } else {
         $action = $this->app->urlFor('admin-maestro');
         $this->app->redirect($action . '?attempt=5');
     }
 }
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Perfil::create([]);
     }
 }
 public function delete()
 {
     $obj = new Perfil();
     $p = $obj->delete($_GET['id']);
     if ($p[0]) {
         header('Location: index.php?controller=Perfil');
     } else {
         $data = array();
         $view = new View();
         $data['msg'] = $p[1];
         $data['url'] = 'index.php?controller=Perfil';
         $view->setData($data);
         $view->setTemplate('../view/_Error_App.php');
         $view->setLayout('../template/Layout.php');
         $view->render();
     }
 }
Beispiel #8
0
 public function tabla_accesos($perfil_usuario)
 {
     echo "<script>\r\n\t\tfunction checkear(param){\r\n\t\t\tvar x=0;\r\n\t\t\tvar AB = document.getElementsByClassName(param);\r\n\t\t\tfor(i=1;i<AB.length;i++){\r\n\t\t\t\tif(AB[i].checked){\r\n\t\t\t\t\tAB[0].checked=true;\r\n\t\t\t\t\tx++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(AB[0].checked==true && x==0){\r\n\t\t\t\tAB[0].checked=false;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction checkear2(param){\r\n\t\t\tvar x=0;\r\n\t\t\tvar AB = document.getElementsByClassName(param);\r\n\t\t\tif(AB[0].checked){\r\n\t\t\t\tprompt('yes')               \t\r\n\t\t\t}\t            \r\n\t\t\tfor(i=1;i<AB.length;i++){\r\n\t\t\t\tif(AB[i].checked){\r\n\t\t\t\t\tAB[0].checked=true;\r\n\t\t\t\t\tx++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(AB[0].checked==true && x==0){\r\n\t\t\t\tAB[0].checked=false;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tfunction seleccionar_todos(param){\r\n\t\t\t\r\n\t\t\tvar t=document.getElementsByTagName('input');\r\n\r\n\t\t\tfor(i=0;i<t.length;i++){\r\n\t\t\t\tif(t[i].type=='checkbox')\r\n\t\t\t\t\tt[i].checked=param; \r\n\t\t\t}\r\n\t\t\tdocument.getElementById('todos').checked=true;\r\n\t\t\tif(param==true){\r\n\t\t\t\tdocument.getElementById('todos').checked=true;\r\n\t\t\t\tdocument.getElementById('ninguno').checked=false;\r\n\t\t\t}else{\r\n\t\t\t\tdocument.getElementById('todos').checked=false;\r\n\t\t\t\tdocument.getElementById('ninguno').checked=true;\r\n\t\t\t}            \t\r\n\t\t}\r\n\r\n\t\t</script>";
     $perfil = new Perfil();
     $query = $this->c->Ejecutar("SELECT * FROM seguridad.tmodulo where estatus = '1' ORDER BY orden ASC");
     echo "Todos&nbsp;&nbsp;\r\n\t\t<input onclick=seleccionar_todos(true) type='checkbox' name='todos' id='todos'/> \r\n\t\t/ Ninguno&nbsp;&nbsp;<input onclick=seleccionar_todos(false) type='checkbox' name='ninguno' id='ninguno'/>";
     echo "<table class='table table-striped table-bordered table-condensed'>";
     echo "<tr><td>SERVICIOS / OPCIONES</td><td><table class='options'><tr>";
     $query3 = $this->c->Ejecutar("SELECT * FROM seguridad.topcion where estatus = '1' ORDER BY orden ASC");
     while ($Datos3 = $this->c->Respuesta($query3)) {
         //opciones
         echo "<td>" . $Datos3['nombre_opcion'] . "</td>";
     }
     echo "</tr></table></td></tr>";
     while ($Datos1 = $this->c->Respuesta($query)) {
         $query2 = $this->c->Ejecutar("SELECT * FROM seguridad.tservicio where codigo_modulo='" . $Datos1['codigo_modulo'] . "' AND estatus = '1'");
         echo "<tr class='theader'>";
         echo "<th align='left' style='color:#FFFFFF;'><input type='hidden' value='" . $Datos1['codigo_modulo'] . "' name='modulos[]'/>" . "&nbsp;&nbsp;&nbsp;" . $Datos1['nombre_modulo'] . "</th><th>" . "" . "</th>";
         echo "</tr>";
         while ($Datos2 = $this->c->Respuesta($query2)) {
             // servicios
             $perfil->codigo_perfil($perfil_usuario);
             $perfil->codigo_servicio($Datos2['codigo_servicio']);
             $perfil->Consultar_SERVICIOS() == true ? $checked = 'checked' : ($checked = '');
             echo "<tr>";
             echo "<td align='left' style='padding-left:2em;'>";
             echo "<input onclick=checkear2(this.class) class='cls_" . $Datos2['codigo_servicio'] . "' {$checked} type='checkbox' name='servicios[]' value='" . $Datos2['codigo_servicio'] . "'/>";
             echo $Datos2['nombre_servicio'];
             echo "</td>";
             $query3 = $this->c->Ejecutar("SELECT * FROM seguridad.topcion where estatus = '1' ORDER BY orden ASC");
             echo "<td><table class='options'><tr>";
             while ($Datos3 = $this->c->Respuesta($query3)) {
                 //opciones
                 echo "<td>";
                 $perfil->codigo_opcion($Datos3['codigo_opcion']);
                 $perfil->Consultar_OPCIONES() == true ? $checked = 'checked' : ($checked = '');
                 echo "<center><input onclick=checkear('cls_" . $Datos2['codigo_servicio'] . "') \r\n\t                   \tclass='cls_" . $Datos2['codigo_servicio'] . "'\r\n\t                   \t{$checked} type='checkbox' value='" . $Datos3['codigo_opcion'] . "' \r\n\t                   \tname='opciones[" . $Datos2['codigo_servicio'] . "][]'/></center>" . "                      ";
                 echo "</td>";
             }
             echo "</tr></table></td>";
             echo "</tr>";
         }
     }
     echo "<tr><td colspan=2><center>FIN DE SERVICIOS</center></td></tr></table>";
 }
 public function editusuario()
 {
     self::seguridad();
     $this->Load->Model(array('Usuario', 'Perfil'));
     $U = new Usuario();
     $U->id_usuario = $this->PermaLinkVars[0];
     $P = new Perfil();
     $Data['perfiles'] = $P->verPerfiles();
     $Data['action'] = 'Editar';
     $Data['url_action'] = 'ex_admin';
     $Data['user'] = $U->verUsuario();
     $U->where = 'id_usuario != 0';
     $Data['usuarios'] = $U->verUsuariosWhere();
     fk_header();
     $this->Load->View('admin/menu.php');
     $this->Load->View('admin/admin_formedit.php', $Data);
     fk_footer();
 }
Beispiel #10
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function indexUsuarios($id = null)
 {
     if ($id == null) {
         $data['usuarios'] = User::with('Perfil')->orderBy('id', 'asc')->get();
         $data['perfiles'] = Perfil::orderBy('id', 'asc')->get();
         return $data;
     } else {
         return $this->show($id);
     }
 }
 /**
  * Método para listar
  */
 public function listar($order = 'order.modulo.asc')
 {
     if (Input::hasPost('privilegios') or Input::hasPost('old_privilegios')) {
         if (RecursoPerfil::setRecursoPerfil(Input::post('privilegios'), Input::post('old_privilegios'))) {
             Flash::valid('Los privilegios se han registrado correctamente!');
             Input::delete('privilegios');
             //Para que no queden persistentes
             Input::delete('old_privilegios');
         }
     }
     $recurso = new Recurso();
     $this->recursos = $recurso->getListadoRecursoPorModulo(Recurso::ACTIVO);
     $perfil = new Perfil();
     $this->perfiles = $perfil->getListadoPerfil(Perfil::ACTIVO);
     $privilegio = new RecursoPerfil();
     $this->privilegios = $privilegio->getPrivilegiosToArray();
     $this->order = $order;
     $this->page_title = 'Permisos y privilegios de usuarios';
 }
Beispiel #12
0
 /**
  * Display the specified resource.
  * GET /usuarios/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function getEdit($id = NULL)
 {
     if (isset($id)) {
         $usuario = Usuario::find($id);
         $perfiles = Perfil::all()->lists('nombre', 'id');
         $hoteles = Hotel::all()->lists('nombre', 'id');
         $personas = Persona::all()->lists('nombre', 'id');
         return View::make('usuarios.edit', compact('perfiles', 'hoteles', 'personas', 'usuario'));
     } else {
         return Redirect::to('/usuarios');
     }
 }
Beispiel #13
0
 /**
  * Método para crear/modificar un objeto de base de datos
  * 
  * @param string $medthod: create, update
  * @param array $data: Data para autocargar el modelo
  * @param array $optData: Data adicional para autocargar
  * 
  * return object ActiveRecord
  */
 public static function setPerfil($method, $data, $optData = null)
 {
     $obj = new Perfil($data);
     //Se carga los datos con los de las tablas
     if ($optData) {
         //Se carga información adicional al objeto
         $obj->dump_result_self($optData);
     }
     //Verifico que no exista otro perfil, y si se encuentra inactivo lo active
     $conditions = empty($obj->id) ? "perfil = '{$obj->perfil}'" : "perfil = '{$obj->perfil}' AND id != '{$obj->id}'";
     $old = new Perfil();
     if ($old->find_first($conditions)) {
         //Si existe y se intenta crear pero si no se encuentra activo lo activa
         if ($method == 'create' && $old->estado != Perfil::ACTIVO) {
             $obj->id = $old->id;
             $obj->estado = Perfil::ACTIVO;
             $method = 'update';
         } else {
             Flash::info('Ya existe un perfil registrado bajo ese nombre.');
             return FALSE;
         }
     }
     return $obj->{$method}() ? $obj : FALSE;
 }
Beispiel #14
0
 function manter($id = null)
 {
     $dados = array();
     if (!is_null($id)) {
         $us = new Usuario();
         $dados['dados'] = $us->getById($id);
     }
     $ca = new Cargo();
     $dados['cargos'] = $ca->buscarCargos();
     $de = new Departamento();
     $dados['departamentos'] = $de->buscarDepartamentos();
     $pe = new Perfil();
     $dados['perfis'] = $pe->buscarPerfis();
     $this->layout = 'default';
     //informa qual template utilizar para carregar a view dentro
     $this->title = '::: SAD-360 :::';
     //informa o titulo da pagina
     $this->css = array('Template/template');
     //informa o arquivo css a ser carregado com layout da pagina
     $this->js = array('Usuario/manter');
     //informa o arquivo js com scripts de execução da pagina
     $this->load->view('Usuario/manter', $dados);
     //carrega a view
 }
 public static function Authenticate($email, $password, $level_required)
 {
     $perfil = Perfil::with('user')->where('email', '=', $email)->get();
     if (count($perfil) == 0) {
         return false;
     } else {
         $salt = $perfil[0]->user->salt;
         $hash = hash('sha256', $password . $salt);
         if ($hash == $perfil[0]->user->passwd) {
             self::loadProfil($perfil[0]->user);
             if (self::checkAccessRights($level_required)) {
                 return true;
             } else {
                 return false;
             }
         } else {
             return false;
         }
     }
 }
Beispiel #16
0
 /**
  * Faz o login caso o email e senha estejam corretos
  * @param string $email
  * @param string $password
  * @return boolean
  */
 public function login($email, $password)
 {
     $this->logout();
     $db = Zend_Db_Table::getDefaultAdapter();
     $authAdapter = new Zend_Auth_Adapter_DbTable($db, 'usuario', 'email', 'senha', 'md5(?)');
     //$email    = $db->quote($email, 'string');
     //$password = $db->quote($password, 'string');
     $authAdapter->setIdentity($email)->setCredential($password);
     $result = $authAdapter->authenticate();
     if ($result->isValid()) {
         $oIdentify = $authAdapter->getResultRowObject(null, 'senha');
         // @FIXME Gravar registros em cache
         $codigoPerfil = Perfil::build()->find($oIdentify->perfil_id)->current()->codigo;
         $oIdentify->sRole = $codigoPerfil;
         $auth = Zend_Auth::getInstance();
         $auth->getStorage()->write($oIdentify);
         return true;
     }
     return false;
 }
Beispiel #17
0
 public function selectFull()
 {
     $sql = "select * from perfil";
     $result = $this->retrieve($sql);
     $lista = array();
     while ($qr = mysqli_fetch_array($result)) {
         $prf = new Perfil();
         $prf->setPrf_id($qr["prf_id"]);
         $prf->setPrf_perfil($qr["prf_perfil"]);
         $prf->setPrf_url($qr["url"]);
         $prf->setPrf_pagina($qr["pagina"]);
         array_push($lista, $prf);
     }
     return $lista;
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Perfil::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Beispiel #19
0
<script type="text/javascript" src="js/dirhac_parroquia.js"></script>
<?php 
require_once "../class/class_perfil.php";
$perfil = new Perfil();
$perfil->codigo_perfil($_SESSION['user_codigo_perfil']);
$perfil->url('parroquia');
$a = $perfil->IMPRIMIR_OPCIONES();
// el arreglo $a contiene las opciones del menú.
if (!isset($_GET['Opt'])) {
    // Ventana principal -> Paginación
    require_once '../class/class_bd.php';
    $pgsql = new Conexion();
    $sql = "SELECT e.codigo_parroquia, e.descripcion, p.descripcion AS municipio FROM general.tparroquia e \r\n\tINNER JOIN general.tmunicipio p ON e.codigo_municipio = p.codigo_municipio";
    $consulta = $pgsql->Ejecutar($sql);
    ?>
	<fieldset>
		<legend><center>Vista: PARROQUIA</center></legend>
		<div id="paginador" class="enjoy-css">	
			<div class="container">
				<table cellpadding="0" cellspacing="5" border="0" class="bordered-table zebra-striped" id="registro">
					<thead>
						<tr>
							<th>Código:</th>
							<th>Parroquia:</th>
							<th>Municipio:</th>
							<?php 
    for ($x = 0; $x < count($a); $x++) {
        if ($a[$x]['orden'] == '2' || $a[$x]['orden'] == '5') {
            echo '<th>' . $a[$x]['nombre_opcion'] . '</th>';
        }
    }
Beispiel #20
0



<!-- Modal Preguntar con quien -->
<div id="cita" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Profesional que Atenderá</h3>
  </div>
  <div class="modal-body">
 	<!-- Evaluar politicas de cancelación -->
 	<p>Seleccione el Profesional</p>
 	<center>
 		<?php 
$elPersonal = Perfil::model()->findAll("Estado = 'Activo' and agenda = 'Si'");
foreach ($elPersonal as $el_personal) {
    echo CHtml::submitButton($el_personal->nombre, array('submit' => array('citas/calendario&idpaciente=' . $model->id . '&idpersonal=' . $el_personal->id), 'class' => 'btn btn-success'));
}
?>

	</center>
  </div>  
   <div class="modal-footer">
    <!-- <button class="btn" data-dismiss="modal" aria-hidden="true">Cerrar</button> -->
  </div>
</div>


<!-- Modal Sucesos -->
<div id="suceso" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
Beispiel #21
0
 /**
  *Permite eliminar un usuario con identificador de la base de datos
  *@param   int $idperfil identificador del registro en la base de datos
  *@return  int cantidad de registros modificados
  */
 public function eliminarPerfil($idperfil)
 {
     $unPerfil = new Perfil();
     $resultado = $unPerfil->eliminar($idperfil);
     echo $resultado;
 }
Beispiel #22
0
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Perfil $value A Perfil object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Perfil $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
<?php

/* @var $this CitasController */
/* @var $model Citas */
$this->menu = array(array('label' => 'Listar Citas', 'url' => array('index')), array('label' => 'Buscar Citas', 'url' => array('admin')));
?>

<?php 
if (isset($_GET['idpersonal'])) {
    $npersonal = $_GET['idpersonal'];
    $elpersonal = Perfil::model()->find("id={$npersonal}");
    echo "<h1>Crear Cita - {$elpersonal->nombre}</h1>";
} else {
    echo "<h1>Crear Cita</h1>";
}
?>

<?php 
if (isset($_GET['idpaciente'])) {
    $npaciente = $_GET['idpaciente'];
    $paciente = Paciente::model()->find("id={$npaciente}");
    $nombrePaciente = $paciente->nombre . ' ' . $paciente->apellido;
    echo "<h3>Paciente: <span class='text-error'>{$nombrePaciente}</span></h3>";
    $ruta = "&idpaciente={$npaciente}";
} else {
    $ruta = "";
}
?>


<?php 
<?php

//header('Content-Type: text/html; charset=utf-8');
ob_start();
set_include_path(get_include_path() . PATH_SEPARATOR . "system/modules/perfil/");
require_once '../system/modules/perfil/controller/Perfil.class.php';
$perfil = new Perfil($MunicipioPefil);
?>
<meta name="description" content="" />

<!-- SELETOR UDH -->
<link rel="stylesheet" href="assets/css/filter-search_perfil.css">
<script	src="system/modules/perfil/componentes/seletor-perfil/view/js/filter-search.js"></script>
<script	src="system/modules/perfil/componentes/seletor-perfil/view/js/seletor-espacialidade.js"></script>
<!-- SELETOR UDH -->

<script type="text/javascript">

    $(document).ready(function()
    {
        $('#toolTipPrintDown').tooltip({html: true, delay: 500});
        $("#perfil_title_uf").html(lang_mng.getString("home_titlePerfilUF"));
        $("#perfil_title_m").html(lang_mng.getString("home_titlePerfil"));
        $("#perfil_title_rm").html(lang_mng.getString("home_titlePerfilRM"));        
        $("#perfil_title_udh").html(lang_mng.getString("home_titlePerfilUDH"));

        // readyGo();
    });

</script>
<?php

require_once '../negocio/Perfil.class.php';
$dni = $_POST["dni"];
$objPlanD = new Perfil();
$resultado = $objPlanD->listar($dni);
echo json_encode($resultado);
?>
    
Beispiel #26
0
 function modificar()
 {
     @session_start();
     require 'model/Perfil.class.php';
     //require_once "bd/BD.class.php";
     $objUse = new Usuario();
     $objPro = new Perfil();
     $objDb = Database::getInstance();
     $idUser = $_GET['idUser'];
     //Obtenemos el usuario a modificar
     $single_user = $objUse->single_user($idUser);
     //Obtenemos los perfiles existentes
     $profiles = $objPro->show_profiles();
     //$list_modules = $modulo->show_modules();
     $ruta = $this->view->path('default/page.php');
     //carga la plantilla
     $pagina = $this->view->load_page($ruta);
     ob_start();
     //carga html del listado de los modulos
     include 'views/content/usuario_modificar.php';
     //$contenido = $this->load_page('views/content/modulo_modificar.php');
     if ($single_user != '') {
         //si existen registros carga el modulo en memoria y rellena con los datos
         //carga la tabla de la seccion de VIEW
         $contenido = ob_get_clean();
         //realiza el parseado
         $pagina = $this->view->replace_content('/\\#CONTENIDO\\#/ms', $contenido, $pagina);
     } else {
         //si no existen datos -> muestra mensaje de error
         $pagina = $this->replace_content('/\\#CONTENIDO\\#/ms', '<h1>No existen resultados</h1>', $pagina);
     }
     $pagina = $this->view->load_template('- Validar -', $pagina);
     $this->view->view_page($pagina);
 }
 public function render_edit_user($id = null)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         $data["permisos"] = Session::get('permisos');
         if (in_array('side_nuevo_usuario', $data["permisos"]) && $id) {
             $data["user_info"] = User::searchUserById($id)->get();
             if ($data["user_info"]->isEmpty()) {
                 Session::flash('error', 'No se encontró al usuario.');
                 return Redirect::to('user/list_user');
             }
             $data["user_info"] = $data["user_info"][0];
             $data["tipos_identificacion"] = TipoIdentificacion::lists('nombre', 'idtipo_identificacion');
             $perfiles_usuario = User::getPerfilesPorUsuario2($data["user_info"]->id)->get();
             $perfiles_creacion = Perfil::all();
             $data["perfiles_usuario"] = array();
             $data["perfiles"] = array();
             foreach ($perfiles_usuario as $perfil_usuario) {
                 $data["perfiles_usuario"][] = $perfil_usuario->idperfiles;
             }
             foreach ($perfiles_creacion as $perfil_creacion) {
                 $data["perfiles"][] = array('idperfiles' => $perfil_creacion->idperfiles, 'nombre' => $perfil_creacion->nombre);
             }
             return View::make('user/editUser', $data);
         } else {
             // Llamo a la función para registrar el log de auditoria
             $descripcion_log = "Se intentó acceder a la ruta '" . Request::path() . "' por el método '" . Request::method() . "'";
             Helpers::registrarLog(10, $descripcion_log);
             Session::flash('error', 'Usted no tiene permisos para realizar dicha acción.');
             return Redirect::to('/dashboard');
         }
     } else {
         return View::make('error/error');
     }
 }
Beispiel #28
0
<script type="text/javascript" src="js/dirhac_tipo_persona.js"></script>
<?php 
require_once "../class/class_perfil.php";
$perfil = new Perfil();
$perfil->codigo_perfil($_SESSION['user_codigo_perfil']);
$perfil->url('tipo_persona');
$a = $perfil->IMPRIMIR_OPCIONES();
// el arreglo $a contiene las opciones del menú.
if (!isset($_GET['Opt'])) {
    // Ventana principal -> Paginación
    require_once '../class/class_bd.php';
    $pgsql = new Conexion();
    $sql = "SELECT codigo_tipopersona, descripcion, CASE es_usuariosistema WHEN 'Y' THEN 'SÍ' ELSE 'NO' END es_usuariosistema \r\n\tFROM general.ttipo_persona";
    $consulta = $pgsql->Ejecutar($sql);
    ?>
	<fieldset>
		<legend><center>Vista: TIPO PERSONA</center></legend>		
		<div id="paginador" class="enjoy-css"> 
			<div class="container">
				<table cellpadding="0" cellspacing="5" border="0" class="bordered-table zebra-striped" id="registro">
					<thead>
						<tr>
							<th>Código</th>
							<th>Tipo Persona</th>
							<th>¿Es Usuario del Sistema?</th>
							<?php 
    for ($x = 0; $x < count($a); $x++) {
        if ($a[$x]['orden'] == '2' || $a[$x]['orden'] == '5') {
            echo '<th>' . $a[$x]['nombre_opcion'] . '</th>';
        }
    }
 public function download($id)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4 || $data["user"]->idrol == 7 || $data["user"]->idrol == 9 || $data["user"]->idrol == 10 || $data["user"]->idrol == 11 || $data["user"]->idrol == 12) {
             $plan = Perfil::find($id);
             $rutaDestino = $plan->url . $plan->nombre_archivo_encriptado;
             $headers = array('Content-Type', mime_content_type($rutaDestino));
             return Response::download($rutaDestino, basename($plan->nombre_archivo), $headers);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
Beispiel #30
0
	//var_dump($sql);
	//return View::make('principal')->with('data', $data);
	//return Response::json($data);
	return View::make('madison')->with('data', $data);
});*/
Route::get('/madison/data', function () {
    $getData = Input::all();
    $query = $getData['query'];
    $data = DB::select(DB::raw("\n\t\t\t\t\t\t\t\tSELECT \ta.PEOPLE_ID, a.NICKNAME, a.FIRST_NAME, a.LAST_NAME, a.STREET, a.CITY, a.ZIP, a.COUNTRY, \n\t\t\t\t\t\t\t\t\t\ta.PHONE, a.WORK_PHONE, a.MOBILE_PHONE, a.GENDER, a.BIRTHDAY, a.PROFILE_CAPTION, a.EMAIL,\n\n\t\t\t\t\t\t\t\t\t\tb.NAME COUNTRY_NAME, c.NAME GENDER_NAME\n\t\t\t\t\t\t\t\tFROM tpeople a\n\t\t\t\t\t\t\t\tINNER JOIN tcountry b\n\t\t\t\t\t\t\t\tON a.COUNTRY = b.COUNTRY_ID\n\t\t\t\t\t\t\t\tINNER JOIN tgender c\n\t\t\t\t\t\t\t\tON a.GENDER = c.GENDER_ID\n\t\t\t\t\t\t\t\tWHERE CONCAT(a.FIRST_NAME, ' ', a.LAST_NAME) = '{$query}' OR a.EMAIL = '{$query}'\n\t\t\t\t\t\t\t\tOR a.EMAIL = '{$query}'\n\n\t\t\t\t\t\t\t\t"));
    //WHERE a.FIRST_NAME LIKE '%{$query}%'
    //var_dump($sql);
    //return View::make('principal')->with('data', $data);
    if (count($data) > 0) {
        $persona = $data[0];
        $image = null;
        $perfil = new Perfil();
        $perfil->nombre = $persona->FIRST_NAME;
        $perfil->apaterno = $persona->LAST_NAME;
        $perfil->amaterno = '';
        $perfil->confesion = '';
        $perfil->facebook = '';
        $perfil->twitter = '';
        $perfil->instagram = '';
        $perfil->secret = '';
        $perfil->secret_pub = '';
        $perfil->pais = $persona->COUNTRY_NAME;
        $perfil->estado = '';
        $perfil->municipio = '';
        $perfil->ciudad = $persona->CITY;
        $perfil->colonia = $persona->STREET;
        $perfil->mascaras = '';