public function index() { $this->load->model('news/news'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } //$limit = PAGESIZE; $limit = 20; //get certificates $data = array('start' => ($page - 1) * $limit, 'limit' => $limit); $li = $this->data['li'] = $_GET['li']; $title = $this->data['title'] = $_GET['title']; $typeid = $data['typeid'] = $_GET['typeid']; $this->data['news'] = $this->model_news_news->getNewsList($data); $items_count = $this->model_news_news->getNewsCount($data); // var_dump($this->data['news']); $this->data['hotArr'] = $this->model_news_news->getIsHot(); // var_dump($this->data['hotArr']); //pagination $route = $this->request->get['route']; $pagination = new Pagination(); $pagination->total = $items_count; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link($route, 'page={page}&&li=' . $li . '&&typeid=' . $typeid . '&&title=' . $title, 'SSL'); $this->data['pagination'] = $pagination->render(); // var_dump($this->data); $this->template = 'news/news.tpl'; $this->children = array('common/footer', 'common/header', 'common/hot'); $this->response->setOutput($this->render()); }
public function index() { if (isset($this->request->get['message_id']) && $this->request->get['message_id']) { if (isset($this->request->get['message_id'])) { $message_id = $this->request->get['message_id']; } else { $message_id = ''; } //判断用户是否登陆 if ($this->customer->isLogged()) { $this->data['logged'] = 1; } else { $this->data['logged'] = 0; $this->data['error_login'] = ""; $this->data['action'] = $this->url->link('account/login', '', 'SSL'); $this->data['register'] = $this->url->link('account/register', '', 'SSL'); $this->data['forgotten'] = $this->url->link('account/forgotten', '', 'SSL'); $this->data['email'] = ''; $this->data['password'] = ''; include_once DIR_SYSTEM . 'weibo/config.php'; include_once DIR_SYSTEM . 'weibo/saetv2.ex.class.php'; $o = new SaeTOAuthV2(WB_AKEY, WB_SKEY); $this->data['code_url'] = $o->getAuthorizeURL(WB_CALLBACK_URL); } $this->load->model('social/social'); $message_info = $this->model_social_social->getMessageByid($message_id); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; $this->data['page'] = $page; } else { $page = 1; $this->data['page'] = $page; } $limit = 20; $this->data['limit'] = $limit; $data = array('message_id' => $message_id, 'start' => ($page - 1) * $limit, 'limit' => $limit); $comment_info = $this->model_social_social->getComment($data); $comment_total = $this->model_social_social->getTotalComment($message_id); //回复的用户id $this->data['customer_id'] = $this->customer->getId(); //回复的脸 $this->data['face'] = $this->customer->getface(); if (!$this->data['face']) { $this->data['face'] = "uploads/big/0b4a96400b2372d25da769647bfe4059.jpg"; } $this->data['message'] = $message_info; $this->data['comment_info_all'] = $comment_info; $this->data['comment_total'] = $comment_total; $pagination = new Pagination(); $pagination->total = $comment_total; $pagination->page = $page; $pagination->limit = $limit; $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('social/comment', 'message_id=' . $message_id . '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $this->template = $this->config->get('config_template') . '/template/social/comment_list.tpl'; $this->children = array('common/footer', 'common/social_right', 'common/header_sns'); $this->response->setOutput($this->render()); } }
public function index() { $this->load->model('sale/transaction'); $this->template = 'common/transactions.tpl'; if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $store_id = $this->session->data['store_id']; $data = array('start' => ($page - 1) * 10, 'limit' => 10, 'store_id' => $store_id); $this->data['transactions'] = array(); foreach ($this->model_sale_transaction->getTransactions($data) as $tran) { $tran['money_in'] = $this->currency->format($tran['money_in']); $tran['money_out'] = $this->currency->format($tran['money_out']); $this->data['transactions'][] = $tran; } $transactions_total = $this->model_sale_transaction->getTotalTransactions($store_id); $this->data['total'] = $this->currency->format($this->model_sale_transaction->getTotal($store_id)); $pagination = new Pagination(); $pagination->total = $transactions_total; $pagination->page = $page; $pagination->limit = $this->config->get('config_admin_limit'); $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('common/transactions', 'token=' . $this->session->data['postoken'] . '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $this->data['empty'] = true; if ($transactions_total > 0) { $this->data['empty'] = false; } $this->response->setOutput($this->load->view($this->template, $this->data)); }
/** * the getList method is used to * pupolate the listing table */ public function getList($id = "", $pg) { $purl = array(); if (isset($_GET['url'])) { $purl = $_GET['url']; $purl = rtrim($purl); $purl = explode('/', $_GET['url']); } else { $purl = null; } if (!isset($purl['2'])) { $pn = 1; } else { $pn = $purl['2']; } $prodname = ""; $clientname = ""; $areaname = ""; $regionname = ""; $atmtype = ""; $clientid = ""; /** * of all the filter fields if only one field is set */ $filterResult = ""; if (isset($_REQUEST['prodname']) && !empty($_REQUEST['prodname'])) { $prodname .= " AND prod_name = '" . $_REQUEST['prodname'] . "' "; } if (isset($_REQUEST['prodname']) && !empty($_REQUEST['prodname'])) { $prodname .= " AND prod_name = '" . $_REQUEST['prodname'] . "' "; } if (isset($_REQUEST['clientid']) && !empty($_REQUEST['clientid'])) { $clientid .= " AND client_id ='" . $_REQUEST['clientid'] . "'"; } if (isset($_REQUEST['clientname']) && !empty($_REQUEST['clientname'])) { $clientname .= " AND client_name='" . $_REQUEST['clientname'] . "' "; } if (isset($_REQUEST['areaname']) && !empty($_REQUEST['areaname'])) { $areaname .= " AND install_area='" . $_REQUEST['areaname'] . "' "; } if (isset($_REQUEST['location']) && !empty($_REQUEST['location'])) { $regionname .= " AND (install_city LIKE '%" . $_REQUEST['location'] . "%' OR install_address LIKE '%" . $_REQUEST['location'] . "%') "; } if (isset($_REQUEST['machine']) && !empty($_REQUEST['machine'])) { $atmtype .= " AND atm_type='" . $_REQUEST['machine'] . "' "; } $filterResult .= " WHERE id !='' " . $prodname . $clientname . $areaname . $regionname . $atmtype . $clientid; print_r($filterResult); global $database; $result = $database->db_query("SELECT * FROM client_product "); $resultEmployee = $database->db_query("SELECT * FROM client_product " . $filterResult); $pagin = new Pagination(); //create the pagination object; $pagin->nr = $database->dbNumRows($resultEmployee); $pagin->itemsPerPage = 20; $pagin->totalRec = $database->dbNumRows($result); $myitems = Cproduct::find_by_sql("SELECT * FROM client_product " . $filterResult . " ORDER BY id DESC " . $pagin->pgLimit($pn)); $index_array = array("clientproduct" => $myitems, "mypagin" => $pagin->render($pg)); return $index_array; }
public function review() { $this->language->load('product/list'); $this->load->model('catalog/review'); $this->data['text_on'] = $this->language->get('text_on'); $this->data['text_no_reviews'] = $this->language->get('text_no_reviews'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $this->data['reviews'] = array(); $review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']); $results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5); foreach ($results as $result) { $this->data['reviews'][] = array('author' => $result['author'], 'text' => $result['text'], 'rating' => (int) $result['rating'], 'reviews' => sprintf($this->language->get('text_reviews'), (int) $review_total), 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))); } $pagination = new Pagination(); $pagination->total = $review_total; $pagination->page = $page; $pagination->limit = 5; $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('product/list/review', 'product_id=' . $this->request->get['product_id'] . '&page={page}'); $this->data['pagination'] = $pagination->render(); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/review.tpl')) { $this->template = $this->config->get('config_template') . '/template/product/review.tpl'; } else { $this->template = 'default/template/product/review.tpl'; } $this->response->setOutput($this->render()); }
public function index() { $this->data['http'] = __WEBURL__; $this->assign('sitename', 'blog example'); //在字符串情况下$this->data,$this->lable,$this->assign等效 $this->data['form_list'] = array(); $this->data['head_list'] = array(); $this->model('blog/data'); $test = $this->M['blog/data']->test(); $page = isset($this->request->get['page']) ? $this->request->get['page'] : 1; $count = 3; $data = array('limit' => ($page - 1) * $count . ',' . $count); $this->data['form_list'] = $this->M['blog/data']->getFormList($data); $total = $this->M['blog/data']->getFormTotal(); $pagination = new Pagination(); $pagination->total = $total; $pagination->page = $page; $pagination->limit = $count; $pagination->text = "从 {start} 起到 {end} 页 总 {total}个 总 ({pages} 页)"; $pagination->url = $this->url->link('home/index', '&page={page}'); $this->data['pagination'] = $pagination->render(); $this->language('blog/data'); $sitename = $this->language->get('sitename'); $this->lable('title', $sitename); $this->data['test'] = $test; //在模板中$this->data的健值即为变量名 $this->data['header'] = $this->view('public/header'); $this->data['footer'] = $this->view('public/footer'); $this->data['right'] = $this->view('public/right'); //调用右边的controller $this->display(); //可指定模板,模认为当前controll的名字+方法 }
public function index() { if (!$this->customer->isLogged()) { $this->session->data['redirect'] = $this->url->link('account/order', '', 'SSL'); $this->response->redirect($this->url->link('account/login', '', 'SSL')); } $this->load->language('account/order'); $this->document->setTitle($this->language->get('heading_title')); $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home')); $data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', 'SSL')); $url = ''; if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('account/order', $url, 'SSL')); $data['heading_title'] = $this->language->get('heading_title'); $data['text_empty'] = $this->language->get('text_empty'); $data['column_order_id'] = $this->language->get('column_order_id'); $data['column_status'] = $this->language->get('column_status'); $data['column_date_added'] = $this->language->get('column_date_added'); $data['column_customer'] = $this->language->get('column_customer'); $data['column_product'] = $this->language->get('column_product'); $data['column_total'] = $this->language->get('column_total'); $data['button_view'] = $this->language->get('button_view'); $data['button_continue'] = $this->language->get('button_continue'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $data['orders'] = array(); $this->load->model('account/order'); $order_total = $this->model_account_order->getTotalOrders(); $results = $this->model_account_order->getOrders(($page - 1) * 10, 10); foreach ($results as $result) { $product_total = $this->model_account_order->getTotalOrderProductsByOrderId($result['order_id']); $voucher_total = $this->model_account_order->getTotalOrderVouchersByOrderId($result['order_id']); $data['orders'][] = array('order_id' => $result['order_id'], 'name' => $result['firstname'] . ' ' . $result['lastname'], 'status' => $result['status'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 'products' => $product_total + $voucher_total, 'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']), 'href' => $this->url->link('account/order/info', 'order_id=' . $result['order_id'], 'SSL')); } $pagination = new Pagination(); $pagination->total = $order_total; $pagination->page = $page; $pagination->limit = 10; $pagination->url = $this->url->link('account/order', 'page={page}', 'SSL'); $data['pagination'] = $pagination->render(); $data['results'] = sprintf($this->language->get('text_pagination'), $order_total ? ($page - 1) * 10 + 1 : 0, ($page - 1) * 10 > $order_total - 10 ? $order_total : ($page - 1) * 10 + 10, $order_total, ceil($order_total / 10)); $data['continue'] = $this->url->link('account/account', '', 'SSL'); $data['column_left'] = $this->load->controller('common/column_left'); $data['column_right'] = $this->load->controller('common/column_right'); $data['content_top'] = $this->load->controller('common/content_top'); $data['content_bottom'] = $this->load->controller('common/content_bottom'); $data['footer'] = $this->load->controller('common/footer'); $data['header'] = $this->load->controller('common/header'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/order_list.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/account/order_list.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/account/order_list.tpl', $data)); } }
/** * this index is a little differnt from normal, it will filter the results by the group params and show the * page with only thoes values, further more * @param $group */ public function index($group = NULL) { if ($this->access->allowed('news', 'read')) { $this->breadcrumbs->add()->url('news/index/' . $group)->title('News'); // add the group filter to the crumb $news = ORM::factory('news')->where('status !=', 'deleted'); if ($group != NULL) { $news->where('group', $group); } $paging = new Pagination(array('total_items' => $news->count_all())); $view = new view(url::location()); // re add the clauses we need $news->where('status !=', 'deleted'); if ($group != NULL) { $news->where('group', $group); } $view->news = $news->find_all($paging->items_per_page, $paging->sql_offset); $view->group = $group; // used tos end to the add page so we know what group to return to. $view->pagination = $paging->render(); $view->page_number = $paging->page_number(); $this->template->title = 'News'; $this->template->content = $view; } else { Kohana::log('debug', 'User failed constructor security check'); url::failed(); } }
public function index() { $this->load->model('common/all'); $gallery_string = html_entity_decode($this->model_common_all->getGallery()); $galleries_array = json_decode($gallery_string); $galleries_array_total = count($galleries_array); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $limit = 12; $page_begin = ($page - 1) * $limit; $page_end = $galleries_array_total > $page * $limit ? $page * $limit : $galleries_array_total; $this->data['galleries'] = array(); for ($i = $page_begin; $i < $page_end; $i++) { $this->data['galleries'][] = $galleries_array[$i]; } $pagination = new Pagination(); $pagination->total = $galleries_array_total; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link('common/gallery', '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/gallery.tpl')) { $this->template = $this->config->get('config_template') . '/template/common/gallery.tpl'; } else { $this->template = 'default/template/common/gallery.tpl'; } $this->children = array('common/right', 'common/footer', 'common/header'); $this->response->setOutput($this->render()); }
public function getList($id = "", $pg) { $purl = array(); if (isset($_GET['url'])) { $purl = $_GET['url']; $purl = rtrim($purl); $purl = explode('/', $_GET['url']); } else { $purl = null; } if (!isset($purl['2'])) { $pn = 1; } else { $pn = $purl['2']; } global $database; $resultUser = $database->db_query("SELECT * FROM users_client"); $pagin = new Pagination(); $pagin->nr = $database->dbNumRows($resultUser); $pagin->itemsPerPage = 20; $users = User::find_by_sql("SELECT * FROM users_client WHERE company_id=" . $_SESSION['client_ident'] . " " . $pagin->pgLimit($pn)); $index_array = array("myusers" => $users, "mypagin" => $pagin->render($pg)); return $index_array; return $index_array; }
public function review() { $this->load->language('review/store_review'); $this->load->model('review/store_review'); $data['text_no_reviews'] = $this->language->get('text_no_reviews'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $data['reviews'] = array(); $review_total = $this->model_review_store_review->getTotalReviews(); $results = $this->model_review_store_review->getReviews(($page - 1) * 5, 5); foreach ($results as $result) { $data['reviews'][] = array('author' => $result['author'], 'text' => nl2br($result['text']), 'rating' => (int) $result['rating'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))); } $pagination = new Pagination(); $pagination->total = $review_total; $pagination->page = $page; $pagination->limit = 5; $pagination->url = $this->url->link('review/store_review/review', '&page={page}'); $data['pagination'] = $pagination->render(); $data['results'] = sprintf($this->language->get('text_pagination'), $review_total ? ($page - 1) * 5 + 1 : 0, ($page - 1) * 5 > $review_total - 5 ? $review_total : ($page - 1) * 5 + 5, $review_total, ceil($review_total / 5)); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/review/store_review_list.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/review/store_review_list.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/review/store_review_list.tpl', $data)); } }
public function index() { $this->document->setTitle("ÂÃÓÎ×ÊѶ"); $this->load->model('informations/informations'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $limit = 10; //get informations $data = array('start' => ($page - 1) * $limit, 'limit' => $limit); $this->data['informations'] = $this->model_informations_informations->getInformations($data); $items_count = $this->model_informations_informations->getInformationsCount(); //pagination $route = $this->request->get['route']; $pagination = new Pagination(); $pagination->total = $items_count; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link($route, 'page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $this->template = 'informations/informations.tpl'; $this->children = array('common/footer', 'common/header', 'common/column_left_information'); $this->response->setOutput($this->render()); }
public function index() { if (!$this->customer->isLogged()) { $this->session->data['redirect'] = $this->url->link('account/order', '', 'SSL'); $this->redirect($this->url->link('account/login', '', 'SSL')); } $this->language->load('account/recurring'); $this->document->setTitle($this->language->get('heading_title')); // Breadcrumbs $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', 'SSL'), 'separator' => $this->language->get('text_separator')); $url = ''; if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('account/recurring', $url, 'SSL'), 'separator' => $this->language->get('text_separator')); $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['column_created'] = $this->language->get('column_created'); $this->data['column_status'] = $this->language->get('column_status'); $this->data['column_product'] = $this->language->get('column_product'); $this->data['column_action'] = $this->language->get('column_action'); $this->data['column_profile_id'] = $this->language->get('column_profile_id'); $this->data['text_empty'] = $this->language->get('text_empty'); $this->data['button_view'] = $this->language->get('button_view'); $this->data['button_continue'] = $this->language->get('button_continue'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $this->data['orders'] = array(); $this->load->model('account/recurring'); $recurring_total = $this->model_account_recurring->getTotalRecurring(); $results = $this->model_account_recurring->getAllProfiles(($page - 1) * 10, 10); $this->data['profiles'] = array(); if ($results) { foreach ($results as $result) { $this->data['profiles'][] = array('id' => $result['order_recurring_id'], 'name' => $result['product_name'], 'status' => $result['status'], 'created' => date($this->language->get('date_format_short'), strtotime($result['created'])), 'href' => $this->url->link('account/recurring/info', 'recurring_id=' . $result['order_recurring_id'], 'SSL')); } } $this->data['status_types'] = array(1 => $this->language->get('text_status_inactive'), 2 => $this->language->get('text_status_active'), 3 => $this->language->get('text_status_suspended'), 4 => $this->language->get('text_status_cancelled'), 5 => $this->language->get('text_status_expired'), 6 => $this->language->get('text_status_pending')); $pagination = new Pagination(); $pagination->total = $recurring_total; $pagination->page = $page; $pagination->limit = 10; $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('account/recurring', 'page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $this->data['continue'] = $this->url->link('account/account', '', 'SSL'); // Theme $this->data['template'] = $this->config->get('config_template'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/recurring_list.tpl')) { $this->template = $this->config->get('config_template') . '/template/account/recurring_list.tpl'; } else { $this->template = 'default/template/account/recurring_list.tpl'; } $this->children = array('common/column_left', 'common/column_right', 'common/content_header', 'common/content_top', 'common/content_bottom', 'common/content_footer', 'common/footer', 'common/header'); $this->response->setOutput($this->render()); }
public function action_default() { $this->quick_menu = array('administrator/add' => '添加管理员', 'administrator/group/' => '权限组列表', 'administrator/group/add' => '添加权限组'); $view = new View('admin/administrator/list'); $model_administrator = new Model_Admin_Administrator(); $only_list_self_group_user = false; $is_super = $this->session()->member()->perm()->is_super_perm(); if ($is_super) { $project = null; $list_groups = null; } else { $project = Core::$project; if (!$this->session()->member()->perm()->is_own('administrator.view_user_info')) { $list_groups = $this->session()->member()->has_own_perm_groups('view_users')->ids(); if (!count($list_groups)) { $this->message('您不具备此权限', -1); } } } if ($_GET['k']) { # 搜索模式 $list = $model_administrator->search_aministrator_list($project, $list_groups, $_GET['k']); $view->list = $list; } else { $list_type = null; if ($is_super && $_GET['list']) { if ($_GET['list'] == 'supadmin') { $list_type = 1; } elseif ($_GET['list'] == 'groupmanager') { $list_type = 2; } elseif ($_GET['list'] == 'zdy') { $list_type = 3; } } else { if (isset($_GET['group_id'])) { $group_id = (int) $_GET['group_id']; } if (!$group_id > 0) { $group_id = 0; } if ($group_id > 0) { if (!$this->session()->member()->is_own_group_perm($group_id, 'view_users')) { $this->message('您不具备查看此权限组用户的权限', -1); } $list_groups = array($group_id); } } $count = $model_administrator->total_count($project, $list_groups, $list_type); if ($count) { $pageconfig = Core::config('admin/pagination'); $pageconfig['total_items'] = $count; $pagination = new Pagination($pageconfig); $list = $model_administrator->get_aministrator_list($project, $list_groups, $pagination->get_offset(), $pagination->get_items_per_page(), $list_type); $view->list = $list; $view->pagehtml = $pagination->render(); } } $view->is_super = $is_super; $view->render(); }
/** * the getList method is used to * pupolate the listing table */ public function getList($id = "", $pg) { $purl = array(); if (isset($_GET['url'])) { $purl = $_GET['url']; $purl = rtrim($purl); $purl = explode('/', $_GET['url']); } else { $purl = null; } if (!isset($purl['2'])) { $pn = 1; } else { $pn = $purl['2']; } global $database; $resultEmployee = $database->db_query("SELECT * FROM vendors"); $pagin = new Pagination(); //create the pagination object; $pagin->nr = $database->dbNumRows($resultEmployee); $pagin->itemsPerPage = 20; $myitems = Vendor::find_by_sql("SELECT * FROM vendors " . $pagin->pgLimit($pn)); $index_array = array("vendors" => $myitems, "mypagin" => $pagin->render($pg)); return $index_array; return $index_array; }
/** * 权限组列表 */ public function action_default() { $this->quick_menu = array('administrator/group/add' => '添加权限组', 'administrator/' => '管理员列表', 'administrator/add' => '添加管理员'); if (!$this->session()->member()->perm()->is_own('administrator.view_group_info')) { if ($this->session()->member()->perm()->is_own('administrator.can_edit_group')) { $groups = $this->session()->member()->groups(); } else { $this->message('抱歉,您无此权限'); } } $view = new View('admin/administrator/group_list'); if (isset($groups)) { $view->list = $groups; $view->group_manager = true; } else { if ($this->session()->member()->perm()->is_super_perm()) { # 超级管理员列出所有组 $project = null; } else { $project = Core::$project; } $model_administrator = new Model_Admin_Administrator(); $count = $model_administrator->total_group_count($project); if ($count) { $pageconfig = Core::config('admin/pagination'); $pageconfig['total_items'] = $count; $pagination = new Pagination($pageconfig); $list = $model_administrator->get_group_list($project, $pagination->get_offset(), $pagination->get_items_per_page()); $view->list = $list; $view->pagehtml = $pagination->render(); } } $view->render(); }
protected function getList() { error_reporting(E_ALL); ini_set('display_errors', 'On'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $url = ''; if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false); $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('sale/link', 'token=' . $this->session->data['token'] . $url, 'SSL'), 'separator' => ' :: '); $this->data['insert'] = $this->url->link('sale/link/insert', 'token=' . $this->session->data['token'] . $url, 'SSL'); $this->data['delete'] = $this->url->link('sale/link/delete', 'token=' . $this->session->data['token'] . $url, 'SSL'); $this->data['user_groups'] = array(); $data = array('sort' => "ASC", 'order' => "link_order", 'start' => ($page - 1) * $this->config->get('config_admin_limit'), 'limit' => $this->config->get('config_admin_limit')); $user_group_total = $this->model_sale_link->getTotalLinks(); $results = $this->model_sale_link->getTotalLink($data); foreach ($results as &$result) { $action = array(); $action[] = array('text' => $this->language->get('text_edit'), 'href' => $this->url->link('sale/link/update&id=' . $result['id'], 'token=' . $this->session->data['token'] . $url, 'SSL')); $result['action'] = $action; } $this->data['results'] = $results; $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['text_no_results'] = $this->language->get('text_no_results'); $this->data['column_name'] = $this->language->get('column_name'); $this->data['column_action'] = $this->language->get('column_action'); $this->data['button_insert'] = $this->language->get('button_insert'); $this->data['button_delete'] = $this->language->get('button_delete'); if (isset($this->error['warning'])) { $this->data['error_warning'] = $this->error['warning']; } else { $this->data['error_warning'] = ''; } if (isset($this->session->data['success'])) { $this->data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $this->data['success'] = ''; } $url = ''; if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $pagination = new Pagination(); $pagination->total = $user_group_total; $pagination->page = $page; $pagination->limit = $this->config->get('config_admin_limit'); $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('sale/link', 'token=' . $this->session->data['token'] . $url . '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $this->template = 'sale/link.tpl'; $this->children = array('common/header', 'common/footer'); $this->response->setOutput($this->render()); }
public function index() { $this->data = $this->load->language('system/activity'); $this->document->setTitle($this->language->get('heading_title')); $url = $this->build->url(array('page')); $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL')); $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('system/activity', 'token=' . $this->session->data['token'] . $url, 'SSL')); if (isset($this->request->get['page'])) { $page = (int) $this->request->get['page']; } else { $page = 1; } $filter_data = array('start' => $this->config->get('config_limit_admin') * ($page - 1), 'limit' => $this->config->get('config_limit_admin')); $this->load->model('system/activity'); $this->data['activities'] = array(); $activities = $this->model_system_activity->getActivities($filter_data); foreach ($activities as $activity) { $this->data['activities'][] = array('date_added' => date($this->language->get('datetime_format_short'), strtotime($activity['date_added'])), 'message' => $activity['message']); } $pagination = new Pagination(); $pagination->total = $this->model_system_activity->getTotalActivities(); $pagination->page = $page; $pagination->limit = $this->config->get('config_limit_admin'); $pagination->url = $this->url->link('system/activity', 'token=' . $this->session->data['token'] . '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $this->data['clear'] = $this->url->link('system/activity/clear', 'token=' . $this->session->data['token'], 'SSL'); $this->data['success'] = $this->build->data('success', $this->session->data); $this->data['error_warning'] = $this->build->data('warning', $this->session->data); $this->data['header'] = $this->load->controller('common/header'); $this->data['footer'] = $this->load->controller('common/footer'); $this->response->setOutput($this->render('system/activity.tpl')); }
private function getData() { $modelToolImage = $this->load->model('tool/image'); $urlParameters = $this->buildUrlParameterString($this->parameters); $this->data['invoice'] = $this->url->link('sale/invoice/showForm', $urlParameters, 'SSL'); $this->data['print'] = $this->url->link('sale/repurchaseOrders/printPage', $urlParameters, 'SSL'); $this->data['orders'] = array(); $data = array('start' => ($this->parameters['page'] - 1) * $this->config->get('config_admin_limit'), 'limit' => $this->config->get('config_admin_limit')); $data = array_merge($data, $this->parameters); $order_items = RepurchaseOrderDAO::getInstance()->getOrders($data); $showedCustomerIds = array(); $this->data['customers'] = array(); foreach ($order_items as $order_item) { if (!in_array($order_item['customerId'], $showedCustomerIds)) { $this->data['customers'][] = array('id' => $order_item['customerId'], 'name' => $order_item['customerName'] . '/' . $order_item['customerNick']); $showedCustomerIds[] = $order_item['customerId']; } $actions = array(); $actions[] = array('text' => $this->getLanguage()->get('GOTO_ITEM'), 'href' => $order_item['itemUrl']); $actions[] = array('text' => $this->getLanguage()->get('CHANGE_PICTURE'), 'href' => '', 'onclick' => 'imageManager(' . $order_item['orderItemId'] . ', $(this).parent().parent().find(\'img\'))'); /// Check if item URL is valid if (preg_match('/https?:\\/\\/([\\w\\-\\.]+)/', $order_item['itemUrl'], $matches)) { $siteName = $matches[1]; } else { $siteName = 'Wrong URL format'; } /// Get image path or URL if (file_exists(DIR_IMAGE . $order_item['imagePath'])) { $image = $modelToolImage->resize($order_item['imagePath'], 100, 100); $hint = ''; } else { $image = $modelToolImage->resize('no_image.jpg', 100, 100); $hint = $this->getLanguage()->get('WARNING_HTML_PAGE_PROVIDED'); } $this->data['orders'][] = array('privateComment' => $order_item['privateComment'], 'orderId' => $order_item['orderItemId'], 'underlyingOrderId' => $order_item['orderId'], 'hint' => $hint, 'imagePath' => $image, 'itemName' => $order_item['itemName'], 'itemUrl' => $order_item['itemUrl'], 'shopName' => $order_item['shopName'], 'siteName' => $siteName, 'customerName' => $order_item['customerName'], 'customerNick' => $order_item['customerNick'], 'customerUrl' => $this->url->link('sale/customer/update', 'token=' . $this->session->data['token'] . '&customer_id=' . $order_item['customerId'], 'SSL'), 'options' => nl2br(RepurchaseOrderDAO::getInstance()->getOptionsString($order_item['orderItemId'])), 'originalImagePath' => file_exists(DIR_IMAGE . $order_item['imagePath']) ? HTTP_IMAGE . $order_item['imagePath'] : $order_item['imagePath'], 'comment' => $order_item['comment'], 'publicComment' => $order_item['comment'], 'status' => $order_item['status'] ? Status::getStatus($order_item['status'], $this->config->get('config_language_id')) : "", 'quantity' => $order_item['quantity'], 'price' => (double) $order_item['price'], 'whiteprice' => (double) $order_item['whiteprice'], 'shipping' => (double) $order_item['shipping'], 'amount' => (double) $order_item['total'], 'actions' => $actions, 'whoOrders' => $order_item['whoOrders']); } if (isset($this->error['warning'])) { $this->data['error_warning'] = $this->error['warning']; } else { $this->data['error_warning'] = ''; } if (isset($this->session->data['success'])) { $this->data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $this->data['success'] = ''; } $pagination = new Pagination(); $pagination->total = RepurchaseOrderDAO::getInstance()->getOrdersCount($data); $pagination->page = $this->parameters['page']; $pagination->limit = $this->config->get('config_admin_limit'); $pagination->text = $this->getLanguage()->get('text_pagination'); $pagination->url = $this->url->link('sale/repurchaseOrders', $urlParameters . '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $this->data['currencyCode'] = $this->config->get('config_currency'); $this->data['invoiceUrl'] = $this->url->link('sale/invoice/showForm', 'token=' . $this->session->data['token'], 'SSL'); $this->data['urlImageChange'] = $this->url->link('sale/repurchaseOrders/setProperty', 'propName=image&token=' . $this->parameters['token'], 'SSL'); $this->data['urlImageManager'] = $this->url->link('common/filemanager', 'field=image&token=' . $this->parameters['token'], 'SSL'); $this->data = array_merge($this->data, $this->parameters); }
public function index() { $this->load->model('video/video'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $limit = PAGESIZE; //get certificates $data = array('start' => ($page - 1) * $limit, 'limit' => $limit); $this->data['video'] = $this->model_video_video->getvideoList($data); $items_count = $this->model_video_video->getvideoCount(); //pagination $route = $this->request->get['route']; $pagination = new Pagination(); $pagination->total = $items_count; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link($route, 'page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); // var_dump($this->data); $this->template = 'video/video.tpl'; $this->children = array('common/footer', 'common/header', 'common/banner', 'common/contentleft'); $this->response->setOutput($this->render()); }
public function index() { if (!isset($this->request->post['order_id'])) { $this->template = 'common/orders.tpl'; if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $data = array('sort' => 'o.date_added', 'order' => 'DESC', 'start' => ($page - 1) * 10, 'limit' => 5, 'payment_code' => 'cash_' . $this->user->getId()); $this->load->model('sale/order'); $results = $this->model_sale_order->getOrders($data); foreach ($results as $result) { $action = array(); $action = array('text' => $this->language->get('text_view'), 'href' => $this->url->link('sale/order/info', 'token=' . $this->session->data['postoken'] . '&order_id=' . $result['order_id'], 'SSL')); $totals = $this->model_sale_order->getOrderTotals($result['order_id']); $paid = 0; $balance = 0; foreach ($totals as $total) { if ($total['code'] == 'total_paid') { $paid = $total['title']; } if ($total['code'] == 'balance') { $balance = $total['title']; } } $this->data['orders'][] = array('order_id' => $result['order_id'], 'customer' => $result['customer'], 'status' => $result['status'], 'payment_method' => $result['payment_method'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']), 'total_paid' => $paid, 'balance' => $balance, 'action' => $action); } $data = array('sort' => 'o.date_added', 'order' => 'DESC', 'payment_code' => 'cash_' . $this->user->getId()); $results = $this->model_sale_order->getOrders($data); $order_total = count($results); $pagination = new Pagination(); $pagination->total = $order_total; $pagination->page = $page; $pagination->limit = $this->config->get('config_admin_limit'); $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('common/refund', 'token=' . $this->session->data['postoken'] . '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $this->response->setOutput($this->load->view($this->template, $this->data)); } else { $this->load->model('sale/order'); $order_id = (int) $this->request->post['order_id']; $this->data['order'] = $this->model_sale_order->getOrder($order_id); $this->data['order_products'] = array(); $order_products = $this->model_sale_order->getOrderProducts($order_id); foreach ($order_products as $order_product) { $order_option = $this->model_sale_order->getOrderOptions($order_id, $order_product['order_product_id']); if (isset($order_product['order_download'])) { $order_download = $order_product['order_download']; } elseif (isset($this->request->get['order_id'])) { $order_download = $this->model_sale_order->getOrderDownloads($order_id, $order_product['order_product_id']); } else { $order_download = array(); } $this->data['order_products'][] = array('order_product_id' => $order_product['order_product_id'], 'product_id' => $order_product['product_id'], 'name' => $order_product['name'], 'model' => $order_product['model'], 'option' => $order_option, 'download' => $order_download, 'quantity' => $order_product['quantity'], 'price' => $order_product['price'], 'total' => $order_product['total'], 'tax' => $order_product['tax']); } $this->data['totals'] = $this->model_sale_order->getOrderTotals($order_id); echo json_encode($this->data); } }
/** * Used to display the index page but also uses a jquery and the pagination to do preload of next pages * of the news articles. Which are then displaye don scroll * @param integer $page the page number (Matt are you sure this is needed, the pagination is smart enough not to need this). */ public function index($page = 1) { $total = orm::factory('news')->where('group', 'site')->where('status', 'approved')->count_all(); $paging = new Pagination(array('total_items' => $total, 'items_per_page' => 3)); $articles = orm::factory('news')->where('group', 'site')->where('status', 'approved')->find_all($paging->items_per_page, $paging->sql_offset); $view = new View(url::location()); $view->articles = $articles; $view->pagination = $paging->render(); $view->page_number = $paging->page_number(); // If the request is an ajax request, then the page is attempting to autoupdate // the items with in the news, so just send through the news items. if (request::is_ajax()) { // if the ajax is attempting to get a page which doesnt exist, send 404 if ($page > $paging->total_pages) { Event::run('system.404'); } else { $this->ajax['view'] = $view; } } else { // otherwise its a http request, send throught he entire page with template. $this->template->title = 'About Us › News & Updates Archive'; $this->breadcrumbs->add()->url(false)->title('Archive'); $view->breadcrumbs = $this->breadcrumbs->cut(); $this->template->content = $view; } }
public function index() { $this->document->setTitle("America Travel Info"); $this->load->model('transportations/transportations'); global $LANGUAGE; $this->data['TEXT'] = $LANGUAGE; $language = $this->session->data['language']; if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $limit = 10; //header banner $data = array("position" => "header", "language_id" => $language); $header_banners = $this->model_transportations_transportations->getBanners($data); $this->data['header_banners_link'] = $header_banners ? $header_banners[0]['link'] : ''; $this->data['header_banners'] = $header_banners ? $header_banners[0]['image_url'] : ''; //category $this->session->data['class_type'] = "transportations"; $this->session->data['class_title'] = "transportations"; $data = array("language_id" => $language); $categorys = $this->model_transportations_transportations->getCategorys($data); $current_category = isset($this->request->get['cid']) ? $this->request->get['cid'] : ""; $this->data['current_category'] = $current_category; $this->data['category_title'] = ""; foreach ($categorys as $category) { if ($category['item_id'] == $current_category) { $this->data['category_title'] = $category['title']; } } //items $ids = array(); if (isset($this->session->data['transportations_ids'])) { $ids = $this->session->data['transportations_ids']; } $this->data['ids'] = $ids; $search = ""; if (isset($this->request->get['search'])) { $search = $this->request->get['search']; } $data = array("category" => $current_category, "language_id" => $language, "search" => $search, 'start' => ($page - 1) * $limit, 'limit' => $limit); $items = $this->model_transportations_transportations->getItems($data); $data = array("category" => $current_category, "search" => $search, "language_id" => $language); $items_total = $this->model_transportations_transportations->getItems($data); $this->data['items'] = $items; $items_count = count($items_total); //pagination $route = $this->request->get['route']; $pagination = new Pagination(); $pagination->total = $items_count; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link($route, 'cid=' . $current_category . '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $this->template = 'transportations/transportations.tpl'; $this->children = array('common/footer', 'common/header', 'common/column_left'); $this->response->setOutput($this->render()); }
protected function getList() { $url = ''; $limit = $this->config->get('config_admin_limit'); $filter_name = ''; $order = 'ASC'; $page = 1; if (isset($this->request->get['limit']) && (int) $this->request->get['limit'] > 0) { $limit = (int) $this->request->get['limit']; $url .= '&limit=' . $limit; } if (isset($this->request->get['filter_name']) && !empty($this->request->get['filter_name'])) { $filter_name = $this->request->get['filter_name']; $url .= '&filter_name=' . urlencode(html_entity_decode($filter_name, ENT_QUOTES, 'UTF-8')); } if (isset($this->request->get['order']) && $this->request->get['order'] != 'ASC') { $order = 'DESC'; } if (isset($this->request->get['page']) && (int) $this->request->get['page'] > 0) { $page = (int) $this->request->get['page']; } $pagination = new Pagination(); $pagination->total = $this->model_sale_company->getCompanyCount(array('filter_name' => $filter_name)); $pagination->page = $page; $pagination->limit = $limit; $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('sale/company', 'token=' . $this->session->data['token'] . $url . '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $url .= '&page=' . $page; $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false); $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('sale/company', 'token=' . $this->session->data['token'] . $url, 'SSL'), 'separator' => ' :: '); $this->data['token'] = $this->session->data['token']; $this->data['success'] = ''; $this->data['error_warning'] = ''; if (isset($this->session->data['success'])) { $this->data['success'] = $this->session->data['success']; unset($this->session->data['success']); } if (isset($this->error['warning'])) { $this->data['error_warning'] = $this->error['warning']; } $this->data['insert'] = $this->url->link('sale/company/insert', 'token=' . $this->session->data['token'], 'SSL'); $this->data['delete'] = $this->url->link('sale/company/delete', 'token=' . $this->session->data['token'], 'SSL'); $this->data['company_edit_url'] = $this->url->link('sale/company/update', 'token=' . $this->session->data['token'], 'SSL'); $data = array('filter_name' => $filter_name, 'start' => ($page - 1) * $limit, 'limit' => $limit, 'order' => $order); $this->data['companies'] = $this->model_sale_company->getCompanies($data); foreach ($this->data['companies'] as $k => $v) { $this->data['companies'][$k]['href'] = $this->url->link('sale/company/update', 'token=' . $this->session->data['token'] . '&company_id=' . $v['company_id'], 'SSL'); $this->data['companies'][$k]['selected'] = isset($this->request->post['selected']) && in_array($v['company_id'], $this->request->post['selected']); } $language_vars = array('heading_title', 'button_insert', 'button_delete', 'button_edit', 'text_no_results', 'text_name', 'text_ax_code', 'text_cui', 'text_cif', 'text_action', 'text_search'); foreach ($language_vars as $language_var) { $this->data[$language_var] = $this->language->get($language_var); } $this->template = 'sale/company_list.tpl'; $this->children = array('common/header', 'common/footer'); $this->response->setOutput($this->render()); }
public function index() { $this->load->language('report/pro2ven_viewed'); $this->document->setTitle($this->language->get('heading_title')); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $url = ''; if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false); $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('report/pro2ven_viewed', 'token=' . $this->session->data['token'] . $url, 'SSL'), 'separator' => ' :: '); $this->load->model('report/pro2ven_report'); $data = array('start' => ($page - 1) * $this->config->get('config_admin_limit'), 'limit' => $this->config->get('config_admin_limit')); $product_viewed_total = $this->model_report_pro2ven_report->getTotalProductsViewed($data); $product_views_total = $this->model_report_pro2ven_report->getTotalProductViews(); $this->data['products'] = array(); $results = $this->model_report_pro2ven_report->getProductsViewed($data); foreach ($results as $result) { if ($result['viewed']) { $percent = round($result['viewed'] / $product_views_total * 100, 2); } else { $percent = 0; } $this->data['products'][] = array('name' => $result['name'], 'model' => $result['model'], 'viewed' => $result['viewed'], 'percent' => $percent . '%'); } $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['text_no_results'] = $this->language->get('text_no_results'); $this->data['column_name'] = $this->language->get('column_name'); $this->data['column_model'] = $this->language->get('column_model'); $this->data['column_viewed'] = $this->language->get('column_viewed'); $this->data['column_percent'] = $this->language->get('column_percent'); $this->data['button_reset'] = $this->language->get('button_reset'); $url = ''; if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $this->data['reset'] = $this->url->link('report/pro2ven_viewed/reset', 'token=' . $this->session->data['token'] . $url, 'SSL'); if (isset($this->session->data['success'])) { $this->data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $this->data['success'] = ''; } $pagination = new Pagination(); $pagination->total = $product_viewed_total; $pagination->page = $page; $pagination->limit = $this->config->get('config_admin_limit'); $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('report/pro2ven_viewed', 'token=' . $this->session->data['token'] . '&page={page}', 'SSL'); $this->data['pagination'] = $pagination->render(); $this->template = 'report/pro2ven_viewed.tpl'; $this->children = array('common/header', 'common/footer'); $this->response->setOutput($this->render()); }
public function index() { $this->data = $this->load->language('accounting/currency'); $this->document->setTitle($this->language->get('heading_title')); $url = $this->build->url(array('sort', 'order', 'page')); $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL')); $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('accounting/currency', 'token=' . $this->session->data['token'] . $url, 'SSL')); if (isset($this->request->get['page'])) { $page = (int) $this->request->get['page']; } else { $page = 1; } if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'title'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; } $filter_data = array('start' => $this->config->get('config_limit_admin') * ($page - 1), 'limit' => $this->config->get('config_limit_admin'), 'sort' => $sort, 'order' => $order); $this->load->model('accounting/currency'); $this->data['currencies'] = array(); $currencies = $this->model_accounting_currency->getCurrencies($filter_data); foreach ($currencies as $currency) { $this->data['currencies'][] = array('currency_id' => $currency['currency_id'], 'title' => $currency['title'], 'code' => $currency['code'], 'value' => $currency['value'], 'status' => $currency['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled'), 'date_modified' => date($this->language->get('datetime_format_short'), strtotime($currency['date_modified'])), 'edit' => $this->url->link('accounting/currency/form', 'token=' . $this->session->data['token'] . $url . '¤cy_id=' . $currency['currency_id'], 'SSL')); } $url = $this->build->url(array('sort', 'order')); $pagination = new Pagination(); $pagination->total = $this->model_accounting_currency->getTotalCurrencies(); $pagination->page = $page; $pagination->limit = $this->config->get('config_limit_admin'); $pagination->url = $this->url->link('accounting/currency', 'token=' . $this->session->data['token'] . '&page={page}' . $url, 'SSL'); $this->data['pagination'] = $pagination->render(); $this->data['delete'] = $this->url->link('accounting/currency/delete', 'token=' . $this->session->data['token'], 'SSL'); $this->data['insert'] = $this->url->link('accounting/currency/form', 'token=' . $this->session->data['token'], 'SSL'); $this->data['refresh'] = $this->url->link('accounting/currency/refresh', 'token=' . $this->session->data['token'], 'SSL'); $this->data['success'] = $this->build->data('success', $this->session->data); $this->data['error_warning'] = $this->build->data('warning', $this->error); $this->data['selected'] = $this->build->data('selected', $this->request->post, array(), array()); $this->data['sort'] = $sort; $this->data['order'] = $order; if ($order == 'ASC') { $order = 'DESC'; } else { $order = 'ASC'; } $this->data['sort_title'] = $this->url->link('accounting/currency', 'token=' . $this->session->data['token'] . '&sort=title&order=' . $order, 'SSL'); $this->data['sort_code'] = $this->url->link('accounting/currency', 'token=' . $this->session->data['token'] . '&sort=code&order=' . $order, 'SSL'); $this->data['sort_value'] = $this->url->link('accounting/currency', 'token=' . $this->session->data['token'] . '&sort=value&order=' . $order, 'SSL'); $this->data['sort_status'] = $this->url->link('accounting/currency', 'token=' . $this->session->data['token'] . '&sort=status&order=' . $order, 'SSL'); $this->data['sort_date_modified'] = $this->url->link('accounting/currency', 'token=' . $this->session->data['token'] . '&sort=date_modified&order=' . $order, 'SSL'); $this->data['header'] = $this->load->controller('common/header'); $this->data['footer'] = $this->load->controller('common/footer'); $this->response->setOutput($this->render('accounting/currency_list.tpl')); }
public function index() { $this->data = $this->load->language('system/user'); $this->document->setTitle($this->language->get('heading_title')); $url = $this->build->url(array('sort', 'order', 'page')); $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL')); $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('system/user', 'token=' . $this->session->data['token'] . $url, 'SSL')); if (isset($this->request->get['page'])) { $page = (int) $this->request->get['page']; } else { $page = 1; } if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'username'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; } $filter_data = array('start' => $this->config->get('config_limit_admin') * ($page - 1), 'limit' => $this->config->get('config_limit_admin'), 'sort' => $sort, 'order' => $order); $this->load->model('system/user'); $this->data['users'] = array(); $users = $this->model_system_user->getUsers($filter_data); foreach ($users as $user) { $this->data['users'][] = array('user_id' => $user['user_id'], 'name' => $user['name'], 'username' => $user['username'], 'user_group' => $user['user_group'], 'status' => $user['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled'), 'date_added' => date($this->language->get('date_format_short'), strtotime($user['date_added'])), 'date_modified' => date($this->language->get('date_format_short'), strtotime($user['date_modified'])), 'edit' => $this->url->link('system/user/form', 'token=' . $this->session->data['token'] . $url . '&user_id=' . $user['user_id'], 'SSL')); } $url = $this->build->url(array('sort', 'order')); $pagination = new Pagination(); $pagination->total = $this->model_system_user->getTotalUsers(); $pagination->page = $page; $pagination->limit = $this->config->get('config_limit_admin'); $pagination->url = $this->url->link('system/user', 'token=' . $this->session->data['token'] . '&page={page}' . $url, 'SSL'); $this->data['pagination'] = $pagination->render(); $this->data['delete'] = $this->url->link('system/user/delete', 'token=' . $this->session->data['token'], 'SSL'); $this->data['insert'] = $this->url->link('system/user/form', 'token=' . $this->session->data['token'], 'SSL'); $this->data['success'] = $this->build->data('success', $this->session->data); $this->data['error_warning'] = $this->build->data('warning', $this->error); $this->data['selected'] = $this->build->data('selected', $this->request->post, array(), array()); $this->data['sort'] = $sort; $this->data['order'] = $order; if ($order == 'ASC') { $order = 'DESC'; } else { $order = 'ASC'; } $this->data['sort_name'] = $this->url->link('system/user', 'token=' . $this->session->data['token'] . '&sort=u.name&order=' . $order, 'SSL'); $this->data['sort_username'] = $this->url->link('system/user', 'token=' . $this->session->data['token'] . '&sort=username&order=' . $order, 'SSL'); $this->data['sort_user_group'] = $this->url->link('system/user', 'token=' . $this->session->data['token'] . '&sort=ug.name&order=' . $order, 'SSL'); $this->data['sort_status'] = $this->url->link('system/user', 'token=' . $this->session->data['token'] . '&sort=status&order=' . $order, 'SSL'); $this->data['sort_date_added'] = $this->url->link('system/user', 'token=' . $this->session->data['token'] . '&sort=date_added&order=' . $order, 'SSL'); $this->data['sort_date_modified'] = $this->url->link('system/user', 'token=' . $this->session->data['token'] . '&sort=date_modified&order=' . $order, 'SSL'); $this->data['header'] = $this->load->controller('common/header'); $this->data['footer'] = $this->load->controller('common/footer'); $this->response->setOutput($this->render('system/user_list.tpl')); }
public function index() { if (!$this->customer->isLogged()) { $this->session->data['redirect'] = $this->url->link('account/recurring', '', true); $this->response->redirect($this->url->link('account/login', '', true)); } $this->load->language('account/recurring'); $this->document->setTitle($this->language->get('heading_title')); $url = ''; if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home')); $data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', true)); $data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('account/recurring', $url, true)); $data['heading_title'] = $this->language->get('heading_title'); $data['text_empty'] = $this->language->get('text_empty'); $data['column_order_recurring_id'] = $this->language->get('column_order_recurring_id'); $data['column_product'] = $this->language->get('column_product'); $data['column_status'] = $this->language->get('column_status'); $data['column_date_added'] = $this->language->get('column_date_added'); $data['column_action'] = $this->language->get('column_action'); $data['button_view'] = $this->language->get('button_view'); $data['button_continue'] = $this->language->get('button_continue'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $data['recurrings'] = array(); $this->load->model('account/recurring'); $recurring_total = $this->model_account_recurring->getTotalOrderRecurrings(); $results = $this->model_account_recurring->getOrderRecurrings(($page - 1) * 10, 10); foreach ($results as $result) { if ($result['status']) { $status = $this->language->get('text_status_' . $result['status']); } else { $status = ''; } $data['recurrings'][] = array('order_recurring_id' => $result['order_recurring_id'], 'product' => $result['product_name'], 'status' => $status, 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 'view' => $this->url->link('account/recurring/info', 'order_recurring_id=' . $result['order_recurring_id'], true)); } $pagination = new Pagination(); $pagination->total = $recurring_total; $pagination->page = $page; $pagination->limit = 10; $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('account/recurring', 'page={page}', true); $data['pagination'] = $pagination->render(); $data['continue'] = $this->url->link('account/account', '', true); $data['column_left'] = $this->load->controller('common/column_left'); $data['column_right'] = $this->load->controller('common/column_right'); $data['content_top'] = $this->load->controller('common/content_top'); $data['content_bottom'] = $this->load->controller('common/content_bottom'); $data['footer'] = $this->load->controller('common/footer'); $data['header'] = $this->load->controller('common/header'); $this->response->setOutput($this->load->view('account/recurring_list', $data)); }
public function index() { if (!$this->customer->isLogged()) { $this->session->data['redirect'] = $this->url->link('account/transaction', '', 'SSL'); $this->response->redirect($this->url->link('account/login', '', 'SSL')); } $this->load->language('account/transaction'); $this->document->setTitle($this->language->get('heading_title')); $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home')); $data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', 'SSL')); $data['breadcrumbs'][] = array('text' => $this->language->get('text_transaction'), 'href' => $this->url->link('account/transaction', '', 'SSL')); $this->load->model('account/transaction'); $data['heading_title'] = $this->language->get('heading_title'); $data['column_date_added'] = $this->language->get('column_date_added'); $data['column_description'] = $this->language->get('column_description'); $data['column_amount'] = sprintf($this->language->get('column_amount'), $this->config->get('config_currency')); $data['text_total'] = $this->language->get('text_total'); $data['text_empty'] = $this->language->get('text_empty'); $data['button_continue'] = $this->language->get('button_continue'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $data['transactions'] = array(); $filter_data = array('sort' => 'date_added', 'order' => 'DESC', 'start' => ($page - 1) * 10, 'limit' => 10); $transaction_total = $this->model_account_transaction->getTotalTransactions(); $results = $this->model_account_transaction->getTransactions($filter_data); foreach ($results as $result) { $data['transactions'][] = array('amount' => $this->currency->format($result['amount'], $this->config->get('config_currency')), 'description' => $result['description'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))); } $pagination = new Pagination(); $pagination->total = $transaction_total; $pagination->page = $page; $pagination->limit = 10; $pagination->url = $this->url->link('account/transaction', 'page={page}', 'SSL'); $data['pagination'] = $pagination->render(); $data['results'] = sprintf($this->language->get('text_pagination'), $transaction_total ? ($page - 1) * 10 + 1 : 0, ($page - 1) * 10 > $transaction_total - 10 ? $transaction_total : ($page - 1) * 10 + 10, $transaction_total, ceil($transaction_total / 10)); $data['total'] = $this->currency->format($this->customer->getBalance()); $data['continue'] = $this->url->link('account/account', '', 'SSL'); $data['column_left'] = $this->load->controller('common/column_left'); $data['column_right'] = $this->load->controller('common/column_right'); $data['content_top'] = $this->load->controller('common/content_top'); $data['content_bottom'] = $this->load->controller('common/content_bottom'); $data['content_block2'] = $this->load->controller('common/content_block2'); $data['content_block3'] = $this->load->controller('common/content_block3'); $data['content_banner'] = $this->load->controller('common/content_banner'); $data['content_right'] = $this->load->controller('common/content_right'); $data['content_left'] = $this->load->controller('common/content_left'); $data['footer'] = $this->load->controller('common/footer'); $data['header'] = $this->load->controller('common/header'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/transaction.tpl')) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/account/transaction.tpl', $data)); } else { $this->response->setOutput($this->load->view('default/template/account/transaction.tpl', $data)); } }
public function index() { error_reporting(E_ALL); ini_set('display_errors', 'On'); if (!$this->customer->isLogged()) { $this->session->data['redirect'] = $this->url->link('account/coupons', '', 'SSL'); $this->redirect($this->url->link('account/login', '', 'SSL')); } if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $url = ''; $this->load->model('account/coupon'); $limit = 15; if (isset($this->session->data['advisory_type']) && $this->session->data['advisory_type'] != 6) { $data = array('type' => $this->session->data['advisory_type'], 'order' => 'DESC', 'start' => ($page - 1) * $limit, 'limit' => $limit); $this->data['advisory_type'] = $this->session->data['advisory_type']; $coupon_info = $this->model_account_coupon->getCoupon($data); $coupon_total = $this->model_account_coupon->getTotalCoupon($this->session->data['advisory_type']); } else { $data = array('type' => 6, 'order' => 'DESC', 'start' => ($page - 1) * $limit, 'limit' => $limit); $this->data['advisory_type'] = 6; $coupon_info = $this->model_account_coupon->getCoupon($data); $coupon_total = $this->model_account_coupon->getTotalCoupon(); } $pagination = new Pagination(); $pagination->total = $coupon_total; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link('account/coupons', $url . '&page={page}'); $this->data['pagination'] = $pagination->render(); $this->data['coupon_info'] = $coupon_info; $this->language->load('account/coupons'); $this->document->setTitle($this->language->get('heading_title')); $this->document->setKeywords($this->language->get('keywords')); $this->document->setDescription($this->language->get('description')); $this->data['heading_title'] = $this->document->getTitle(); $this->data['keywords'] = $this->document->getKeywords(); $this->data['description'] = $this->document->getDescription(); $this->data['text_my_coupons'] = $this->language->get('text_my_coupons'); $this->data['text_serial_number'] = $this->language->get('text_serial_number'); $this->data['text_par_value'] = $this->language->get('text_par_value'); $this->data['text_validity'] = $this->language->get('text_validity'); $this->data['text_state'] = $this->language->get('text_state'); $this->data['text_used'] = $this->language->get('text_used'); $this->data['text_without_use'] = $this->language->get('text_without_use'); $this->data['text_expired'] = $this->language->get('text_expired'); $this->data['text_use_source'] = $this->language->get('text_use_source'); $this->data['text_to'] = $this->language->get('text_to'); $this->template = 'cnstorm/template/account/coupons_business.tpl'; if (isset($this->request->get['page']) && array_key_exists('HTTP_REFERER', $_SERVER)) { $this->template = 'cnstorm/template/account/coupons_business_list.tpl'; } $this->children = array('common/header_cart', 'common/footer', 'common/uc_business'); $this->response->setOutput($this->render()); }