Exemple #1
0
 /**
  * 
  * 订单数据服务费列表
  * 
  */
 public function actionIndex()
 {
     $ecmsTaxModel = new EcmsTaxReceiptModel();
     $dataserviceModel = new DataServiceFeeModel();
     $plamfromType = CDict::$platform_type;
     $getData = $this->_get();
     $curr_page = $getData['page'] ? $getData['page'] : 1;
     $platform_type = $this->_get('platform_type');
     // 平台类型
     $platfromType = CDict::$platform_type;
     $whereSql = '';
     if ($getData['platform_type'] != '0' && $getData['platform_type']) {
         $whereSql .= "AND ORDERTYPE = '" . $getData['platform_type'] . "'";
     }
     if (strlen($getData['gbillno']) > 0) {
         $whereSql .= "AND GENERALBILLNO LIKE '%" . $getData['gbillno'] . "%'";
     }
     if (strlen($getData['start-time']) > 0) {
         $whereSql .= " AND TO_CHAR(REALARRIVALDATE, 'YYYY-MM-DD HH24:MI:SS') > '" . $getData['start-time'] . " 00:00:00'";
     }
     if (strlen($getData['end-time']) > 0) {
         $whereSql .= " AND TO_CHAR(REALARRIVALDATE, 'YYYY-MM-DD HH24:MI:SS') < '" . $getData['end-time'] . " 24:00:00'";
     }
     $data = $dataserviceModel->getList($whereSql, $curr_page, $this->_pageSize);
     $count = $dataserviceModel->getNowhereCount($whereSql);
     $page = new pager($count, $curr_page, $this->_pageSize);
     $pageStr = $page->GetPagerContent();
     //var_dump($data);
     //var_dump($getData);
     //var_dump($whereSql);
     $count1 = $this->_orderHeadModel->get_count(" AND HANDLESTATE='3' AND BILLSTATUS='0' ");
     $count2 = $this->_orderHeadModel->get_count(" AND HANDLESTATE='3' AND BILLSTATUS='1' ");
     $count3 = $this->_orderHeadModel->get_count(" AND HANDLESTATE='3' AND BILLSTATUS='2' ");
     $count4 = $ecmsTaxModel->get_count(" AND TYPE='ECMS'");
     $count5 = $ecmsTaxModel->get_count(" AND TYPE='UPS'");
     $count6 = $dataserviceModel->getNowhereCount("");
     $this->assign("count1", $count1);
     $this->assign("count2", $count2);
     $this->assign("count3", $count3);
     $this->assign("count4", $count4);
     $this->assign("count5", $count5);
     $this->assign("count6", $count6);
     array_unshift($plamfromType, "选择平台类型");
     $this->assign('page', $pageStr);
     $this->assign('count', $count);
     $this->assign('platform_type', $getData['platform_type']);
     $this->assign('gbillno', $getData['gbillno']);
     $this->assign('starttime', $getData['start-time']);
     $this->assign('endtime', $getData['end-time']);
     $this->assign('data', $data);
     $this->assign("platformType", $plamfromType);
     $this->display('dataservicefee/dataservicefee_index.html');
 }
Exemple #2
0
 function init($pages, $cur_page, $uri)
 {
     self::$pager = true;
     self::$pages = $pages;
     self::$cur_page = $cur_page;
     self::$pager_uri = $uri;
 }
Exemple #3
0
 /**
  * Trash 
  * 
  * @param  string $type all|hidden 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function trash($type = 'all', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Save session. */
     $uri = $this->app->getURI(true);
     $this->session->set('productList', $uri);
     $this->session->set('productPlanList', $uri);
     $this->session->set('releaseList', $uri);
     $this->session->set('storyList', $uri);
     $this->session->set('projectList', $uri);
     $this->session->set('taskList', $uri);
     $this->session->set('buildList', $uri);
     $this->session->set('bugList', $uri);
     $this->session->set('caseList', $uri);
     $this->session->set('testtaskList', $uri);
     $this->session->set('docList', $uri);
     /* Get deleted objects. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     $trashes = $this->action->getTrashes($type, $orderBy, $pager);
     /* Title and position. */
     $this->view->title = $this->lang->action->trash;
     $this->view->position[] = $this->lang->action->trash;
     $this->view->trashes = $trashes;
     $this->view->type = $type;
     $this->view->orderBy = $orderBy;
     $this->view->pager = $pager;
     $this->view->users = $this->loadModel('user')->getPairs('noletter');
     $this->display();
 }
Exemple #4
0
 public function setURL()
 {
     parent::setURL();
     $url = parse_url($_SERVER['REQUEST_URI']);
     if (isset($url['query'])) {
         parse_str($url['query'], $args);
     } else {
         $args = array();
     }
     # Removing session information
     if (session_id()) {
         if (isset($args[session_name()])) {
             unset($args[session_name()]);
         }
     }
     if (isset($args[$this->var_page])) {
         unset($args[$this->var_page]);
     }
     if (isset($args['ok'])) {
         unset($args['ok']);
     }
     $this->form_hidden = '';
     foreach ($args as $k => $v) {
         if (is_array($v)) {
             foreach ($v as $k2 => $v2) {
                 $this->form_hidden .= form::hidden(array($k . '[]'), html::escapeHTML($v2));
             }
         } else {
             $this->form_hidden .= form::hidden(array($k), html::escapeHTML($v));
         }
     }
     $this->form_action = $url['path'];
 }
 function set($entries, $page, $limit)
 {
     self::$entries = $entries;
     self::$limit = $limit;
     self::$pages = $entries > 0 ? ceil($entries / $limit) : 0;
     self::$page = self::sanitize($page, self::$pages);
 }
