public function getIndex() { if ($this->access['is_view'] == 0) { return Redirect::to('')->with('message', SiteHelpers::alert('error', ' Your are not allowed to access the page ')); } // Filter sort and order for query $sort = !is_null(Input::get('sort')) ? Input::get('sort') : ''; $order = !is_null(Input::get('order')) ? Input::get('order') : 'asc'; // End Filter sort and order for query // Filter Search for query $filter = !is_null(Input::get('search')) ? $this->buildSearch() : ''; // End Filter Search for query $page = Input::get('page', 1); $params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0); // Get Query $results = $this->model->getRows($params); // Build pagination setting $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1; $pagination = Paginator::make($results['rows'], $results['total'], $params['limit']); $this->data['rowData'] = $results['rows']; // Build Pagination $this->data['pagination'] = $pagination; // Build pager number and append current param GET $this->data['pager'] = $this->injectPaginate(); // Row grid Number $this->data['i'] = $page * $params['limit'] - $params['limit']; // Grid Configuration $this->data['tableGrid'] = $this->info['config']['grid']; $this->data['tableForm'] = $this->info['config']['forms']; $this->data['colspan'] = SiteHelpers::viewColSpan($this->info['config']['grid']); // Group users permission $this->data['access'] = $this->access; // Render into template $this->layout->nest('content', 'rinvoices.index', $this->data)->with('menus', SiteHelpers::menus()); }
public function getIndex() { if ($this->access['is_view'] == 0) { return Redirect::to('')->with('message', SiteHelpers::alert('error', ' Your are not allowed to access the page ')); } // Filter sort and order for query $sort = !is_null(Input::get('sort')) ? Input::get('sort') : 'id'; $order = !is_null(Input::get('order')) ? Input::get('order') : 'asc'; // End Filter sort and order for query // Filter Search for query $filter = !is_null(Input::get('search')) ? $this->buildSearch() : ''; // End Filter Search for query $filter .= " AND id !='1' AND tb_groups.level >= " . Session::get('gid') . ""; $page = Input::get('page', 1); $params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter); // Get Query $results = $this->model->getRows($params); $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1; $pagination = Paginator::make($results['rows'], $results['total'], $params['limit']); $this->data['rowData'] = $results['rows']; $this->data['pagination'] = $pagination; $this->data['pager'] = $this->injectPaginate(); $this->data['i'] = $page * $params['limit'] - $params['limit']; $this->data['tableGrid'] = $this->info['config']['grid']; $this->data['tableForm'] = $this->info['config']['forms']; $this->data['colspan'] = SiteHelpers::viewColSpan($this->info['config']['grid']); $this->data['access'] = $this->access; $this->layout->nest('content', 'users.index', $this->data)->with('menus', SiteHelpers::menus()); }
public function __construct() { $this->menus = SiteHelpers::menus(); $this->sidebar = SiteHelpers::menus('sidebar'); $driver = Config::get('database.default'); $database = Config::get('database.connections'); $this->db = $database[$driver]['database']; }
public function getIndex() { if ($this->access['is_view'] == 0) { return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric'))); } // Filter sort and order for query $sort = !is_null(Input::get('sort')) ? Input::get('sort') : 'advertise_id'; $order = !is_null(Input::get('order')) ? Input::get('order') : 'asc'; // End Filter sort and order for query // Filter Search for query $filter = !is_null(Input::get('search')) ? $this->buildSearch() : ''; $filter .= " AND lang = '{$this->lang}'"; // End Filter Search for query // Take param master detail if any $master = $this->buildMasterDetail(); // append to current $filter $filter .= $master['masterFilter']; $page = Input::get('page', 1); $params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0); // Get Query $results = $this->model->getRows($params); // Build pagination setting $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1; $pagination = Paginator::make($results['rows'], $results['total'], $params['limit']); $test = $this->model->columnTable(); $arr_search = SiteHelpers::arraySearch(Input::get('search')); foreach ($arr_search as $key => $val) { if ($key != "sort" && $key != "order" && $key != "rows") { $test[$key]['value'] = $val; } } $this->data['test'] = $test; $this->data['rowData'] = $results['rows']; // Build Pagination $this->data['pagination'] = $pagination; // Build pager number and append current param GET $this->data['pager'] = $this->injectPaginate(); // Row grid Number $this->data['i'] = $page * $params['limit'] - $params['limit']; // Grid Configuration $this->data['tableGrid'] = $this->info['config']['grid']; $this->data['tableForm'] = $this->info['config']['forms']; $this->data['colspan'] = SiteHelpers::viewColSpan($this->info['config']['grid']); // Group users permission $this->data['access'] = $this->access; // Detail from master if any $this->data['masterdetail'] = $this->masterDetailParam(); $this->data['details'] = $master['masterView']; // Master detail link if any $this->data['subgrid'] = isset($this->info['config']['subgrid']) ? $this->info['config']['subgrid'] : array(); // Render into template $this->layout->nest('content', 'advertise.index', $this->data)->with('menus', SiteHelpers::menus()); }
public function getIndex($id = null) { //$id = ($id == null ? '' : SiteHelpers::encryptID($id,true)) ; $pos = !is_null(Input::get('pos')) ? Input::get('pos') : 'top'; $row = $this->model->find($id); if ($row) { $this->data['row'] = $row; } else { $this->data['row'] = $this->model->getColumnTable('tb_menu'); } $this->data['menus'] = SiteHelpers::menus($pos, 'all'); $this->data['modules'] = DB::table('tb_module')->where('module_type', '!=', 'core')->get(); //$this->data['groups'] = DB::select(" SELECT * FROM tb_groups "); $this->data['pages'] = DB::select(" SELECT * FROM tb_pages where lang = '{$this->lang}'"); $this->data['active'] = $pos; $this->layout->nest('content', 'menu.index', $this->data)->with('menus', SiteHelpers::menus()); }
function getConfig($id) { $row = DB::table('tb_module')->where('module_name', $id)->get(); if (count($row) <= 0) { return Redirect::to($this->module)->with('message', SiteHelpers::alert('error', Lang::get('core.not_found_module'))); } $row = $row[0]; $this->data['row'] = $row; $this->data['module'] = $this->module; $this->data['module_name'] = $row->module_name; $config = SiteHelpers::CF_decode_json($row->module_config); $tasks = array('is_global' => 'Global ', 'is_view' => 'View ', 'is_detail' => 'Detail', 'is_add' => 'Add ', 'is_edit' => 'Edit ', 'is_remove' => 'Remove ', 'is_excel' => 'Excel '); /* Update permission global / own access new ver 1.1 Adding new param is_global End Update permission global / own access new ver 1.1 */ if (isset($config['tasks'])) { foreach ($config['tasks'] as $row) { $tasks[$row['item']] = $row['title']; } } $this->data['tasks'] = $tasks; $this->data['groups'] = DB::table('tb_groups')->get(); $access = array(); foreach ($this->data['groups'] as $r) { // $GA = $this->model->gAccessss($this->uri->rsegment(3),$row['group_id']); $group = $r->group_id != null ? "and group_id ='" . $r->group_id . "'" : ""; $GA = DB::select("SELECT * FROM tb_groups_access where module_id ='" . $row->module_id . "' {$group}"); if (count($GA) >= 1) { $GA = $GA[0]; } $access_data = isset($GA->access_data) ? json_decode($GA->access_data, true) : array(); $rows = array(); //$access_data = json_decode($AD,true); $rows['group_id'] = $r->group_id; $rows['group_name'] = $r->name; foreach ($tasks as $item => $val) { $rows[$item] = isset($access_data[$item]) && $access_data[$item] == 1 ? 1 : 0; } $access[$r->name] = $rows; } $this->data['access'] = $access; $this->data['groups_access'] = DB::select("select * from tb_groups_access where module_id ='" . $row->module_id . "'"); $this->layout->nest('content', 'admin.permission.config', $this->data)->with('menus', SiteHelpers::menus()); }
public function getIndex(Request $request, $id = null) { $pos = !is_null($request->input('pos')) ? $request->input('pos') : 'top'; $row = \DB::table('tb_menu')->where('menu_id', $id)->get(); if (count($row) >= 1) { $rows = $row[0]; $this->data['row'] = (array) $rows; $this->data['menu_lang'] = json_decode($rows->menu_lang, true); } else { $this->data['row'] = array('menu_id' => '', 'parent_id' => '', 'menu_name' => '', 'menu_type' => '', 'url' => '', 'module' => '', 'position' => '', 'menu_icons' => '', 'active' => '', 'allow_guest' => '', 'access_data' => ''); $this->data['menu_lang'] = array(); } //echo '<pre>';print_r($this->data);echo '</pre>'; exit; $this->data['menus'] = \SiteHelpers::menus($pos, 'all'); $this->data['modules'] = \DB::table('tb_module')->where('module_type', '!=', 'core')->get(); $this->data['groups'] = \DB::select(" SELECT * FROM tb_groups "); $this->data['pages'] = \DB::select(" SELECT * FROM tb_pages "); $this->data['active'] = $pos; return view('sximo.menu.index', $this->data); }
public function index($id = null) { $pos = $this->input->get('pos') != '' ? $this->input->get('pos') : 'top'; $rows = $this->db->get_where('tb_menu', array('menu_id' => $id)); if (count($rows->result()) >= 1) { $row = $rows->result_array(); $this->data['row'] = $row[0]; $this->data['menu_lang'] = json_decode($this->data['row']['menu_lang'], true); } else { $this->data['row'] = $this->model->getColumnTable('tb_menu'); $this->data['menu_lang'] = array(); } //echo '<pre>';print_r($this->data['row']);echo '</pre>';exit; $this->data['menus'] = SiteHelpers::menus($pos, 'all'); $this->data['modules'] = $this->db->query("SELECT * FROM tb_module WHERE module_type !='core'")->result(); $this->data['groups'] = $this->db->get('tb_groups'); $this->data['pages'] = $this->db->get('tb_pages'); $this->data['active'] = $pos; $this->data['content'] = $this->load->view('sximo/menu/index', $this->data, true); $this->load->view('layouts/main', $this->data); }
public function getIndex() { if ($this->access['is_view'] == 0) { return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric'))); } // Filter sort and order for query $sort = !is_null(Input::get('sort')) ? Input::get('sort') : 'id'; $order = !is_null(Input::get('order')) ? Input::get('order') : 'asc'; // End Filter sort and order for query // Filter Search for query $filter = !is_null(Input::get('search')) ? $this->buildSearch() : ''; // End Filter Search for query $filter .= " AND id !='1' "; $page = Input::get('page', 1); $params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter); // Get Query $results = $this->model->getRows($params); $page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1; $pagination = Paginator::make($results['rows'], $results['total'], $params['limit']); $test = $this->model->columnTable(); $arr_search = SiteHelpers::arraySearch(Input::get('search')); foreach ($arr_search as $key => $val) { if ($key != "sort" && $key != "order" && $key != "rows") { $test[$key]['value'] = $val; } } $this->data['test'] = $test; $this->data['rowData'] = $results['rows']; $this->data['pagination'] = $pagination; $this->data['pager'] = $this->injectPaginate(); $this->data['i'] = $page * $params['limit'] - $params['limit']; $this->data['tableGrid'] = $this->info['config']['grid']; $this->data['tableForm'] = $this->info['config']['forms']; $this->data['colspan'] = SiteHelpers::viewColSpan($this->info['config']['grid']); $this->data['access'] = $this->access; $this->layout->nest('content', 'users.index', $this->data)->with('menus', SiteHelpers::menus()); }
function getShow($id = null) { if ($this->access['is_detail'] == 0) { return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric'))); } $ids = is_numeric($id) ? $id : SiteHelpers::encryptID($id, true); $row = $this->model->getRow($ids); if ($row) { $this->data['row'] = $row; } else { $this->data['row'] = $this->model->getColumnTable('slideshow'); } $this->data['masterdetail'] = $this->masterDetailParam(); $this->data['id'] = $id; $this->data['access'] = $this->access; $this->layout->nest('content', 'Slideshow.view', $this->data)->with('menus', SiteHelpers::menus()); }
<?php $sidebar = SiteHelpers::menus('sidebar'); ?> <nav role="navigation" class="navbar-default navbar-static-side"> <div class="sidebar-collapse"> <ul id="sidemenu" class="nav expanded-menu"> <li class="logo-header" > <a class="navbar-brand" href="{{ URL::to('dashboard')}}"> @if(file_exists(public_path().'/sximo/images/'.CNF_LOGO) && CNF_LOGO !='') <img src="{{ asset('sximo/images/'.CNF_LOGO)}}" alt="{{ CNF_APPNAME }}" /> @else <img src="{{ asset('sximo/images/logo.png')}}" alt="{{ CNF_APPNAME }}" /> @endif </a> </li> <li class="nav-header"> <div class="dropdown profile-element" style="text-align:center;"> <span> {!! SiteHelpers::avatar() !!} </span> <a href="{{ URL::to('user/profile') }}" > <span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">{{ Session::get('fid') }}</strong> <br /> {{ Lang::get('core.lastlogin') }} : <br /> <small>{{ date("H:i F j, Y", strtotime(Session::get('ll'))) }}</small> </span> </span> </a> </div> <div class="photo-header "> {!! SiteHelpers::avatar( 40 ) !!} </div> </li> @foreach ($sidebar as $menu)
public function getProfile() { if (!Auth::check()) { return Redirect::to('user/login'); } $user_id = Auth::user()->id; $info = User::find($user_id); $this->data = array('pageTitle' => 'My Profile', 'pageNote' => 'View Detail My Info', 'info' => $info); $this->layout = View::make('layouts.main'); $this->layout->nest('content', 'user.profile', $this->data)->with('menus', SiteHelpers::menus()); }
function getSub($id = '') { $row = DB::table('tb_module')->where('module_name', $id)->get(); if (count($row) <= 0) { return Redirect::to($this->module)->with('messagetext', 'Can not find module')->with('msgstatus', 'error'); } $row = $row[0]; $config = SiteHelpers::CF_decode_json($row->module_config); $this->data['row'] = $row; $this->data['fields'] = $config['grid']; $this->data['subs'] = isset($config['subgrid']) ? $config['subgrid'] : array(); $this->data['tables'] = Module::getTableList($this->db); $this->data['module'] = $this->module; $this->data['module_name'] = $id; $this->data['modules'] = Module::all(); $this->layout->nest('content', 'admin.module.ConfigSub', $this->data)->with('menus', SiteHelpers::menus()); }
<?php $menus = SiteHelpers::menus('top'); ?> <ul class="nav navbar-nav navbar-collapse collapse navbar-right" id="topmenu"> <?php foreach ($menus as $menu) { ?> <li class="<?php if ($this->uri->segment(1) == $menu['module']) { echo 'active'; } ?> " > <a <?php if ($menu['menu_type'] == 'external') { ?> href="<?php echo $menu['url']; ?> " <?php } else { ?> href="<?php echo site_url($menu['module']); ?> " <?php }