function showlist()
 {
     $apperance = M('branchapperance');
     $academy = M('academy');
     //        $branch=M('branch');
     //        //支部分页
     //        $countBranch=$branch->count();
     //        $pageBranch = new \Think\Page ( $countBranch, 9, 'p1' );
     //        $pageBranch->setP('p1');
     //        $listBranch = $branch->order ( 'branchacademy,branchid desc' )->limit ( $pageBranch->firstRow . ',' . $pageBranch->listRows )->select ();
     //
     //        //获取支部对应的学院
     //        $listAcademy=$academy->select();
     //        for($i = 0; $i < count ( $listBranch ); $i ++) {
     //            for($j = 0; $j < count ( $listAcademy ); $j ++) {
     //                if ($listBranch [$i] ['branchacademy'] == $listAcademy [$j] ['academyid']) {
     //                    $listBranch [$i] ['branchacademy'] = $listAcademy [$j] ['academyname'];
     //                    break;
     //                }
     //            }
     //        }
     //设置默认
     $nameOfacademy = '';
     if (isset($_GET['branchapperanceacademy'])) {
         $nameOfacademy = $_GET['branchapperanceacademy'];
     } else {
         $defaultacademy = $academy->order('academyRank desc')->limit(1)->select();
         $nameOfacademy = $defaultacademy[0]['academyname'];
         //            dump($nameOfacademy);
         //            return;
     }
     //        dump($nameOfacademy);
     //        return;
     //支部分页
     $countAcademy = $academy->count() - 1;
     $pageAcademy = new \Think\Page($countAcademy, 8, 'p1');
     $pageAcademy->setP('p1');
     $listAcademy = $academy->where('academyName<>"' . $nameOfacademy . '"')->order('academyRank desc')->limit($pageAcademy->firstRow . ',' . $pageAcademy->listRows)->select();
     if (strcmp($_GET['p1'], "2") != 0) {
         $currentAcademy = $academy->where('academyName="' . $nameOfacademy . '"')->select();
         $this->assign('currentAcademy', $currentAcademy);
         //选中的学院
     }
     $this->assign('listAcademy', $listAcademy);
     // 赋值数据集
     $this->assign('pageAcademy', $pageAcademy->show());
     // 赋值分页输出
     //支部风采分页
     $countApperance = $apperance->where('branchApperanceAcademy="' . $nameOfacademy . '" and branchapperanceacademyauditstatus=1')->count();
     $pageApperance = new \Think\Page($countApperance, 10, 'p2');
     $pageApperance->setP('p2');
     $listApperance = $apperance->where('branchApperanceAcademy="' . $nameOfacademy . '" and branchapperanceacademyauditstatus=1')->order('branchApperanceid desc')->limit($pageApperance->firstRow . ',' . $pageApperance->listRows)->select();
     $this->assign('listApperance', $listApperance);
     //赋值数据集
     $this->assign('pageApperance', $pageApperance->show());
     //赋值分页输出
     $this->assign('title', $nameOfacademy);
     //标题
     $this->display();
 }
 public function allPage()
 {
     if (!isset($_SESSION['userId'])) {
         $this->error(C('LOGIN_FIRST'));
     }
     doLog($_SESSION['userId'], 29, 'View_All_WorkTendency');
     $this->assign('APPLICATION_NAME', C('APPLICATION_NAME'));
     $this->assign('USER_ID', $_SESSION['userId']);
     $this->assign('USER_LEVEL', $_SESSION['userLevel']);
     $this->assign('CURRENT_MENU', 'WORKTENDENCY');
     $workTendency = M('worktendency');
     try {
         if (isset($_GET['delete'])) {
             // 传入删除参数
             $workTendency->where('worktendencyid=' . $_GET['delete'])->delete();
         }
         if (isset($_GET['deleteMulti'])) {
             // 传入删除多项的参数
             $multi = explode(',', $_GET['deleteMulti']);
             for ($index = 1; $index < count($multi); $index++) {
                 // 从第二个开始删除,第一个的产生是由于U方法生成参数的时候无法不输入一个参数
                 if ($multi[$index] != null) {
                     $workTendency->where('worktendencyid=' . $multi[$index])->delete();
                 }
             }
         }
     } catch (Exception $e) {
         // 删除错误
         $this->error(C('DELETE_FAIL') . $e->__toString());
         return;
     }
     // 查询当前所有的工作状态并且分页
     $count = $workTendency->count();
     $page = new \Think\Page($count, C('PAGE_COUNT'), 'p1');
     $page->setP('p1');
     $orderby['worktendencyid'] = 'desc';
     $list = $workTendency->order($orderby)->limit($page->firstRow . ',' . $page->listRows)->select();
     $user = M('user');
     $listAllUser = $user->select();
     // 将人员id转换为名称
     for ($i = 0; $i < count($list); $i++) {
         for ($j = 0; $j < count($listAllUser); $j++) {
             if ($list[$i]['worktendencyreleaseid'] == $listAllUser[$j]['userid']) {
                 $list[$i]['worktendencyreleaseid'] = $listAllUser[$j]['usernickname'];
             }
         }
     }
     $this->assign('list', $list);
     // 赋值数据集
     $this->assign('page', $page->show());
     // 赋值分页输出
     $editor = new \FCKeditor\FCKeditor('editor');
     $editor->Value = ' ';
     // 设置默认值
     $editorHtml = $editor->Createhtml();
     // 创建。注意:若用到模板(如smarty)则$fck = $oFCKeditor->CreateHtml();然后把$fck抛给模板
     $this->assign("editorHtml", $editorHtml);
     $this->display();
 }
