Ignore:
Timestamp:
2007/07/12 15:06:41 (17 years ago)
Author:
adati
Message:

#エビスタグ付加モジュール(thanksページで顧客情報をタグ埋め込み・CSVダウンロード機能)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev/data/include/module.inc

    r8 r15040  
    11<?php 
    22 
    3 // ¥¿¥°½ÐÎÏÍÑ¥¯¥é¥¹ 
     3// ¥¨¥Ó¥¹¥¿¥°½ÐÎÏÍÑ¥¯¥é¥¹ 
    44class LC_EbisPage { 
    5     function LC_EbisPage() { 
    6         $this->tpl_mainpage = MODULE_PATH . "ebis_tag_text.tpl"; 
    7     } 
     5    function LC_EbisPage() { 
     6        $this->tpl_mainpage = MODULE_PATH . "ebis_tag_text.tpl"; 
     7    } 
    88} 
    99 
     
    1111function sfPrintEbisTag($pid = "") { 
    1212    $objQuery = new SC_Query(); 
    13     $arrRet = $objQuery->select("sub_data", "dtb_module", "module_id = ?", array(EBIS_TAG_MID)); 
     13    $arrRet   = $objQuery->select("sub_data", "dtb_module", "module_id = ?", array(EBIS_TAG_MID)); 
    1414    $arrSubData = unserialize($arrRet[0]['sub_data']); 
    15     $arrEbis = array(); 
    16      
    17     if($arrSubData['cid'] != "") { 
    18         $arrEbis['cid'] = $arrSubData['cid']; 
    19     } else { 
    20         return; 
    21     } 
    22      
    23     // ¡Ö/¡×¤¬½ÅÊ£¤·¤Æ¤¤¤ë¤â¤Î¤Ø¤ÎÂбþ 
    24     $php_self = ereg_replace("[/]+", "/", $_SERVER['PHP_SELF']); 
    25     // PHP¥Õ¥¡¥¤¥ë¤Î¸å¤í¤Ë¡Ö/¡×¤¬¤Ä¤¤¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¤â¤Î¤Ø¤ÎÂбþ 
    26     $php_self = ereg_replace(".php[/]+$", ".php", $php_self); 
    27      
     15     
     16    if ( empty($arrSubData['cid']) ) return; 
     17     
     18    $arrEbis = array( 
     19        'cid'       => $arrSubData['cid'], 
     20        'login_url' => $arrSubData['login_url'], 
     21    ); 
     22     
    2823    if(!is_array($pid) && $pid != "") { 
    2924        if(!ereg(".tpl$", $pid)) { 
     
    3227        } else { 
    3328            // ¥Æ¥ó¥×¥ì¡¼¥È¤Î¥Ñ¥¹¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤ë¾ì¹ç 
    34             $temp_id = ereg_replace(HTML_PATH,"",$pid);          
    35             $temp_id = ereg_replace("^[/]+","",$temp_id); 
    36             $temp_id = ereg_replace(".tpl$","",$temp_id); 
    37             $temp_id = ereg_replace("[\./]","_",$temp_id); 
     29            $temp_id = str_replace(USER_TEMPLATE_PATH, '', $pid); 
     30            $temp_id = str_replace(HTML_PATH,   '',  $temp_id); 
     31            $temp_id = preg_replace('|^/+|',    '',  $temp_id); 
     32            $temp_id = preg_replace('|\.tpl$|', '',  $temp_id); 
     33            $temp_id = preg_replace('|[\./]|',  '_', $temp_id); 
    3834            $arrEbis['pid'] = $temp_id; 
    3935        } 
     
    5147        $arrEbis['pid'] = ereg_replace("detail.php\?product_id=", "detail-p", $filename); 
    5248    } 
    53      
     49 
     50    // ¹ØÆþ´°Î»¥Ú¡¼¥¸(thanks¥Ú¡¼¥¸)¤ÏÆüìID¤òȯ¹Ô 
     51    if(preg_match("|/shopping/complete.php$|", $_SERVER["REQUEST_URI"])) { 
     52        global $arrEBiSTagAttrKeys; 
     53        global $arrEBiSTagAttrTagName; 
     54        global $arrJob; 
     55        global $arrSex; 
     56         
     57        $arrEbis['pid']  = 'thanks'; // ¥Ú¡¼¥¸ID¤ò¥»¥Ã¥È 
     58        $customerInfo    = $_SESSION['customer']; 
     59         
     60        /** 
     61         * $arrSubData == Array ( 
     62         *      [user] => username 
     63         *      [pass] => password 
     64         *      [login_url] => http://login_url/ 
     65         *      [cid] => ebis_parameter 
     66         *      [m1id] => 1 
     67         *      [a1id] => 2 
     68         *      [o1id] => 3 
     69         *      [o2id] => 4 
     70         *      [o3id] => 0 
     71         *      [o4id] => 0 
     72         *      [o5id] => 0 
     73         * ) 
     74         **/ 
     75         
     76        foreach ($arrSubData as $key => $value) { 
     77            if (!in_array($key , $arrEBiSTagAttrTagName)) continue; 
     78            if (empty($arrEBiSTagAttrKeys[$value])) continue; 
     79             
     80            // °À­¾ðÊó¤ò¥»¥Ã¥È 
     81            switch ($value) { 
     82            case EBiS_TAG_ATTR_CUSTOMER_ID: 
     83            case EBiS_TAG_ATTR_PAYMENT: 
     84                $tmp_key       = $arrEBiSTagAttrKeys[$value]; 
     85                $arrEbis[$key] = $customerInfo[$tmp_key]; 
     86                break; 
     87            case EBiS_TAG_ATTR_JOB: 
     88                $tmp_key       = $arrEBiSTagAttrKeys[$value]; 
     89                $arrEbis[$key] = $arrJob[$customerInfo[$tmp_key]]; 
     90                break; 
     91            case EBiS_TAG_ATTR_SEX: 
     92                $tmp_key       = $arrEBiSTagAttrKeys[$value]; 
     93                $arrEbis[$key] = $arrSex[$customerInfo[$tmp_key]]; 
     94                break; 
     95            default: 
     96            } 
     97        } 
     98    } 
     99     
    54100    // ID³ä¤êÅö¤Æ¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ú¡¼¥¸¤Ï¡¢¼«Æ°Åª¤ËÀ¸À®¤¹¤ë¡£ 
    55101    if($arrEbis['pid'] == "") {              
     
    59105        $arrEbis['pid'] = $temp_id; 
    60106    } 
    61              
     107 
    62108    // ¥Ú¡¼¥¸ID¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ß¥¿¥°¤ò½ÐÎϤ¹¤ë¡£ 
    63109    if($arrEbis['pid'] != "") { 
Note: See TracChangeset for help on using the changeset viewer.