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

Revision 12853, 17.8 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ÃͤμèÆÀ
38print_r($_POST);
39
40if ($_POST["mode2"] == "deliv") {
41           
42            $objFormParam = new SC_FormParam();
43            // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
44           
45            // POSTÃͤμèÆÀ
46            $objFormParam->setParam($_POST);
47            $arrRet = $objFormParam->getHashArray();
48            $sqlval = $objFormParam->getDbArray();
49           
50            // ÆþÎÏÃͤμèÆÀ
51            $objPage->arrForm = $objFormParam->getFormParamList();
52            $objPage->arrErr = $arrErr;
53           
54           foreach($_POST as $key => $value){
55               $objPage->arrAddr[0][$key] = $value;
56           }
57            lfRegistDataTemp($objPage->tpl_uniqid,$objPage->arrAddr[0]);
58           
59            print("test<BR>");
60            lfCopyDeliv($objPage->tpl_uniqid, $_POST);
61           
62            $objPage->tpl_mainpage = 'nonmember/nonmember_deliv.tpl';
63            $objPage->tpl_title = '¤ªÆϤ±Àè¾ðÊó';
64        }
65       
66         if ($_POST["mode2"] == "customer_addr") {
67            //print_r($_POST);
68            if ($_POST['deli'] != "") {
69           
70           header("Location:" . gfAddSessionId("./payment.php"));
71            exit;
72    }else{
73        // ¥¨¥é¡¼¤òÊÖ¤¹
74        $arrErr['deli'] = '¢¨ ¤ªÆϤ±Àè¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£';
75    }
76         }
77         
78         function lfRegistData($uniqid) {
79    global $objFormParam;
80    $arrRet = $objFormParam->getHashArray();
81    $sqlval = $objFormParam->getDbArray();
82   
83    // ÅÐÏ¿¥Ç¡¼¥¿¤ÎºîÀ®
84    $sqlval['order_temp_id'] = $uniqid;
85    $sqlval['order_birth'] = sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']);
86    $sqlval['update_date'] = 'Now()';
87    $sqlval['customer_id'] = '0';
88    $sqlval['order_name01'] = $objPage->arrAddr[0]['name01'];
89         
90    // ´û¸¥Ç¡¼¥¿¤Î¥Á¥§¥Ã¥¯
91    $objQuery = new SC_Query();
92    $where = "order_temp_id = ?";
93    $cnt = $objQuery->count("dtb_order_temp", $where, array($uniqid));
94    // ´û¸¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç
95    if ($cnt == 0) {
96        $sqlval['create_date'] = 'Now()';
97        $objQuery->insert("dtb_order_temp", $sqlval);
98    } else {
99        $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
100    }
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/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
187function lfCheckError() {
188    global $objFormParam;
189    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
190    $arrRet =  $objFormParam->getHashArray();
191    $objErr = new SC_CheckError($arrRet);
192    $objErr->arrErr = $objFormParam->checkError();
193       
194    // Ê̤ΤªÆϤ±Àè¥Á¥§¥Ã¥¯
195    if($_POST['deliv_check'] == "1") {
196        $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01"), array("EXIST_CHECK"));
197        $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02"), array("EXIST_CHECK"));
198        $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01"), array("EXIST_CHECK"));
199        $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02"), array("EXIST_CHECK"));
200        $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "deliv_zip01"), array("EXIST_CHECK"));
201        $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "deliv_zip02"), array("EXIST_CHECK"));
202        $objErr->doFunc(array("ÅÔÆ»Éܸ©", "deliv_pref"), array("EXIST_CHECK"));
203        $objErr->doFunc(array("½»½ê1", "deliv_addr01"), array("EXIST_CHECK"));
204        $objErr->doFunc(array("½»½ê2", "deliv_addr02"), array("EXIST_CHECK"));
205        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", "deliv_tel01"), array("EXIST_CHECK"));
206        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", "deliv_tel02"), array("EXIST_CHECK"));
207        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", "deliv_tel03"), array("EXIST_CHECK"));
208    }
209   
210    // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯
211    $objErr->doFunc(array("TEL", "order_tel01", "order_tel02", "order_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
212    $objErr->doFunc(array("FAX", "order_fax01", "order_fax02", "order_fax03", TEL_ITEM_LEN), array("TEL_CHECK"));
213    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "order_zip01", "order_zip02"), array("ALL_EXIST_CHECK"));
214    $objErr->doFunc(array("TEL", "deliv_tel01", "deliv_tel02", "deliv_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
215    $objErr->doFunc(array("FAX", "deliv_fax01", "deliv_fax02", "deliv_fax03", TEL_ITEM_LEN), array("TEL_CHECK"));
216    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "deliv_zip01", "deliv_zip02"), array("ALL_EXIST_CHECK"));
217    $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
218    $objErr->doFunc(array("¥á¡¼¥ë¥¢¥É¥ì¥¹", "¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email", "order_email_check"), array("EQUAL_CHECK"));
219   
220    // ¤¹¤Ç¤Ë¥á¥ë¥Þ¥¬¥Æ¡¼¥Ö¥ë¤Ë²ñ°÷¤È¤·¤Æ¥á¡¼¥ë¥¢¥É¥ì¥¹¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¾ì¹ç
221    if(sfCheckCustomerMailMaga($arrRet['order_email'])) {
222        $objErr->arrErr['order_email'] = "¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ï¤¹¤Ç¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£<br>";
223    }
224       
225    return $objErr->arrErr;
226}
227
228// ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤Î¤ªÆϤ±Àè¤ò¥³¥Ô¡¼¤¹¤ë
229function lfCopyDeliv($uniqid, $arrData) {
230    $objQuery = new SC_Query();
231   
232    // Ê̤ΤªÆϤ±Àè¤ò»ØÄꤷ¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ÇÛÁ÷Àè¤ËÅÐÏ¿½»½ê¤ò¥³¥Ô¡¼¤¹¤ë¡£
233    if($arrData["deliv_check"] != "1") {
234        $sqlval['deliv_name01'] = $arrData['order_name01'];
235        $sqlval['deliv_name02'] = $arrData['order_name02'];
236        $sqlval['deliv_kana01'] = $arrData['order_kana01'];
237        $sqlval['deliv_kana02'] = $arrData['order_kana02'];
238        $sqlval['deliv_pref'] = $arrData['order_pref'];
239        $sqlval['deliv_zip01'] = $arrData['order_zip01'];
240        $sqlval['deliv_zip02'] = $arrData['order_zip02'];
241        $sqlval['deliv_addr01'] = $arrData['order_addr01'];
242        $sqlval['deliv_addr02'] = $arrData['order_addr02'];
243        $sqlval['deliv_tel01'] = $arrData['order_tel01'];
244        $sqlval['deliv_tel02'] = $arrData['order_tel02'];
245        $sqlval['deliv_tel03'] = $arrData['order_tel03'];
246        $where = "order_temp_id = ?";
247        $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
248    }
249}
250
251//-----------------------------NONMEMBER´Ø¿ô·²¢§------------------------------------------------------------------
252//----¡¡¼èÆÀʸ»úÎó¤ÎÊÑ´¹
253function lfConvertParam($array, $arrRegistColumn) {
254    /*
255     *  ʸ»úÎó¤ÎÊÑ´¹
256     *  K :  ¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
257     *  C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
258     *  V :  ÂùÅÀÉÕ¤­¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹
259     *  n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)¡×¤ËÊÑ´¹
260     *  a :  Á´³Ñ±Ñ¿ô»ú¤òȾ³Ñ±Ñ¿ô»ú¤ËÊÑ´¹¤¹¤ë
261     */
262    // ¥«¥é¥à̾¤È¥³¥ó¥Ð¡¼¥È¾ðÊó
263    foreach ($arrRegistColumn as $data) {
264        $arrConvList[ $data["column"] ] = $data["convert"];
265    }
266    // ʸ»úÊÑ´¹
267    foreach ($arrConvList as $key => $val) {
268        // POST¤µ¤ì¤Æ¤­¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£
269        if(strlen(($array[$key])) > 0) {
270            $array[$key] = mb_convert_kana($array[$key] ,$val);
271        }
272    }
273    return $array;
274}
275
276//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
277function lfErrorCheck1($array) {
278
279    global $objConn;
280    $objErr = new SC_CheckError($array);
281   
282    $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
283    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
284    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/À«¡Ë", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
285    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/̾¡Ë", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
286    $objErr->doFunc(array('¥á¡¼¥ë¥¢¥É¥ì¥¹', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK", "MOBILE_EMAIL_CHECK"));
287
288    return $objErr->arrErr;
289}
290
291//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
292function lfErrorCheck2($array) {
293
294    global $objConn, $objDate;
295    $objErr = new SC_CheckError($array);
296   
297    $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
298    $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
299    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK"));
300
301    $objErr->doFunc(array("À­ÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));
302    $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", 4), array("EXIST_CHECK", "SPTAB_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
303    if (!isset($objErr->arrErr['year'])) {
304        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getStartYear()), array("MIN_CHECK"));
305        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getEndYear()), array("MAX_CHECK"));
306    }
307    $objErr->doFunc(array("À¸Ç¯·îÆü (·îÆü)", "month", "day"), array("SELECT_CHECK"));
308    if (!isset($objErr->arrErr['year']) && !isset($objErr->arrErr['month']) && !isset($objErr->arrErr['day'])) {
309        $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
310    }
311   
312    return $objErr->arrErr;
313}
314
315
316//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
317function lfErrorCheck3($array) {
318
319    global $objConn;
320    $objErr = new SC_CheckError($array);
321   
322    $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK"));
323    $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
324    $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
325    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" ));
326    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" ));
327    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" ));
328    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK"));
329   
330    return $objErr->arrErr;
331}
332
333// ͹ÊØÈֹ椫¤é½»½ê¤Î¼èÆÀ
334function lfGetAddress($zipcode) {
335    global $arrPref;
336
337    $conn = new SC_DBconn(ZIP_DSN);
338
339    // ͹ÊØÈֹ渡º÷ʸºîÀ®
340    $zipcode = mb_convert_kana($zipcode ,"n");
341    $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
342
343    $data_list = $conn->getAll($sqlse, array($zipcode));
344
345    // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£
346    $arrREV_PREF = array_flip($arrPref);
347
348    /*
349        Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È
350        °Ê²¼¤Î¤è¤¦¤Êʸ»úÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ç   Âкö¤¹¤ë¡£
351        ¡¦¡Ê£±¡¦£±£¹ÃúÌÜ¡Ë
352        ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç
353    */
354    $town =  $data_list[0]['town'];
355    $town = ereg_replace("¡Ê.*¡Ë$","",$town);
356    $town = ereg_replace("°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town);
357    $data_list[0]['town'] = $town;
358    $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];
359
360    return $data_list;
361}
362//NONMEMBER_´Ø¿ô·²---------------------------------------------------------------------------------------
363?>
364         
365?>
Note: See TracBrowser for help on using the repository browser.