/** * * Enter description here ... * @param unknown_type $form */ public static function checkPermission($form) { if (!Forms::isAllowed($form)) { echo "Acceso Denegado."; return false; } return true; }
<p class="form-title">Listado de Clientes</p> <?php if (!Forms::isAllowed(FORM_CUSTOMER_LIST)) { return; } require 'inc/class.customer.php'; require 'inc/class.formatter.php'; $sortBy = isset($_GET['sort_by']) ? $_GET['sort_by'] : ""; $sortOrder = isset($_GET['sort_dir']) ? strtolower($_GET['sort_dir']) : ""; if (!$sortBy || !Customer::isField($sortBy)) { $sortBy = "name"; } if (!$sortOrder) { $sortOrder = "a"; } $customers = Customer::getAll($sortBy, $sortOrder == "d" ? "DESC" : "ASC"); ?> <table class="default"> <thead> <tr> <th style="width:27em"><a href="<?php echo Forms::getLink(FORM_CUSTOMER_LIST, Forms::getSort($sortBy, Customer::fieldName("name"), $sortOrder)); ?> ">Nombre</a></th> <th style="width:8em"><a href="<?php echo Forms::getLink(FORM_CUSTOMER_LIST, Forms::getSort($sortBy, Customer::fieldName("nit"), $sortOrder)); ?> ">NIT</a></th> <th><a href="<?php echo Forms::getLink(FORM_CUSTOMER_LIST, Forms::getSort($sortBy, Customer::fieldName("phone"), $sortOrder)); ?>
<tr> <td class="label">Dirección:</td> <td><?php echo $customer->address; ?> </td> </tr> <tr> <td class="label">E-Mail:</td> <td><?php echo $customer->email; ?> </td> </tr> </tbody> </table> <br /> <?php if (Forms::isAllowed(FORM_CUSTOMER_EDIT)) { $params = array("customer" => "{$customerid}"); echo "<a href='" . Forms::getLink(FORM_CUSTOMER_EDIT, $params) . "' id='edit'>Editar Infomación</a>"; } } ?> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery('#edit').button({ icons: {primary: 'ui-icon-pencil'} }) }) </script>