public static function listUser() { $allUser = Admin_User::all(); $datagrid = new Datagrid(); $datagrid->setFields(array('userprofile/fullname' => 'Fullname')); $datagrid->setFields(array('userprofile/emel' => 'Email')); $datagrid->setFields(array('userprofile/icno' => 'IC Number')); $datagrid->setFields(array('status' => 'Status')); $datagrid->setAction('view', 'deleteRole', true, array('userid')); $datagrid->setAction('reset', 'deleteRole', true, array('userid')); $datagrid->setTable('users', 'table table-bordered table-hover table-striped table-condensed'); $datagrid->build($allUser, 'userid'); return $datagrid->render(); }
public static function listRole() { Bundle::start('datagrid'); $rolelist = Admin_UserRole::where('roleid', '<>', 1)->get(); $datagrid = new Datagrid(); $datagrid->setFields(array('roleid' => 'Role Id', 'role' => 'User Role Description')); $datagrid->setAction('edit', 'editRoleModal', true, array('roleid')); //false,array('id'=>'roleid','data-toggle'=>'modal')); $datagrid->setAction('delete', 'deleteRole', true, array('roleid')); $datagrid->setContainer('list01', 'span12'); $datagrid->setTable('users', 'table table-bordered table-hover table-striped table-condensed'); $datagrid->build($rolelist, 'roleid'); return $datagrid->render(); }
public static function listDetailsHistory($claimsId) { $allClaims = Claims_App::find($claimsId)->detail()->paginate(10); $datagrid = new Datagrid(); $datagrid->setFields(array('detaildate' => 'Date')); $datagrid->setFields(array('detaildesc' => 'Description')); $datagrid->setFields(array('detailfrom' => 'Distance From')); $datagrid->setFields(array('detailto' => 'Distance To')); $datagrid->setFields(array('detailmile' => 'Milage')); $datagrid->setFields(array('detailtoll' => 'Toll')); $datagrid->setFields(array('detailpark' => 'Parking')); $datagrid->setAction('receipt', 'uploadResit', true, array('claimdetailid')); $datagrid->setTable('claimsDetails', 'table table-bordered table-hover table-striped table-condensed'); $datagrid->build($allClaims, 'claimdetailid'); return $datagrid->render(); }
function filteredgrid() { $this->rapyd->load("datafilter", "datagrid"); function rtrunc($forma) { $pos = strpos($forma, "\r\n"); return substr($forma, 0, $pos); } $filter = new DataFilter("Filtro de Busqueda"); $filter->db->select(array("forma", 'nombre')); $filter->db->from("formatos"); $filter->db->orderby("nombre"); //$filter->db->where("forma LIKE"); $filter->nombre = new inputField("Nombre", "nombre"); $filter->nombre->size = 20; $filter->forma = new inputField("Forma", "forma"); $filter->forma->size = 20; $filter->buttons("reset", "search"); $filter->build(); $form = new DataForm("supervisor/puertosdir/filteredgrid/process"); $form->puerto = new inputField("Nuevo Puerto", "puerto"); $form->puerto->rule = "required"; $form->submit("btnsubmit", "Cambiar"); $form->build_form(); if ($form->on_success()) { echo 'pasamos'; } $grid = new Datagrid("Resultados"); $grid->use_function('rtrunc'); $link = site_url('/supervisor/acdatasis/activar'); $grid->per_page = 15; $grid->column("Nombre", "nombre"); $grid->column("Dirigido", "<rtrunc><#forma#></rtrunc>", 'align="center"'); $grid->build(); //echo $grid->db->last_query(); $ssql = json_encode($grid->db->last_query()); $data['script'] = "<script type='text/javascript'>\n\t\t\t\$(document).ready(function() {\n\t\t\t\tsql={$ssql};\n\t\t\t\t\n\t\t\t});\n\t\t\t</script>"; $data['content'] = $filter->output . $form->output . $grid->output; $data['title'] = "<h1>Redirección de puertos en formatos DataSIS</h1>"; $data["head"] = script("jquery.js") . $this->rapyd->get_head(); $this->load->view('view_ventanas', $data); }
function copia($usua = null) { $this->rapyd->load("datafilter", "datagrid"); $usuario = $usua; function ractivo($acceso, $codigo) { if ($acceso == 'S') { $retorna = form_checkbox($codigo, 'accept', TRUE); } else { $retorna = form_checkbox($codigo, 'accept', FALSE); } return $retorna; } $filter = new DataFilter(""); $filter->db->select(array("b.modulo", 'b.codigo', "a.usuario", "a.usuario as value", "a.acceso", "b.titulo")); $filter->db->from("sida AS a"); $filter->db->join("tmenus AS b", "a.modulo=b.codigo"); $filter->db->orderby("b.modulo"); $filter->usuario = new dropdownField("Copiar de", "usuario"); $filter->usuario->options("Select us_codigo as value,CONCAT_WS(' - ', us_codigo, us_nombre) as codigo from usuario group by us_codigo"); $filter->usuario->style = 'width:250px;'; $filter->buttons("reset", "search"); $filter->build(); if ($this->rapyd->uri->is_set("search") and $filter->is_valid()) { $usr = $filter->usuario->newValue; $mSQL = "INSERT IGNORE INTO sida SELECT '{$usr}',b.codigo,'N' FROM sida AS a RIGHT JOIN tmenus AS b ON a.modulo=b.codigo AND a.usuario='{$usr}' WHERE a.modulo IS NULL"; $this->db->simple_query($mSQL); $copiar = anchor("supervisor/acdatasis/copiar/{$usr}/{$usuario}", 'Copiar'); $grid = new Datagrid("Resultados"); $grid->use_function('ractivo'); $link = site_url('/supervisor/acdatasis/activar'); //$grid->per_page = 15; $grid->column("Módulo", "modulo"); $grid->column("Nombre", "titulo"); $grid->column("Acceso", "<ractivo><#acceso#>|<#codigo#>|</ractivo>", 'align="center"'); $grid->build(); $tabla = $copiar . $grid->output; //echo $grid->db->last_query(); $url = site_url('supervisor/acdatasis/activar'); $data['script'] = '<script type="text/javascript"> $(document).ready(function() { $("form :checkbox").click(function () { usr=$("#usuario").attr("value"); $.ajax({type: "POST", url: "' . $url . '", data: "codigo="+this.name+"&usuario="+usr, success: function(msg){ if (msg==0) alert("Ocurrio un problema"); } }); }).change(); }); </script>'; } else { $tabla = ''; } $data['content'] = ' Usuario:' . $usuario . $filter->output . form_open('') . $tabla . form_close(); $data['title'] = "<h1>Copiar Accesos de Usuario en DataSIS</h1>"; $data["head"] = script("jquery.js") . $this->rapyd->get_head(); $this->load->view('view_ventanas', $data); }