Changeset 20250
- Timestamp:
- 2011/02/20 13:53:04 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/pages/admin/mail/LC_Page_Admin_Mail_History.php
r20247 r20250 76 76 case 'delete': 77 77 // 削除時 78 if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) { 79 $sql = "UPDATE dtb_send_history SET del_flg = 1 WHERE send_id = ?"; 80 $objQuery->query($sql, array($_GET['send_id']) ); 81 $_SERVER['QUERY_STRING'] = ""; 82 $this->objDisplay->reload(); 83 } 78 $this->lfDeleteHistory($_GET['send_id']); 79 $this->objDisplay->reload(null, true); 84 80 break; 85 81 default: 86 82 break; 87 83 } 88 89 // 行数の取得 90 $linemax = $objQuery->count($from, $where, $arrval); 91 92 // ページ送りの取得 93 $objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, SEARCH_PMAX, "fnNaviSearchPage", NAVI_PMAX); 94 $this->tpl_strnavi = $objNavi->strnavi; // 表示文字列 95 $startno = $objNavi->start_row; 96 97 // 取得範囲の指定(開始行番号、行数のセット) 98 $objQuery->setLimitOffset(SEARCH_PMAX, $startno); 99 100 // 検索結果の取得 101 $this->arrDataList = $this->lfGetMailHistory(); 84 85 list($this->tpl_linemax, $this->arrDataList, $this->arrPagenavi) = $this->lfDoSearch($_POST['search_pageno']); 102 86 } 103 87 … … 113 97 /** 114 98 * 実行履歴の取得 115 * 99 * 100 * @param integer $search_pageno 表示したいページ番号 116 101 * @return array( integer 全体件数, mixed メール配信データ一覧配列, mixed SC_PageNaviオブジェクト) 117 102 */ 118 function lfGetMailHistory() { 119 $objQuery =& SC_Query::getSingletonInstance(); 120 $objQuery->setOrder("start_date DESC, send_id DESC"); 103 function lfDoSearch($search_pageno = 1) { 104 105 // 引数の初期化 106 if(SC_Utils_Ex::sfIsInt($search_pageno)===false) $search_pageno = 1; 107 // 108 $objSelect =& SC_Query::getSingletonInstance(); // 一覧データ取得用 109 $objQuery =& SC_Query::getSingletonInstance(); // 件数取得用 110 111 // 該当全体件数の取得 112 $linemax = $objQuery->count("dtb_send_history","del_flg = 0"); 113 114 // 一覧データの取得 115 $objSelect->setOrder("start_date DESC, send_id DESC"); 121 116 122 117 $col = "*"; … … 125 120 $col .= ",(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id AND send_flag = 2) AS count_error"; 126 121 $col .= ",(SELECT COUNT(*) FROM dtb_send_customer WHERE dtb_send_customer.send_id = dtb_send_history.send_id AND send_flag IS NULL) AS count_unsent"; 127 128 $arrResult = $objQuery->select($col, "dtb_send_history", " del_flg = 0"); 129 return $arrResult; 130 131 /* 132 $page_rows = $arrParam['page_rows']; 133 if(SC_Utils_Ex::sfIsInt($page_rows)) { 134 $page_max = $page_rows; 135 }else{ 136 $page_max = SEARCH_PMAX; 122 123 // ページ送りの取得 124 $offset = SEARCH_PMAX * ($search_pageno - 1); 125 $objSelect->setLimitOffset(SEARCH_PMAX, $offset); 126 $arrResult = $objSelect->select($col, "dtb_send_history", " del_flg = 0"); 127 128 $objNavi = new SC_PageNavi($search_pageno, 129 $linemax, 130 SEARCH_PMAX); 131 132 return array($linemax, $arrResult, $objNavi->arrPagenavi); 133 } 134 135 /** 136 * 送信履歴の削除 137 * @param integer $send_id 削除したい送信履歴のID 138 * @return void 139 */ 140 function lfDeleteHistory($send_id){ 141 if (SC_Utils_Ex::sfIsInt($send_id)) { 142 $objQuery =& SC_Query::getSingletonInstance(); 143 $objQuery->update("dtb_send_history", 144 array('del_flg' =>1), 145 "send_id = ?", 146 array($send_id)); 137 147 } 138 $disp_pageno = $arrParam['search_pageno']; 139 if($disp_pageno == 0) { 140 $disp_pageno = 1; 141 } 142 $offset = $page_max * ($disp_pageno - 1); 143 $objSelect->setLimitOffset($page_max, $offset); 144 $arrData = $objQuery->getAll($objSelect->getList(), $objSelect->arrVal); 145 146 // 該当全体件数の取得 147 $linemax = $objQuery->getOne($objSelect->getListCount(), $objSelect->arrVal); 148 // ページ送りの取得 149 $objNavi = new SC_PageNavi($arrParam['search_pageno'], 150 $linemax, 151 $page_max, 152 "fnCustomerPage", 153 NAVI_PMAX); 154 return array($linemax, $arrData, $objNavi); 155 } */ 156 148 } 157 149 } 158 150 ?>
Note: See TracChangeset
for help on using the changeset viewer.