示例#1
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>";
 }
示例#2
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>';
        }
    }
示例#3
0
if (isset($_POST['lOpt'])) {
    $lOpt = trim($_POST['lOpt']);
}
if (isset($_POST['codigo_perfil'])) {
    $codigo_perfil = trim($_POST['codigo_perfil']);
}
if (isset($_POST['codigo_configuracion'])) {
    $codigo_configuracion = trim($_POST['codigo_configuracion']);
}
if (isset($_POST['nombre_perfil'])) {
    $nombre_perfil = trim($_POST['nombre_perfil']);
}
include_once "../class/class_perfil.php";
$perfil = new Perfil();
if ($lOpt == 'Registrar') {
    $perfil->codigo_perfil($codigo_perfil);
    $perfil->codigo_configuracion($codigo_configuracion);
    $perfil->nombre_perfil($nombre_perfil);
    if (!$perfil->Comprobar($comprobar)) {
        if ($perfil->Registrar($_SESSION['user_name'])) {
            $confirmacion = 1;
            if (isset($_POST['modulos']) && isset($_POST['servicios']) && isset($_POST['opciones'])) {
                $perfil->ELIMINAR_OPCION_SERVICIO_PERFIL();
                $perfil->INSERTAR_OPCION_SERVICIO_PERFIL($_SESSION['user_name'], $_POST['modulos'], $_POST['servicios'], $_POST['opciones']);
            }
        } else {
            $confirmacion = -1;
        }
    } else {
        if ($perfil->estatus() == 1) {
            $confirmacion = 0;