Exemplo n.º 1
0
 public function view_whIoTypeList()
 {
     if (!isset($_SESSION['userName'])) {
         header('Location:index.php?mod=login&act=login');
     }
     $this->smarty->assign('secnev', '5');
     $this->smarty->assign('module', '仓库');
     $this->smarty->assign('curusername', $_SESSION['userName']);
     $navlist = array(array('url' => 'index.php?mod=warehouseManagement&act=whStore', 'title' => '仓库设置'), array('url' => 'index.php?mod=warehouseManagement&act=whIoTypeList', 'title' => '出入库类型'));
     $this->smarty->assign('navlist', $navlist);
     //调用action层, 获取列表数据
     $WarehouseManagement = new WarehouseManagementAct();
     $total = $WarehouseManagement->act_getPageNum($this->where);
     $num = 20;
     //每页显示的个数
     $page = new Page($total, $num, '', 'CN');
     $this->where .= " order by id desc " . $page->limit;
     $whIoTypeListArr = $WarehouseManagement->act_whIoTypeList($this->where);
     if (!empty($_GET['page'])) {
         if (intval($_GET['page']) <= 1 || intval($_GET['page']) > ceil($total / $num)) {
             $n = 1;
         } else {
             $n = (intval($_GET['page']) - 1) * $num + 1;
         }
     } else {
         $n = 1;
     }
     if ($total > $num) {
         //输出分页显示
         $show_page = $page->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $show_page = $page->fpage(array(0, 2, 3));
     }
     $WarehouseManagement = new WarehouseManagementAct();
     $warehouseManagementArrList = $WarehouseManagement->act_warehouseManagementList($this->where = '');
     $whNameArr = array();
     foreach ($warehouseManagementArrList as $storeArr) {
         $whNameArr[$storeArr['id']] = $storeArr['whName'];
     }
     $this->smarty->assign('secnev', 1);
     $this->smarty->assign('toptitle', '出入库类型列表');
     $toplevel = 4;
     //一级菜单的序号  0 开始
     $this->smarty->assign('toplevel', $toplevel);
     $secondlevel = 06;
     //当前的二级菜单
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('whNameArr', $whNameArr);
     $this->smarty->assign('show_page', $show_page);
     $this->smarty->assign('whIoTypeListArr', $whIoTypeListArr);
     $this->smarty->display('whIoTypeList.htm');
 }