Esempio n. 1
0
 public function detail_log($rule_id)
 {
     $render = $this->app->render();
     $gcruleMdl = $this->app->model('member_giftcardrule');
     $giftcard = $gcruleMdl->getList('*', array('rule_id' => $rule_id));
     $giftcard = $giftcard[0];
     //日志分页
     $page = $_POST['page'] ? $_POST['page'] : 1;
     $pageLimit = 10;
     $glog = $gcruleMdl->getGiftcardLogList($rule_id, $page - 1, $pageLimit);
     $ui = new base_component_ui($this->app);
     $render->pagedata['gclogList'] = $glog;
     $render->pagedata['result'] = array('SUCCESS' => app::get('b2c')->_('成功'), 'FAILURE' => app::get('b2c')->_('失败'));
     $pager = array('current' => $page, 'total' => ceil($glog['page'] / $pageLimit), 'link' => 'javascript:W.page(\'index.php?app=b2c&ctl=admin_member_giftcardrule&act=index&_finder[finder_id]=' . $_GET['_finder']['finder_id'] . '&action=detail&finder_id=' . $_GET['_finder']['finder_id'] . '&id=' . $rule_id . '&finderview=detail_log&finder_name=' . $_GET['_finder']['finder_id'] . '\', {update:$E(\'.subtableform\').parentNode, method:\'post\', data:\'&page=%d\'});');
     $render->pagedata['pager'] = $ui->pager($pager);
     $render->pagedata['pagestart'] = ($page - 1) * $pageLimit;
     return $render->fetch('admin/member/giftcard_info.html', $this->app->app_id);
 }
Esempio n. 2
0
 /**
  * 图片管理列表内容显示
  * @param string 图片的tag
  * @param int 第几页的页面
  * @return string html内容
  */
 function image_lib($tag = '', $page = 1)
 {
     $pagelimit = 12;
     //$otag = $this->app->model('tag');
     $oimage = $this->app->model('image');
     //$tags = $otag->getList('*',array('tag_type'=>'image'));
     $filter = array();
     if ($tag) {
         $filter = array('tag' => array($tag));
     }
     $images = $oimage->getList('*', $filter, $pagelimit * ($page - 1), $pagelimit);
     $count = $oimage->count($filter);
     $limitwidth = 100;
     foreach ($images as $key => $row) {
         $maxsize = max($row['width'], $row['height']);
         if ($maxsize > $limitwidth) {
             $size = 'width=';
             $size .= $row['width'] - $row['width'] * (($maxsize - $limitwidth) / $maxsize);
             $size .= ' height=';
             $size .= $row['height'] - $row['height'] * (($maxsize - $limitwidth) / $maxsize);
         } else {
             $size = 'width=' . $row['width'] . ' height=' . $row['height'];
         }
         $row['size'] = $size;
         $images[$key] = $row;
     }
     $this->pagedata['images'] = $images;
     $ui = new base_component_ui($this->app);
     $this->pagedata['pagers'] = $ui->pager(array('current' => $page, 'total' => ceil($count / $pagelimit), 'link' => 'index.php?app=image&ctl=admin_manage&act=image_lib&p[0]=' . $tag . '&p[1]=%d'));
     $this->display('image_lib.html');
 }
Esempio n. 3
0
 public function pagination($current, $count, $get)
 {
     //本控制器公共分页函数
     $app = app::get('b2c');
     $render = $app->render();
     $ui = new base_component_ui($this->app);
     //unset($get['singlepage']);
     $link = 'index.php?app=b2c&ctl=admin_member&act=ajax_html&id=' . $get['id'] . '&finder_act=' . $get['page'] . '&' . $get['page'] . '=%d';
     $this->pagedata['pager'] = $ui->pager(array('current' => $current, 'total' => ceil($count / $this->pagelimit), 'link' => $link));
 }
Esempio n. 4
0
 public function detail_logs($order_id)
 {
     $render = app::get('base')->render();
     $order = $this->app->model('archive_orders');
     $aOrder = $order->dump($order_id);
     $order = $this->app->model('archive_orders');
     $page = $_POST['page'] ? $_POST['page'] : 1;
     $pageLimit = 10;
     $aLog = $order->getOrderLogList($order_id, $page - 1, $pageLimit);
     $ui = new base_component_ui($this->app);
     $render->pagedata['logs'] = $aLog;
     $render->pagedata['result'] = array('SUCCESS' => app::get('b2c')->_('成功'), 'FAILURE' => app::get('b2c')->_('失败'));
     $pager = array('current' => $page, 'total' => ceil($aLog['page'] / $pageLimit), 'link' => 'javascript:W.page(\'index.php?app=b2c&ctl=admin_archive_order&act=index&_finder[finder_id]=' . $_GET['_finder']['finder_id'] . '&finder_id=' . $_GET['_finder']['finder_id'] . '&id=' . $order_id . '&finderview=detail_logs&finder_name=' . $_GET['_finder']['finder_id'] . '&action=detail&p[0]=_PPP_\', {update:$E(\'.tableform\').parentNode, method:\'post\', data:\'&page=%d\'});', 'token' => '_PPP_');
     $render->pagedata['pager'] = $ui->pager($pager);
     $render->pagedata['pagestart'] = ($page - 1) * $pageLimit;
     return $render->fetch('admin/order/order_logs.html', $this->app->app_id);
 }
Esempio n. 5
0
 function image_lib($tag = '', $page = 1)
 {
     $pagelimit = 10;
     //$otag = $this->app->model('tag');
     $oimage = $this->app->model('image');
     //$tags = $otag->getList('*',array('tag_type'=>'image'));
     $filter = array();
     if ($tag) {
         $filter = array('tag' => array($tag));
     }
     $images = $oimage->getList('*', $filter, $pagelimit * ($page - 1), $pagelimit);
     $count = $oimage->count($filter);
     $maxsize = 90;
     foreach ($images as $key => $v) {
         $width = $v['width'];
         $height = $v['height'];
         if ($width > $height) {
             $props = 'width="' . ($width > $maxsize ? $maxsize : $width) . '"';
         } else {
             $props = 'height="' . ($height > $maxsize ? $maxsize : $height) . '"';
         }
         $v['size'] = $props;
         $images[$key] = $v;
     }
     $this->pagedata['images'] = $images;
     $ui = new base_component_ui($this->app);
     $this->pagedata['pagers'] = $ui->pager(array('current' => $page, 'total' => ceil($count / $pagelimit), 'link' => 'index.php?app=image&ctl=admin_manage&act=image_lib&p[0]=' . $tag . '&p[1]=%d'));
     $this->display('image_lib.html');
 }