Changeset 14676 for branches/beta/html/admin/basis/mail.php
- Timestamp:
- 2007/06/14 22:01:13 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/beta/html/admin/basis/mail.php
r17 r14676 20 20 21 21 $conn = new SC_DBConn(); 22 $objQuery = new SC_Query(); 22 23 $objPage = new LC_Page(); 23 24 $objView = new SC_AdminView(); 24 25 $objSess = new SC_Session(); 25 26 26 // 27 //ǧ¾Ú²ÄÈݤÎȽÄê 27 28 sfIsSuccess($objSess); 28 29 29 30 $objPage->arrMailTEMPLATE = $arrMAILTEMPLATE; 30 31 31 if ( $_POST['mode'] == 'id_set'){ 32 // ¥Æ¥ó¥×¥ì¡¼¥È¥×¥ë¥À¥¦¥óÊѹ¹»þ 33 34 if ( sfCheckNumLength( $_ POST['template_id']) ){32 $objPage->arrSendType = array("¥Ñ¥½¥³¥ó","·ÈÂÓ"); 33 34 if ( $_GET['mode'] == 'edit' && sfCheckNumLength($_GET['template_id']) === true ){ 35 if ( sfCheckNumLength( $_GET['template_id']) ){ 35 36 $sql = "SELECT * FROM dtb_mailtemplate WHERE template_id = ?"; 36 $result = $conn->getAll($sql, array($_ POST['template_id']) );37 $result = $conn->getAll($sql, array($_GET['template_id']) ); 37 38 if ( $result ){ 38 39 $objPage->arrForm = $result[0]; 39 40 } else { 40 $objPage->arrForm['template_id'] = $_ POST['template_id'];41 $objPage->arrForm['template_id'] = $_GET['template_id']; 41 42 } 42 43 } 43 44 44 } elseif ( $_POST['mode'] == 'regist' && sfCheckNumLength( $_POST['template_id']) ){ 45 46 45 // POST¥Ç¡¼¥¿¤Î°ú¤·Ñ¤® 47 46 $objPage->arrForm = lfConvertParam($_POST); 48 47 $objPage->arrErr = fnErrorCheck($objPage->arrForm); 49 50 48 if ( $objPage->arrErr ){ 51 49 // ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ 52 50 $objPage->tpl_msg = "¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿"; 53 54 51 } else { 55 52 // Àµ¾ï 56 53 lfRegist($conn, $objPage->arrForm); 57 58 54 // ´°Î»¥á¥Ã¥»¡¼¥¸ 59 $objPage->tpl_onload = "window.alert('¥á¡¼¥ëÀßÄ꤬´°Î»¤·¤Þ¤·¤¿¡£¥Æ¥ó¥×¥ì¡¼¥È¤òÁªÂò¤·¤ÆÆâÍƤò¤´³Îǧ¤¯¤À¤µ¤¤¡£');"; 60 unset($objPage->arrForm); 55 $objPage->tpl_onload = "window.alert('¥á¡¼¥ëÀßÄ꤬´°Î»¤·¤Þ¤·¤¿¡£');"; 61 56 } 62 63 57 } 64 58 … … 72 66 $data['creator_id'] = $_SESSION['member_id']; 73 67 74 $sql = "SELECT * FROM dtb_mailtemplate WHERE template_id = ? ";68 $sql = "SELECT * FROM dtb_mailtemplate WHERE template_id = ? AND del_flg = 0"; 75 69 $result = $conn->getAll($sql, array($_POST['template_id']) ); 76 70 if ( $result ){ 77 71 $sql_where = "template_id = ". addslashes($_POST['template_id']); 78 $conn->query("UPDATE dtb_mailtemplate SET template_id = ?, subject = ?,header = ?, footer= ?,creator_id = ?, update_date = now() WHERE ".$sql_where, $data);72 $conn->query("UPDATE dtb_mailtemplate SET send_type = ?,template_id = ?, template_name = ?,subject = ?,body = ?,creator_id = ?, update_date = now() WHERE ".$sql_where, $data); 79 73 }else{ 80 $conn->query("INSERT INTO dtb_mailtemplate ( template_id,subject,header,footer,creator_id,update_date,create_date) values (?,?,?,?,?,now(),now() )", $data);74 $conn->query("INSERT INTO dtb_mailtemplate (send_type,template_id,template_name,subject,body,creator_id,update_date,create_date) values ( ?,?,?,?,?,?,now(),now() )", $data); 81 75 } 82 76 83 77 } 84 78 85 86 79 function lfConvertParam($array) { 87 80 81 $new_array["send_type"] = $array["send_type"]; 88 82 $new_array["template_id"] = $array["template_id"]; 83 $new_array["template_name"] = mb_convert_kana($array["template_name"],"KV"); 89 84 $new_array["subject"] = mb_convert_kana($array["subject"] ,"KV"); 90 $new_array["header"] = mb_convert_kana($array["header"] ,"KV"); 91 $new_array["footer"] = mb_convert_kana($array["footer"] ,"KV"); 85 $new_array["body"] = mb_convert_kana($array["body"] ,"KV"); 92 86 93 87 return $new_array; … … 98 92 99 93 $objErr = new SC_CheckError($array); 100 94 $objErr->doFunc(array("¥á¡¼¥ë¤Î¼ïÎà",'send_type'), array("EXIST_CHECK")); 101 95 $objErr->doFunc(array("¥Æ¥ó¥×¥ì¡¼¥È",'template_id'), array("EXIST_CHECK")); 96 $objErr->doFunc(array("¥Æ¥ó¥×¥ì¡¼¥È",'template_name'), array("EXIST_CHECK")); 102 97 $objErr->doFunc(array("¥á¡¼¥ë¥¿¥¤¥È¥ë",'subject',MTEXT_LEN,"BIG"), array("EXIST_CHECK", "MAX_LENGTH_CHECK")); 103 $objErr->doFunc(array("¥Ø¥Ã¥À¡¼",'header',LTEXT_LEN,"BIG"), array("MAX_LENGTH_CHECK")); 104 $objErr->doFunc(array("¥Õ¥Ã¥¿¡¼",'footer',LTEXT_LEN,"BIG"), array("MAX_LENGTH_CHECK")); 98 $objErr->doFunc(array("¥á¡¼¥ë¤ÎÆâÍÆ",'body',LTEXT_LEN,"BIG"), array("MAX_LENGTH_CHECK","EXIST_CHECK")); 105 99 106 100 return $objErr->arrErr;
Note: See TracChangeset
for help on using the changeset viewer.