Exemple #6
0
 public static function init($page, $total, $num = 10)
 {
     self::$page = max(1, $page);
     self::$start = $num * (self::$page - 1);
     self::$num = $num;
     self::$total = $total;
     self::$last = ceil($total / $num);
 }
 public function _get()
 {
     $total = oo::m()->count();
     $page = $this->req('page');
     pager::init($page, $total);
     $list = oo::m()->limit(pager::$start, pager::$num)->orderby('id desc')->getall();
     method_exists($this, 'after_get') && $this->after_get($list);
     $this->assign('pager', pager::get());
     $this->assign('list', $list);
     $this->display("{$this->form['tpl']}_list");
 }
Exemple #8
0
 public function getPager($addWhere = '', $addSql = '', $showMax = 20, $select = '', $key = '', $form_vars = array())
 {
     $db = sf::getLib("db");
     if ($select) {
         $sql = $select . " ";
     } else {
         $sql = "SELECT * FROM `" . $this->table . "` ";
     }
     $addWhere && ($sql .= "WHERE " . $addWhere . " ");
     $addSql && ($sql .= $addSql . " ");
     if (!router::get("totalnum" . $key)) {
         $_sql = "SELECT COUNT(*) AS NUM FROM `" . $this->table . "` ";
         $addWhere && ($_sql .= "WHERE " . $addWhere . " ");
         $addSql && ($_sql .= $addSql . " ");
         $row = $db->fetch_first($_sql);
         $total = $row['NUM'];
     } else {
         $total = router::get("totalnum" . $key);
     }
     $pager = new pager($total, $showMax, $key, $form_vars);
     $sql .= "LIMIT " . $pager->getStartNum() . "," . $pager->getShowNum();
     $query = $db->query($sql);
     $pager->setField($db->result_array($query));
     $pager->setObject(clone $this);
     return $pager;
 }
Exemple #9
0
 public function display($page, $nb_per_page, $enclose_block = '')
 {
     if ($this->rs->isEmpty()) {
         echo '<p><strong>' . __('No page') . '</strong></p>';
     } else {
         $pager = new pager($page, $this->rs_count, $nb_per_page, 10);
         $pager->html_prev = $this->html_prev;
         $pager->html_next = $this->html_next;
         $pager->var_page = 'page';
         $html_block = '<table class="clear"><tr>' . '<th colspan="2">' . __('Title') . '</th>' . '<th>' . __('Date') . '</th>' . '<th>' . __('Author') . '</th>' . '<th>' . __('Comments') . '</th>' . '<th>' . __('Trackbacks') . '</th>' . '<th>' . __('Status') . '</th>' . '</tr>%s</table>';
         if ($enclose_block) {
             $html_block = sprintf($enclose_block, $html_block);
         }
         echo '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>';
         $blocks = explode('%s', $html_block);
         echo $blocks[0];
         while ($this->rs->fetch()) {
             echo $this->postLine();
         }
         echo $blocks[1];
         echo '<p>' . __('Page(s)') . ' : ' . $pager->getLinks() . '</p>';
     }
 }
Exemple #10
0
 /**
  * Processes available input adjusting internal state of databrowser.
  *
  * @return \de\toxa\txf\databrowser current instance
  */
 public function processInput()
 {
     if (!$this->pager) {
         // process all input once USING pager for semaphore
         $this->pager = new pager($this->datasource->count(), $this->volatilePager);
         if ($this->pager->isEnabled()) {
             $this->datasource->size($this->pager->size())->offset($this->pager->offset());
             if ($this->getForm()) {
                 $this->pager->enableButtons(true);
             }
         }
     }
     return $this;
 }
Exemple #11
0
 public function index()
 {
     $cid = $this->req('cid', 0, 'intval');
     $where = array();
     $cid && ($where = array('cateid' => $cid));
     $total = oo::m('product')->where($where)->count();
     $page = $this->req('page');
     pager::init($page, $total);
     $list = oo::m('product')->limit(pager::$start, pager::$num)->orderby('id desc')->where($where)->getall();
     $this->assign('list', $list);
     //推荐商家
     $seller = oo::m('seller')->limit(5)->getall();
     $this->assign('seller', $seller);
     $this->display('list');
 }
 /**
  * отображаем весь список материалов
  */
 function indexAction()
 {
     if (isset($_POST['status'])) {
         $_SESSION['status'] = $_POST['status'];
     }
     if (isset($_POST['status'])) {
         $limit = 1000;
     } else {
         $_total_news = dbh::news_get_total_count();
         $limit = pager::pager_limit($_total_news, ADMIN_NEWS_AT_PAGE);
     }
     // строим запрос
     $_sql = 'SELECT * FROM ' . $this->tablename . ' where id>0 ' . general::get_status_for_filter($this->tablename) . ' order by created_at desc, sort limit ' . $limit;
     // выполняем запрос + при необходимости выводим сам запрос
     $result = mysql::query($_sql, 3);
     return system::show_tpl(array('result' => $result, 'msg' => $this->msg, '_status' => isset($_POST['status']) ? $_POST['status'] : 2, 'tpl_folder' => $this->tpl_folder, '_total_news' => $_total_news), $this->tpl_folder . '/index.php');
 }
 /**
  * отображаем весь список материалов
  */
 function indexAction()
 {
     // если перешли по get ссылке из меню
     if (isset($_POST['name'])) {
         $_SESSION['name'] = $_POST['name'];
     }
     if (isset($_POST['artikul'])) {
         $_SESSION['artikul'] = $_POST['artikul'];
     }
     if ($_POST) {
         if (isset($_POST['block_new'])) {
             $_SESSION['block_new'] = $_POST['block_new'];
         } else {
             unset($_SESSION['block_new']);
         }
         if (isset($_POST['block_lider'])) {
             $_SESSION['block_lider'] = $_POST['block_lider'];
         } else {
             unset($_SESSION['block_lider']);
         }
     }
     if (isset($_POST['id_parent'])) {
         $_SESSION['id_parent'] = $_POST['id_parent'];
     }
     if (isset($_POST['brand'])) {
         $_SESSION['brand'] = $_POST['brand'];
     }
     if (isset($_POST['photo'])) {
         $_SESSION['photo'] = $_POST['photo'];
     }
     if (isset($_POST['sklad'])) {
         $_SESSION['sklad'] = $_POST['sklad'];
     }
     if (isset($_POST['status'])) {
         $_SESSION['status'] = $_POST['status'];
     }
     // get limit
     // всего в каталоге
     $_total_catalog = dbh::catalog_get_total_count();
     $limit = pager::pager_limit($_total_catalog, ADMIN_CATALOG_AT_PAGE);
     // строим запрос
     $_sql = 'SELECT * FROM ' . $this->tablename . ' where id>0 ' . general::get_status_for_filter($this->tablename) . ' order by sort limit ' . $limit;
     // выполняем запрос + при необходимости выводим сам запрос
     $result = mysql::query($_sql, 0);
     return system::show_tpl(array('result' => $result, 'msg' => $this->msg, '_total_catalog' => $_total_catalog, '_status' => isset($_SESSION['status']) ? $_SESSION['status'] : 2, '_brand' => isset($_SESSION['brand']) ? $_SESSION['brand'] : 0, '_photo' => isset($_SESSION['photo']) ? $_SESSION['photo'] : 2, '_sklad' => isset($_SESSION['sklad']) ? $_SESSION['sklad'] : 3, 'tpl_folder' => $this->tpl_folder, 'select' => dbh::get_catolog_tree(), 'brand' => dbh::get_brand(), 'curent_id_parent' => isset($_SESSION['id_parent']) ? $_SESSION['id_parent'] : 0), $this->tpl_folder . '/index.php');
 }