예제 #3
0
 function download()
 {
     $model = M('download');
     $count = $model->count();
     $page = new \Think\Page($count, 10, 'p1');
     $page->setP('p1');
     $orderby['downloadid'] = 'desc';
     $list = $model->order($orderby)->limit($page->firstRow . ',' . $page->listRows)->select();
     $this->assign("list", $list);
     $this->assign("page", $page->show());
     $this->display();
 }
 public function voluntaryService()
 {
     $model = M('activitypractice');
     //需要做分页,页面显示10条
     $count = $model->where('activitypracticetype<>0 and activitypracticeauditstatus=1')->count();
     $page = new \Think\Page($count, 10, 'p1');
     $page->setP('p1');
     $orderby['activitypracticeid'] = 'desc';
     $list = $model->where('activitypracticetype<>0 and activitypracticeauditstatus=1')->order($orderby)->limit($page->firstRow . ',' . $page->listRows)->select();
     $this->assign("list", $list);
     $this->assign('page', $page->show());
     // 赋值分页输出
     $this->display();
 }
예제 #5
0
 function showlist()
 {
     $notice = M('notice');
     //需要做分页,页面显示10条
     $count = $notice->count();
     $page = new \Think\Page($count, 10, 'p1');
     $page->setP('p1');
     $orderby['noticeid'] = 'desc';
     $list = $notice->where('noticeAuditId=1')->order($orderby)->limit($page->firstRow . ',' . $page->listRows)->select();
     $this->assign('list', $list);
     // 赋值数据集
     $this->assign('page', $page->show());
     // 赋值分页输出
     $this->display();
 }
 function showList()
 {
     $workTendency = M('worktendency');
     //需要做分页,页面显示10条
     $count = $workTendency->count();
     $page = new \Think\Page($count, 10, 'p1');
     $page->setP('p1');
     $orderby['worktendencyid'] = 'desc';
     $list = $workTendency->order($orderby)->limit($page->firstRow . ',' . $page->listRows)->select();
     $this->assign('list', $list);
     // 赋值数据集
     $this->assign('page', $page->show());
     // 赋值分页输出
     $this->display();
 }
