Changeset 20203 for branches/version-2_5-dev/data/class
- Timestamp:
- 2011/02/19 18:38:11 (13 years ago)
- Location:
- branches/version-2_5-dev/data/class
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/helper/SC_Helper_Mail.php
r20198 r20203 331 331 /** 332 332 * 保存されているメールテンプレートの取得 333 * @param array $arrParams 特定IDのテンプレートを取り出したい時は$arrParams['template_id']で指定333 * @param integer 特定IDのテンプレートを取り出したい時はtemplate_idを指定。未指定時は全件取得 334 334 * @return array メールテンプレート情報を格納した配列 335 335 * @todo 表示順も引数で変更できるように 336 336 */ 337 function sfGetMailTemplate($ arrParams = array()){337 function sfGetMailTemplate($template_id = null){ 338 338 // 初期化 339 339 $where = ''; 340 $arrValues = array();341 340 $objQuery =& SC_Query::getSingletonInstance(); 342 341 … … 345 344 $arrValues[] = 0; 346 345 //template_id指定時 347 if ( isset($arrParams['template_id'])) {346 if (SC_Utils_Ex::sfIsInt($template_id) === true) { 348 347 $where .= 'AND template_id = ?'; 349 $arrValues[] = $ arrParams['template_id'];348 $arrValues[] = $template_id; 350 349 } 351 350 -
branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Mail.php
r20168 r20203 80 80 // テンプレートプルダウン変更時 81 81 82 if ( SC_Utils_Ex::sf CheckNumLength( $_POST['template_id']) ){82 if ( SC_Utils_Ex::sfIsInt( $_POST['template_id']) ){ 83 83 $result = $this->lfGetMailTemplateByTemplateID($_POST['template_id']); 84 84 if ( $result ){ … … 90 90 break; 91 91 case 'regist': 92 if (SC_Utils_Ex::sf CheckNumLength( $_POST['template_id']) ){92 if (SC_Utils_Ex::sfIsInt( $_POST['template_id']) ){ 93 93 94 94 // POSTデータの引き継ぎ -
branches/version-2_5-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_Recommend.php
r20116 r20203 116 116 117 117 // カテゴリID取得 無いときはトップページ 118 if ( SC_Utils_Ex::sf CheckNumLength($_POST['category_id']) ){118 if ( SC_Utils_Ex::sfIsInt($_POST['category_id']) ){ 119 119 $this->category_id = $_POST['category_id']; 120 120 } else { -
branches/version-2_5-dev/data/class/pages/admin/mail/LC_Page_Admin_Mail.php
r20198 r20203 173 173 query:配信履歴「確認」 174 174 */ 175 if (SC_Utils_Ex::sf CheckNumLength($_GET["send_id"])) {175 if (SC_Utils_Ex::sfIsInt($_GET["send_id"])) { 176 176 // 送信履歴より、送信条件確認画面 177 177 $sql = "SELECT search_data FROM dtb_send_history WHERE send_id = ?"; … … 675 675 function getTemplateData(&$objQuery, $id){ 676 676 677 if ( SC_Utils_Ex::sf CheckNumLength($id) ){677 if ( SC_Utils_Ex::sfIsInt($id) ){ 678 678 $sql = "SELECT * FROM dtb_mailmaga_template WHERE template_id = ? ORDER BY template_id DESC"; 679 679 $result = $objQuery->getAll( $sql, array($id) ); -
branches/version-2_5-dev/data/class/pages/admin/mail/LC_Page_Admin_Mail_History.php
r20116 r20203 82 82 case 'delete': 83 83 // 削除時 84 if (SC_Utils_Ex::sf CheckNumLength($_GET['send_id'])) {84 if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) { 85 85 $sql = "UPDATE dtb_send_history SET del_flg = 1 WHERE send_id = ?"; 86 86 $objQuery->query($sql, array($_GET['send_id']) ); -
branches/version-2_5-dev/data/class/pages/admin/mail/LC_Page_Admin_Mail_Preview.php
r20198 r20203 70 70 SC_Utils_Ex::sfIsSuccess($objSess); 71 71 72 if (!isset($_POST['body'])) $_POST['body'] = ""; 73 if (!isset($_REQUEST['method'])) $_REQUEST['method'] = ""; 74 if (!isset($_REQUEST['id'])) $_REQUEST['id'] = ""; 75 if (!isset($_GET['send_id'])) $_GET['send_id'] = ""; 76 77 if ( $_POST['body'] ){ 78 $this->body = $_POST['body']; 79 80 // HTMLメールテンプレートのプレビュー 81 } elseif ($_REQUEST["method"] == "template" 82 && SC_Utils_Ex::sfCheckNumLength($_REQUEST['id'])) { 83 84 $sql = "SELECT * FROM dtb_mailmaga_template WHERE template_id = ?"; 85 $result = $objQuery->getAll($sql, array($_REQUEST["id"])); 86 $this->list_data = $result[0]; 87 88 // メイン商品の情報取得 89 // FIXME SC_Product クラスを使用した実装 90 $sql = "SELECT name, main_image, point_rate, deliv_fee, price01_min, price01_max, price02_min, price02_max FROM vw_products_allclass AS allcls WHERE product_id = ?"; 91 $main = $objQuery->getAll($sql, array($this->list_data["main_product_id"])); 92 $this->list_data["main"] = $main[0]; 93 94 // サブ商品の情報取得 95 // FIXME SC_Product クラスを使用した実装 96 $sql = "SELECT product_id, name, main_list_image, price01_min, price01_max, price02_min, price02_max FROM vw_products_allclass WHERE product_id = ?"; 97 $k = 0; 98 $l = 0; 99 for ($i = 1; $i <= 12; $i ++) { 100 if ($l == 4) { 101 $l = 0; 102 $k ++; 103 } 104 $result = ""; 105 $j = sprintf("%02d", $i); 106 if ($i > 0 && $i < 5 ) $k = 0; 107 if ($i > 4 && $i < 9 ) $k = 1; 108 if ($i > 8 && $i < 13 ) $k = 2; 109 110 if (is_numeric($this->list_data["sub_product_id" .$j])) { 111 $result = $objQuery->getAll($sql, array($this->list_data["sub_product_id" .$j])); 112 $this->list_data["sub"][$k][$l] = $result[0]; 113 $this->list_data["sub"][$k]["data_exists"] = "OK"; //当該段にデータが1つ以上存在するフラグ 114 } 115 $l ++; 116 } 117 $this->tpl_mainpage = 'mail/html_template.tpl'; 118 119 } elseif (SC_Utils_Ex::sfCheckNumLength($_GET['send_id']) 120 || SC_Utils_Ex::sfCheckNumLength($_GET['id'])){ 72 if (SC_Utils_Ex::sfIsInt($_GET['send_id']) 73 || SC_Utils_Ex::sfIsInt($_GET['id'])){ 74 121 75 if (is_numeric($_GET["send_id"])) { 122 76 $id = $_GET["send_id"]; … … 132 86 // テキスト形式の時はタグ文字をエスケープ 133 87 $this->escape_flag = 1; 134 } 88 } 135 89 $this->body = $result[0]["body"]; 136 90 } -
branches/version-2_5-dev/data/class/pages/admin/mail/LC_Page_Admin_Mail_Template.php
r20198 r20203 78 78 switch ($this->getMode()) { 79 79 case 'delete': 80 if ( SC_Utils_Ex::sf CheckNumLength($_GET['id'])===true ){80 if ( SC_Utils_Ex::sfIsInt($_GET['id'])===true ){ 81 81 $this->lfDeleteMailTemplate($_GET['id']); 82 82 $this->objDisplay->reload(null, true); … … 86 86 break; 87 87 } 88 $this-> list_data= $objMailHelper->sfGetMailTemplate();88 $this->arrTemplates = $objMailHelper->sfGetMailTemplate(); 89 89 } 90 90 … … 105 105 function lfDeleteMailTemplate($template_id){ 106 106 $objQuery =& SC_Query::getSingletonInstance(); 107 $sqlval["del_flg"] = "1"; 108 $arrValIn[] = $template_id; 109 $objQuery->update("dtb_mailmaga_template", $sqlval, "template_id = ?", $arrValIn); 107 $objQuery->update("dtb_mailmaga_template", 108 array('del_flg' =>1), 109 "template_id = ?", 110 array($template_id)); 110 111 } 111 112 -
branches/version-2_5-dev/data/class/pages/admin/mail/LC_Page_Admin_Mail_TemplateInput.php
r20116 r20203 91 91 case 'edit': 92 92 // モードによる処理分岐 93 if ( SC_Utils_Ex::sf CheckNumLength($_GET['template_id'])===true ){93 if ( SC_Utils_Ex::sfIsInt($_GET['template_id'])===true ){ 94 94 // 編集 95 95 $sql = "SELECT * FROM dtb_mailmaga_template WHERE template_id = ? AND del_flg = 0"; -
branches/version-2_5-dev/data/class/util/SC_Utils.php
r20133 r20203 671 671 } 672 672 673 /* DBに渡す数値のチェック674 * 10桁以上はオーバーフローエラーを起こすので。675 */676 function sfCheckNumLength( $value ){677 if ( ! is_numeric($value) ){678 return false;679 }680 681 if ( strlen($value) > 9 ) {682 return false;683 }684 685 return true;686 }687 688 673 // 一致した値のキー名を取得 689 674 function sfSearchKey($array, $word, $default) {
Note: See TracChangeset
for help on using the changeset viewer.