Exemple #14
0
 public function defaultpwd($recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Load pager. */
     $this->app->loadClass('pager', $static = true);
     if ($this->app->getViewType() == 'mhtml') {
         $recPerPage = 10;
     }
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     $passwords = $this->kevinlogin->getPasswordList($pager);
     if (!empty($_POST)) {
         $this->kevinlogin->updateDefaultPwd();
         die(js::reload('parent'));
     }
     $this->view->title = $this->lang->kevinlogin->common . $this->lang->colon . $this->lang->kevinlogin->defaultpwd;
     $this->view->position[] = $this->lang->kevinlogin->defaultpwd;
     $this->view->pager = $pager;
     $this->view->passwords = $passwords;
     $this->view->controlType = 'defaultpwd';
     $this->display();
 }
 /**
  * отображаем весь список материалов
  */
 function indexAction()
 {
     if (isset($_POST['status'])) {
         $_SESSION['status'] = $_POST['status'];
     }
     if (isset($_POST['id_parent']) and $_POST['id_parent'] > 0) {
         $limit = 1000;
     } else {
         // get limit
         // всего в каталоге
         $_total_gallery = dbh::gallery_get_total_count();
         $limit = pager::pager_limit($_total_gallery, ADMIN_GALLERY_AT_PAGE);
     }
     // строим запрос
     $_sql = 'SELECT * FROM ' . $this->tablename . ' where id>0 ' . general::get_status_for_filter($this->tablename) . ' ' . general::get_for_filter($this->tablename, 'id_parent') . ' order by sort  limit ' . $limit;
     // выполняем запрос + при необходимости выводим сам запрос
     $result = mysql::query($_sql, 0);
     // выбираем фотоальбомы
     $_sql = 'SELECT * FROM gallery_grupa where status=1 and id_parent=0 order by pole';
     $gallery_grupa = mysql::query($_sql, 0);
     return system::show_tpl(array('result' => $result, 'msg' => $this->msg, '_status' => isset($_POST['status']) ? $_POST['status'] : 2, 'gallery_grupa' => $gallery_grupa, 'tpl_folder' => $this->tpl_folder, '_total_gallery' => $_total_gallery), $this->tpl_folder . '/index.php');
 }
Exemple #16
0
 /**
  * Link cases to a test task.
  * 
  * @param  int    $taskID 
  * @access public
  * @return void
  */
 public function linkCase($taskID, $param = 'all', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     if (!empty($_POST)) {
         $this->testtask->linkCase($taskID);
         $this->locate(inlink('cases', "taskID={$taskID}"));
     }
     /* Save session. */
     $this->session->set('caseList', $this->app->getURI(true));
     /* Get task and product id. */
     $task = $this->testtask->getById($taskID);
     $productID = $this->product->saveState($task->product, $this->products);
     /* Load pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     /* Build the search form. */
     $this->loadModel('testcase');
     $this->config->testcase->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct);
     $this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case');
     $this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID={$taskID}");
     $this->view->searchForm = $this->fetch('search', 'buildForm', $this->config->testcase->search);
     /* Save session. */
     $this->testtask->setMenu($this->products, $productID);
     $this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->linkCase;
     $this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID={$productID}"), $this->products[$productID]);
     $this->view->position[] = $this->lang->testtask->linkCase;
     /* Get cases. */
     if ($this->session->testcaseQuery == false) {
         $this->session->set('testcaseQuery', ' 1 = 1');
     }
     $query = str_replace("`product` = 'all'", '1', $this->session->testcaseQuery);
     // If search all product, replace product = all to 1=1
     $linkedCases = $this->dao->select('`case`')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->fetchPairs('case');
     if ($param == 'all') {
         $cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)->andWhere('product')->eq($productID)->andWhere('id')->notIN($linkedCases)->andWhere('deleted')->eq(0)->orderBy('id desc')->page($pager)->fetchAll();
     }
     if ($param == 'bystory') {
         $stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories');
         $cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)->andWhere('product')->eq($productID)->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()->andWhere('story')->in($stories)->andWhere('deleted')->eq(0)->orderBy('id desc')->page($pager)->fetchAll();
     }
     if ($param == 'bybug') {
         $bugs = $this->dao->select('bugs')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('bugs');
         $cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)->andWhere('product')->eq($productID)->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()->andWhere('fromBug')->in($bugs)->andWhere('deleted')->eq(0)->orderBy('id desc')->page($pager)->fetchAll();
     }
     $this->view->users = $this->loadModel('user')->getPairs('noletter');
     $this->view->cases = $cases;
     $this->view->taskID = $taskID;
     $this->view->pager = $pager;
     $this->display();
 }