예제 #7
0
 public function allDownload()
 {
     if (!isset($_SESSION['userId'])) {
         $this->error(C('LOGIN_FIRST'));
     }
     $this->assign('APPLICATION_NAME', C('APPLICATION_NAME'));
     $this->assign('USER_ID', $_SESSION['userId']);
     $this->assign('USER_LEVEL', $_SESSION['userLevel']);
     $this->assign('CURRENT_MENU', 'DOWNLAODSETTING');
     doLog($_SESSION['userId'], 5, 'view_allDownload');
     $download = M('download');
     try {
         if (isset($_GET['delete'])) {
             // 传入删除参数
             $download->where('downloadid=' . $_GET['delete'])->delete();
         }
         if (isset($_GET['deleteMulti'])) {
             // 传入删除多项的参数
             $multi = explode(',', $_GET['deleteMulti']);
             for ($index = 1; $index < count($multi); $index++) {
                 // 从第二个开始删除,第一个的产生是由于U方法生成参数的时候无法不输入一个参数
                 if ($multi[$index] != null) {
                     $download->where('downloadid=' . $multi[$index])->delete();
                 }
             }
         }
     } catch (Exception $e) {
         // 删除错误
         $this->error(C('DELETE_FAIL') . $e->__toString());
         return;
     }
     // 查询当前所有的工作状态并且分页
     $count = $download->count();
     $page = new \Think\Page($count, C('PAGE_COUNT'), 'p1');
     $page->setP('p1');
     $orderby['downloadid'] = 'desc';
     $list = $download->order($orderby)->limit($page->firstRow . ',' . $page->listRows)->select();
     // dump($list);
     // return;
     $this->assign('list', $list);
     // 赋值数据集
     $this->assign('page', $page->show());
     // 赋值分页输出
     $this->display();
 }
 public function allBreakingNews()
 {
     if (!isset($_SESSION['userId'])) {
         $this->error(C('LOGIN_FIRST'));
     }
     $this->assign('APPLICATION_NAME', C('APPLICATION_NAME'));
     $this->assign('USER_ID', $_SESSION['userId']);
     $this->assign('USER_LEVEL', $_SESSION['userLevel']);
     $this->assign('CURRENT_MENU', 'BREAKINGNEWS');
     $breakingNews = M('breakingnews');
     try {
         if (isset($_GET['delete'])) {
             // 传入删除参数
             $breakingNews->where('breakingnewsid=' . $_GET['delete'])->delete();
         }
         if (isset($_GET['deleteMulti'])) {
             // 传入删除多项的参数
             $multi = explode(',', $_GET['deleteMulti']);
             for ($index = 1; $index < count($multi); $index++) {
                 // 从第二个开始删除,第一个的产生是由于U方法生成参数的时候无法不输入一个参数
                 if ($multi[$index] != null) {
                     $breakingNews->where('breakingnewsid=' . $multi[$index])->delete();
                 }
             }
         }
     } catch (Exception $e) {
         // 删除错误
         $this->error(C('DELETE_FAIL') . $e->__toString());
         return;
     }
     // 查询当前所有的工作状态并且分页
     $count = $breakingNews->count();
     $page = new \Think\Page($count, C('PAGE_COUNT'), 'p1');
     $page->setP('p1');
     $orderby['breakingnewsid'] = 'desc';
     $selectedType = $_GET['selectedType'];
     // $selectedType = "1";
     // dump ( $selectedType == null);
     // dump ("all" != $selectedType && $selectedType != null);
     // return;
     if ("all" != $selectedType && null != $selectedType) {
         $list = $breakingNews->where('breakingnewstype=' . $selectedType)->order($orderby)->limit($page->firstRow . ',' . $page->listRows)->select();
     } else {
         $selectedType = "all";
         $list = $breakingNews->order($orderby)->limit($page->firstRow . ',' . $page->listRows)->select();
         // dump ( $selectedType );
         // return;
     }
     // $list = $breakingNews->order ( $orderby )->limit ( $page->firstRow . ',' . $page->listRows )->select ();
     for ($i = 0; $i < count($list); $i++) {
         switch ($list[$i]['breakingnewstype']) {
             case 1:
                 $list[$i]['breakingnewstype'] = "新聞";
                 break;
             case 2:
                 $list[$i]['breakingnewstype'] = "留學考試區";
                 break;
             case 3:
                 $list[$i]['breakingnewstype'] = "世界排名一覽";
                 break;
             case 4:
                 $list[$i]['breakingnewstype'] = "留學區域資料";
                 break;
             case 5:
                 $list[$i]['breakingnewstype'] = "申請步驟";
                 break;
             case 6:
                 $list[$i]['breakingnewstype'] = "項目費用明細";
                 break;
             case 7:
                 $list[$i]['breakingnewstype'] = "常見問題";
                 break;
             case 8:
                 $list[$i]['breakingnewstype'] = "遊學優勢";
                 break;
             case 9:
                 $list[$i]['breakingnewstype'] = "留學案例";
                 break;
             case 10:
                 $list[$i]['breakingnewstype'] = "學生之聲";
                 break;
             default:
                 $list[$i]['breakingnewstype'] = "NULL";
                 break;
         }
     }
     $this->assign('list', $list);
     // 赋值数据集
     $this->assign('page', $page->show());
     // 赋值分页输出
     $this->assign('selectedtype', $selectedType);
     // 赋值分页输出
     $editor = new \FCKeditor\FCKeditor('editor');
     $editor->Value = ' ';
     // 设置默认值
     $editorHtml = $editor->Createhtml();
     // 创建。注意:若用到模板(如smarty)则$fck = $oFCKeditor->CreateHtml();然后把$fck抛给模板
     $this->assign("editorHtml", $editorHtml);
     $this->display();
 }
 public function accountSetting()
 {
     if (!isset($_SESSION['userId'])) {
         $this->error(C('LOGIN_FIRST'));
     }
     doLog($_SESSION['userId'], 22, 'View_AccountSetting');
     $this->assign('APPLICATION_NAME', C('APPLICATION_NAME'));
     $this->assign('USER_ID', $_SESSION['userId']);
     $this->assign('USER_LEVEL', $_SESSION['userLevel']);
     $this->assign('CURRENT_MENU', 'ACCOUNTSETTING');
     $user = M('user');
     try {
         if (isset($_GET['deleteUser'])) {
             // 传入删除参数
             $user->where('userid=' . $_GET['deleteUser'])->delete();
         }
         if (isset($_GET['deleteUserMulti'])) {
             // 传入删除多项的参数
             $multi = explode(',', $_GET['deleteUserMulti']);
             for ($index = 1; $index < count($multi); $index++) {
                 // 从第二个开始删除,第一个的产生是由于U方法生成参数的时候无法不输入一个参数
                 if ($multi[$index] != null) {
                     $user->where('userid=' . $multi[$index])->delete();
                 }
             }
         }
     } catch (Exception $e) {
         // 删除错误
         $this->error(C('DELETE_FAIL') . $e->__toString());
         return;
     }
     // 查询当前所有的学院并且分页
     $countUser = $user->count();
     $pageUser = new \Think\Page($countUser, C('PAGE_COUNT'), 'p1');
     $pageUser->setP('p1');
     $orderbyUser['userid'] = 'desc';
     $listUser = $user->order($orderbyUser)->limit($pageUser->firstRow . ',' . $pageUser->listRows)->select();
     // 获得所有的学院和支部
     $branch = M('branch');
     $academy = M('academy');
     $listAllAcademy = $academy->select();
     $listAllBranch = $branch->select();
     for ($i = 0; $i < count($listUser); $i++) {
         for ($j = 0; $j < count($listAllAcademy); $j++) {
             if ($listUser[$i]['useracademy'] == $listAllAcademy[$j]['academyid']) {
                 $listUser[$i]['useracademy'] = $listAllAcademy[$j]['academyname'];
                 break;
             }
             if ($j == count($listAllAcademy) - 1) {
                 $listUser[$i]['useracademy'] = '无支部信息';
             }
         }
         for ($j = 0; $j < count($listAllBranch); $j++) {
             if ($listUser[$i]['userbranch'] == $listAllBranch[$j]['branchid']) {
                 $listUser[$i]['userbranch'] = $listAllBranch[$j]['branchname'];
                 break;
             }
             if ($j == count($listAllBranch) - 1) {
                 $listUser[$i]['userbranch'] = '无支部信息';
             }
         }
     }
     $this->assign('listUserLevel', array(1, 11, 21));
     $this->assign('listAllAcademy', $listAllAcademy);
     $this->assign('listAllBranch', $listAllBranch);
     $this->assign('listUser', $listUser);
     // 赋值数据集
     $this->assign('pageUser', $pageUser->show());
     // 赋值分页输出
     $this->show();
 }
 public function systemSetting()
 {
     if (!isset($_SESSION['userId'])) {
         $this->error(C('LOGIN_FIRST'));
     }
     $this->assign('APPLICATION_NAME', C('APPLICATION_NAME'));
     $this->assign('USER_ID', $_SESSION['userId']);
     $this->assign('CURRENT_MENU', 'SYSTEM');
     $systemSetting = M('systemsetting');
     try {
         if (isset($_GET['delete'])) {
             // 传入删除参数
             $systemSetting->where('systemsettingid=' . $_GET['delete'])->delete();
         }
         if (isset($_GET['deleteMulti'])) {
             // 传入删除多项的参数
             $multi = explode(',', $_GET['deleteMulti']);
             for ($index = 1; $index < count($multi); $index++) {
                 // 从第二个开始删除,第一个的产生是由于U方法生成参数的时候无法不输入一个参数
                 if ($multi[$index] != null) {
                     $systemSetting->where('systemsettingid=' . $multi[$index])->delete();
                 }
             }
         }
     } catch (Exception $e) {
         // 删除错误
         $this->error(C('DELETE_FAIL') . $e->__toString());
         return;
     }
     $count = $systemSetting->count();
     $page = new \Think\Page($count, C('PAGE_COUNT'), 'p1');
     $page->setP('p1');
     $orderby['systemsettingid'] = 'desc';
     $list = $systemSetting->order($orderby)->limit($page->firstRow . ',' . $page->listRows)->select();
     for ($i = 0; $i < count($list); $i++) {
         switch ($list[$i]['systemsettingname']) {
             case 1:
                 $list[$i]['systemsettingname'] = "遊學優勢標題";
                 break;
             case 2:
                 $list[$i]['systemsettingname'] = "遊學優勢內容";
                 break;
             case 3:
                 $list[$i]['systemsettingname'] = "酒店鏈接";
                 break;
             case 4:
                 $list[$i]['systemsettingname'] = "聯繫方式電話";
                 break;
             case 5:
                 $list[$i]['systemsettingname'] = "聯繫方式郵箱";
                 break;
             default:
                 $list[$i]['systemsettingname'] = "NULL";
                 break;
         }
     }
     // dump($list);
     // return;
     $this->assign('list', $list);
     // 赋值数据集
     $this->assign('page', $page->show());
     // 赋值分页输出
     $this->display();
 }
 public function allBranchApperance()
 {
     if (!isset($_SESSION['userId'])) {
         $this->error(C('LOGIN_FIRST'));
     }
     doLog($_SESSION['userId'], 33, 'View_allBranchApperance');
     $this->assign('APPLICATION_NAME', C('APPLICATION_NAME'));
     $this->assign('USER_ID', $_SESSION['userId']);
     $this->assign('USER_LEVEL', $_SESSION['userLevel']);
     $this->assign('CURRENT_MENU', 'BRANCHAPPERANCE');
     $branchApperance = M('branchapperance');
     try {
         if (isset($_GET['delete'])) {
             // 传入删除参数
             $branchApperance->where('branchapperanceid=' . $_GET['delete'])->delete();
         }
         if (isset($_GET['deleteMulti'])) {
             // 传入删除多项的参数
             $multi = explode(',', $_GET['deleteMulti']);
             for ($index = 1; $index < count($multi); $index++) {
                 // 从第二个开始删除,第一个的产生是由于U方法生成参数的时候无法不输入一个参数
                 if ($multi[$index] != null) {
                     $branchApperance->where('branchapperanceid=' . $multi[$index])->delete();
                 }
             }
         }
     } catch (Exception $e) {
         // 删除错误
         $this->error(C('DELETE_FAIL') . $e->__toString());
         return;
     }
     // 查询当前所有的工作状态并且分页
     $count = $branchApperance->count();
     $page = new \Think\Page($count, C('PAGE_COUNT'), 'p1');
     $page->setP('p1');
     $orderby['branchapperanceid'] = 'desc';
     $list = $branchApperance->order($orderby)->limit($page->firstRow . ',' . $page->listRows)->select();
     // dump($list);
     // return;
     $user = M('user');
     $listAllUser = $user->select();
     // 将人员id转换为名称
     for ($i = 0; $i < count($list); $i++) {
         $list[$i]['branchapperancereleaseid'] = getUserNicknameByUserId($list[$i]['branchapperancereleaseid']);
         $list[$i]['branchapperanceacademyauditid'] = getUserNicknameByUserId($list[$i]['branchapperanceacademyauditid']);
         $list[$i]['branchapperanceorangizationauditid'] = getUserNicknameByUserId($list[$i]['branchapperanceorangizationauditid']);
         // $list [$i] ['activitypracticereleaseid'] = getUserNicknameByUserId($list [$i] ['activitypracticereleaseid']);
         // $list [$i] ['activitypracticeauditid'] = getUserNicknameByUserId($list [$i] ['activitypracticeauditid']);
         if ($list[$i]['branchapperanceacademyauditstatus'] == 0) {
             $list[$i]['branchapperanceacademyauditstatus'] = '未审核';
         } else {
             $list[$i]['branchapperanceacademyauditstatus'] = '通过审核';
         }
         if ($list[$i]['branchapperanceorangizationauditstatus'] == 0) {
             $list[$i]['branchapperanceorangizationauditstatus'] = '未审核';
         } else {
             $list[$i]['branchapperanceorangizationauditstatus'] = '通过审核';
         }
     }
     $academy = M('academy');
     $listAcademy = $academy->select();
     $branch = M('branch');
     $listBranch = $branch->select();
     $this->assign('listAcademy', $listAcademy);
     // 赋值数据集
     $this->assign('listBranch', $listBranch);
     // 赋值数据集
     $this->assign('list', $list);
     // 赋值数据集
     $this->assign('page', $page->show());
     // 赋值分页输出
     $editor = new \FCKeditor\FCKeditor('editor');
     $editor->Value = ' ';
     // 设置默认值
     $editorHtml = $editor->Createhtml();
     // 创建。注意:若用到模板(如smarty)则$fck = $oFCKeditor->CreateHtml();然后把$fck抛给模板
     // 		dump($list);
     // 		return;
     $this->assign("editorHtml", $editorHtml);
     $this->display();
 }