source: branches/dev/html/mobile/nonmember/deliv.php @ 12870

Revision 12870, 10.6 KB checked in by nakanishi, 15 years ago (diff)
Line 
1<?php
2
3require_once("../require.php");
4
5class LC_Page {
6    var $arrSession;
7    var $tpl_mode;
8    var $tpl_login_email;
9    function LC_Page() {
10        $this->tpl_mainpage = 'nonmember/index.tpl';
11        global $arrPref;
12        $this->arrPref = $arrPref;
13        global $arrSex;
14        $this->arrSex = $arrSex;
15        global $arrJob;
16        $this->arrJob = $arrJob;
17        $this->tpl_onload = 'fnCheckInputDeliv();';
18       
19        /*
20         session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç
21         ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£
22         private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£
23        */
24        session_cache_limiter('private-no-expire');             
25    }
26}
27
28$conn = new SC_DBConn();
29$objPage = new LC_Page();
30$objView = new SC_MobileView();
31$objSiteSess = new SC_SiteSession();
32$objCartSess = new SC_CartSession();
33$objCustomer = new SC_Customer();
34$objCookie = new SC_Cookie();
35$objFormParam = new SC_FormParam();         // ¥Õ¥©¡¼¥àÍÑ
36lfInitParam();                              // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
37$objFormParam->setParam($_POST);            // POSTÃͤμèÆÀ
38
39$uniqid = sfCheckNormalAccess($objSiteSess, $objCartSess);
40// ¥æ¥Ë¡¼¥¯ID¤ò°ú¤­·Ñ¤°
41$objPage->tpl_uniqid = $uniqid;
42
43if(!empty($_POST["mode2"])){
44if ($_POST["mode2"] == "deliv") {
45           
46            $objFormParam = new SC_FormParam();
47            // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
48           
49            // POSTÃͤμèÆÀ
50            $objFormParam->setParam($_POST);
51            $arrRet = $objFormParam->getHashArray();
52            $sqlval = $objFormParam->getDbArray();
53           
54            // ÆþÎÏÃͤμèÆÀ
55            $objPage->arrForm = $objFormParam->getFormParamList();
56            $objPage->arrErr = $arrErr;
57           
58           foreach($_POST as $key => $value){
59               $objPage->arrAddr[0][$key] = $value;
60           }
61            lfRegistDataTemp($objPage->arrAddr[0]['uniqid'],$objPage->arrAddr[0]);
62           
63            lfCopyDeliv($objPage->tpl_uniqid, $_POST);
64           
65            $objPage->tpl_mainpage = 'nonmember/nonmember_deliv.tpl';
66            $objPage->tpl_title = '¤ªÆϤ±Àè¾ðÊó';
67            //objPage¤Î¾ðÊó¤òobjView¤Ë³ÊǼ
68            $objView->assignobj($objPage);
69            $objView->display(SITE_FRAME);
70        }
71       
72         if ($_POST["mode2"] == "customer_addr") {
73            //print_r($_POST);
74            if ($_POST['deli'] != "") {
75           
76           header("Location:" . gfAddSessionId("./payment.php"));
77            exit;
78    }else{
79        // ¥¨¥é¡¼¤òÊÖ¤¹
80        $arrErr['deli'] = '¢¨ ¤ªÆϤ±Àè¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£';
81            }
82        }
83    }elseif(!empty($_POST["mode"]) && $_POST["mode"]=="deliv_date"){ 
84        $objQuery = new SC_Query();
85        print($objPage->tpl_uniqid);
86        $objPage->tpl_mainpage = 'nonmember/nonmember_deliv.tpl';
87        $objPage->tpl_title = '¤ªÆϤ±Àè¾ðÊó';
88        //objPage¤Î¾ðÊó¤òobjView¤Ë³ÊǼ
89       
90        $where = "order_temp_id = ?";
91        $arrRet = $objQuery->select("*", "dtb_order_temp", $where, array($objPage->tpl_uniqid));
92        $objFormParam->setParam($arrRet[0]);
93        $objPage->arrForm = $objFormParam->getFormParamList();       
94        print_r($objPage->arrForm[0]);
95             foreach($objPage->arrForm as $key => $value){
96               $objPage->arrAddr[0][$key] = $value;
97           }
98       
99        $objView->assignobj($objPage);
100        $objView->display(SITE_FRAME);
101    }
102
103//ÆþÎϤµ¤ì¤¿¾ðÊó¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹dtb_order_temp¤Ë³ÊǼ¤¹¤ë
104function lfRegistDataTemp($uniqid,$array) {
105    global $objFormParam;
106    $arrRet = $objFormParam->getHashArray();
107    $sqlval = $objFormParam->getDbArray();
108       
109    // ÅÐÏ¿¥Ç¡¼¥¿¤ÎºîÀ®
110    $sqlval['order_temp_id'] = $uniqid;
111    $sqlval['order_birth'] = sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']);
112    $sqlval['update_date'] = 'Now()';
113    $sqlval['customer_id'] = '0';
114   
115    $sqlval['order_name01'] = $array['name01'];
116    $sqlval['order_name02'] = $array['name02'];
117    $sqlval['order_kana01'] = $array['kana01'];
118    $sqlval['order_kana02'] = $array['kana02'];
119    $sqlval['order_zip01'] = $array['zip01'];
120    $sqlval['order_zip02'] = $array['zip02'];
121    $sqlval['order_pref'] = $array['pref'];
122    $sqlval['order_addr01'] = $array['addr01'];
123    $sqlval['order_addr02'] = $array['addr02'];
124    $sqlval['order_tel01'] = $array['tel01'];
125    $sqlval['order_tel02'] = $array['tel02'];
126    $sqlval['order_tel03'] = $array['tel03'];
127    $sqlval['order_email'] = $array['email'];
128    $sqlval['order_sex'] = $array['sex'];
129         
130    // ´û¸¥Ç¡¼¥¿¤Î¥Á¥§¥Ã¥¯
131    $objQuery = new SC_Query();
132    $where = "order_temp_id = ?";
133    $cnt = $objQuery->count("dtb_order_temp", $where, array($uniqid));
134    // ´û¸¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç
135    if ($cnt == 0) {
136        $sqlval['create_date'] = 'Now()';
137        $objQuery->insert("dtb_order_temp", $sqlval);
138    } else {
139        $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
140    }
141}
142
143/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
144function lfInitParam() {
145    global $objFormParam;
146    $objFormParam->addParam("¤ªÌ¾Á°¡ÊÀ«¡Ë", "order_name01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
147    $objFormParam->addParam("¤ªÌ¾Á°¡Ê̾¡Ë", "order_name02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
148    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "order_kana01", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
149    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "order_kana02", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
150    $objFormParam->addParam("͹ÊØÈÖ¹æ1", "order_zip01", ZIP01_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
151    $objFormParam->addParam("͹ÊØÈÖ¹æ2", "order_zip02", ZIP02_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
152    $objFormParam->addParam("ÅÔÆ»Éܸ©", "order_pref", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
153    $objFormParam->addParam("½»½ê1", "order_addr01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
154    $objFormParam->addParam("½»½ê2", "order_addr02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
155    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ1", "order_tel01", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
156    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ2", "order_tel02", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
157    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ3", "order_tel03", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
158    $objFormParam->addParam("FAXÈÖ¹æ1", "order_fax01", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
159    $objFormParam->addParam("FAXÈÖ¹æ2", "order_fax02", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
160    $objFormParam->addParam("FAXÈÖ¹æ3", "order_fax03", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
161    $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹", "order_email", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK"));
162    $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email_check", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK"), "", false);
163    $objFormParam->addParam("ǯ", "year", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
164    $objFormParam->addParam("·î", "month", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
165    $objFormParam->addParam("Æü", "day", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
166    $objFormParam->addParam("À­ÊÌ", "order_sex", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
167    $objFormParam->addParam("¿¦¶È", "order_job", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
168    $objFormParam->addParam("Ê̤ΤªÆϤ±Àè", "deliv_check", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
169    $objFormParam->addParam("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
170    $objFormParam->addParam("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
171    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01", STEXT_LEN, "KVCa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
172    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02", STEXT_LEN, "KVCa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
173    $objFormParam->addParam("͹ÊØÈÖ¹æ1", "deliv_zip01", ZIP01_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK"));
174    $objFormParam->addParam("͹ÊØÈÖ¹æ2", "deliv_zip02", ZIP02_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK"));
175    $objFormParam->addParam("ÅÔÆ»Éܸ©", "deliv_pref", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
176    $objFormParam->addParam("½»½ê1", "deliv_addr01", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
177    $objFormParam->addParam("½»½ê2", "deliv_addr02", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
178    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ1", "deliv_tel01", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
179    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ2", "deliv_tel02", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
180    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ3", "deliv_tel03", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
181    $objFormParam->addParam("¥á¡¼¥ë¥Þ¥¬¥¸¥ó", "mail_flag", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"), 1);
182}
183
184/* DB¤Ø¥Ç¡¼¥¿¤ÎÅÐÏ¿ */
185
186
187// ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤Î¤ªÆϤ±Àè¤ò¥³¥Ô¡¼¤¹¤ë
188function lfCopyDeliv($uniqid, $arrData) {
189    $objQuery = new SC_Query();
190   
191    // Ê̤ΤªÆϤ±Àè¤ò»ØÄꤷ¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ÇÛÁ÷Àè¤ËÅÐÏ¿½»½ê¤ò¥³¥Ô¡¼¤¹¤ë¡£
192    if($arrData["deliv_check"] != "1") {
193        $sqlval['deliv_name01'] = $arrData['order_name01'];
194        $sqlval['deliv_name02'] = $arrData['order_name02'];
195        $sqlval['deliv_kana01'] = $arrData['order_kana01'];
196        $sqlval['deliv_kana02'] = $arrData['order_kana02'];
197        $sqlval['deliv_pref'] = $arrData['order_pref'];
198        $sqlval['deliv_zip01'] = $arrData['order_zip01'];
199        $sqlval['deliv_zip02'] = $arrData['order_zip02'];
200        $sqlval['deliv_addr01'] = $arrData['order_addr01'];
201        $sqlval['deliv_addr02'] = $arrData['order_addr02'];
202        $sqlval['deliv_tel01'] = $arrData['order_tel01'];
203        $sqlval['deliv_tel02'] = $arrData['order_tel02'];
204        $sqlval['deliv_tel03'] = $arrData['order_tel03'];
205        $where = "order_temp_id = ?";
206        $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
207    }
208}
209
210?>
Note: See TracBrowser for help on using the repository browser.