Exemple #17
0
 public function __construct($env, $nb_elements, $nb_per_page = 10, $nb_pages_per_group = 10)
 {
     parent::__construct($env, $nb_elements, $nb_per_page, $nb_pages_per_group);
     $this->html_prev = '&#171;&nbsp;' . __('c_c_previous_f');
     $this->html_next = __('c_c_next_f') . '&nbsp;&#187;';
 }
Exemple #18
0
?>
 href="<?php 
echo isset($_GET['id']) ? general::link('filter/id/' . $_GET['id'] . '/type_sort/2') : general::link('filter/type_sort/2');
?>
">Я>А</a> </div>
                    </div><!-- .srt_block-->

                    <div class="tovar_list_3">
					
	<?php 
foreach ($result as $obj) {
    ?>
	
				<?php 
    echo system::show_tpl(array('obj' => $obj, 'level' => ''), '/frontend/catalog/list_index.php');
    ?>
	
	<?php 
}
?>
	
                    </div><!-- .tovar_list_3-->	
	
	
	<?php 
// pager
if (isset($_GET['id'])) {
    echo filter::get_count() > CATALOG_AT_PAGE ? pager::pager_J("filter/id/" . $_GET['id'], CATALOG_AT_PAGE, filter::get_count(), intval($_GET['page'])) : '';
} else {
    echo filter::get_count() > CATALOG_AT_PAGE ? pager::pager_J("filter", CATALOG_AT_PAGE, filter::get_count(), intval($_GET['page'])) : '';
}
Exemple #19
0
 /**
  * Product dynamic.
  * 
  * @param  string $type 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function dynamic($productID = 0, $type = 'today', $param = '', $orderBy = 'date_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Save session. */
     $uri = $this->app->getURI(true);
     $this->session->set('productList', $uri);
     $this->session->set('productPlanList', $uri);
     $this->session->set('releaseList', $uri);
     $this->session->set('storyList', $uri);
     $this->session->set('projectList', $uri);
     $this->session->set('taskList', $uri);
     $this->session->set('buildList', $uri);
     $this->session->set('bugList', $uri);
     $this->session->set('caseList', $uri);
     $this->session->set('testtaskList', $uri);
     $this->product->setMenu($this->products, $productID);
     /* Append id for secend sort. */
     $sort = $this->loadModel('common')->appendOrder($orderBy);
     /* Set the pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     /* Set the user and type. */
     $account = $type == 'account' ? $param : 'all';
     $period = $type == 'account' ? 'all' : $type;
     /* The header and position. */
     $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->product->dynamic;
     $this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $this->products[$productID]);
     $this->view->position[] = $this->lang->product->dynamic;
     /* Assign. */
     $this->view->productID = $productID;
     $this->view->type = $type;
     $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noletter');
     $this->view->account = $account;
     $this->view->orderBy = $orderBy;
     $this->view->pager = $pager;
     $this->view->param = $param;
     $this->view->actions = $this->loadModel('action')->getDynamic($account, $period, $sort, $pager, $productID);
     $this->display();
 }
Exemple #20
0
 /**
  * User dynamic.
  * 
  * @param  string $period 
  * @param  string $account 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function dynamic($period = 'today', $account = '', $orderBy = 'date_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* set menus. */
     $this->lang->set('menugroup.user', 'company');
     $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
     /* Save session. */
     $uri = $this->app->getURI(true);
     $this->session->set('productList', $uri);
     $this->session->set('productPlanList', $uri);
     $this->session->set('releaseList', $uri);
     $this->session->set('storyList', $uri);
     $this->session->set('projectList', $uri);
     $this->session->set('taskList', $uri);
     $this->session->set('buildList', $uri);
     $this->session->set('bugList', $uri);
     $this->session->set('caseList', $uri);
     $this->session->set('testtaskList', $uri);
     /* Set the pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     $this->view->orderBy = $orderBy;
     $this->view->pager = $pager;
     $this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->dynamic;
     $this->view->position[] = $this->lang->user->dynamic;
     /* Assign. */
     $this->view->period = $period;
     $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noletter');
     $this->view->account = $account;
     $this->view->user = $this->dao->findByAccount($account)->from(TABLE_USER)->fetch();
     $this->view->actions = $this->loadModel('action')->getDynamic($account, $period, $orderBy, $pager);
     $this->display();
 }
        if ($curpage != $pages && $pages != 0) {
            $page_list .= "<a href=\"" . $_SERVER['PHP_SELF'] . "?p=8&page=" . $pages . "\" title=\"Trang cuối\"> >> </a>";
        }
        $page_list .= "</td>\n";
        return $page_list;
    }
}
?>


