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

Revision 12856, 17.9 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->arrAddr[0]['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            //objPage¤Î¾ðÊó¤òobjView¤Ë³ÊǼ
65$objView->assignobj($objPage);
66$objView->display(SITE_FRAME);
67        }
68       
69         if ($_POST["mode2"] == "customer_addr") {
70            //print_r($_POST);
71            if ($_POST['deli'] != "") {
72           
73           header("Location:" . gfAddSessionId("./payment.php"));
74            exit;
75    }else{
76        // ¥¨¥é¡¼¤òÊÖ¤¹
77        $arrErr['deli'] = '¢¨ ¤ªÆϤ±Àè¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£';
78    }
79         }
80         
81         function lfRegistData($uniqid) {
82    global $objFormParam;
83    $arrRet = $objFormParam->getHashArray();
84    $sqlval = $objFormParam->getDbArray();
85   
86    // ÅÐÏ¿¥Ç¡¼¥¿¤ÎºîÀ®
87    $sqlval['order_temp_id'] = $uniqid;
88    $sqlval['order_birth'] = sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']);
89    $sqlval['update_date'] = 'Now()';
90    $sqlval['customer_id'] = '0';
91    $sqlval['order_name01'] = $objPage->arrAddr[0]['name01'];
92         
93    // ´û¸¥Ç¡¼¥¿¤Î¥Á¥§¥Ã¥¯
94    $objQuery = new SC_Query();
95    $where = "order_temp_id = ?";
96    $cnt = $objQuery->count("dtb_order_temp", $where, array($uniqid));
97    // ´û¸¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç
98    if ($cnt == 0) {
99        $sqlval['create_date'] = 'Now()';
100        $objQuery->insert("dtb_order_temp", $sqlval);
101    } else {
102        $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
103    }
104}
105
106//ÆþÎϤµ¤ì¤¿¾ðÊó¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹dtb_order_temp¤Ë³ÊǼ¤¹¤ë
107function lfRegistDataTemp($uniqid,$array) {
108    global $objFormParam;
109    $arrRet = $objFormParam->getHashArray();
110    $sqlval = $objFormParam->getDbArray();
111       
112    // ÅÐÏ¿¥Ç¡¼¥¿¤ÎºîÀ®
113    $sqlval['order_temp_id'] = $uniqid;
114    $sqlval['order_birth'] = sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']);
115    $sqlval['update_date'] = 'Now()';
116    $sqlval['customer_id'] = '0';
117   
118    $sqlval['order_name01'] = $array['name01'];
119    $sqlval['order_name02'] = $array['name02'];
120    $sqlval['order_kana01'] = $array['kana01'];
121    $sqlval['order_kana02'] = $array['kana02'];
122    $sqlval['order_zip01'] = $array['zip01'];
123    $sqlval['order_zip02'] = $array['zip02'];
124    $sqlval['order_pref'] = $array['pref'];
125    $sqlval['order_addr01'] = $array['addr01'];
126    $sqlval['order_addr02'] = $array['addr02'];
127    $sqlval['order_tel01'] = $array['tel01'];
128    $sqlval['order_tel02'] = $array['tel02'];
129    $sqlval['order_tel03'] = $array['tel03'];
130    $sqlval['order_email'] = $array['email'];
131    $sqlval['order_sex'] = $array['sex'];
132         
133    // ´û¸¥Ç¡¼¥¿¤Î¥Á¥§¥Ã¥¯
134    $objQuery = new SC_Query();
135    $where = "order_temp_id = ?";
136    $cnt = $objQuery->count("dtb_order_temp", $where, array($uniqid));
137    // ´û¸¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç
138    if ($cnt == 0) {
139        $sqlval['create_date'] = 'Now()';
140        $objQuery->insert("dtb_order_temp", $sqlval);
141    } else {
142        $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
143    }
144}
145
146/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
147function lfInitParam() {
148    global $objFormParam;
149    $objFormParam->addParam("¤ªÌ¾Á°¡ÊÀ«¡Ë", "order_name01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
150    $objFormParam->addParam("¤ªÌ¾Á°¡Ê̾¡Ë", "order_name02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
151    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "order_kana01", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
152    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "order_kana02", STEXT_LEN, "KVCa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
153    $objFormParam->addParam("͹ÊØÈÖ¹æ1", "order_zip01", ZIP01_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
154    $objFormParam->addParam("͹ÊØÈÖ¹æ2", "order_zip02", ZIP02_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
155    $objFormParam->addParam("ÅÔÆ»Éܸ©", "order_pref", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
156    $objFormParam->addParam("½»½ê1", "order_addr01", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
157    $objFormParam->addParam("½»½ê2", "order_addr02", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
158    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ1", "order_tel01", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
159    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ2", "order_tel02", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
160    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ3", "order_tel03", TEL_ITEM_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"));
161    $objFormParam->addParam("FAXÈÖ¹æ1", "order_fax01", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
162    $objFormParam->addParam("FAXÈÖ¹æ2", "order_fax02", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
163    $objFormParam->addParam("FAXÈÖ¹æ3", "order_fax03", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
164    $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹", "order_email", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK"));
165    $objFormParam->addParam("¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email_check", STEXT_LEN, "KVa", array("EXIST_CHECK", "SPTAB_CHECK", "NO_SPTAB", "MAX_LENGTH_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK"), "", false);
166    $objFormParam->addParam("ǯ", "year", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
167    $objFormParam->addParam("·î", "month", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
168    $objFormParam->addParam("Æü", "day", INT_LEN, "n", array("MAX_LENGTH_CHECK"), "", false);
169    $objFormParam->addParam("À­ÊÌ", "order_sex", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
170    $objFormParam->addParam("¿¦¶È", "order_job", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
171    $objFormParam->addParam("Ê̤ΤªÆϤ±Àè", "deliv_check", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
172    $objFormParam->addParam("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
173    $objFormParam->addParam("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
174    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01", STEXT_LEN, "KVCa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
175    $objFormParam->addParam("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02", STEXT_LEN, "KVCa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
176    $objFormParam->addParam("͹ÊØÈÖ¹æ1", "deliv_zip01", ZIP01_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK"));
177    $objFormParam->addParam("͹ÊØÈÖ¹æ2", "deliv_zip02", ZIP02_LEN, "n", array("NUM_CHECK", "NUM_COUNT_CHECK"));
178    $objFormParam->addParam("ÅÔÆ»Éܸ©", "deliv_pref", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
179    $objFormParam->addParam("½»½ê1", "deliv_addr01", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
180    $objFormParam->addParam("½»½ê2", "deliv_addr02", STEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
181    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ1", "deliv_tel01", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
182    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ2", "deliv_tel02", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
183    $objFormParam->addParam("ÅÅÏÃÈÖ¹æ3", "deliv_tel03", TEL_ITEM_LEN, "n", array("MAX_LENGTH_CHECK" ,"NUM_CHECK"));
184    $objFormParam->addParam("¥á¡¼¥ë¥Þ¥¬¥¸¥ó", "mail_flag", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"), 1);
185}
186
187/* DB¤Ø¥Ç¡¼¥¿¤ÎÅÐÏ¿ */
188
189/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
190function lfCheckError() {
191    global $objFormParam;
192    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
193    $arrRet =  $objFormParam->getHashArray();
194    $objErr = new SC_CheckError($arrRet);
195    $objErr->arrErr = $objFormParam->checkError();
196       
197    // Ê̤ΤªÆϤ±Àè¥Á¥§¥Ã¥¯
198    if($_POST['deliv_check'] == "1") {
199        $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01"), array("EXIST_CHECK"));
200        $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02"), array("EXIST_CHECK"));
201        $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01"), array("EXIST_CHECK"));
202        $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02"), array("EXIST_CHECK"));
203        $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "deliv_zip01"), array("EXIST_CHECK"));
204        $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "deliv_zip02"), array("EXIST_CHECK"));
205        $objErr->doFunc(array("ÅÔÆ»Éܸ©", "deliv_pref"), array("EXIST_CHECK"));
206        $objErr->doFunc(array("½»½ê1", "deliv_addr01"), array("EXIST_CHECK"));
207        $objErr->doFunc(array("½»½ê2", "deliv_addr02"), array("EXIST_CHECK"));
208        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", "deliv_tel01"), array("EXIST_CHECK"));
209        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", "deliv_tel02"), array("EXIST_CHECK"));
210        $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", "deliv_tel03"), array("EXIST_CHECK"));
211    }
212   
213    // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯
214    $objErr->doFunc(array("TEL", "order_tel01", "order_tel02", "order_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
215    $objErr->doFunc(array("FAX", "order_fax01", "order_fax02", "order_fax03", TEL_ITEM_LEN), array("TEL_CHECK"));
216    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "order_zip01", "order_zip02"), array("ALL_EXIST_CHECK"));
217    $objErr->doFunc(array("TEL", "deliv_tel01", "deliv_tel02", "deliv_tel03", TEL_ITEM_LEN), array("TEL_CHECK"));
218    $objErr->doFunc(array("FAX", "deliv_fax01", "deliv_fax02", "deliv_fax03", TEL_ITEM_LEN), array("TEL_CHECK"));
219    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "deliv_zip01", "deliv_zip02"), array("ALL_EXIST_CHECK"));
220    $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
221    $objErr->doFunc(array("¥á¡¼¥ë¥¢¥É¥ì¥¹", "¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email", "order_email_check"), array("EQUAL_CHECK"));
222   
223    // ¤¹¤Ç¤Ë¥á¥ë¥Þ¥¬¥Æ¡¼¥Ö¥ë¤Ë²ñ°÷¤È¤·¤Æ¥á¡¼¥ë¥¢¥É¥ì¥¹¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¾ì¹ç
224    if(sfCheckCustomerMailMaga($arrRet['order_email'])) {
225        $objErr->arrErr['order_email'] = "¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ï¤¹¤Ç¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£<br>";
226    }
227       
228    return $objErr->arrErr;
229}
230
231// ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤Î¤ªÆϤ±Àè¤ò¥³¥Ô¡¼¤¹¤ë
232function lfCopyDeliv($uniqid, $arrData) {
233    $objQuery = new SC_Query();
234   
235    // Ê̤ΤªÆϤ±Àè¤ò»ØÄꤷ¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ÇÛÁ÷Àè¤ËÅÐÏ¿½»½ê¤ò¥³¥Ô¡¼¤¹¤ë¡£
236    if($arrData["deliv_check"] != "1") {
237        $sqlval['deliv_name01'] = $arrData['order_name01'];
238        $sqlval['deliv_name02'] = $arrData['order_name02'];
239        $sqlval['deliv_kana01'] = $arrData['order_kana01'];
240        $sqlval['deliv_kana02'] = $arrData['order_kana02'];
241        $sqlval['deliv_pref'] = $arrData['order_pref'];
242        $sqlval['deliv_zip01'] = $arrData['order_zip01'];
243        $sqlval['deliv_zip02'] = $arrData['order_zip02'];
244        $sqlval['deliv_addr01'] = $arrData['order_addr01'];
245        $sqlval['deliv_addr02'] = $arrData['order_addr02'];
246        $sqlval['deliv_tel01'] = $arrData['order_tel01'];
247        $sqlval['deliv_tel02'] = $arrData['order_tel02'];
248        $sqlval['deliv_tel03'] = $arrData['order_tel03'];
249        $where = "order_temp_id = ?";
250        $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid));
251    }
252}
253
254//-----------------------------NONMEMBER´Ø¿ô·²¢§------------------------------------------------------------------
255//----¡¡¼èÆÀʸ»úÎó¤ÎÊÑ´¹
256function lfConvertParam($array, $arrRegistColumn) {
257    /*
258     *  ʸ»úÎó¤ÎÊÑ´¹
259     *  K :  ¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
260     *  C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
261     *  V :  ÂùÅÀÉÕ¤­¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹
262     *  n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)¡×¤ËÊÑ´¹
263     *  a :  Á´³Ñ±Ñ¿ô»ú¤òȾ³Ñ±Ñ¿ô»ú¤ËÊÑ´¹¤¹¤ë
264     */
265    // ¥«¥é¥à̾¤È¥³¥ó¥Ð¡¼¥È¾ðÊó
266    foreach ($arrRegistColumn as $data) {
267        $arrConvList[ $data["column"] ] = $data["convert"];
268    }
269    // ʸ»úÊÑ´¹
270    foreach ($arrConvList as $key => $val) {
271        // POST¤µ¤ì¤Æ¤­¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£
272        if(strlen(($array[$key])) > 0) {
273            $array[$key] = mb_convert_kana($array[$key] ,$val);
274        }
275    }
276    return $array;
277}
278
279//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
280function lfErrorCheck1($array) {
281
282    global $objConn;
283    $objErr = new SC_CheckError($array);
284   
285    $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
286    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK"));
287    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/À«¡Ë", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
288    $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/̾¡Ë", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK"));
289    $objErr->doFunc(array('¥á¡¼¥ë¥¢¥É¥ì¥¹', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK", "MOBILE_EMAIL_CHECK"));
290
291    return $objErr->arrErr;
292}
293
294//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
295function lfErrorCheck2($array) {
296
297    global $objConn, $objDate;
298    $objErr = new SC_CheckError($array);
299   
300    $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
301    $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));
302    $objErr->doFunc(array("͹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK"));
303
304    $objErr->doFunc(array("À­ÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));
305    $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", 4), array("EXIST_CHECK", "SPTAB_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK"));
306    if (!isset($objErr->arrErr['year'])) {
307        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getStartYear()), array("MIN_CHECK"));
308        $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getEndYear()), array("MAX_CHECK"));
309    }
310    $objErr->doFunc(array("À¸Ç¯·îÆü (·îÆü)", "month", "day"), array("SELECT_CHECK"));
311    if (!isset($objErr->arrErr['year']) && !isset($objErr->arrErr['month']) && !isset($objErr->arrErr['day'])) {
312        $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE"));
313    }
314   
315    return $objErr->arrErr;
316}
317
318
319//---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
320function lfErrorCheck3($array) {
321
322    global $objConn;
323    $objErr = new SC_CheckError($array);
324   
325    $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK"));
326    $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
327    $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
328    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" ));
329    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" ));
330    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" ));
331    $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK"));
332   
333    return $objErr->arrErr;
334}
335
336// ͹ÊØÈֹ椫¤é½»½ê¤Î¼èÆÀ
337function lfGetAddress($zipcode) {
338    global $arrPref;
339
340    $conn = new SC_DBconn(ZIP_DSN);
341
342    // ͹ÊØÈֹ渡º÷ʸºîÀ®
343    $zipcode = mb_convert_kana($zipcode ,"n");
344    $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";
345
346    $data_list = $conn->getAll($sqlse, array($zipcode));
347
348    // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£
349    $arrREV_PREF = array_flip($arrPref);
350
351    /*
352        Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È
353        °Ê²¼¤Î¤è¤¦¤Êʸ»úÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ç   Âкö¤¹¤ë¡£
354        ¡¦¡Ê£±¡¦£±£¹ÃúÌÜ¡Ë
355        ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç
356    */
357    $town =  $data_list[0]['town'];
358    $town = ereg_replace("¡Ê.*¡Ë$","",$town);
359    $town = ereg_replace("°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town);
360    $data_list[0]['town'] = $town;
361    $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']];
362
363    return $data_list;
364}
365//NONMEMBER_´Ø¿ô·²---------------------------------------------------------------------------------------
366?>
367         
368?>
Note: See TracBrowser for help on using the repository browser.