本文整理汇总了PHP中page_url函数的典型用法代码示例。如果您正苦于以下问题:PHP page_url函数的具体用法?PHP page_url怎么用?PHP page_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了page_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$this->template->setTitle($this->lang->line('text_title'));
$this->template->setHeading($this->lang->line('text_heading'));
$this->template->setButton($this->lang->line('button_new'), array('class' => 'btn btn-primary', 'href' => page_url() . '/edit'));
$this->template->setButton($this->lang->line('button_delete'), array('class' => 'btn btn-danger', 'onclick' => 'confirmDelete();'));
if ($this->input->post('delete') and $this->_deleteTemplate() === TRUE) {
redirect('mail_templates');
}
$results = $this->Mail_templates_model->getList();
$data['templates'] = array();
foreach ($results as $result) {
if ($result['template_id'] !== $this->config->item('mail_template_id')) {
$default = site_url('mail_templates?default=1&template_id=' . $result['template_id']);
} else {
$default = '1';
}
$data['templates'][] = array('template_id' => $result['template_id'], 'name' => $result['name'], 'date_added' => mdate('%d %M %y - %H:%i', strtotime($result['date_added'])), 'date_updated' => mdate('%d %M %y - %H:%i', strtotime($result['date_updated'])), 'status' => $result['status'] === '1' ? $this->lang->line('text_enabled') : $this->lang->line('text_disabled'), 'default' => $default, 'edit' => site_url('mail_templates/edit?id=' . $result['template_id']));
}
if ($this->input->get('default') === '1' and $this->input->get('template_id')) {
$template_id = $this->input->get('template_id');
if ($this->Settings_model->addSetting('prefs', 'mail_template_id', $template_id, '0')) {
$this->alert->set('success', $this->lang->line('alert_set_default'));
}
redirect('mail_templates');
}
$this->template->render('mail_templates', $data);
}
示例2: index
public function index()
{
$url = '?';
$filter = array();
if ($this->input->get('page')) {
$filter['page'] = (int) $this->input->get('page');
} else {
$filter['page'] = '';
}
if ($this->config->item('page_limit')) {
$filter['limit'] = $this->config->item('page_limit');
}
if ($this->input->get('filter_search')) {
$filter['filter_search'] = $data['filter_search'] = $this->input->get('filter_search');
$url .= 'filter_search=' . $filter['filter_search'] . '&';
} else {
$data['filter_search'] = '';
}
if ($this->input->get('sort_by')) {
$filter['sort_by'] = $data['sort_by'] = $this->input->get('sort_by');
} else {
$filter['sort_by'] = $data['sort_by'] = 'category_id';
}
if ($this->input->get('order_by')) {
$filter['order_by'] = $data['order_by'] = $this->input->get('order_by');
$data['order_by_active'] = $this->input->get('order_by') . ' active';
} else {
$filter['order_by'] = $data['order_by'] = 'ASC';
$data['order_by_active'] = 'ASC';
}
$this->template->setTitle($this->lang->line('text_title'));
$this->template->setHeading($this->lang->line('text_heading'));
$this->template->setButton($this->lang->line('button_new'), array('class' => 'btn btn-primary', 'href' => page_url() . '/edit'));
$this->template->setButton($this->lang->line('button_delete'), array('class' => 'btn btn-danger', 'onclick' => '$(\'#list-form\').submit();'));
$order_by = (isset($filter['order_by']) and $filter['order_by'] == 'ASC') ? 'DESC' : 'ASC';
$data['sort_name'] = site_url('categories' . $url . 'sort_by=name&order_by=' . $order_by);
$data['sort_priority'] = site_url('categories' . $url . 'sort_by=priority&order_by=' . $order_by);
$data['sort_id'] = site_url('categories' . $url . 'sort_by=category_id&order_by=' . $order_by);
$results = $this->Categories_model->getList($filter);
$data['categories'] = array();
foreach ($results as $result) {
//load categories data into array
$data['categories'][] = array('category_id' => $result['category_id'], 'name' => $result['name'], 'parent_id' => $result['parent_id'], 'priority' => $result['priority'], 'description' => substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..', 'edit' => site_url('categories/edit?id=' . $result['category_id']));
}
if ($this->input->get('sort_by') and $this->input->get('order_by')) {
$url .= 'sort_by=' . $filter['sort_by'] . '&';
$url .= 'order_by=' . $filter['order_by'] . '&';
}
$config['base_url'] = site_url('categories' . $url);
$config['total_rows'] = $this->Categories_model->getCount($filter);
$config['per_page'] = $filter['limit'];
$this->pagination->initialize($config);
$data['pagination'] = array('info' => $this->pagination->create_infos(), 'links' => $this->pagination->create_links());
if ($this->input->post('delete') and $this->_deleteCategory() === TRUE) {
redirect('categories');
}
$this->template->setPartials(array('header', 'footer'));
$this->template->render('categories', $data);
}
示例3: onlogView
function onlogView($msg = '', $ty = '')
{
$action = "index.php?admin_log/logView";
$hasLogViewPrivilege = $_ENV['menu']->checkPermission($this->ask_login_name, $_SERVER['QUERY_STRING'], "logView");
$hasLogViewPrivilege['url'] = "?admin_main";
$hasLogViewPrivilege['return'] = true;
!$hasLogViewPrivilege['return'] && __msg($hasLogViewPrivilege);
$LogTypeList = $this->ask_config->getLogType();
$operator_list = $_ENV['operator']->getList(0, 0);
$ConditionList['StartDate'] = isset($this->post['StartDate']) ? $this->post['StartDate'] : (isset($this->get[2]) ? $this->get[2] : date("Y-m-d", time()));
$ConditionList['EndDate'] = isset($this->post['EndDate']) ? $this->post['EndDate'] : (isset($this->get[3]) ? $this->get[3] : date("Y-m-d", time()));
$ConditionList['EndDate'] = min($ConditionList['EndDate'], date("Y-m-d", time()), date("Y-m-t", strtotime($ConditionList['StartDate'])));
$ConditionList['operatorId'] = isset($this->post['operatorId']) ? intval(urldecode($this->post['operatorId'])) : (isset($this->get[4]) ? intval(urldecode($this->get[4])) : 0);
$ConditionList['operator'] = !in_array($ConditionList['operatorId'], array(-2, -1, 0)) ? $operator_list[$ConditionList['operatorId']]['login_name'] : $ConditionList['operatorId'];
$ConditionList['QuestionId'] = isset($this->post['QuestionId']) ? intval($this->post['QuestionId']) : (isset($this->get[5]) ? intval($this->get[5]) : 0);
$ConditionList['log_type_id'] = isset($this->post['log_type_id']) ? intval(urldecode($this->post['log_type_id'])) : (isset($this->get[6]) ? intval(urldecode($this->get[6])) : 0);
$ConditionList['AuthorName'] = isset($this->post['AuthorName']) ? trim(urldecode($this->post['AuthorName'])) : (isset($this->get[7]) ? trim(urldecode($this->get[7])) : '');
$ConditionList['log_type'] = $ConditionList['log_type_id'] ? $LogTypeList[$ConditionList['log_type_id']] : $ConditionList['log_type_id'];
@($page = max(1, intval($this->get[8])));
$export = trim($this->get[9]) == "export" ? 1 : 0;
$setting = $this->setting;
if (!$export) {
$pagesize = $this->setting['list_default'];
$pagesize = 20;
$log_list = $_ENV['log']->getLogList($ConditionList, $page, $pagesize);
$departstr = page($log_list['LogCount'], $pagesize, $page, "admin_log/logView/" . $ConditionList['StartDate'] . "/" . $ConditionList['EndDate'] . "/" . urlencode($ConditionList['operatorId']) . "/" . $ConditionList['QuestionId'] . "/" . $ConditionList['log_type_id'] . "/" . urlencode($ConditionList['AuthorName']));
$downloadstr = page_url("<下载EXCEL表格>", "admin_log/logView/" . $ConditionList['StartDate'] . "/" . $ConditionList['EndDate'] . "/" . urlencode($ConditionList['operatorId']) . "/" . $ConditionList['QuestionId'] . "/" . $ConditionList['log_type_id'] . "/" . urlencode($ConditionList['AuthorName']) . "/" . $page . "/export");
$msg && ($message = $msg);
$ty && ($type = $ty);
} else {
set_time_limit(0);
$page = 1;
$pagesize = 1000;
$num = 1;
require TIPASK_ROOT . '/lib/Excel.php';
$oExcel = new Excel();
$FileName = '操作日志表';
$oExcel->download($FileName)->addSheet('日志表');
//标题栏
$title = array("日志ID", "对应问题ID", "用户名", "操作人", "操作时间", "日志内容");
$oExcel->addRows(array($title));
while ($num > 0) {
$log_list = $_ENV['log']->getLogList($ConditionList, $page, $pagesize);
foreach ($log_list['LogList'] as $key => $value) {
$value['message'] = htmlspecialchars_decode($value['message']);
$log_list['LogList'][$key]['message'] = preg_replace("/<(.*?)>/", "", $value['message']);
$excelArr = array("id" => $log_list['LogList'][$key]['id'], "qid" => $log_list['LogList'][$key]['qid'], "AuthorName" => $log_list['LogList'][$key]['AuthorName'], "user" => $log_list['LogList'][$key]['user'], "time" => date("Y-m-d H:i:s", $log_list['LogList'][$key]['time']), "message" => $log_list['LogList'][$key]['message']);
$oExcel->addRows(array($excelArr));
}
$page++;
$num = count($order_list['OrderList']);
}
$oExcel->closeSheet()->close();
}
include template('logview', 'admin');
}
示例4: index
public function index()
{
$url = '?';
$filter = array();
if ($this->input->get('page')) {
$filter['page'] = (int) $this->input->get('page');
} else {
$filter['page'] = '';
}
if ($this->config->item('page_limit')) {
$filter['limit'] = $this->config->item('page_limit');
}
if ($this->input->get('filter_type')) {
$filter['filter_type'] = $data['filter_type'] = $this->input->get('filter_type');
$url .= 'filter_type=' . $filter['filter_type'] . '&';
} else {
$filter['filter_type'] = '';
$data['filter_type'] = '';
}
if ($this->input->get('sort_by')) {
$filter['sort_by'] = $data['sort_by'] = $this->input->get('sort_by');
} else {
$filter['sort_by'] = $data['sort_by'] = 'status_for';
}
if ($this->input->get('order_by')) {
$filter['order_by'] = $data['order_by'] = $this->input->get('order_by');
$data['order_by_active'] = $this->input->get('order_by') . ' active';
} else {
$filter['order_by'] = $data['order_by'] = 'ASC';
$data['order_by_active'] = '';
}
$this->template->setTitle($this->lang->line('text_title'));
$this->template->setHeading($this->lang->line('text_heading'));
$this->template->setButton($this->lang->line('button_new'), array('class' => 'btn btn-primary', 'href' => page_url() . '/edit'));
$this->template->setButton($this->lang->line('button_delete'), array('class' => 'btn btn-danger', 'onclick' => '$(\'#list-form\').submit();'));
$order_by = (isset($filter['order_by']) and $filter['order_by'] == 'ASC') ? 'DESC' : 'ASC';
$data['sort_id'] = site_url('statuses' . $url . 'sort_by=status_id&order_by=' . $order_by);
$data['sort_name'] = site_url('statuses' . $url . 'sort_by=status_name&order_by=' . $order_by);
$data['sort_type'] = site_url('statuses' . $url . 'sort_by=status_for&order_by=' . $order_by);
$data['sort_notify'] = site_url('statuses' . $url . 'sort_by=notify_customer&order_by=' . $order_by);
$data['statuses'] = array();
$results = $this->Statuses_model->getList($filter);
foreach ($results as $result) {
$data['statuses'][] = array('status_id' => $result['status_id'], 'status_name' => $result['status_name'], 'status_comment' => $result['status_comment'], 'status_for' => $result['status_for'] === 'reserve' ? 'Reservations' : ucwords($result['status_for']), 'notify_customer' => $result['notify_customer'] === '1' ? 'Yes' : 'No', 'edit' => site_url('statuses/edit?id=' . $result['status_id']));
}
$config['base_url'] = site_url('statuses' . $url);
$config['total_rows'] = $this->Statuses_model->getCount($filter);
$config['per_page'] = $filter['limit'];
$this->pagination->initialize($config);
$data['pagination'] = array('info' => $this->pagination->create_infos(), 'links' => $this->pagination->create_links());
if ($this->input->post('delete') and $this->_deleteStatus() === TRUE) {
redirect('statuses');
}
$this->template->setPartials(array('header', 'footer'));
$this->template->render('statuses', $data);
}
示例5: action_url
function action_url($class, $method, $current_url = TRUE)
{
$EE =& get_instance();
$EE->db->where(array('class' => $class, 'method' => $method));
$action = $EE->db->get('actions')->row();
$action_id = isset($action->action_id) ? $action->action_id : NULL;
if ($current_url) {
$url = page_url(TRUE, FALSE);
} else {
$url = base_page(TRUE);
}
return $url . '?ACT=' . $action_id;
}
示例6: index
public function index()
{
$url = '?';
$filter = array();
if ($this->input->get('page')) {
$filter['page'] = (int) $this->input->get('page');
} else {
$filter['page'] = '';
}
if ($this->config->item('page_limit')) {
$filter['limit'] = $this->config->item('page_limit');
}
if ($this->input->get('sort_by')) {
$filter['sort_by'] = $data['sort_by'] = $this->input->get('sort_by');
} else {
$filter['sort_by'] = $data['sort_by'] = 'customer_group_id';
}
if ($this->input->get('order_by')) {
$filter['order_by'] = $data['order_by'] = $this->input->get('order_by');
$data['order_by_active'] = $this->input->get('order_by') . ' active';
} else {
$filter['order_by'] = $data['order_by'] = 'DESC';
$data['order_by_active'] = '';
}
$this->template->setTitle($this->lang->line('text_title'));
$this->template->setHeading($this->lang->line('text_heading'));
$this->template->setButton($this->lang->line('button_new'), array('class' => 'btn btn-primary', 'href' => page_url() . '/edit'));
$this->template->setButton($this->lang->line('button_delete'), array('class' => 'btn btn-danger', 'onclick' => '$(\'#list-form\').submit();'));
$order_by = (isset($filter['order_by']) and $filter['order_by'] == 'ASC') ? 'DESC' : 'ASC';
$data['sort_id'] = site_url('customer_groups' . $url . 'sort_by=customer_group_id&order_by=' . $order_by);
$data['customer_group_id'] = $this->config->item('customer_group_id');
$data['customer_groups'] = array();
$results = $this->Customer_groups_model->getList($filter);
foreach ($results as $result) {
$data['customer_groups'][] = array('customer_group_id' => $result['customer_group_id'], 'group_name' => $result['group_name'], 'edit' => site_url('customer_groups/edit?id=' . $result['customer_group_id']));
}
if ($this->input->get('sort_by') and $this->input->get('order_by')) {
$url .= 'sort_by=' . $filter['sort_by'] . '&';
$url .= 'order_by=' . $filter['order_by'] . '&';
}
$config['base_url'] = site_url('customer_groups' . $url);
$config['total_rows'] = $this->Customer_groups_model->getCount($filter);
$config['per_page'] = $filter['limit'];
$this->pagination->initialize($config);
$data['pagination'] = array('info' => $this->pagination->create_infos(), 'links' => $this->pagination->create_links());
if ($this->input->post('delete') and $this->_deleteCustomerGroup() === TRUE) {
redirect('customer_groups');
}
$this->template->render('customer_groups', $data);
}
示例7: index
public function index()
{
$this->template->setTitle($this->lang->line('text_title'));
$this->template->setHeading($this->lang->line('text_heading'));
$this->template->setButton($this->lang->line('button_new'), array('class' => 'btn btn-primary', 'href' => page_url() . '/edit'));
$this->template->setButton($this->lang->line('button_delete'), array('class' => 'btn btn-danger', 'onclick' => '$(\'#list-form\').submit();'));
$this->template->setButton($this->lang->line('button_modules'), array('class' => 'btn btn-default', 'href' => site_url('extensions')));
$data['banners'] = array();
$results = $this->Banners_model->getBanners();
foreach ($results as $result) {
$data['banners'][] = array('banner_id' => $result['banner_id'], 'name' => $result['name'], 'type' => $result['type'], 'status' => $result['status'] === '1' ? $this->lang->line('text_enabled') : $this->lang->line('text_disabled'), 'edit' => site_url('banners/edit?id=' . $result['banner_id']));
}
if ($this->input->post('delete') and $this->_deleteBanner() === TRUE) {
redirect('banners');
}
$this->template->render('banners', $data);
}
示例8: index
public function index()
{
$this->template->setTitle($this->lang->line('text_title'));
$this->template->setHeading($this->lang->line('text_heading'));
$this->template->setButton($this->lang->line('button_new'), array('class' => 'btn btn-primary', 'href' => page_url() . '/add'));
$data['payments'] = array();
$results = $this->Extensions_model->getList(array('type' => 'payment'));
foreach ($results as $result) {
if ($result['installed'] === TRUE) {
$manage = 'uninstall';
} else {
$manage = 'install';
}
$data['payments'][] = array('extension_id' => $result['extension_id'], 'name' => $result['title'], 'installed' => $result['installed'], 'type' => $result['type'], 'options' => $result['options'], 'edit' => site_url('payments/edit?action=edit&name=' . $result['name'] . '&id=' . $result['extension_id']), 'manage' => site_url('payments/edit?action=' . $manage . '&name=' . $result['name'] . '&id=' . $result['extension_id']));
}
$this->template->setPartials(array('header', 'footer'));
$this->template->render('payments', $data);
}
示例9: index
public function index()
{
$this->user->restrict('Site.Themes.Access');
$this->template->setTitle($this->lang->line('text_title'));
$this->template->setHeading($this->lang->line('text_heading'));
$this->template->setButton($this->lang->line('button_new'), array('class' => 'btn btn-primary', 'href' => page_url() . '/add'));
$data['themes'] = array();
$themes = $this->Themes_model->getList();
foreach ($themes as $theme) {
if ($theme['name'] === trim($this->config->item(MAINDIR, 'default_themes'), '/')) {
$active = '1';
} else {
$active = FALSE;
}
$data['themes'][] = array('name' => $theme['name'], 'title' => $theme['title'], 'version' => $theme['version'], 'description' => $theme['description'], 'author' => $theme['author'], 'active' => $active, 'screenshot' => $theme['screenshot'], 'activate' => site_url('themes/activate/' . $theme['name']), 'edit' => site_url('themes/edit/' . $theme['name']), 'delete' => site_url('themes/delete/' . $theme['name']));
}
$this->template->render('themes', $data);
}
示例10: index
public function index()
{
$url = '?';
$filter = array();
if ($this->input->get('page')) {
$filter['page'] = (int) $this->input->get('page');
} else {
$filter['page'] = '';
}
if ($this->config->item('page_limit')) {
$filter['limit'] = $this->config->item('page_limit');
}
if ($this->input->get('filter_search')) {
$filter['filter_search'] = $data['filter_search'] = $this->input->get('filter_search');
$url .= 'filter_search=' . $filter['filter_search'] . '&';
} else {
$data['filter_search'] = '';
}
if (is_numeric($this->input->get('filter_status'))) {
$filter['filter_status'] = $data['filter_status'] = $this->input->get('filter_status');
$url .= 'filter_status=' . $filter['filter_status'] . '&';
} else {
$filter['filter_status'] = $data['filter_status'] = '';
}
$this->template->setTitle($this->lang->line('text_title'));
$this->template->setHeading($this->lang->line('text_heading'));
$this->template->setButton($this->lang->line('button_new'), array('class' => 'btn btn-primary', 'href' => page_url() . '/edit'));
$this->template->setButton($this->lang->line('button_delete'), array('class' => 'btn btn-danger', 'onclick' => '$(\'#list-form\').submit();'));
$data['pages'] = array();
$results = $this->Pages_model->getList($filter);
foreach ($results as $result) {
$data['pages'][] = array('page_id' => $result['page_id'], 'name' => $result['name'], 'language' => $result['language_name'], 'date_updated' => mdate('%d %M %y - %H:%i', strtotime($result['date_updated'])), 'status' => $result['status'] === '1' ? 'Enabled' : 'Disabled', 'preview' => root_url('pages?page_id=' . $result['page_id']), 'edit' => site_url('pages/edit?id=' . $result['page_id']));
}
$config['base_url'] = site_url('pages' . $url);
$config['total_rows'] = $this->Pages_model->getCount($filter);
$config['per_page'] = $filter['limit'];
$this->pagination->initialize($config);
$data['pagination'] = array('info' => $this->pagination->create_infos(), 'links' => $this->pagination->create_links());
if ($this->input->post('delete') and $this->_deletePage() === TRUE) {
redirect('pages');
}
$this->template->setPartials(array('header', 'footer'));
$this->template->render('pages', $data);
}
示例11: onbroadcast
function onbroadcast($msg = '', $ty = '')
{
$action = "?admin_broadcast/broadcast";
$hasIntoBroadcastPrivilege = $_ENV['menu']->checkPermission($this->ask_login_name, $_SERVER['QUERY_STRING'], "intoBroadCast");
// 是否有进入操作员管理页面权限
if ($hasIntoBroadcastPrivilege['return']) {
$ConditionList['StartTime'] = isset($this->post['StartTime']) ? $this->post['StartTime'] : (isset($this->get[2]) ? $this->get[2] : date("Y-m-01", time()));
$ConditionList['EndTime'] = isset($this->post['EndTime']) ? $this->post['EndTime'] : (isset($this->get[3]) ? $this->get[3] : date("Y-m-d", time() + 86400));
$BreadCastStatusList = $this->ask_config->getBroadCastStatus();
$BroadCastZoneList = $this->ask_config->getBroadCastZone();
$ConditionList['BroadCastZone'] = isset($this->post['BroadCastZone']) ? intval($this->post['BroadCastZone']) : (isset($this->get[4]) ? intval($this->get[4]) : -1);
$ConditionList['BroadCastStatus'] = isset($this->post['BroadCastStatus']) ? intval($this->post['BroadCastStatus']) : (isset($this->get[5]) ? intval($this->get[5]) : 0);
@($page = max(1, intval($this->get[6])));
$export = trim($this->get[7]) == "export" ? 1 : 0;
$setting = $this->setting;
$pagesize = $this->setting['list_default'];
$pagesize = 20;
$BroadCastList = $_ENV['broadcast']->getBroadCastList($ConditionList, $page, $pagesize);
foreach ($BroadCastList['BroadCastList'] as $key => $value) {
$BroadCastList['BroadCastList'][$key]['BroadCastZone'] = $BroadCastZoneList[$value['BroadCastZone']];
$time = time();
if ($value['BroadCastStatus'] != 3) {
if ($value['StartTime'] <= $time && $value['EndTime'] >= $time) {
$BroadCastList['BroadCastList'][$key]['BroadCastStatus'] = 1;
} elseif ($value['EndTime'] < $time) {
$BroadCastList['BroadCastList'][$key]['BroadCastStatus'] = 2;
} elseif ($value['StartTime'] > $time) {
$BroadCastList['BroadCastList'][$key]['BroadCastStatus'] = 4;
}
}
$BroadCastList['BroadCastList'][$key]['BroadCastStatus'] = $BreadCastStatusList[$BroadCastList['BroadCastList'][$key]['BroadCastStatus']];
}
$departstr = page($complain_list['ComplainCount'], $pagesize, $page, "admin_broadcast/broadcast/" . $ConditionList['StartDate'] . "/" . $ConditionList['EndDate'] . "/" . $ConditionList['AnswerStartDate'] . "/" . $ConditionList['BroadCastZone'] . "/" . $ConditionList['BroadCastStatus']);
$downloadstr = page_url("<下载EXCEL表格>", "admin_broadcast/broadcast/" . $ConditionList['StartDate'] . "/" . $ConditionList['EndDate'] . "/" . $ConditionList['AnswerStartDate'] . "/" . $ConditionList['BroadCastZone'] . "/" . $ConditionList['BroadCastStatus'] . "/" . $page . "/export");
$msg && ($message = $msg);
$ty && ($type = $ty);
include template('broadcast', 'admin');
} else {
$hasIntoBroadcastPrivilege['url'] = "?admin_main";
__msg($hasIntoBroadcastPrivilege);
}
}
示例12: index
public function index()
{
$this->template->setTitle($this->lang->line('text_title'));
$this->template->setHeading($this->lang->line('text_heading'));
$this->template->setButton($this->lang->line('button_new'), array('class' => 'btn btn-primary', 'href' => page_url() . '/edit'));
$this->template->setButton($this->lang->line('button_delete'), array('class' => 'btn btn-danger', 'onclick' => 'confirmDelete();'));
if ($this->input->post('delete') and $this->_deleteLayout() === TRUE) {
redirect('layouts');
}
$data['layouts'] = array();
$results = $this->Layouts_model->getLayouts();
foreach ($results as $result) {
$data['layouts'][] = array('layout_id' => $result['layout_id'], 'name' => $result['name'], 'edit' => site_url('layouts/edit?id=' . $result['layout_id']));
}
$data['uri_routes'] = array();
$results = $this->Layouts_model->getRoutes(1);
foreach ($results as $result) {
$data['uri_routes'][] = array('uri_route_id' => $result['uri_route_id'], 'uri_route' => $result['uri_route']);
}
$this->template->render('layouts', $data);
}
示例13: index
public function index()
{
$url = '?';
$filter = array();
if ($this->input->get('page')) {
$filter['page'] = (int) $this->input->get('page');
} else {
$filter['page'] = '';
}
if ($this->config->item('page_limit')) {
$filter['limit'] = $this->config->item('page_limit');
}
if ($this->input->get('filter_search')) {
$filter['filter_search'] = $data['filter_search'] = $this->input->get('filter_search');
$url .= 'filter_search=' . $filter['filter_search'] . '&';
} else {
$data['filter_search'] = '';
}
if ($this->input->get('filter_category')) {
$filter['filter_category'] = $data['category_id'] = (int) $this->input->get('filter_category');
$url .= 'filter_category=' . $filter['filter_category'] . '&';
} else {
$data['category_id'] = '';
}
if (is_numeric($this->input->get('filter_status'))) {
$filter['filter_status'] = $data['filter_status'] = $this->input->get('filter_status');
$url .= 'filter_status=' . $filter['filter_status'] . '&';
} else {
$filter['filter_status'] = $data['filter_status'] = '';
}
if ($this->input->get('sort_by')) {
$filter['sort_by'] = $data['sort_by'] = $this->input->get('sort_by');
} else {
$filter['sort_by'] = $data['sort_by'] = 'menus.menu_id';
}
if ($this->input->get('order_by')) {
$filter['order_by'] = $data['order_by'] = $this->input->get('order_by');
$data['order_by_active'] = $this->input->get('order_by') . ' active';
} else {
$filter['order_by'] = $data['order_by'] = 'ASC';
$data['order_by_active'] = 'ASC active';
}
$this->template->setTitle($this->lang->line('text_heading'));
$this->template->setHeading($this->lang->line('text_heading'));
$this->template->setButton($this->lang->line('button_new'), array('class' => 'btn btn-primary', 'href' => page_url() . '/edit'));
$this->template->setButton($this->lang->line('button_delete'), array('class' => 'btn btn-danger', 'onclick' => 'confirmDelete();'));
if ($this->input->post('delete') and $this->_deleteMenu() === TRUE) {
redirect('menus');
}
$order_by = (isset($filter['order_by']) and $filter['order_by'] == 'ASC') ? 'DESC' : 'ASC';
$data['sort_name'] = site_url('menus' . $url . 'sort_by=menu_name&order_by=' . $order_by);
$data['sort_price'] = site_url('menus' . $url . 'sort_by=menu_price&order_by=' . $order_by);
$data['sort_stock'] = site_url('menus' . $url . 'sort_by=stock_qty&order_by=' . $order_by);
$data['sort_id'] = site_url('menus' . $url . 'sort_by=menus.menu_id&order_by=' . $order_by);
$this->load->model('Image_tool_model');
$data['menus'] = array();
$results = $this->Menus_model->getList($filter);
foreach ($results as $result) {
$price = ($result['special_status'] === '1' and $result['is_special'] === '1') ? $result['special_price'] : $result['menu_price'];
$data['menus'][] = array('menu_id' => $result['menu_id'], 'menu_name' => $result['menu_name'], 'menu_description' => $result['menu_description'], 'category_name' => $result['name'], 'menu_price' => $this->currency->format($price), 'menu_photo' => $result['menu_photo'], 'stock_qty' => $result['stock_qty'], 'special_status' => $result['special_status'], 'is_special' => $result['is_special'], 'menu_status' => $result['menu_status'] === '1' ? $this->lang->line('text_enabled') : $this->lang->line('text_disabled'), 'edit' => site_url('menus/edit?id=' . $result['menu_id']));
}
//load category data into array
$data['categories'] = array();
$categories = $this->Categories_model->getCategories();
foreach ($categories as $category) {
$data['categories'][] = array('category_id' => $category['category_id'], 'category_name' => $category['name']);
}
if ($this->input->get('sort_by') and $this->input->get('order_by')) {
$url .= 'sort_by=' . $filter['sort_by'] . '&';
$url .= 'order_by=' . $filter['order_by'] . '&';
}
$config['base_url'] = site_url('menus' . $url);
$config['total_rows'] = $this->Menus_model->getCount($filter);
$config['per_page'] = $filter['limit'];
$this->pagination->initialize($config);
$data['pagination'] = array('info' => $this->pagination->create_infos(), 'links' => $this->pagination->create_links());
$this->template->render('menus', $data);
}
示例14: getList
private function getList($data, $filter)
{
$url = '?';
if ($this->input->get('page')) {
$filter['page'] = (int) $this->input->get('page');
} else {
$filter['page'] = 1;
}
if ($this->config->item('page_limit')) {
$filter['limit'] = $this->config->item('page_limit');
} else {
$filter['limit'] = '';
}
if ($this->input->get('filter_search')) {
$filter['filter_search'] = $data['filter_search'] = $this->input->get('filter_search');
} else {
$data['filter_search'] = '';
}
if ($this->input->get('filter_access')) {
$filter['filter_access'] = $data['filter_access'] = $this->input->get('filter_access');
$url .= 'filter_access=' . $filter['filter_access'] . '&';
} else {
$filter['filter_access'] = $data['filter_access'] = '';
}
if ($this->input->get('filter_date')) {
$filter['filter_date'] = $data['filter_date'] = $this->input->get('filter_date');
$url .= 'filter_date=' . $filter['filter_date'] . '&';
} else {
$filter['filter_date'] = $data['filter_date'] = '';
}
if ($this->input->get('sort_by')) {
$filter['sort_by'] = $data['sort_by'] = $this->input->get('sort_by');
} else {
$filter['sort_by'] = $data['sort_by'] = 'date_added';
}
if ($this->input->get('order_by')) {
$filter['order_by'] = $data['order_by'] = $this->input->get('order_by');
$data['order_by_active'] = $this->input->get('order_by') . ' active';
} else {
$filter['order_by'] = $data['order_by'] = 'DESC';
$data['order_by_active'] = '';
}
if ($filter['filter_type'] === 'online') {
$data['text_empty'] = $this->lang->line('text_empty');
} else {
$data['text_empty'] = $this->lang->line('text_empty_report');
}
$order_by = (isset($filter['order_by']) and $filter['order_by'] == 'ASC') ? 'DESC' : 'ASC';
$data['sort_date'] = site_url('customers_online' . $url . 'sort_by=date_added&order_by=' . $order_by);
$customers_online = $this->Customer_online_model->getList($filter);
$data['customers_online'] = array();
foreach ($customers_online as $online) {
$country_code = $online['country_code'] ? strtolower($online['country_code']) : 'no_flag';
$data['customers_online'][] = array('activity_id' => $online['activity_id'], 'ip_address' => $online['ip_address'], 'customer_name' => $online['customer_id'] ? $online['first_name'] . ' ' . $online['last_name'] : $this->lang->line('text_guest'), 'access_type' => ucwords($online['access_type']), 'browser' => $online['browser'], 'user_agent' => $online['user_agent'], 'request_uri' => !empty($online['request_uri']) ? $online['request_uri'] : '--', 'referrer_uri' => !empty($online['referrer_uri']) ? $online['referrer_uri'] : '--', 'request_url' => !empty($online['request_uri']) ? root_url($online['request_uri']) : '#', 'referrer_url' => !empty($online['referrer_uri']) ? root_url($online['referrer_uri']) : '#', 'date_added' => time_elapsed($online['date_added']), 'country_code' => image_url('data/flags/' . $country_code . '.png'), 'country_name' => $online['country_name'] ? $online['country_name'] : $this->lang->line('text_private'));
}
$data['types'] = array('online' => array('badge' => '', 'url' => site_url('customers_online'), 'title' => $this->lang->line('text_online')), 'all' => array('badge' => '', 'url' => site_url('customers_online/all'), 'title' => $this->lang->line('text_all')));
$data['online_dates'] = array();
$online_dates = $this->Customer_online_model->getOnlineDates($filter);
foreach ($online_dates as $date) {
$month_year = mdate('%Y-%m', strtotime($date['year'] . '-' . $date['month']));
$data['online_dates'][$month_year] = mdate('%F %Y', strtotime($date['date_added']));
}
if ($this->input->get('sort_by') and $this->input->get('order_by')) {
$url .= 'sort_by=' . $filter['sort_by'] . '&';
$url .= 'order_by=' . $filter['order_by'] . '&';
}
$config['base_url'] = page_url() . $url;
$config['total_rows'] = $this->Customer_online_model->getCount($filter);
$config['per_page'] = $filter['limit'];
$this->pagination->initialize($config);
$data['pagination'] = array('info' => $this->pagination->create_infos(), 'links' => $this->pagination->create_links());
return $data;
}
示例15: lang
><?php
echo lang('text_uninstalled');
?>
</option>
<?php
}
}
?>
</select>
</div>
<a class="btn btn-grey" onclick="filterList();" title="<?php
echo lang('text_filter');
?>
"><i class="fa fa-filter"></i></a>
<a class="btn btn-grey" href="<?php
echo page_url();
?>
" title="<?php
echo lang('text_clear');
?>
"><i class="fa fa-times"></i></a>
</div>
</div>
</div>
</div>
</form>
</div>
<form role="form" id="list-form" accept-charset="utf-8" method="POST" action="<?php
echo current_url();
?>