<?php 
// kết nối CSDL
require 'db.php';
//$ketnoi_maychu = ketnoi_MC();
//chon_CSDL($ketnoi_maychu);
$p = new pager();
$limit = 20;
$start = $p->findStart($limit);
$count = mysql_num_rows(mysql_query("SELECT*FROM gioi_thieu"));
$pages = $p->findPages($count, $limit);
$result = mysql_query("SELECT * FROM gioi_thieu  ORDER BY id DESC limit {$start},{$limit}");
// $result=mysql_query("SELECT * FROM danh_muc_sp ORDER BY masp DESC");
if (mysql_num_rows($result) != 0) {
    echo "<h2 align='div'>Thông Tin Người Dùng </h2>";
    echo " <table border='1' align='div'>";
    echo "<tr bgcolor='orange'>";
    echo "<td >STT</td>";
    echo "<td >Tiêu đề</td>";
    echo "<td >Hình ảnh</td>";
    echo "<td >Xóa</td>";
    echo "<td >Sữa</td>";
 public function test_twelth_of_twelve_pages()
 {
     $first = new pager(100, 1200, 12);
     $actual = $first->pages();
     $expected = array(1, 'skip', 6, 7, 8, 9, 10, 11, 12);
     $this->assertEquals($expected, $actual);
 }
Exemple #23
0
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4ddc86a40e0ffd66"></script></div>
   
</div>
<div class="sanpham" align="center">

<?php 
include_once "phan_trang.php";
require 'db.php';
$p = new pager();
$limit = 12;
$start = $p->findStart($limit);
$count = mysql_num_rows(mysql_query("SELECT*FROM du_an"));
$pages = $p->findPages($count, $limit);
$id = $_REQUEST["id"];
$result = mysql_query("SELECT * FROM du_an where id<>{$id} ORDER BY id DESC limit {$start},{$limit}");
// hiển thị DL
if (mysql_num_rows($result) != 0) {
    echo " <table width='100%' border='0'>";
    $stt = 0;
    while ($row = mysql_fetch_object($result)) {
        $id = $row->id;
        $tieude = $row->tieude;
        $url = khongdau($tieude);
        // $ngay=$row->ngay;
Exemple #24
0
 /**
  * Browse cases.
  * 
  * @param  int    $productID 
  * @param  string $browseType 
  * @param  int    $param 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function browse($productID = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Set browseType, productID, moduleID and queryID. */
     $browseType = strtolower($browseType);
     $productID = $this->product->saveState($productID, $this->products);
     $moduleID = $browseType == 'bymodule' ? (int) $param : 0;
     $queryID = $browseType == 'bysearch' ? (int) $param : 0;
     /* Set menu, save session. */
     $this->testcase->setMenu($this->products, $productID);
     $this->session->set('caseList', $this->app->getURI(true));
     $this->session->set('productID', $productID);
     $this->session->set('moduleID', $moduleID);
     $this->session->set('browseType', $browseType);
     $this->session->set('orderBy', $orderBy);
     /* Load lang. */
     $this->app->loadLang('testtask');
     /* Load pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     $sort = $this->loadModel('common')->appendOrder($orderBy);
     /* By module or all cases. */
     if ($browseType == 'bymodule' or $browseType == 'all') {
         $childModuleIds = $this->tree->getAllChildId($moduleID);
         $this->view->cases = $this->testcase->getModuleCases($productID, $childModuleIds, $sort, $pager);
     } elseif ($browseType == 'needconfirm') {
         $this->view->cases = $this->dao->select('t1.*, t2.title AS storyTitle')->from(TABLE_CASE)->alias('t1')->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')->where("t2.status = 'active'")->andWhere('t1.deleted')->eq(0)->andWhere('t2.version > t1.storyVersion')->orderBy($sort)->page($pager)->fetchAll();
     } elseif ($browseType == 'bysearch') {
         if ($queryID) {
             $query = $this->loadModel('search')->getQuery($queryID);
             if ($query) {
                 $this->session->set('testcaseQuery', $query->sql);
                 $this->session->set('testcaseForm', $query->form);
             } else {
                 $this->session->set('testcaseQuery', ' 1 = 1');
             }
         } else {
             if ($this->session->testcaseQuery == false) {
                 $this->session->set('testcaseQuery', ' 1 = 1');
             }
         }
         $queryProductID = $productID;
         $allProduct = "`product` = 'all'";
         $caseQuery = '(' . $this->session->testcaseQuery;
         if (strpos($this->session->testcaseQuery, $allProduct) !== false) {
             $products = array_keys($this->loadModel('product')->getPrivProducts());
             $caseQuery = str_replace($allProduct, '1', $caseQuery);
             $caseQuery = $caseQuery . ' AND `product`' . helper::dbIN($products);
             $queryProductID = 'all';
         }
         $caseQuery .= ')';
         $this->view->cases = $this->dao->select('*')->from(TABLE_CASE)->where($caseQuery)->beginIF($queryProductID != 'all')->andWhere('product')->eq($productID)->fi()->andWhere('deleted')->eq(0)->orderBy($sort)->page($pager)->fetchAll();
     }
     /* save session .*/
     $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', $browseType != 'bysearch' ? false : true);
     /* Build the search form. */
     $this->config->testcase->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct);
     $this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case');
     $this->config->testcase->search['actionURL'] = $this->createLink('testcase', 'browse', "productID={$productID}&browseType=bySearch&queryID=myQueryID");
     $this->config->testcase->search['queryID'] = $queryID;
     $this->loadModel('search')->setSearchParams($this->config->testcase->search);
     /* Assign. */
     $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common;
     $this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID={$productID}"), $this->products[$productID]);
     $this->view->position[] = $this->lang->testcase->common;
     $this->view->productID = $productID;
     $this->view->productName = $this->products[$productID];
     $this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createCaseLink'));
     $this->view->moduleID = $moduleID;
     $this->view->pager = $pager;
     $this->view->users = $this->user->getPairs('noletter');
     $this->view->orderBy = $orderBy;
     $this->view->browseType = $browseType;
     $this->view->param = $param;
     $this->display();
 }
Exemple #25
0
function outputUniidSelectionForm($uniSql, $options)
{
    global $tpl;
    // settings
    global $locline, $secondlocationname;
    $urlparamString = prepareLocSelectionForm($options);
    sql_temp_table_slave('uniids');
    sql_slave('CREATE TEMPORARY TABLE &uniids ENGINE=MEMORY ' . $uniSql);
    sql_slave('ALTER TABLE &uniids ADD PRIMARY KEY (`uni_id`)');
    // locidsite
    $locidsite = isset($_REQUEST['locidsite']) ? $_REQUEST['locidsite'] : 0;
    if (!is_numeric($locidsite)) {
        $locidsite = 0;
    }
    $count = sql_value_slave('SELECT COUNT(*) FROM &uniids', 0);
    $tpl->assign('resultscount', $count);
    // create page browser
    $pager = new pager('search.php?' . $urlparamString . '&locidsite={offset}');
    $pager->make_from_offset($locidsite, ceil($count / 20), 1);
    // create locations list
    $rs = sql_slave('SELECT `gns_locations`.`rc` `rc`, `gns_locations`.`cc1` `cc1`, `gns_locations`.`admtxt1` `admtxt1`, `gns_locations`.`admtxt2` `admtxt2`, `gns_locations`.`admtxt3` `admtxt3`, `gns_locations`.`admtxt4` `admtxt4`, `gns_locations`.`uni` `uni_id`, `gns_locations`.`lon` `lon`, `gns_locations`.`lat` `lat`, `gns_locations`.`full_name` `full_name`, &uniids.`olduni` `olduni` FROM `gns_locations`, &uniids WHERE &uniids.`uni_id`=`gns_locations`.`uni` ORDER BY `gns_locations`.`full_name` ASC LIMIT ' . $locidsite * 20 . ', 20');
    $nr = $locidsite * 20 + 1;
    $locations = '';
    while ($r = sql_fetch_array($rs)) {
        $thislocation = $locline;
        $locString = '';
        if ($r['admtxt1'] != '') {
            if ($locString != '') {
                $locString .= ' &gt; ';
            }
            $locString .= htmlspecialchars($r['admtxt1'], ENT_COMPAT, 'UTF-8');
        }
        if ($r['admtxt2'] != '') {
            if ($locString != '') {
                $locString .= ' &gt; ';
            }
            $locString .= htmlspecialchars($r['admtxt2'], ENT_COMPAT, 'UTF-8');
        }
        /*		if ($r['admtxt3'] != '')
        		{
        			if ($locString != '') $locString .= ' &gt; ';
        			$locString .= htmlspecialchars($r['admtxt3'], ENT_COMPAT, 'UTF-8');
        		}
        */
        if ($r['admtxt4'] != '') {
            if ($locString != '') {
                $locString .= ' &gt; ';
            }
            $locString .= htmlspecialchars($r['admtxt4'], ENT_COMPAT, 'UTF-8');
        }
        $thislocation = mb_ereg_replace('{parentlocations}', $locString, $thislocation);
        // koordinaten ermitteln
        $coordString = help_latToDegreeStr($r['lat']) . ' ' . help_lonToDegreeStr($r['lon']);
        $thislocation = mb_ereg_replace('{coords}', htmlspecialchars($coordString, ENT_COMPAT, 'UTF-8'), $thislocation);
        if ($r['olduni'] != 0) {
            // der alte name wurde durch den native-wert ersetzt
            $thissecloc = $secondlocationname;
            $r['olduni'] = $r['olduni'] + 0;
            $rsSecLoc = sql_slave('SELECT full_name FROM gns_locations WHERE uni=' . $r['olduni']);
            $rSecLoc = sql_fetch_assoc($rsSecLoc);
            $thissecloc = mb_ereg_replace('{secondlocationname}', htmlspecialchars($rSecLoc['full_name'], ENT_COMPAT, 'UTF-8'), $thissecloc);
            sql_free_result($rsSecLoc);
            $thislocation = mb_ereg_replace('{secondlocationname}', $thissecloc, $thislocation);
        } else {
            $thislocation = mb_ereg_replace('{secondlocationname}', '', $thislocation);
        }
        $thislocation = mb_ereg_replace('{locationname}', htmlspecialchars($r['full_name'], ENT_COMPAT, 'UTF-8'), $thislocation);
        $thislocation = mb_ereg_replace('{urlparams}', $urlparamString . '&locid={locid}', $thislocation);
        $thislocation = mb_ereg_replace('{locid}', urlencode($r['uni_id']), $thislocation);
        $thislocation = mb_ereg_replace('{nr}', $nr, $thislocation);
        $nr++;
        $locations .= $thislocation . "\n";
    }
    sql_free_result($rs);
    sql_drop_temp_table_slave('uniids');
    $tpl->assign('locations', $locations);
    $tpl->display();
    exit;
}
Exemple #26
0
 /**
  * Browse bugs.
  * 
  * @param  int    $productID 
  * @param  string $browseType 
  * @param  int    $param 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function browse($productID = 0, $branch = '', $browseType = 'unclosed', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Set browseType, productID, moduleID and queryID. */
     $browseType = strtolower($browseType);
     $productID = $this->product->saveState($productID, $this->products);
     if ($branch === '') {
         $branch = $this->session->branch;
     }
     $moduleID = $browseType == 'bymodule' ? (int) $param : 0;
     $queryID = $browseType == 'bysearch' ? (int) $param : 0;
     /* Set menu and save session. */
     $this->bug->setMenu($this->products, $productID, $branch);
     $this->session->set('bugList', $this->app->getURI(true));
     /* Process the order by field. */
     if (!$orderBy) {
         $orderBy = $this->cookie->qaBugOrder ? $this->cookie->qaBugOrder : 'id_desc';
     }
     setcookie('qaBugOrder', $orderBy, $this->config->cookieLife, $this->config->webRoot);
     /* Append id for secend sort. */
     $sort = $this->loadModel('common')->appendOrder($orderBy);
     /* Load pager. */
     $this->app->loadClass('pager', $static = true);
     if ($this->app->getViewType() == 'mhtml') {
         $recPerPage = 10;
     }
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     $projects = $this->loadModel('project')->getPairs();
     $projects[0] = '';
     /* Get bugs. */
     $bugs = array();
     if ($browseType == 'all') {
         $bugs = $this->bug->getAllBugs($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == "bymodule") {
         $childModuleIds = $this->tree->getAllChildId($moduleID);
         $bugs = $this->bug->getModuleBugs($productID, $branch, $childModuleIds, $projects, $sort, $pager);
     } elseif ($browseType == 'assigntome') {
         $bugs = $this->bug->getByAssigntome($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'openedbyme') {
         $bugs = $this->bug->getByOpenedbyme($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'resolvedbyme') {
         $bugs = $this->bug->getByResolvedbyme($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'assigntonull') {
         $bugs = $this->bug->getByAssigntonull($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'unconfirmed') {
         $bugs = $this->bug->getUnconfirmed($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'unresolved') {
         $bugs = $this->bug->getByStatus($productID, $branch, $projects, 'unresolved', $sort, $pager);
     } elseif ($browseType == 'unclosed') {
         $bugs = $this->bug->getByStatus($productID, $branch, $projects, 'unclosed', $sort, $pager);
     } elseif ($browseType == 'toclosed') {
         $bugs = $this->bug->getByStatus($productID, $branch, $projects, 'toclosed', $sort, $pager);
     } elseif ($browseType == 'longlifebugs') {
         $bugs = $this->bug->getByLonglifebugs($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'postponedbugs') {
         $bugs = $this->bug->getByPostponedbugs($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'needconfirm') {
         $bugs = $this->bug->getByNeedconfirm($productID, $branch, $projects, $sort, $pager);
     } elseif ($browseType == 'bysearch') {
         $bugs = $this->bug->getBySearch($productID, $queryID, $sort, $pager, $branch);
     }
     /* Process the sql, get the conditon partion, save it to session. */
     $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug', $browseType == 'needconfirm' ? false : true);
     /* Process bug for check story changed. */
     $bugs = $this->loadModel('story')->checkNeedConfirm($bugs);
     /* Build the search form. */
     $this->config->bug->search['actionURL'] = $this->createLink('bug', 'browse', "productID={$productID}&branch={$branch}&browseType=bySearch&queryID=myQueryID");
     $this->config->bug->search['queryID'] = $queryID;
     $this->config->bug->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->bug->allProduct);
     $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID);
     $this->config->bug->search['params']['module']['values'] = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0);
     $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairs($productID);
     $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID, 0, $params = '');
     $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values'];
     if ($this->session->currentProductType == 'normal') {
         unset($this->config->bug->search['fields']['branch']);
         unset($this->config->bug->search['params']['branch']);
     } else {
         $this->config->bug->search['fields']['branch'] = $this->lang->product->branch;
         $this->config->bug->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($productID, 'noempty');
     }
     $this->loadModel('search')->setSearchParams($this->config->bug->search);
     $users = $this->user->getPairs('noletter');
     /* Process the openedBuild and resolvedBuild fields. */
     $productIdList = array();
     foreach ($bugs as $bug) {
         $productIdList[$bug->id] = $bug->product;
     }
     $builds = $this->loadModel('build')->getProductBuildPairs(array_unique($productIdList), 0, $params = '');
     foreach ($bugs as $key => $bug) {
         $openBuildIdList = explode(',', $bug->openedBuild);
         $openedBuild = '';
         foreach ($openBuildIdList as $buildID) {
             $openedBuild .= isset($builds[$buildID]) ? $builds[$buildID] : $buildID;
             $openedBuild .= ',';
         }
         $bug->openedBuild = rtrim($openedBuild, ',');
         $bug->resolvedBuild = isset($builds[$bug->resolvedBuild]) ? $builds[$bug->resolvedBuild] : $bug->resolvedBuild;
     }
     $memberPairs = $this->user->getPairs('noletter|nodeleted');
     $title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common;
     $position[] = html::a($this->createLink('bug', 'browse', "productID={$productID}"), $this->products[$productID]);
     $position[] = $this->lang->bug->common;
     $this->view->title = $title;
     $this->view->position = $position;
     $this->view->productID = $productID;
     $this->view->productName = $this->products[$productID];
     $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID);
     $this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'bug', $startModuleID = 0, array('treeModel', 'createBugLink'), '', $branch);
     $this->view->browseType = $browseType;
     $this->view->bugs = $bugs;
     $this->view->users = $users;
     $this->view->pager = $pager;
     $this->view->param = $param;
     $this->view->orderBy = $orderBy;
     $this->view->moduleID = $moduleID;
     $this->view->memberPairs = $memberPairs;
     $this->view->branch = $branch;
     $this->view->branches = $this->loadModel('branch')->getPairs($productID);
     $this->display();
 }
Exemple #27
0
 /**
  * My dynamic.
  * 
  * @param  string $type 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function dynamic($type = 'today', $orderBy = 'date_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Save session. */
     $uri = $this->app->getURI(true);
     $this->session->set('productList', $uri);
     $this->session->set('productPlanList', $uri);
     $this->session->set('releaseList', $uri);
     $this->session->set('storyList', $uri);
     $this->session->set('projectList', $uri);
     $this->session->set('taskList', $uri);
     $this->session->set('buildList', $uri);
     $this->session->set('bugList', $uri);
     $this->session->set('caseList', $uri);
     $this->session->set('testtaskList', $uri);
     /* Set the pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     /* Append id for secend sort. */
     $sort = $this->loadModel('common')->appendOrder($orderBy);
     /* The header and position. */
     $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->dynamic;
     $this->view->position[] = $this->lang->my->dynamic;
     /* Assign. */
     $this->view->type = $type;
     $this->view->recTotal = $recTotal;
     $this->view->recPerPage = $recPerPage;
     $this->view->pageID = $pageID;
     $this->view->orderBy = $orderBy;
     $this->view->pager = $pager;
     $this->view->actions = $this->loadModel('action')->getDynamic($this->app->user->account, $type, $sort, $pager);
     $this->display();
 }
Exemple #28
0
    echo $em->success;
}
?>
  <table width="522" border="1" cellspacing="0">
    <tr>
      <td width="173" align="center"><strong>Full name </strong></td>
      <td width="181" align="center"><strong>
        <label>Email Address </label>
      </strong></td>
      <td width="154" align="center"><strong>Actions</strong></td>
    </tr>
