Changeset 12863


Ignore:
Timestamp:
2007/05/15 21:53:57 (15 years ago)
Author:
nakanishi
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev/html/mobile/nonmember/deliv.php

    r12857 r12863  
    7676    } 
    7777         } 
    78           
    79          function lfRegistData($uniqid) { 
    80     global $objFormParam; 
    81     $arrRet = $objFormParam->getHashArray(); 
    82     $sqlval = $objFormParam->getDbArray(); 
    83      
    84     // ÅÐÏ¿¥Ç¡¼¥¿¤ÎºîÀ® 
    85     $sqlval['order_temp_id'] = $uniqid; 
    86     $sqlval['order_birth'] = sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']); 
    87     $sqlval['update_date'] = 'Now()'; 
    88     $sqlval['customer_id'] = '0'; 
    89     $sqlval['order_name01'] = $objPage->arrAddr[0]['name01']; 
    90            
    91     // ´û¸¥Ç¡¼¥¿¤Î¥Á¥§¥Ã¥¯ 
    92     $objQuery = new SC_Query(); 
    93     $where = "order_temp_id = ?"; 
    94     $cnt = $objQuery->count("dtb_order_temp", $where, array($uniqid)); 
    95     // ´û¸¥Ç¡¼¥¿¤¬¤Ê¤¤¾ì¹ç 
    96     if ($cnt == 0) { 
    97         $sqlval['create_date'] = 'Now()'; 
    98         $objQuery->insert("dtb_order_temp", $sqlval); 
    99     } else { 
    100         $objQuery->update("dtb_order_temp", $sqlval, $where, array($uniqid)); 
    101     } 
    102 } 
    10378 
    10479//ÆþÎϤµ¤ì¤¿¾ðÊó¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹dtb_order_temp¤Ë³ÊǼ¤¹¤ë 
     
    185160/* DB¤Ø¥Ç¡¼¥¿¤ÎÅÐÏ¿ */ 
    186161 
    187 /* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */ 
    188 function lfCheckError() { 
    189     global $objFormParam; 
    190     // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£ 
    191     $arrRet =  $objFormParam->getHashArray(); 
    192     $objErr = new SC_CheckError($arrRet); 
    193     $objErr->arrErr = $objFormParam->checkError(); 
    194          
    195     // Ê̤ΤªÆϤ±Àè¥Á¥§¥Ã¥¯ 
    196     if($_POST['deliv_check'] == "1") {  
    197         $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", "deliv_name01"), array("EXIST_CHECK")); 
    198         $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", "deliv_name02"), array("EXIST_CHECK")); 
    199         $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥»¥¤¡Ë", "deliv_kana01"), array("EXIST_CHECK")); 
    200         $objErr->doFunc(array("¥Õ¥ê¥¬¥Ê¡Ê¥á¥¤¡Ë", "deliv_kana02"), array("EXIST_CHECK")); 
    201         $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "deliv_zip01"), array("EXIST_CHECK")); 
    202         $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "deliv_zip02"), array("EXIST_CHECK")); 
    203         $objErr->doFunc(array("ÅÔÆ»Éܸ©", "deliv_pref"), array("EXIST_CHECK")); 
    204         $objErr->doFunc(array("½»½ê1", "deliv_addr01"), array("EXIST_CHECK")); 
    205         $objErr->doFunc(array("½»½ê2", "deliv_addr02"), array("EXIST_CHECK")); 
    206         $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", "deliv_tel01"), array("EXIST_CHECK")); 
    207         $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", "deliv_tel02"), array("EXIST_CHECK")); 
    208         $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", "deliv_tel03"), array("EXIST_CHECK")); 
    209     } 
    210      
    211     // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯ 
    212     $objErr->doFunc(array("TEL", "order_tel01", "order_tel02", "order_tel03", TEL_ITEM_LEN), array("TEL_CHECK")); 
    213     $objErr->doFunc(array("FAX", "order_fax01", "order_fax02", "order_fax03", TEL_ITEM_LEN), array("TEL_CHECK")); 
    214     $objErr->doFunc(array("͹ÊØÈÖ¹æ", "order_zip01", "order_zip02"), array("ALL_EXIST_CHECK")); 
    215     $objErr->doFunc(array("TEL", "deliv_tel01", "deliv_tel02", "deliv_tel03", TEL_ITEM_LEN), array("TEL_CHECK")); 
    216     $objErr->doFunc(array("FAX", "deliv_fax01", "deliv_fax02", "deliv_fax03", TEL_ITEM_LEN), array("TEL_CHECK")); 
    217     $objErr->doFunc(array("͹ÊØÈÖ¹æ", "deliv_zip01", "deliv_zip02"), array("ALL_EXIST_CHECK")); 
    218     $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE")); 
    219     $objErr->doFunc(array("¥á¡¼¥ë¥¢¥É¥ì¥¹", "¥á¡¼¥ë¥¢¥É¥ì¥¹¡Ê³Îǧ¡Ë", "order_email", "order_email_check"), array("EQUAL_CHECK")); 
    220      
    221     // ¤¹¤Ç¤Ë¥á¥ë¥Þ¥¬¥Æ¡¼¥Ö¥ë¤Ë²ñ°÷¤È¤·¤Æ¥á¡¼¥ë¥¢¥É¥ì¥¹¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¾ì¹ç 
    222     if(sfCheckCustomerMailMaga($arrRet['order_email'])) { 
    223         $objErr->arrErr['order_email'] = "¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ï¤¹¤Ç¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£<br>"; 
    224     } 
    225          
    226     return $objErr->arrErr; 
    227 } 
    228162 
    229163// ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤Î¤ªÆϤ±Àè¤ò¥³¥Ô¡¼¤¹¤ë 
     
    250184} 
    251185 
    252 //-----------------------------NONMEMBER´Ø¿ô·²¢§------------------------------------------------------------------ 
    253 //----¡¡¼èÆÀʸ»úÎó¤ÎÊÑ´¹ 
    254 function lfConvertParam($array, $arrRegistColumn) { 
    255     /* 
    256      *  ʸ»úÎó¤ÎÊÑ´¹ 
    257      *  K :  ¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹ 
    258      *  C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹ 
    259      *  V :  ÂùÅÀÉÕ¤­¤Îʸ»ú¤ò°ìʸ»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹  
    260      *  n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖȾ³Ñ(ŽÊŽÝŽ¶Ž¸)¡×¤ËÊÑ´¹ 
    261      *  a :  Á´³Ñ±Ñ¿ô»ú¤òȾ³Ñ±Ñ¿ô»ú¤ËÊÑ´¹¤¹¤ë 
    262      */ 
    263     // ¥«¥é¥à̾¤È¥³¥ó¥Ð¡¼¥È¾ðÊó 
    264     foreach ($arrRegistColumn as $data) { 
    265         $arrConvList[ $data["column"] ] = $data["convert"]; 
    266     } 
    267     // ʸ»úÊÑ´¹ 
    268     foreach ($arrConvList as $key => $val) { 
    269         // POST¤µ¤ì¤Æ¤­¤¿ÃͤΤßÊÑ´¹¤¹¤ë¡£ 
    270         if(strlen(($array[$key])) > 0) { 
    271             $array[$key] = mb_convert_kana($array[$key] ,$val); 
    272         } 
    273     } 
    274     return $array; 
    275 } 
    276  
    277 //---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯ 
    278 function lfErrorCheck1($array) { 
    279  
    280     global $objConn; 
    281     $objErr = new SC_CheckError($array); 
    282      
    283     $objErr->doFunc(array("¤ªÌ¾Á°¡ÊÀ«¡Ë", 'name01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); 
    284     $objErr->doFunc(array("¤ªÌ¾Á°¡Ê̾¡Ë", 'name02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" , "MAX_LENGTH_CHECK")); 
    285     $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/À«¡Ë", 'kana01', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK")); 
    286     $objErr->doFunc(array("¤ªÌ¾Á°¡Ê¥«¥Ê/̾¡Ë", 'kana02', STEXT_LEN), array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK", "KANA_CHECK")); 
    287     $objErr->doFunc(array('¥á¡¼¥ë¥¢¥É¥ì¥¹', "email", MTEXT_LEN) ,array("NO_SPTAB", "EXIST_CHECK", "EMAIL_CHECK", "SPTAB_CHECK" ,"EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK", "MOBILE_EMAIL_CHECK")); 
    288  
    289     return $objErr->arrErr; 
    290 } 
    291  
    292 //---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯ 
    293 function lfErrorCheck2($array) { 
    294  
    295     global $objConn, $objDate; 
    296     $objErr = new SC_CheckError($array); 
    297      
    298     $objErr->doFunc(array("͹ÊØÈÖ¹æ1", "zip01", ZIP01_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK")); 
    299     $objErr->doFunc(array("͹ÊØÈÖ¹æ2", "zip02", ZIP02_LEN ) ,array("EXIST_CHECK", "SPTAB_CHECK" ,"NUM_CHECK", "NUM_COUNT_CHECK"));  
    300     $objErr->doFunc(array("͹ÊØÈÖ¹æ", "zip01", "zip02"), array("ALL_EXIST_CHECK")); 
    301  
    302     $objErr->doFunc(array("À­ÊÌ", "sex") ,array("SELECT_CHECK", "NUM_CHECK"));  
    303     $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", 4), array("EXIST_CHECK", "SPTAB_CHECK", "NUM_CHECK", "NUM_COUNT_CHECK")); 
    304     if (!isset($objErr->arrErr['year'])) { 
    305         $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getStartYear()), array("MIN_CHECK")); 
    306         $objErr->doFunc(array("À¸Ç¯·îÆü (ǯ)", "year", $objDate->getEndYear()), array("MAX_CHECK")); 
    307     } 
    308     $objErr->doFunc(array("À¸Ç¯·îÆü (·îÆü)", "month", "day"), array("SELECT_CHECK")); 
    309     if (!isset($objErr->arrErr['year']) && !isset($objErr->arrErr['month']) && !isset($objErr->arrErr['day'])) { 
    310         $objErr->doFunc(array("À¸Ç¯·îÆü", "year", "month", "day"), array("CHECK_DATE")); 
    311     } 
    312      
    313     return $objErr->arrErr; 
    314 } 
    315  
    316  
    317 //---- ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯ 
    318 function lfErrorCheck3($array) { 
    319  
    320     global $objConn; 
    321     $objErr = new SC_CheckError($array); 
    322      
    323     $objErr->doFunc(array("ÅÔÆ»Éܸ©", 'pref'), array("SELECT_CHECK","NUM_CHECK")); 
    324     $objErr->doFunc(array("»Ô¶èĮ¼", "addr01", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); 
    325     $objErr->doFunc(array("ÈÖÃÏ", "addr02", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK" ,"MAX_LENGTH_CHECK")); 
    326     $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ1", 'tel01'), array("EXIST_CHECK","SPTAB_CHECK" )); 
    327     $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ2", 'tel02'), array("EXIST_CHECK","SPTAB_CHECK" )); 
    328     $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ3", 'tel03'), array("EXIST_CHECK","SPTAB_CHECK" )); 
    329     $objErr->doFunc(array("ÅÅÏÃÈÖ¹æ", "tel01", "tel02", "tel03",TEL_ITEM_LEN) ,array("TEL_CHECK")); 
    330      
    331     return $objErr->arrErr; 
    332 } 
    333  
    334 // ͹ÊØÈֹ椫¤é½»½ê¤Î¼èÆÀ 
    335 function lfGetAddress($zipcode) { 
    336     global $arrPref; 
    337  
    338     $conn = new SC_DBconn(ZIP_DSN); 
    339  
    340     // ͹ÊØÈֹ渡º÷ʸºîÀ® 
    341     $zipcode = mb_convert_kana($zipcode ,"n"); 
    342     $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?"; 
    343  
    344     $data_list = $conn->getAll($sqlse, array($zipcode)); 
    345  
    346     // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÈÃͤòȿž¤µ¤»¤ë¡£ 
    347     $arrREV_PREF = array_flip($arrPref); 
    348  
    349     /* 
    350         Áí̳¾Ê¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤¿¥Ç¡¼¥¿¤ò¤½¤Î¤Þ¤Þ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤È 
    351         °Ê²¼¤Î¤è¤¦¤Êʸ»úÎó¤¬Æþ¤Ã¤Æ¤¤¤ë¤Î¤Ç   Âкö¤¹¤ë¡£ 
    352         ¡¦¡Ê£±¡¦£±£¹ÃúÌÜ¡Ë 
    353         ¡¦°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç 
    354     */ 
    355     $town =  $data_list[0]['town']; 
    356     $town = ereg_replace("¡Ê.*¡Ë$","",$town); 
    357     $town = ereg_replace("°Ê²¼¤Ë·ÇºÜ¤¬¤Ê¤¤¾ì¹ç","",$town); 
    358     $data_list[0]['town'] = $town; 
    359     $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']]; 
    360  
    361     return $data_list; 
    362 } 
    363 //NONMEMBER_´Ø¿ô·²--------------------------------------------------------------------------------------- 
    364186?> 
    365187          
Note: See TracChangeset for help on using the changeset viewer.