1 | <?php |
---|
2 | /* |
---|
3 | * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. |
---|
4 | * |
---|
5 | * http://www.lockon.co.jp/ |
---|
6 | */ |
---|
7 | require_once("../require.php"); |
---|
8 | |
---|
9 | class LC_Page { |
---|
10 | var $list_data; |
---|
11 | |
---|
12 | function LC_Page() { |
---|
13 | $this->tpl_mainpage = 'order/mail.tpl'; |
---|
14 | $this->tpl_subnavi = 'order/subnavi.tpl'; |
---|
15 | $this->tpl_mainno = 'order'; |
---|
16 | $this->tpl_subno = 'index'; |
---|
17 | $this->tpl_subtitle = '¼õÃí´ÉÍý'; |
---|
18 | global $arrMAILTEMPLATE; |
---|
19 | $this->arrMAILTEMPLATE = $arrMAILTEMPLATE; |
---|
20 | } |
---|
21 | } |
---|
22 | |
---|
23 | $objPage = new LC_Page(); |
---|
24 | $objView = new SC_AdminView(); |
---|
25 | $objSess = new SC_Session(); |
---|
26 | sfIsSuccess($objSess); |
---|
27 | |
---|
28 | //-- ¥«¥é¥à¤ÎÇÛÎó |
---|
29 | $arrRegistColumn = array( |
---|
30 | array( "column" => "name01", "convert" => "aKV" ), |
---|
31 | array( "column" => "name02", "convert" => "aKV" ), |
---|
32 | array( "column" => "email", "convert" => "a" ), |
---|
33 | array( "column" => "email_mobile", "convert" => "a" ), |
---|
34 | ); |
---|
35 | |
---|
36 | // ¸¡º÷¥Ñ¥é¥á¡¼¥¿¤Î°ú¤·Ñ¤® |
---|
37 | foreach ($_POST as $key => $val) { |
---|
38 | if (ereg("^search_", $key)) { |
---|
39 | $objPage->arrSearchHidden[$key] = $val; |
---|
40 | } |
---|
41 | } |
---|
42 | |
---|
43 | $objPage->tpl_order_id = $_POST['order_id']; |
---|
44 | $objPage->tpl_order_name01 = $_POST['order_name01']; |
---|
45 | $objPage->tpl_order_name02 = $_POST['order_name02']; |
---|
46 | $objPage->tpl_order_email = $_POST['order_email']; |
---|
47 | print_r($objPage->tpl_order_name02); |
---|
48 | print_r($objPage->tpl_order_id); |
---|
49 | // ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹ |
---|
50 | $objFormParam = new SC_FormParam(); |
---|
51 | // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ |
---|
52 | lfInitParam($objPage->tpl_order_id); |
---|
53 | |
---|
54 | switch($_POST['mode']) { |
---|
55 | case 'pre_edit': |
---|
56 | break; |
---|
57 | case 'return': |
---|
58 | // POSTÃͤμèÆÀ |
---|
59 | $objFormParam->setParam($_POST); |
---|
60 | break; |
---|
61 | case 'send': |
---|
62 | // POSTÃͤμèÆÀ |
---|
63 | $objFormParam->setParam($_POST); |
---|
64 | // ÆþÎÏÃͤÎÊÑ´¹ |
---|
65 | $objFormParam->convParam(); |
---|
66 | $objPage->arrErr = $objFormParam->checkerror(); |
---|
67 | // ¥á¡¼¥ë¤ÎÁ÷¿® |
---|
68 | if (count($objPage->arrErr) == 0) { |
---|
69 | // Ãíʸ¼õÉե᡼¥ë |
---|
70 | sfSendOrderMail($_POST['order_id'], $_POST['template_id'], $_POST['subject'], $_POST['header'], $_POST['footer']); |
---|
71 | } |
---|
72 | header("Location: " . URL_SEARCH_ORDER); |
---|
73 | exit; |
---|
74 | break; |
---|
75 | case 'confirm': |
---|
76 | // POSTÃͤμèÆÀ |
---|
77 | $objFormParam->setParam($_POST); |
---|
78 | // ÆþÎÏÃͤÎÊÑ´¹ |
---|
79 | $objFormParam->convParam(); |
---|
80 | // ÆþÎÏÃͤΰú¤·Ñ¤® |
---|
81 | $objPage->arrHidden = $objFormParam->getHashArray(); |
---|
82 | $objPage->arrErr = $objFormParam->checkerror(); |
---|
83 | // ¥á¡¼¥ë¤ÎÁ÷¿® |
---|
84 | if (count($objPage->arrErr) == 0) { |
---|
85 | // Ãíʸ¼õÉե᡼¥ë(Á÷¿®¤Ê¤·) |
---|
86 | $objSendMail = sfSendOrderMail($_POST['order_id'], $_POST['template_id'], $_POST['subject'], $_POST['header'], $_POST['footer'], false); |
---|
87 | // ³Îǧ¥Ú¡¼¥¸¤Îɽ¼¨ |
---|
88 | $objPage->tpl_subject = $objSendMail->subject; |
---|
89 | $objPage->tpl_body = mb_convert_encoding( $objSendMail->body, "EUC-JP", "auto" ); |
---|
90 | $objPage->tpl_to = $objSendMail->tpl_to; |
---|
91 | $objPage->tpl_mainpage = 'order/mail_confirm.tpl'; |
---|
92 | |
---|
93 | $objView->assignobj($objPage); |
---|
94 | $objView->display(MAIN_FRAME); |
---|
95 | |
---|
96 | exit; |
---|
97 | } |
---|
98 | break; |
---|
99 | case 'change': |
---|
100 | // POSTÃͤμèÆÀ |
---|
101 | $objFormParam->setValue('template_id', $_POST['template_id']); |
---|
102 | if(sfIsInt($_POST['template_id'])) { |
---|
103 | $objQuery = new SC_Query(); |
---|
104 | $where = "template_id = ?"; |
---|
105 | $arrRet = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array($_POST['template_id'])); |
---|
106 | $objFormParam->setParam($arrRet[0]); |
---|
107 | } |
---|
108 | break; |
---|
109 | } |
---|
110 | |
---|
111 | |
---|
112 | $objQuery = new SC_Query(); |
---|
113 | $col = "send_date, subject, template_id, send_id"; |
---|
114 | $where = "order_id = ?"; |
---|
115 | $objQuery->setorder("send_date DESC"); |
---|
116 | |
---|
117 | if(sfIsInt($_POST['order_id'])) { |
---|
118 | $objPage->arrMailHistory = $objQuery->select($col, "dtb_mail_history", $where, array($_POST['order_id'])); |
---|
119 | } |
---|
120 | |
---|
121 | $objPage->arrForm = $objFormParam->getFormParamList(); |
---|
122 | $objView->assignobj($objPage); |
---|
123 | $objView->display(MAIN_FRAME); |
---|
124 | //----------------------------------------------------------------------------------------------------------------------------------- |
---|
125 | /* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */ |
---|
126 | function lfInitParam() { |
---|
127 | global $objFormParam; |
---|
128 | $objFormParam->addParam("¥Æ¥ó¥×¥ì¡¼¥È", "template_id", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK")); |
---|
129 | $objFormParam->addParam("¥á¡¼¥ë¥¿¥¤¥È¥ë", "subject", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "SPTAB_CHECK")); |
---|
130 | $objFormParam->addParam("¥Ø¥Ã¥À¡¼", "header", LTEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "SPTAB_CHECK")); |
---|
131 | $objFormParam->addParam("¥Õ¥Ã¥¿¡¼", "footer", LTEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "SPTAB_CHECK")); |
---|
132 | } |
---|