<?php 
include "library/config.php";
include "library/opendb.php";
$sql = "SELECT * FROM subscribers where 1";
$pager = new pager($sql, 'page', 15);
while ($row = mysql_fetch_array($pager->result)) {
    $pager->sno++;
    ?>
    <tr>
      <td><?php 
    echo $row['Title'] . " " . $row['first_name'] . " " . $row['last_name'];
    ?>
</td>
      <td><?php 
    echo $row['email_address'];
    ?>
</td>
      <td><a href="journal_article_update.php">&nbsp;<img src="img/b_edit.png" alt="edit" width="16" height="16" border="0" /></a> 
	  <a href="<?php 
    echo $_SERVER['PHP_SELF'];
Exemple #29
0
 /**
  * Project dynamic.
  * 
  * @param  string $type 
  * @param  string $orderBy 
  * @param  int    $recTotal 
  * @param  int    $recPerPage 
  * @param  int    $pageID 
  * @access public
  * @return void
  */
 public function dynamic($projectID = 0, $type = 'today', $param = '', $orderBy = 'date_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
 {
     /* Save session. */
     $uri = $this->app->getURI(true);
     $this->session->set('productList', $uri);
     $this->session->set('productPlanList', $uri);
     $this->session->set('releaseList', $uri);
     $this->session->set('storyList', $uri);
     $this->session->set('projectList', $uri);
     $this->session->set('taskList', $uri);
     $this->session->set('buildList', $uri);
     $this->session->set('bugList', $uri);
     $this->session->set('caseList', $uri);
     $this->session->set('testtaskList', $uri);
     /* use first project if projectID does not exist. */
     if (!isset($this->projects[$projectID])) {
         $projectID = key($this->projects);
     }
     /* Append id for secend sort. */
     $sort = $this->loadModel('common')->appendOrder($orderBy);
     /* Set the menu. If the projectID = 0, use the indexMenu instead. */
     $this->project->setMenu($this->projects, $projectID);
     if ($projectID == 0) {
         $this->projects = array('0' => $this->lang->project->selectProject) + $this->projects;
         unset($this->lang->project->menu);
         $this->lang->project->menu = $this->lang->project->indexMenu;
         $this->lang->project->menu->list = $this->project->select($this->projects, 0, 'project', 'dynamic');
     }
     /* Set the pager. */
     $this->app->loadClass('pager', $static = true);
     $pager = pager::init($recTotal, $recPerPage, $pageID);
     /* Set the user and type. */
     $account = $type == 'account' ? $param : 'all';
     $period = $type == 'account' ? 'all' : $type;
     /* The header and position. */
     $project = $this->project->getByID($projectID);
     $this->view->title = $project->name . $this->lang->colon . $this->lang->project->dynamic;
     $this->view->position[] = html::a($this->createLink('project', 'browse', "projectID={$projectID}"), $project->name);
     $this->view->position[] = $this->lang->project->dynamic;
     /* Assign. */
     $this->view->projectID = $projectID;
     $this->view->type = $type;
     $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noletter');
     $this->view->account = $account;
     $this->view->orderBy = $orderBy;
     $this->view->pager = $pager;
     $this->view->param = $param;
     $this->view->actions = $this->loadModel('action')->getDynamic($account, $period, $sort, $pager, 'all', $projectID);
     $this->display();
 }
Exemple #30
0
					WHERE catalog.brand=brand.id and catalog.status=1 and brand.status=1 ' . $_filter . ' 
					ORDER BY ' . $_sort . ' 
					LIMIT ' . $limit;
    // выполняем запрос + при необходимости выводим сам запрос
    $result = mysql::query($_sql, 0);
    // наименование бренда
    $_brand = ___findpole('select pole from brand where id=' . $id, 'pole');
    if ($result) {
        $_str .= system::show_tpl(array('result' => $result, '_brand' => $_brand), 'frontend/catalog/brand/list.php');
    } else {
        $_str .= 'У данного бренда товары отсутствуют.';
    }
} else {
    // выводим все бренды
    // get limit
    $limit = pager::pager_limit(brand::get_count(), mysql::query_findpole('select zna from config where id=47', 'zna'));
    // строим запрос
    $_sql = 'SELECT
					brand.*,
					count(catalog.id) as count
				FROM
					brand
				Left Outer Join catalog ON brand.id=catalog.brand
				WHERE brand.id>0 and brand.status=1
				GROUP BY
					brand.id
				order by brand.sort
				LIMIT ' . $limit;
    // выполняем запрос + при необходимости выводим сам запрос
    $result = mysql::query($_sql, 0);
    $_str .= system::show_tpl(array('result' => $result), 'frontend/catalog/brand/all_brands.php');