source: branches/dev/html/mobile/nonmember/index.php @ 14985

Revision 14985, 23.5 KB checked in by nakanishi, 15 years ago (diff)

nonmember_confirmを削除

Line 
1<?php
2/**
3 *
4 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
5 *
6 * http://www.lockon.co.jp/
7 *
8 */
9
10require_once("../require.php");
11
12class LC_Page {
13    var $arrSession;
14    var $tpl_mode;
15    var $tpl_login_email;
16    function LC_Page() {
17        $this->tpl_mainpage = 'nonmember/index.tpl';
18        global $arrPref;
19        $this->arrPref = $arrPref;
20        global $arrSex;
21        $this->arrSex = $arrSex;
22        global $arrJob;
23        $this->arrJob = $arrJob;
24        $this->tpl_onload = 'fnCheckInputDeliv();';
25       
26        /*
27         session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç
28         ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£
29         private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£
30        */
31        session_cache_limiter('private-no-expire');             
32    }
33}
34
35$conn = new SC_DBConn();
36$objPage = new LC_Page();
37$objView = new SC_MobileView();
38$objSiteSess = new SC_SiteSession();
39$objCartSess = new SC_CartSession();
40$objCustomer = new SC_Customer();
41$objCookie = new SC_Cookie();
42$objFormParam = new SC_FormParam();         // ¥Õ¥©¡¼¥àÍÑ
43lfInitParam();                              // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
44$objFormParam->setParam($_POST);            // POSTÃͤμèÆÀ
45
46//-------------------------------------¢§NONMEMBER----------------------------------------------
47//---- ¥Ú¡¼¥¸½é´üÀßÄê
48
49$CONF = sf_getBasisData();                  // ŹÊÞ´ðËܾðÊó
50$objDate = new SC_Date(START_BIRTH_YEAR, date("Y",strtotime("now")));
51$objPage->arrPref = $arrPref;
52$objPage->arrJob = $arrJob;
53$objPage->arrReminder = $arrReminder;
54$objPage->arrYear = $objDate->getYear('', 1950);    //¡¡ÆüÉÕ¥×¥ë¥À¥¦¥óÀßÄê
55$objPage->arrMonth = $objDate->getMonth();
56$objPage->arrDay = $objDate->getDay();
57
58//SSLURLȽÄê
59if (SSLURL_CHECK == 1){
60    $ssl_url= sfRmDupSlash(MOBILE_SSL_URL.$_SERVER['REQUEST_URI']);
61    if (!ereg("^https://", $non_ssl_url)){
62        sfDispSiteError(URL_ERROR, "", false, "", true);
63    }
64}
65
66// ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ
67$objPage = sfGetPageLayout($objPage, false, DEF_LAYOUT);
68
69// ¥æ¡¼¥¶¥æ¥Ë¡¼¥¯ID¤Î¼èÆÀ¤È¹ØÆþ¾õÂÖ¤ÎÀµÅöÀ­¤ò¥Á¥§¥Ã¥¯
70$uniqid = sfCheckNormalAccess($objSiteSess, $objCartSess);
71
72$objPage->tpl_uniqid = $uniqid;
73
74switch($_POST['mode']) {
75// Á°¤Î¥Ú¡¼¥¸¤ËÌá¤ë
76case 'return':
77    // ³Îǧ¥Ú¡¼¥¸¤Ø°ÜÆ°
78    header("Location: " . gfAddSessionId(MOBILE_URL_CART_TOP));
79    exit;
80    break;
81case 'nonmember':
82    $objPage = lfSetNonMember($objPage);
83    // ¢¨break¤Ê¤·
84default:
85    if($_GET['from'] == 'nonmember') {
86        $objPage = lfSetNonMember($objPage);
87    }
88    // ¥æ¡¼¥¶¥æ¥Ë¡¼¥¯ID¤Î¼èÆÀ
89    $uniqid = $objSiteSess->getUniqId();
90    $objQuery = new SC_Query();
91    $where = "order_temp_id = ?";
92    //$arrRet = $objQuery->select("*", "dtb_order_temp", $where, array($uniqid));
93    sfprintr($arrRet);
94    // DBÃͤμèÆÀ
95    $objFormParam->setParam($arrRet[0]);
96    $objFormParam->setValue('order_email_check', $arrRet[0]['order_email']);
97    $objFormParam->setDBDate($arrRet[0]['order_birth']);
98    break;
99}
100
101// ¥¯¥Ã¥­¡¼È½Äê
102$objPage->tpl_login_email = $objCookie->getCookie('login_email');
103if($objPage->tpl_login_email != "") {
104    $objPage->tpl_login_memory = "1";
105}
106
107// ÁªÂòÍÑÆüÉդμèÆÀ
108$objDate = new SC_Date(START_BIRTH_YEAR);
109$objPage->arrYear = $objDate->getYear('', 1950);    //¡¡ÆüÉÕ¥×¥ë¥À¥¦¥óÀßÄê
110$objPage->arrMonth = $objDate->getMonth();
111$objPage->arrDay = $objDate->getDay();
112
113// ÆþÎÏÃͤμèÆÀ
114$objPage->arrForm = $objFormParam->getFormParamList();
115sfprintr($_SESSION);
116//objPage¤Î¾ðÊó¤òobjView¤Ë³ÊǼ
117$objView->assignobj($objPage);
118$objView->display(SITE_FRAME);
119
120//--------------------------------------------------------------------------------------------------------------------------
121/* Èó²ñ°÷ÆþÎÏ¥Ú¡¼¥¸¤Î¥»¥Ã¥È */
122function lfSetNonMember($objPage) {
123   
124    $arrRegistColumn = array(
125                             array(  "column" => "name01", "convert" => "aKV" ),
126                             array(  "column" => "name02", "convert" => "aKV" ),
127                             array(  "column" => "kana01", "convert" => "CKV" ),
128                             array(  "column" => "kana02", "convert" => "CKV" ),
129                             array(  "column" => "zip01", "convert" => "n" ),
130                             array(  "column" => "zip02", "convert" => "n" ),
131                             array(  "column" => "pref", "convert" => "n" ),
132                             array(  "column" => "addr01", "convert" => "aKV" ),
133                             array(  "column" => "addr02", "convert" => "aKV" ),
134                             array(  "column" => "email", "convert" => "a" ),
135                             array(  "column" => "email2", "convert" => "a" ),
136                             array(  "column" => "email_mobile", "convert" => "a" ),
137                             array(  "column" => "email_mobile2", "convert" => "a" ),
138                             array(  "column" => "tel01", "convert" => "n" ),
139                             array(  "column" => "tel02", "convert" => "n" ),
140                             array(  "column" => "tel03", "convert" => "n" ),
141                             array(  "column" => "fax01", "convert" => "n" ),
142                             array(  "column" => "fax02", "convert" => "n" ),
143                             array(  "column" => "fax03", "convert" => "n" ),
144                             array(  "column" => "sex", "convert" => "n" ),
145                             array(  "column" => "job", "convert" => "n" ),
146                             array(  "column" => "birth", "convert" => "n" ),
147                             array(  "column" => "reminder", "convert" => "n" ),
148                             array(  "column" => "reminder_answer", "convert" => "aKV"),
149                             array(  "column" => "password", "convert" => "a" ),
150                             array(  "column" => "password02", "convert" => "a" ),
151                             array(  "column" => "mailmaga_flg", "convert" => "n" ),
152                         );
153
154//---- ÅÐÏ¿½ü³°ÍÑ¥«¥é¥àÇÛÎó
155$arrRejectRegistColumn = array("year", "month", "day", "email02", "email_mobile02", "password02");
156       
157    $objPage->tpl_mainpage = 'nonmember/nonmember_set1.tpl';
158    $objPage->tpl_css = array();
159    $objPage->tpl_css[] = '/css/layout/login/nonmember.css';
160   
161    //-- POST¥Ç¡¼¥¿¤Î°ú¤­·Ñ¤®
162    $objPage->arrForm = $_POST;
163   
164    if($objPage->arrForm['year'] == '----') {
165        $objPage->arrForm['year'] = '';
166    }
167   
168    //$objPage->arrForm['email'] = strtolower($objPage->arrForm['email']);        // email¤Ï¤¹¤Ù¤Æ¾®Ê¸»ú¤Ç½èÍý
169   
170    //-- ÆþÎϥǡ¼¥¿¤ÎÊÑ´¹
171    $objPage->arrForm = lfConvertParam($objPage->arrForm, $arrRegistColumn);
172
173    // Ìá¤ë¥Ü¥¿¥óÍѽèÍý
174    //return¤ÎÃæ¤Ë¸µ¤Î¥Ú¡¼¥¸¤Î̾Á°¤¬Æþ¤Ã¤Æ¤¤¤ë
175    if (!empty($_POST["return"])) {
176        switch ($_POST["mode2"]) {
177        case "deliv_date": 
178       
179            break;
180        case "deliv":
181            $_POST["mode2"] = "set3";
182            break;
183        case "set3":
184            $_POST["mode2"] = "set2";
185            break;
186        default:
187            $_POST["mode2"] = "set1";
188            break;
189        }
190    }   
191
192    //--¡¡ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
193    if (!empty($_POST["mode2"])) {
194            if ($_POST["mode2"] == "set2") {
195            $objPage->arrErr = lfErrorCheck1($objPage->arrForm);
196            $objPage->tpl_mainpage = 'nonmember/nonmember_set1.tpl';
197            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(1/3)';
198        } elseif ($_POST["mode2"] == "set3") {
199           
200            $objPage->arrErr = lfErrorCheck2($objPage->arrForm);
201            $objPage->tpl_mainpage = 'nonmember/nonmember_set2.tpl';
202            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(2/3)';
203        } elseif ($_POST["mode2"] == "deliv"){
204            $objPage->arrErr = lfErrorCheck3($objPage->arrForm);
205            $objPage->tpl_mainpage = 'nonmember/nonmember_set3.tpl';
206            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(3/3)';
207        }
208   
209    //¥Õ¥©¡¼¥à¤ÎÃͤò$objPage¤Î¥­¡¼¤È¤·¤ÆÂåÆþ¤·¤Æ¤¤¤¯
210   foreach($objPage->arrForm as $key => $val) {
211        $objPage->$key = $val;
212        }
213    }
214
215        // ÆþÎÏ¥¨¥é¡¼¤Î¥Á¥§¥Ã¥¯
216    if ($objPage->arrErr || !empty($_POST["return"])) {     
217
218        //-- ¥Ç¡¼¥¿¤ÎÀßÄê
219        if ($_POST["mode2"] == "set2") {
220            $checkVal = array("email", "name01", "name02", "kana01", "kana02");
221        } elseif ($_POST["mode2"] == "set3") {
222            $checkVal = array("sex", "year", "month", "day", "zip01", "zip02");
223        } else {
224            $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mail_flag");
225        }
226
227        foreach($objPage->arrForm as $key => $val) {
228            if ($key != "mode2" && $key != "submit" && $key != "return" && $key != session_name() && !in_array($key, $checkVal))
229                $objPage->list_data[ $key ] = $val;
230        }
231
232    } else {
233
234        //--¡¡¥Æ¥ó¥×¥ì¡¼¥ÈÀßÄê
235        if ($_POST["mode2"] == "set2") {
236            $objPage->tpl_mainpage = 'nonmember/nonmember_set2.tpl';
237            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(2/3)';
238        } elseif ($_POST["mode2"] == "set3") {
239            $objPage->tpl_mainpage = 'nonmember/nonmember_set3.tpl';
240            $objPage->tpl_title = '¤ªµÒÍ;ðÊóÆþÎÏ(3/3)';
241
242            if (@$objPage->arrForm['pref'] == "" && @$objPage->arrForm['addr01'] == "" && @$objPage->arrForm['addr02'] == "") {
243                $address = lfGetAddress($_REQUEST['zip01'].$_REQUEST['zip02']);
244                $objPage->pref = @$address[0]['state'];
245                $objPage->addr01 = @$address[0]['city'] . @$address[0]['town'];
246            }
247        }
248
249        //-- ¥Ç¡¼¥¿ÀßÄê
250        unset($objPage->list_data);
251        if ($_POST["mode2"] == "set2") {
252            $checkVal = array("sex", "year", "month", "day", "zip01", "zip02");
253        } elseif ($_POST["mode2"] == "set3") {
254            $checkVal = array("pref", "addr01", "addr02", "tel01", "tel02", "tel03", "mail_flag");
255        } else {
256            $checkVal = array();
257        }
258
259        //$objPage->arrForm¥Õ¥©¡¼¥à¤ÎÃͤòlist¤Ë³ÊǼ
260        foreach($objPage->arrForm as $key => $val) {
261            if ($key != "mode2" && $key != "submit" && $key != "confirm" && $key != "return" && $key != session_name() && !in_array($key, $checkVal)) {
262                $objPage->list_data[ $key ] = $val;
263                $_SESSION['user_info'][$key] = $val;
264            }
265        }
266//        sfprintr($_SESSION['user_info']);
267       if($_POST["mode2"] == "deliv"){
268            $_SESSION['user_info']['mode2'] = "deliv";
269            header("Location:" . gfAddSessionId("./deliv.php"));
270       }
271    }
272    return $objPage;
273}
274
275
276/**
277 * regist data function
278 *
279 * @param string $uniqid this parameter is unique ID of user.
280 *
281 *
282 */
283 //¥Ç¡¼¥¿¤ÎÅÐÏ¿¤ò¹Ô¤¦
284function lfRegistData($uniqid) {
285    global $objFormParam;
286    $arrRet = $objFormParam->getHashArray();
287    $sqlval = $objFormParam->getDbArray();
288   
289    // ÅÐÏ¿¥Ç¡¼¥¿¤ÎºîÀ®
290    $sqlval['order_temp_id'] = $uniqid;
291    $sqlval['order_birth'] = sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']);
292    $sqlval['update_date'] = 'Now()';
293    $sqlval['customer_id'] = '0';
294    $sqlval['order_name01'] = $objPage->arrAddr[0]['name01'];
295         
296    // ´û¸¥Ç¡¼¥¿¤Î¥Á¥§¥Ã¥¯
297    $objQuery = new SC_Query();
298    $where = "order_temp_id = ?";
299    $cnt = $objQuery->count("dtb_order_temp", $where, array($uniqid));
300    // ´û¸¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç
301    if ($cnt == 0) {
302        $sqlval['create_date'] = 'Now()';
303        $objQuery->insert("dtb_order_temp", $sqlval);
304    } else {
305        $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
306    }
307}
308
309/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
310function lfInitParam() {
311    global $objFormParam;
312    $objFormParam->addParam("¤ªÌ¾Á°¡ÊÀ«¡Ë", "order_name01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
313    $objFormParam->addParam("¤ªÌ¾Á°¡Ê̾¡Ë", "order_name02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
314    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "order_kana01", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
315    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "order_kana02", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
316    $objFormParam->addParam("͹ÊØÈÖ¹æ1", "order_zip01", ZIP01_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
317    $objFormParam->addParam("͹ÊØÈÖ¹æ2", "order_zip02", ZIP02_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
318    $objFormParam->addParam("ÅÔÆ»Éܸ©", "order_pref", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
319    $objFormParam->addParam("½»½ê1", "order_addr01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
320    $objFormParam->addParam("½»½ê2", "order_addr02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
321    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ1", "order_tel01", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
322    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ2", "order_tel02", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
323    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ3", "order_tel03", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
324    $objFormParam->addParam("FAXÈÖ¹æ1", "order_fax01", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
325    $objFormParam->addParam("FAXÈÖ¹æ2", "order_fax02", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
326    $objFormParam->addParam("FAXÈÖ¹æ3", "order_fax03", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
327    $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹", "order_email", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK"));
328    $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email_check", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK"), "", false);
329    $objFormParam->addParam("ǯ", "year", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
330    $objFormParam->addParam("·î", "month", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
331    $objFormParam->addParam("Æü", "day", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
332    $objFormParam->addParam("À­ÊÌ", "order_sex", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
333    $objFormParam->addParam("¿¦¶È", "order_job", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
334    $objFormParam->addParam("Ê̤ΤªÆϤ±Àè", "deliv_check", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
335    $objFormParam->addParam("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
336    $objFormParam->addParam("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
337    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01", STEXT_LEN, "KVCa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
338    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02", STEXT_LEN, "KVCa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
339    $objFormParam->addParam("͹ÊØÈÖ¹æ1", "deliv_zip01", ZIP01_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK"));
340    $objFormParam->addParam("͹ÊØÈÖ¹æ2", "deliv_zip02", ZIP02_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK"));
341    $objFormParam->addParam("ÅÔÆ»Éܸ©", "deliv_pref", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
342    $objFormParam->addParam("½»½ê1", "deliv_addr01", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
343    $objFormParam->addParam("½»½ê2", "deliv_addr02", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
344    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ1", "deliv_tel01", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
345    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ2", "deliv_tel02", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
346    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ3", "deliv_tel03", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
347    $objFormParam->addParam("¥á¡¼¥ë¥Þ¥¬¥¸¥ó", "mail_flag", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"), 1);
348}
349
350/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
351function lfCheckError() {
352    global $objFormParam;
353    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
354    $arrRet =  $objFormParam->getHashArray();
355    $objErr = new SC_CheckError($arrRet);
356    $objErr->arrErr = $objFormParam->checkError();
357       
358    // Ê̤ΤªÆϤ±Àè¥Á¥§¥Ã¥¯
359    if($_POST['deliv_check'] == "1") {
360        $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01"), array("EXIST_CHECK"));
361        $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02"), array("EXIST_CHECK"));
362        $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01"), array("EXIST_CHECK"));
363        $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02"), array("EXIST_CHECK"));
364        $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "deliv_zip01"), array("EXIST_CHECK"));
365        $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "deliv_zip02"), array("EXIST_CHECK"));
366        $objErr->doFunc(array("ÅÔÆ»Éܸ©", "deliv_pref"), array("EXIST_CHECK"));
367        $objErr->doFunc(array("½»½ê1", "deliv_addr01"), array("EXIST_CHECK"));
368        $objErr->doFunc(array("½»½ê2", "deliv_addr02"), array("EXIST_CHECK"));
369        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", "deliv_tel01"), array("EXIST_CHECK"));
370        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", "deliv_tel02"), array("EXIST_CHECK"));
371        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", "deliv_tel03"), array("EXIST_CHECK"));
372    }
373   
374    // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯
375    $objErr->doFunc(array("TEL", "order_tel01", "order_tel02", "order_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
376    $objErr->doFunc(array("FAX", "order_fax01", "order_fax02", "order_fax03", TEL_ITEM_LEN), array("TEL_CHECK"));
377    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "order_zip01", "order_zip02"), array("ALL_EXIST_CHECK"));
378    $objErr->doFunc(array("TEL", "deliv_tel01", "deliv_tel02", "deliv_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
379    $objErr->doFunc(array("FAX", "deliv_fax01", "deliv_fax02", "deliv_fax03", TEL_ITEM_LEN), array("TEL_CHECK"));
380    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "deliv_zip01", "deliv_zip02"), array("ALL_EXIST_CHECK"));
381    $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
382    $objErr->doFunc(array("¥á¡¼¥ë¥¢¥É¥ì¥¹", "¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email", "order_email_check"), array("EQUAL_CHECK"));
383   
384    // ¤¹¤Ç¤Ë¥á¥ë¥Þ¥¬¥Æ¡¼¥Ö¥ë¤Ë²ñ°÷¤È¤·¤Æ¥á¡¼¥ë¥¢¥É¥ì¥¹¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¾ì¹ç
385    if(sfCheckCustomerMailMaga($arrRet['order_email'])) {
386        $objErr->arrErr['order_email'] = "¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ï¤¹¤Ç¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£<br>";
387    }
388       
389    return $objErr->arrErr;
390}
391
392
393//-----------------------------NONMEMBER´Ø¿ô·²¢§------------------------------------------------------------------
394//----¡¡¼èÆÀʸ»úÎó¤ÎÊÑ´¹
395function lfConvertParam($array, $arrRegistColumn) {
396    /*
397     *  ʸ»úÎó¤ÎÊÑ´¹
398     *  K :  ¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
399     *  C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
400     *  V :  ÂùÅÀÉÕ¤­¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹
401     *  n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)¡×¤ËÊÑ´¹
402     *  a :  Á´³Ñ±Ñ¿ô»ú¤òȾ³Ñ±Ñ¿ô»ú¤ËÊÑ´¹¤¹¤ë
403     */
404    // ¥«¥é¥à̾¤È¥³¥ó¥Ð¡¼¥È¾ðÊó
405    foreach ($arrRegistColumn as $data) {
406        $arrConvList[ $data["column"] ] = $data["convert"];
407    }
408    // ʸ»úÊÑ´¹
409    foreach ($arrConvList as $key => $val) {
410        // POST¤µ¤ì¤Æ¤­¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£
411        if(strlen(($array[$key])) > 0) {
412            $array[$key] = mb_convert_kana($array[$key] ,$val);
413        }
414    }
415    return $array;
416}
417
418
419//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
420function lfErrorCheck1($array) {
421
422    global $objConn;
423    $objErr = new SC_CheckError($array);
424   
425    $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
426    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
427    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/À«¡Ë", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
428    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/̾¡Ë", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
429    $objErr->doFunc(array('¥á¡¼¥ë¥¢¥É¥ì¥¹', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK", "MOBILE_EMAIL_CHECK"));
430
431    return $objErr->arrErr;
432}
433
434//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
435function lfErrorCheck2($array) {
436
437    global $objConn, $objDate;
438    $objErr = new SC_CheckError($array);
439   
440    $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
441    $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
442    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK"));
443
444    $objErr->doFunc(array("À­ÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));
445    $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", 4), array("EXIST_CHECK", "SPTAB_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
446    if (!isset($objErr->arrErr['year'])) {
447        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getStartYear()), array("MIN_CHECK"));
448        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getEndYear()), array("MAX_CHECK"));
449    }
450    $objErr->doFunc(array("À¸Ç¯·îÆü (·îÆü)", "month", "day"), array("SELECT_CHECK"));
451    if (!isset($objErr->arrErr['year']) && !isset($objErr->arrErr['month']) && !isset($objErr->arrErr['day'])) {
452        $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
453    }
454   
455    return $objErr->arrErr;
456}
457
458
459//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
460function lfErrorCheck3($array) {
461
462    global $objConn;
463    $objErr = new SC_CheckError($array);
464   
465    $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK"));
466    $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
467    $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
468    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" ));
469    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" ));
470    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" ));
471    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK"));
472   
473    return $objErr->arrErr;
474}
475
476// ͹ÊØÈֹ椫¤é½»½ê¤Î¼èÆÀ
477function lfGetAddress($zipcode) {
478    global $arrPref;
479
480    $conn = new SC_DBconn(ZIP_DSN);
481
482    // ͹ÊØÈֹ渡º÷ʸºîÀ®
483    $zipcode = mb_convert_kana($zipcode ,"n");
484    $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
485
486    $data_list = $conn->getAll($sqlse, array($zipcode));
487
488    // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£
489    $arrREV_PREF = array_flip($arrPref);
490
491    /*
492        Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È
493        °Ê²¼¤Î¤è¤¦¤Êʸ»úÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ç   Âкö¤¹¤ë¡£
494        ¡¦¡Ê£±¡¦£±£¹ÃúÌÜ¡Ë
495        ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç
496    */
497    $town =  $data_list[0]['town'];
498    $town = ereg_replace("¡Ê.*¡Ë$","",$town);
499    $town = ereg_replace("°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town);
500    $data_list[0]['town'] = $town;
501    $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];
502
503    return $data_list;
504}
505//NONMEMBER_´Ø¿ô·²---------------------------------------------------------------------------------------
506?>
Note: See TracBrowser for help on using the repository browser.