コード例 #1
0
ファイル: mailShow.view.php プロジェクト: ohjack/newErp
 function view_getUserMailByCondition()
 {
     $title = '邮件订阅系统';
     $navTitle = '邮件订阅';
     $dy_cho = 'cho Subscription';
     $gl_cho = 'setup';
     $user_id = $_SESSION['globaluserid'];
     $pagesize = 7;
     $where = " ";
     $wheresql = " ";
     $and = " ";
     $systemId = $_POST['system'];
     $mailName = isset($_POST['mailName']) ? trim($_POST['mailName']) : '';
     if (!empty($systemId) && $systemId != 'default') {
         //是否指定keywords
         $and .= " AND `mail_list`.`list_system_id` = '{$systemId}'";
     }
     if (!empty($mailName)) {
         //是否指定keywords
         $and .= " AND `mail_list`.`list_name` LIKE '%{$mailName}%'";
     }
     $getMail = new MailShowModel();
     //$getUserMail		= $getMail->getUserMailByCondition($where, $user_id);
     /* 分页  */
     $userMail = $getMail->userMail($and, $user_id);
     $page_obj = new Page($userMail, $pagesize);
     /* 显示用户可订阅邮件并分页 */
     $getUserMail = $getMail->getUserMailByCondition($and, $page_obj->limit, $user_id);
     /* 显示用户已订阅邮件 */
     $showUserMail = $getMail->showUserMail($user_id);
     /* 获取全部系统 */
     $getSystem = $getMail->getAllSystem();
     /* 显示用户可订阅邮件并分页 */
     $showMailList = $getMail->showMailList($user_id, $wheresql);
     if ($showMailList > $pagesize) {
         //分页
         $pagestr = $page_obj->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
     } else {
         $pagestr = $page_obj->fpage(array(0, 2, 3));
     }
     foreach ($getUserMail as $key => $item) {
         if (array_key_exists($item['power_list_id'], $showUserMail)) {
             $getUserMail[$key]['issubscript'] = 1;
         } else {
             $getUserMail[$key]['issubscript'] = 0;
         }
     }
     $this->smarty->assign("title", $title);
     $this->smarty->assign("navTitle", $navTitle);
     $this->smarty->assign("dy_cho", $dy_cho);
     $this->smarty->assign("gl_cho", $gl_cho);
     $this->smarty->assign("showUserMail", $showUserMail);
     $this->smarty->assign('getUserMail', $getUserMail);
     $this->smarty->assign("getSystem", $getSystem);
     $this->smarty->assign("page_str", $pagestr);
     $this->smarty->display('index.html');
 }
コード例 #2
0
ファイル: mailManage.view.php プロジェクト: ohjack/newErp
 function view_addUser()
 {
     $title = '新增订阅用户';
     $navTitle = '新增订阅用户';
     $gl_cho = 'setup cho';
     $dy_cho = 'Subscription';
     $list_id = addslashes($_GET['list_id']);
     $where = " ";
     $and = "AND `mail_list`.`list_id`='{$list_id}' AND `mail_power`.`power_list_id`='{$list_id}'";
     $show = new MailManageModel();
     //显示邮件信息
     $showMail = $show->showMailPower($where, $and);
     //获取公司列表
     $showCompany = $show->showCompany();
     // 获取所有系统
     $showSystem = new MailShowModel();
     $getSystem = $showSystem->getAllSystem();
     foreach ($showMail as $key => $item) {
         $mailName = $item['list_name'];
         $mailDescript = $item['list_description'];
         $mailEnglish = $item['list_english_id'];
         $mailSystem = $item['system_name'];
     }
     $this->smarty->assign("title", $title);
     $this->smarty->assign("navTitle", $navTitle);
     $this->smarty->assign("gl_cho", $gl_cho);
     $this->smarty->assign("dy_cho", $dy_cho);
     $this->smarty->assign("showMail", $showMail);
     $this->smarty->assign("showCompany", $showCompany);
     $this->smarty->assign("getSystem", $getSystem);
     $this->smarty->assign("mailName", $mailName);
     $this->smarty->assign("mailDescript", $mailDescript);
     $this->smarty->assign("mailEnglish", $mailEnglish);
     $this->smarty->assign("mailSystem", $mailSystem);
     $this->smarty->assign("list_id", $list_id);
     $this->smarty->display("addMailUser.html");
 }