Changeset 15315


Ignore:
Timestamp:
2007/08/20 18:17:01 (17 years ago)
Author:
adachi
Message:

ログインできない問題の修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rel/data/lib/slib.php

    r15046 r15315  
    2929        } 
    3030    } 
    31      
     31 
    3232    $objQuery = new SC_Query($dsn, true, true); 
    3333    list($db_type) = split(":", $dsn); 
     
    3535        $val = $objQuery->getOne("select version()"); 
    3636        $version = "MySQL " . $val; 
    37     }    
     37    } 
    3838    if($db_type == 'pgsql') { 
    3939        $val = $objQuery->getOne("select version()"); 
     
    5353        } 
    5454    } 
    55      
     55 
    5656    $objQuery = new SC_Query($dsn, true, true); 
    5757    // Àµ¾ï¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç 
     
    6565                        pg_class 
    6666                    WHERE 
    67                         (relkind = 'r' OR relkind = 'v') AND  
    68                         relname = ?  
     67                        (relkind = 'r' OR relkind = 'v') AND 
     68                        relname = ? 
    6969                    GROUP BY 
    7070                        relname"; 
     
    9696    // ¥Æ¡¼¥Ö¥ë¤¬Ìµ¤±¤ì¤Ð¥¨¥é¡¼ 
    9797    if(!sfTabaleExists($table_name, $dsn)) return false; 
    98      
     98 
    9999    $objQuery = new SC_Query($dsn, true, true); 
    100100    // Àµ¾ï¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç 
    101101    if(!$objQuery->isError()) { 
    102102        list($db_type) = split(":", $dsn); 
    103          
     103 
    104104        // ¥«¥é¥à¥ê¥¹¥È¤ò¼èÆÀ 
    105105        $arrRet = sfGetColumnList($table_name, $objQuery, $db_type); 
     
    110110        } 
    111111    } 
    112      
     112 
    113113    // ¥«¥é¥à¤òÄɲ乤ë 
    114114    if($add){ 
     
    116116        return true; 
    117117    } 
    118      
     118 
    119119    return false; 
    120120} 
     
    132132    // ¥Æ¡¼¥Ö¥ë¤¬Ìµ¤±¤ì¤Ð¥¨¥é¡¼ 
    133133    if(!sfTabaleExists($table_name, $dsn)) return false; 
    134      
     134 
    135135    $objQuery = new SC_Query($dsn, true, true); 
    136136    // Àµ¾ï¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç 
    137137    if(!$objQuery->isError()) { 
    138         list($db_type) = split(":", $dsn);       
     138        list($db_type) = split(":", $dsn); 
    139139        switch($db_type) { 
    140140        case 'pgsql': 
     
    144144        case 'mysql': 
    145145            // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¸ºß³Îǧ 
    146             $arrRet = $objQuery->getAll("SHOW INDEX FROM ? WHERE Key_name = ?", array($table_name, $index_name));            
     146            $arrRet = $objQuery->getAll("SHOW INDEX FROM ? WHERE Key_name = ?", array($table_name, $index_name)); 
    147147            break; 
    148148        default: 
     
    154154        } 
    155155    } 
    156      
     156 
    157157    // ¥¤¥ó¥Ç¥Ã¥¯¥¹¤òºîÀ®¤¹¤ë 
    158158    if($add){ 
     
    162162            break; 
    163163        case 'mysql': 
    164             $objQuery->query("CREATE INDEX ? ON ? (?(?))", array($index_name, $table_name, $col_name, $length));             
     164            $objQuery->query("CREATE INDEX ? ON ? (?(?))", array($index_name, $table_name, $col_name, $length)); 
    165165            break; 
    166166        default: 
     
    168168        } 
    169169        return true; 
    170     }    
     170    } 
    171171    return false; 
    172172} 
     
    193193        $objQuery->exec($sql); 
    194194    } 
    195      
     195 
    196196    return $ret; 
    197197} 
     
    201201 * ¥Ç¡¼¥¿¤¬Â¸ºß¤¹¤ë¾ì¹ç¡¢É¬¤º1°Ê¾å¤Î¿ôÃͤ¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¡£ 
    202202 * 0¤òÊÖ¤·¤¿¾ì¹ç¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¤ÇÂбþ¤¹¤ë¤³¤È¡£ 
    203  *  
     203 * 
    204204 * @param $control_id ´ÉÍýID 
    205205 * @param $dsn DataSource 
     
    232232        $control_flg = $arrSiteControl[0]["control_flg"]; 
    233233    } 
    234      
     234 
    235235    return $control_flg; 
    236236} 
     
    240240    if($objQuery == "") $objQuery = new SC_Query(); 
    241241    $arrRet = array(); 
    242      
     242 
    243243    // postgresql¤Èmysql¤È¤Ç½èÍý¤òʬ¤±¤ë 
    244244    if ($db_type == "pgsql") { 
     
    268268            sfErrorHeader(">> /install/index.php¤Ï¡¢¥¤¥ó¥¹¥È¡¼¥ë´°Î»¸å¤Ë¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡£"); 
    269269        } 
    270          
     270 
    271271        // µì¥Ð¡¼¥¸¥ç¥ó¤Îinstall.php¤Î¥Á¥§¥Ã¥¯ 
    272272        $path = HTML_PATH . "install.php"; 
    273273        if(file_exists($path)) { 
    274274            sfErrorHeader(">> /install.php¤Ï¥»¥­¥å¥ê¥Æ¥£¡¼¥Û¡¼¥ë¤È¤Ê¤ê¤Þ¤¹¡£ºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡£"); 
    275         }        
     275        } 
    276276    } 
    277277} 
     
    312312    $GLOBAL_ERR.= " </tr>\n"; 
    313313    $GLOBAL_ERR.= "</table>\n"; 
    314      
     314 
    315315    if($print) { 
    316316        print($GLOBAL_ERR); 
     
    320320/* ¥¨¥é¡¼¥Ú¡¼¥¸¤Îɽ¼¨ */ 
    321321function sfDispError($type) { 
    322      
     322 
    323323    class LC_ErrorPage { 
    324324        function LC_ErrorPage() { 
     
    330330    $objPage = new LC_ErrorPage(); 
    331331    $objView = new SC_AdminView(); 
    332      
     332 
    333333    switch ($type) { 
    334334        case LOGIN_ERROR: 
     
    348348            break; 
    349349    } 
    350      
     350 
    351351    $objView->assignobj($objPage); 
    352352    $objView->display(LOGIN_FRAME); 
    353      
     353 
    354354    exit; 
    355355} 
     
    358358function sfDispSiteError($type, $objSiteSess = "", $return_top = false, $err_msg = "", $is_mobile = false) { 
    359359    global $objCampaignSess; 
    360      
     360 
    361361    if ($objSiteSess != "") { 
    362362        $objSiteSess->setNowPage('error'); 
    363363    } 
    364      
     364 
    365365    class LC_ErrorPage { 
    366366        function LC_ErrorPage() { 
     
    370370        } 
    371371    } 
    372      
     372 
    373373    $objPage = new LC_ErrorPage(); 
    374      
     374 
    375375    if($is_mobile === true) { 
    376         $objView = new SC_MobileView();      
     376        $objView = new SC_MobileView(); 
    377377    } else { 
    378378        $objView = new SC_SiteView(); 
    379379    } 
    380      
     380 
    381381    switch ($type) { 
    382382        case PRODUCT_NOT_FOUND: 
     
    450450            break; 
    451451    } 
    452      
     452 
    453453    $objPage->return_top = $return_top; 
    454      
     454 
    455455    $objView->assignobj($objPage); 
    456      
     456 
    457457    if(is_object($objCampaignSess)) { 
    458458        // ¥Õ¥ì¡¼¥à¤òÁªÂò(¥­¥ã¥ó¥Ú¡¼¥ó¥Ú¡¼¥¸¤«¤éÁ«°Ü¤Ê¤éÊѹ¹) 
     
    460460    } else { 
    461461        $objView->display(SITE_FRAME); 
    462     }    
     462    } 
    463463    exit; 
    464464} 
     
    481481        // sfErrorHeader('>> referrer¤¬Ìµ¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£'); 
    482482    } else { 
    483         $domain  = sfIsHTTPS() ? SSL_URL : SITE_URL; 
    484         $pattern = sprintf('|^%s.*|', $domain); 
     483        $siteurl = preg_quote(SITE_URL, "/"); 
     484        $sslurl  = preg_quote(SSL_URL, "/"); 
     485 
     486        $pattern = "/^($siteurl|$sslurl)/"; 
    485487        $referer = $_SERVER['HTTP_REFERER']; 
    486488 
    487489        // ´ÉÍý²èÌ̤«¤é°Ê³°¤ÎÁ«°Ü¤Î¾ì¹ç¤Ï¥¨¥é¡¼²èÌ̤òɽ¼¨ 
    488         if (!preg_match($pattern, $referer)) { 
     490        if ( !preg_match($pattern, $referer) ) { 
    489491            if ($disp_error) sfDispError(INVALID_MOVE_ERRORR); 
    490492            return false; 
     
    496498/** 
    497499 * HTTPS¤«¤É¤¦¤«¤òȽÄê 
    498  *  
     500 * 
    499501 * @return bool 
    500502 */ 
     
    530532    if($ret != true) { 
    531533        // ¥¨¥é¡¼¥Ú¡¼¥¸¤Îɽ¼¨ 
    532         sfDispSiteError(PAGE_ERROR, $objSiteSess, false, "", $is_mobile);            
     534        sfDispSiteError(PAGE_ERROR, $objSiteSess, false, "", $is_mobile); 
    533535    } 
    534536} 
     
    545547        sfDispSiteError(CANCEL_PURCHASE, $objSiteSess); 
    546548    } 
    547      
     549 
    548550    // ¥«¡¼¥ÈÆ⤬¶õ¤Ç¤Ê¤¤¤« || ¹ØÆþ¥Ü¥¿¥ó¤ò²¡¤·¤Æ¤«¤éÊѲ½¤¬¤Ê¤¤¤« 
    549551    $quantity = $objCartSess->getTotalQuantity(); 
     
    559561/* DBÍÑÆüÉÕʸ»úÎó¼èÆÀ */ 
    560562function sfGetTimestamp($year, $month, $day, $last = false) { 
    561     if($year != "" && $month != "" && $day != "") {  
     563    if($year != "" && $month != "" && $day != "") { 
    562564        if($last) { 
    563565            $time = "23:59:59"; 
     
    581583 
    582584function sfCSVDownload($data, $prefix = ""){ 
    583      
     585 
    584586    if($prefix == "") { 
    585587        $dir_name = sfUpDirName(); 
     
    588590        $file_name = $prefix . date("ymdHis") .".csv"; 
    589591    } 
    590      
     592 
    591593    /* HTTP¥Ø¥Ã¥À¤Î½ÐÎÏ */ 
    592594    Header("Content-disposition: attachment; filename=${file_name}"); 
     
    594596    Header("Cache-Control: "); 
    595597    Header("Pragma: "); 
    596      
     598 
    597599    /* i18n¢· ¤À¤ÈÀµ¾ï¤ËÆ°ºî¤·¤Ê¤¤¤¿¤á¡¢mb¢· ¤ËÊѹ¹ 
    598600    if (i18n_discover_encoding($data) == CHAR_CODE){ 
     
    603605        $data = mb_convert_encoding($data,'SJIS',CHAR_CODE); 
    604606    } 
    605      
     607 
    606608    /* ¥Ç¡¼¥¿¤ò½ÐÎÏ */ 
    607609    echo $data; 
     
    623625        $url = ereg_replace(URL_DIR . "$", "", SITE_URL); 
    624626    } 
    625      
     627 
    626628    if($get != "") { 
    627629        header("Location: ". $url . $_SERVER['PHP_SELF'] . "?" . $get); 
     
    671673    // ÂоݹàÌܤΥé¥ó¥¯¤ò¼èÆÀ 
    672674    $rank = $objQuery->get($table, "rank", $where, array($id)); 
    673          
     675 
    674676    // ¥é¥ó¥¯¤¬1(ºÇ¾®ÃÍ)¤è¤ê¤âÂ礭¤¤¾ì¹ç¤Ë¼Â¹Ô¤¹¤ë¡£ 
    675677    if($rank > 1) { 
     
    693695    $objQuery = new SC_Query(); 
    694696    $objQuery->begin(); 
    695          
     697 
    696698    // ¼«¿È¤Î¥é¥ó¥¯¤ò¼èÆÀ¤¹¤ë 
    697     $rank = $objQuery->get($tableName, "rank", "$keyIdColumn = ?", array($keyId));   
     699    $rank = $objQuery->get($tableName, "rank", "$keyIdColumn = ?", array($keyId)); 
    698700    $max = $objQuery->max($tableName, "rank", $where); 
    699          
     701 
    700702    // ÃͤÎÄ´À°¡ÊµÕ½ç¡Ë 
    701703    if($pos > $max) { 
     
    706708        $position = $max - $pos + 1; 
    707709    } 
    708      
     710 
    709711    if( $position > $rank ) $term = "rank - 1"; //Æþ¤ìÂؤ¨Àè¤Î½ç°Ì¤¬Æþ¤ì´¹¤¨¸µ¤Î½ç°Ì¤è¤êÂ礭¤¤¾ì¹ç 
    710712    if( $position < $rank ) $term = "rank + 1"; //Æþ¤ìÂؤ¨Àè¤Î½ç°Ì¤¬Æþ¤ì´¹¤¨¸µ¤Î½ç°Ì¤è¤ê¾®¤µ¤¤¾ì¹ç 
     
    715717        $sql.= " AND $where"; 
    716718    } 
    717      
     719 
    718720    if( $position > $rank ) $objQuery->exec( $sql, array( $rank + 1, $position )); 
    719721    if( $position < $rank ) $objQuery->exec( $sql, array( $position, $rank - 1 )); 
     
    724726        $sql.= " AND $where"; 
    725727    } 
    726      
     728 
    727729    $objQuery->exec( $sql, array( $position, $keyId ) ); 
    728730    $objQuery->commit(); 
     
    734736    $objQuery = new SC_Query(); 
    735737    $objQuery->begin(); 
    736     // ºï½ü¥ì¥³¡¼¥É¤Î¥é¥ó¥¯¤ò¼èÆÀ¤¹¤ë¡£      
     738    // ºï½ü¥ì¥³¡¼¥É¤Î¥é¥ó¥¯¤ò¼èÆÀ¤¹¤ë¡£ 
    737739    $where = "$colname = ?"; 
    738740    if($andwhere != "") { 
     
    750752        $objQuery->delete($table, "$colname = ?", array($id)); 
    751753    } 
    752      
     754 
    753755    // Äɲå쥳¡¼¥É¤Î¥é¥ó¥¯¤è¤ê¾å¤Î¥ì¥³¡¼¥É¤ò°ì¤Ä¤º¤é¤¹¡£ 
    754756    $where = "rank > ?"; 
     
    765767    $objQuery = new SC_Query(); 
    766768    $arrCol = split("[, ]", $col); 
    767          
     769 
    768770    $where = "del_flg = 0"; 
    769      
     771 
    770772    if($addwhere != "") { 
    771773        $where.= " AND $addwhere"; 
    772774    } 
    773          
     775 
    774776    foreach($arrCol as $val) { 
    775777        if($val != "") { 
     
    782784    } 
    783785    $ret = $objQuery->get($table, $col, $where, $arrval); 
    784      
     786 
    785787    if($ret != "") { 
    786788        return true; 
     
    806808function sfMergeCheckBoxes($array, $max) { 
    807809    $ret = ""; 
    808     if(is_array($array)) {   
     810    if(is_array($array)) { 
    809811        foreach($array as $val) { 
    810812            $arrTmp[$val] = "1"; 
    811813        } 
    812814    } 
    813     for($i = 1; $i <= $max; $i++) {  
     815    for($i = 1; $i <= $max; $i++) { 
    814816        if($arrTmp[$i] == "1") { 
    815817            $ret.= "1"; 
     
    830832                $ret.= "-$val"; 
    831833            } else { 
    832                 $ret = $val;             
     834                $ret = $val; 
    833835            } 
    834836        } 
     
    849851        } 
    850852    } 
    851     for($i = 1; $i <= $max; $i++) {  
     853    for($i = 1; $i <= $max; $i++) { 
    852854        if($arrTmp[$i] == "1") { 
    853855            $ret.= "1"; 
     
    856858        } 
    857859    } 
    858      
    859     if($ret != "") {     
     860 
     861    if($ret != "") { 
    860862        $ret.= "%"; 
    861863    } 
     
    905907// ¥­¡¼¤ÈÃͤò¥»¥Ã¥È¤·¤¿ÇÛÎó¤ò¼èÆÀ 
    906908function sfArrKeyValue($arrList, $keyname, $valname, $len_max = "", $keysize = "") { 
    907      
     909 
    908910    $max = count($arrList); 
    909      
     911 
    910912    if($len_max != "" && $max > $len_max) { 
    911913        $max = $len_max; 
    912914    } 
    913      
     915 
    914916    for($cnt = 0; $cnt < $max; $cnt++) { 
    915917        if($keysize != "") { 
     
    919921        } 
    920922        $val = $arrList[$cnt][$valname]; 
    921          
     923 
    922924        if(!isset($arrRet[$key])) { 
    923925            $arrRet[$key] = $val; 
    924926        } 
    925          
     927 
    926928    } 
    927929    return $arrRet; 
     
    930932// ¥­¡¼¤ÈÃͤò¥»¥Ã¥È¤·¤¿ÇÛÎó¤ò¼èÆÀ(Ãͤ¬Ê£¿ô¤Î¾ì¹ç) 
    931933function sfArrKeyValues($arrList, $keyname, $valname, $len_max = "", $keysize = "", $connect = "") { 
    932      
     934 
    933935    $max = count($arrList); 
    934      
     936 
    935937    if($len_max != "" && $max > $len_max) { 
    936938        $max = $len_max; 
    937939    } 
    938      
     940 
    939941    for($cnt = 0; $cnt < $max; $cnt++) { 
    940942        if($keysize != "") { 
     
    944946        } 
    945947        $val = $arrList[$cnt][$valname]; 
    946          
     948 
    947949        if($connect != "") { 
    948950            $arrRet[$key].= "$val".$connect; 
    949951        } else { 
    950             $arrRet[$key][] = $val;      
     952            $arrRet[$key][] = $val; 
    951953        } 
    952954    } 
     
    974976        return false; 
    975977    } 
    976      
     978 
    977979} 
    978980 
     
    10441046    if ( ! is_numeric($value)  ){ 
    10451047        return false; 
    1046     }  
    1047      
     1048    } 
     1049 
    10481050    if ( strlen($value) > 9 ) { 
    10491051        return false; 
    10501052    } 
    1051      
     1053 
    10521054    return true; 
    10531055} 
     
    10671069    $objQuery = new SC_Query(); 
    10681070    $where = "del_flg = 0"; 
    1069      
     1071 
    10701072    if($addwhere != "") { 
    10711073        $where.= " AND $addwhere"; 
    10721074    } 
    1073          
     1075 
    10741076    $objQuery->setoption("ORDER BY rank DESC"); 
    1075      
     1077 
    10761078    if($products_check) { 
    10771079        $col = "T1.category_id, category_name, level"; 
     
    10821084        $from = "dtb_category"; 
    10831085    } 
    1084      
     1086 
    10851087    $arrRet = $objQuery->select($col, $from, $where); 
    1086              
     1088 
    10871089    $max = count($arrRet); 
    10881090    for($cnt = 0; $cnt < $max; $cnt++) { 
     
    11111113    $arrRet = $objQuery->select($col, "dtb_category", $where); 
    11121114    $max = count($arrRet); 
    1113      
     1115 
    11141116    for($cnt = 0; $cnt < $max; $cnt++) { 
    11151117        if($parent_zero) { 
     
    11171119                $arrValue[$cnt] = $arrRet[$cnt]['category_id']; 
    11181120            } else { 
    1119                 $arrValue[$cnt] = "";  
     1121                $arrValue[$cnt] = ""; 
    11201122            } 
    11211123        } else { 
    11221124            $arrValue[$cnt] = $arrRet[$cnt]['category_id']; 
    11231125        } 
    1124          
     1126 
    11251127        $arrOutput[$cnt] = ""; 
    1126         /*           
     1128        /* 
    11271129        for($n = 1; $n < $arrRet[$cnt]['level']; $n++) { 
    11281130            $arrOutput[$cnt].= "¡¡"; 
     
    11951197    $len = count($arrId); 
    11961198    $where = ""; 
    1197      
     1199 
    11981200    for($cnt = 0; $cnt < $len; $cnt++) { 
    11991201        if($where == "") { 
     
    12031205        } 
    12041206    } 
    1205      
     1207 
    12061208    $objQuery->setorder("level"); 
    12071209    $arrRet = $objQuery->select($col, $table, $where, $arrId); 
    1208     return $arrRet;  
     1210    return $arrRet; 
    12091211} 
    12101212 
     
    12211223    } 
    12221224    // µì¥«¥Æ¥´¥ê¤Ç¤Î¥é¥ó¥¯ºï½ü½èÍý 
    1223     // °ÜÆ°¥ì¥³¡¼¥É¤Î¥é¥ó¥¯¤ò¼èÆÀ¤¹¤ë¡£      
     1225    // °ÜÆ°¥ì¥³¡¼¥É¤Î¥é¥ó¥¯¤ò¼èÆÀ¤¹¤ë¡£ 
    12241226    $where = "$id_name = ?"; 
    12251227    $rank = $objQuery->get($table, "rank", $where, array($id)); 
     
    12651267    $real_tax = $tax / 100; 
    12661268    $ret = $price * (1 + $real_tax); 
    1267      
     1269 
    12681270    switch($tax_rule) { 
    12691271    // »Í¼Î¸ÞÆþ 
     
    12951297        $ret = (round($value * $adjust)/$adjust); 
    12961298    } 
    1297      
     1299 
    12981300    $ret = round($ret); 
    12991301 
     
    13071309        $where = "now() >= cast(start_date as date) AND "; 
    13081310        $where .= "now() < cast(end_date as date) AND "; 
    1309          
     1311 
    13101312        $where .= "del_flg = 0 AND campaign_id IN (SELECT campaign_id FROM dtb_campaign_detail where product_id = ? )"; 
    13111313        //ÅÐÏ¿(¹¹¿·)ÆüÉÕ½ç 
     
    13571359    // ¥­¡¼¤ÈÃͤò¥»¥Ã¥È¤·¤¿ÇÛÎó¤ò¼èÆÀ 
    13581360    $arrRet = sfArrKeyValue($arrList, 'class_id', 'count'); 
    1359      
     1361 
    13601362    return $arrRet; 
    13611363} 
     
    13661368    $where = "product_id = ? AND classcategory_id1 <> 0 AND classcategory_id1 <> 0"; 
    13671369    $count = $objQuery->count("dtb_products_class", $where,  array($product_id)); 
    1368      
     1370 
    13691371    // ¤¹¤Ç¤Ëµ¬³ÊÅÐÏ¿¤¬¤Ê¤¤¾ì¹ç 
    13701372    if($count == 0) { 
     
    13821384        $sqlval['creator_id'] = $_SESSION['member_id']; 
    13831385        $sqlval['create_date'] = "now()"; 
    1384          
     1386 
    13851387        if($_SESSION['member_id'] == "") { 
    13861388            $sqlval['creator_id'] = '0'; 
    13871389        } 
    1388          
     1390 
    13891391        // INSERT¤Î¼Â¹Ô 
    13901392        $objQuery->insert("dtb_products_class", $sqlval); 
     
    14071409/* ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ */ 
    14081410function sfGetProductsClass($arrID) { 
    1409     list($product_id, $classcategory_id1, $classcategory_id2) = $arrID;  
    1410      
     1411    list($product_id, $classcategory_id1, $classcategory_id2) = $arrID; 
     1412 
    14111413    if($classcategory_id1 == "") { 
    14121414        $classcategory_id1 = '0'; 
     
    14151417        $classcategory_id2 = '0'; 
    14161418    } 
    1417          
     1419 
    14181420    // ¾¦Éʵ¬³Ê¼èÆÀ 
    14191421    $objQuery = new SC_Query(); 
     
    14301432    // ¾¦Éʤιç·×¸Ä¿ô 
    14311433    $total_quantity = $objCartSess->getTotalQuantity(true); 
    1432      
     1434 
    14331435    // ÀǶâ¤Î¼èÆÀ 
    14341436    $arrData['tax'] = $objPage->tpl_total_tax; 
    14351437    // ¾®·×¤Î¼èÆÀ 
    1436     $arrData['subtotal'] = $objPage->tpl_total_pretax;   
    1437      
     1438    $arrData['subtotal'] = $objPage->tpl_total_pretax; 
     1439 
    14381440    // ¹ç·×Á÷ÎÁ¤Î¼èÆÀ 
    14391441    $arrData['deliv_fee'] = 0; 
    1440          
     1442 
    14411443    // ¾¦Éʤ´¤È¤ÎÁ÷ÎÁ¤¬Í­¸ú¤Î¾ì¹ç 
    14421444    if (OPTION_PRODUCT_DELIV_FEE == 1) { 
    14431445        $arrData['deliv_fee']+= $objCartSess->getAllProductsDelivFee(); 
    14441446    } 
    1445      
     1447 
    14461448    // ÇÛÁ÷¶È¼Ô¤ÎÁ÷ÎÁ¤¬Í­¸ú¤Î¾ì¹ç 
    14471449    if (OPTION_DELIV_FEE == 1) { 
     
    14491451        $arrData['deliv_fee']+= sfGetDelivFee($arrData['deliv_pref'], $arrData['payment_id']); 
    14501452    } 
    1451      
     1453 
    14521454    // Á÷ÎÁ̵ÎÁ¤Î¹ØÆþ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç 
    14531455    if(DELIV_FREE_AMOUNT > 0) { 
    14541456        if($total_quantity >= DELIV_FREE_AMOUNT) { 
    14551457            $arrData['deliv_fee'] = 0; 
    1456         }    
    1457     } 
    1458          
     1458        } 
     1459    } 
     1460 
    14591461    // Á÷ÎÁ̵ÎÁ¾ò·ï¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç 
    14601462    if($arrInfo['free_rule'] > 0) { 
     
    14731475    // ²Ã»»¥Ý¥¤¥ó¥È¤Î·×»» 
    14741476    $arrData['add_point'] = sfGetAddPoint($objPage->tpl_total_point, $arrData['use_point'], $arrInfo); 
    1475      
     1477 
    14761478    if($objCustomer != "") { 
    14771479        // ÃÂÀ¸Æü·î¤Ç¤¢¤Ã¤¿¾ì¹ç 
     
    14811483        } 
    14821484    } 
    1483      
     1485 
    14841486    if($arrData['add_point'] < 0) { 
    14851487        $arrData['add_point'] = 0; 
    14861488    } 
    1487      
     1489 
    14881490    return $arrData; 
    14891491} 
     
    14951497    // µ¬³ÊʬÎà̾°ìÍ÷ 
    14961498    $arrClassCatName = sfGetIDValueList("dtb_classcategory", "classcategory_id", "name"); 
    1497      
     1499 
    14981500    $objPage->tpl_total_pretax = 0;     // ÈñÍѹç·×(Àǹþ¤ß) 
    14991501    $objPage->tpl_total_tax = 0;        // ¾ÃÈñÀǹç·× 
    15001502    $objPage->tpl_total_point = 0;      // ¥Ý¥¤¥ó¥È¹ç·× 
    1501      
     1503 
    15021504    // ¥«¡¼¥ÈÆâ¾ðÊó¤Î¼èÆÀ 
    15031505    $arrCart = $objCartSess->getCartList(); 
     
    15061508 
    15071509    for ($i = 0; $i < $max; $i++) { 
    1508         // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ    
     1510        // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ 
    15091511        $arrData = sfGetProductsClass($arrCart[$i]['id']); 
    15101512        $limit = ""; 
    15111513        // DB¤Ë¸ºß¤¹¤ë¾¦ÉÊ 
    15121514        if (count($arrData) > 0) { 
    1513              
    1514             // ¹ØÆþÀ©¸Â¿ô¤òµá¤á¤ë¡£          
     1515 
     1516            // ¹ØÆþÀ©¸Â¿ô¤òµá¤á¤ë¡£ 
    15151517            if ($arrData['stock_unlimited'] != '1' && $arrData['sale_unlimited'] != '1') { 
    15161518                if($arrData['sale_limit'] < $arrData['stock']) { 
     
    15271529                } 
    15281530            } 
    1529                          
     1531 
    15301532            if($limit != "" && $limit < $arrCart[$i]['quantity']) { 
    15311533                // ¥«¡¼¥ÈÆ⾦ÉÊ¿ô¤òÀ©¸Â¤Ë¹ç¤ï¤»¤ë 
     
    15361538                $quantity = $arrCart[$i]['quantity']; 
    15371539            } 
    1538              
     1540 
    15391541            $objPage->arrProductsClass[$cnt] = $arrData; 
    15401542            $objPage->arrProductsClass[$cnt]['quantity'] = $quantity; 
     
    15441546            $objPage->arrProductsClass[$cnt]['classcategory_name1'] = $arrClassCatName[$arrData['classcategory_id1']]; 
    15451547            $objPage->arrProductsClass[$cnt]['classcategory_name2'] = $arrClassCatName[$arrData['classcategory_id2']]; 
    1546              
     1548 
    15471549            // ²èÁü¥µ¥¤¥º 
    15481550            list($image_width, $image_height) = getimagesize(IMAGE_SAVE_DIR . basename($objPage->arrProductsClass[$cnt]["main_image"])); 
    15491551            $objPage->arrProductsClass[$cnt]["tpl_image_width"] = $image_width + 60; 
    15501552            $objPage->arrProductsClass[$cnt]["tpl_image_height"] = $image_height + 80; 
    1551              
     1553 
    15521554            // ²Á³Ê¤ÎÅÐÏ¿ 
    15531555            if ($arrData['price02'] != "") { 
     
    15701572        } 
    15711573    } 
    1572      
     1574 
    15731575    // Á´¾¦Éʹç·×¶â³Û(Àǹþ¤ß) 
    15741576    $objPage->tpl_total_pretax = $objCartSess->getAllProductsTotal($arrInfo); 
     
    15771579    // Á´¾¦Éʹç·×¥Ý¥¤¥ó¥È 
    15781580    $objPage->tpl_total_point = $objCartSess->getAllProductsPoint(); 
    1579      
    1580     return $objPage;     
     1581 
     1582    return $objPage; 
    15811583} 
    15821584 
     
    15891591            $str = sprintf("%04d/%02d/%02d %02d:%02d", $y, $m, $d, $H, $M); 
    15901592        } else { 
    1591             $str = sprintf("%04d/%02d/%02d", $y, $m, $d, $H, $M);                        
     1593            $str = sprintf("%04d/%02d/%02d", $y, $m, $d, $H, $M); 
    15921594        } 
    15931595    } else { 
     
    15991601function sfGetDelivTime($payment_id = "") { 
    16001602    $objQuery = new SC_Query(); 
    1601      
     1603 
    16021604    $deliv_id = ""; 
    1603      
     1605 
    16041606    if($payment_id != "") { 
    16051607        $where = "del_flg = 0 AND payment_id = ?"; 
     
    16071609        $deliv_id = $arrRet[0]['deliv_id']; 
    16081610    } 
    1609      
     1611 
    16101612    if($deliv_id != "") { 
    16111613        $objQuery->setorder("time_id"); 
     
    16131615        $arrRet= $objQuery->select("time_id, deliv_time", "dtb_delivtime", $where, array($deliv_id)); 
    16141616    } 
    1615      
    1616     return $arrRet;  
     1617 
     1618    return $arrRet; 
    16171619} 
    16181620 
     
    16211623function sfGetDelivFee($pref, $payment_id = "") { 
    16221624    $objQuery = new SC_Query(); 
    1623      
     1625 
    16241626    $deliv_id = ""; 
    1625      
     1627 
    16261628    // »Ùʧ¤¤ÊýË¡¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢Âбþ¤·¤¿ÇÛÁ÷¶È¼Ô¤ò¼èÆÀ¤¹¤ë 
    16271629    if($payment_id != "") { 
     
    16351637        $objQuery->setLimitOffset(1); 
    16361638        $arrRet = $objQuery->select("deliv_id", "dtb_deliv", $where); 
    1637         $deliv_id = $arrRet[0]['deliv_id'];  
    1638     } 
    1639      
     1639        $deliv_id = $arrRet[0]['deliv_id']; 
     1640    } 
     1641 
    16401642    // ÇÛÁ÷¶È¼Ô¤«¤éÇÛÁ÷ÎÁ¤ò¼èÆÀ 
    16411643    if($deliv_id != "") { 
    1642          
     1644 
    16431645        // ÅÔÆ»Éܸ©¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢ÅìµþÅÔ¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Æ¤ª¤¯ 
    16441646        if($pref == "") { 
    16451647            $pref = 13; 
    16461648        } 
    1647          
     1649 
    16481650        $objQuery = new SC_Query(); 
    16491651        $where = "deliv_id = ? AND pref = ?"; 
    16501652        $arrRet= $objQuery->select("fee", "dtb_delivfee", $where, array($deliv_id, $pref)); 
    1651     }    
    1652     return $arrRet[0]['fee'];    
     1653    } 
     1654    return $arrRet[0]['fee']; 
    16531655} 
    16541656 
     
    16601662    $objQuery->setorder("fix, rank DESC"); 
    16611663    $arrRet = $objQuery->select("payment_id, payment_method, rule", "dtb_payment", $where); 
    1662     return $arrRet;  
     1664    return $arrRet; 
    16631665} 
    16641666 
     
    16891691    $objPage->tpl_footer = $arrRet[0]['footer']; 
    16901692    $tmp_subject = $arrRet[0]['subject']; 
    1691      
     1693 
    16921694    $objSiteInfo = new SC_SiteInfo(); 
    16931695    $arrInfo = $objSiteInfo->data; 
    1694      
     1696 
    16951697    $objMailView = new SC_SiteView(); 
    16961698    // ¥á¡¼¥ëËÜʸ¤Î¼èÆÀ 
    16971699    $objMailView->assignobj($objPage); 
    16981700    $body = $objMailView->fetch($arrMAILTPLPATH[$template_id]); 
    1699      
     1701 
    17001702    // ¥á¡¼¥ëÁ÷¿®½èÍý 
    17011703    $objSendMail = new GC_SendMail(); 
     
    17111713function sfSendOrderMail($order_id, $template_id, $subject = "", $header = "", $footer = "", $send = true) { 
    17121714    global $arrMAILTPLPATH; 
    1713      
     1715 
    17141716    $objPage = new LC_Page(); 
    17151717    $objSiteInfo = new SC_SiteInfo(); 
    17161718    $arrInfo = $objSiteInfo->data; 
    17171719    $objPage->arrInfo = $arrInfo; 
    1718      
     1720 
    17191721    $objQuery = new SC_Query(); 
    1720          
     1722 
    17211723    if($subject == "" && $header == "" && $footer == "") { 
    17221724        // ¥á¡¼¥ë¥Æ¥ó¥×¥ì¡¼¥È¾ðÊó¤Î¼èÆÀ 
     
    17311733        $tmp_subject = $subject; 
    17321734    } 
    1733      
     1735 
    17341736    // ¼õÃí¾ðÊó¤Î¼èÆÀ 
    17351737    $where = "order_id = ?"; 
     
    17371739    $arrOrder = $arrRet[0]; 
    17381740    $arrOrderDetail = $objQuery->select("*", "dtb_order_detail", $where, array($order_id)); 
    1739      
     1741 
    17401742    $objPage->Message_tmp = $arrOrder['message']; 
    1741          
     1743 
    17421744    // ¸ÜµÒ¾ðÊó¤Î¼èÆÀ 
    17431745    $customer_id = $arrOrder['customer_id']; 
     
    17511753    if($arrOrder['memo02'] != "") { 
    17521754        $arrOther = unserialize($arrOrder['memo02']); 
    1753          
     1755 
    17541756        foreach($arrOther as $other_key => $other_val){ 
    17551757            if(sfTrim($other_val["value"]) == ""){ 
     
    17571759            } 
    17581760        } 
    1759          
     1761 
    17601762        $objPage->arrOther = $arrOther; 
    17611763    } 
     
    17641766    global $arrPref; 
    17651767    $objPage->arrOrder['deliv_pref'] = $arrPref[$objPage->arrOrder['deliv_pref']]; 
    1766      
     1768 
    17671769    $objPage->arrOrderDetail = $arrOrderDetail; 
    1768      
     1770 
    17691771    $objCustomer = new SC_Customer(); 
    17701772    $objPage->tpl_user_point = $objCustomer->getValue('point'); 
    1771      
     1773 
    17721774    $objMailView = new SC_SiteView(); 
    17731775    // ¥á¡¼¥ëËÜʸ¤Î¼èÆÀ 
    17741776    $objMailView->assignobj($objPage); 
    17751777    $body = $objMailView->fetch($arrMAILTPLPATH[$template_id]); 
    1776      
     1778 
    17771779    // ¥á¡¼¥ëÁ÷¿®½èÍý 
    17781780    $objSendMail = new GC_SendMail(); 
     
    17821784 
    17831785    $tosubject = sfMakeSubject($tmp_subject); 
    1784      
     1786 
    17851787    $objSendMail->setItem('', $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc); 
    17861788    $objSendMail->setTo($arrOrder["order_email"], $arrOrder["order_name01"] . " ". $arrOrder["order_name02"] ." ÍÍ"); 
     
    18141816    $error = $arrInfo['email04']; 
    18151817    $objSendMail->setItem($to, $subject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc); 
    1816     $objSendMail->sendMail();    
     1818    $objSendMail->sendMail(); 
    18171819} 
    18181820 
     
    18321834//·ï̾¤Ë¥Æ¥ó¥×¥ì¡¼¥È¤òÍѤ¤¤ë 
    18331835function sfMakeSubject($subject){ 
    1834      
     1836 
    18351837    $objQuery = new SC_Query(); 
    18361838    $objMailView = new SC_SiteView(); 
    18371839    $objPage = new LC_Page(); 
    1838      
     1840 
    18391841    $arrInfo = $objQuery->select("*","dtb_baseinfo"); 
    18401842    $arrInfo = $arrInfo[0]; 
     
    18441846    $mailtitle = $objMailView->fetch('mail_templates/mail_title.tpl'); 
    18451847    $ret = $mailtitle.$subject; 
    1846     return $ret;  
     1848    return $ret; 
    18471849} 
    18481850 
     
    18591861    } 
    18601862    $sqlval['mail_body'] = $body; 
    1861      
     1863 
    18621864    $objQuery = new SC_Query(); 
    18631865    $objQuery->insert("dtb_mail_history", $sqlval); 
     
    19361938    $now_dir = getcwd();            // require¤¬¤¦¤Þ¤¯¤¤¤«¤Ê¤¤¤Î¤Ç¡¢cgi¼Â¹Ô¥Ç¥£¥ì¥¯¥È¥ê¤Ë°ÜÆ°¤¹¤ë 
    19371939    chdir($dir); 
    1938      
     1940 
    19391941    // ¥Ñ¥¤¥×ÅϤ·¤Ç¥³¥Þ¥ó¥É¥é¥¤¥ó¤«¤écgiµ¯Æ° 
    19401942    $cmd = "$path card_no=$card_no name01=$name01 name02=$name02 card_exp=$card_exp amount=$amount order_id=$order_id jpo_info=$jpo_info"; 
    19411943 
    19421944    $tmpResult = popen($cmd, "r"); 
    1943      
     1945 
    19441946    // ·ë²Ì¼èÆÀ 
    19451947    while( ! FEOF ( $tmpResult ) ) { 
     
    19481950    pclose($tmpResult);             //  ¥Ñ¥¤¥×¤òÊĤ¸¤ë 
    19491951    chdir($now_dir);                //¡¡¸µ¤Ë¤¤¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ëµ¢¤ë 
    1950      
     1952 
    19511953    // ·ë²Ì¤òÏ¢ÁÛÇÛÎó¤Ø³ÊǼ 
    19521954    $result = ereg_replace("&$", "", $result); 
     
    19551957        $return[$key] = $val; 
    19561958    } 
    1957      
     1959 
    19581960    return $return; 
    19591961} 
     
    20412043    // ¹ØÆþ¾¦Éʤιç·×¥Ý¥¤¥ó¥È¤«¤éÍøÍѤ·¤¿¥Ý¥¤¥ó¥È¤Î¥Ý¥¤¥ó¥È´¹»»²ÁÃͤò°ú¤¯Êý¼° 
    20422044    $add_point = $totalpoint - intval($use_point * ($arrInfo['point_rate'] / 100)); 
    2043      
     2045 
    20442046    if($add_point < 0) { 
    20452047        $add_point = '0'; 
     
    20612063    // ´û¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÆâÍƤò¼èÆÀ¤¹¤ë 
    20622064    $sql = "SELECT name, main_image, main_list_image, price01_min, price01_max, price02_min, price02_max, point_rate, 
    2063              A.product_id, A.comment FROM dtb_best_products as A LEFT JOIN vw_products_allclass AS allcls  
     2065             A.product_id, A.comment FROM dtb_best_products as A LEFT JOIN vw_products_allclass AS allcls 
    20642066            USING (product_id) WHERE A.category_id = ? AND A.del_flg = 0 AND status = 1 ORDER BY A.rank"; 
    20652067    $arrItems = $conn->getAll($sql, array($category_id)); 
     
    20812083        return $ret; 
    20822084    } 
    2083      
     2085 
    20842086    // ÇÛÎó¤Î¾ì¹ç 
    20852087    foreach($data as $val) { 
     
    21422144    $line = array(); 
    21432145    $ret = ""; 
    2144      
     2146 
    21452147    while($str[$i] != "") { 
    21462148        $line[$cnt].=$str[$i]; 
     
    21512153        } 
    21522154    } 
    2153      
     2155 
    21542156    foreach($line as $val) { 
    21552157        $ret.=$val; 
     
    21712173    $str = ereg_replace("[/]+", "/", $str); 
    21722174    $ret = $head . $str; 
    2173     return $ret;     
     2175    return $ret; 
    21742176} 
    21752177 
    21762178function sfEncodeFile($filepath, $enc_type, $out_dir) { 
    21772179    $ifp = fopen($filepath, "r"); 
    2178      
     2180 
    21792181    $basename = basename($filepath); 
    21802182    $outpath = $out_dir . "enc_" . $basename; 
    2181      
     2183 
    21822184    $ofp = fopen($outpath, "w+"); 
    2183      
     2185 
    21842186    while(!feof($ifp)) { 
    21852187        $line = fgets($ifp); 
     
    21872189        fwrite($ofp,  $line); 
    21882190    } 
    2189      
     2191 
    21902192    fclose($ofp); 
    21912193    fclose($ifp); 
    2192      
     2194 
    21932195    return  $outpath; 
    21942196} 
     
    22452247    $end_year = $year; 
    22462248    $end_month = $month; 
    2247      
     2249 
    22482250    // ³«»Ï·î¤¬½ªÎ»·î¤ÈƱ¤¸¤«Èݤ« 
    22492251    $same_month = false; 
    2250      
     2252 
    22512253    // ³ºÅö·î¤ÎËöÆü¤òµá¤á¤ë¡£ 
    22522254    $end_last_day = date("d", mktime(0, 0, 0, $month + 1, 0, $year)); 
    2253      
     2255 
    22542256    // ·î¤ÎËöÆü¤¬Äù¤áÆü¤è¤ê¾¯¤Ê¤¤¾ì¹ç 
    22552257    if($end_last_day < $close_day) { 
     
    22592261        $end_day = $close_day; 
    22602262    } 
    2261      
     2263 
    22622264    // Á°·î¤Î¼èÆÀ 
    22632265    $tmp_year = date("Y", mktime(0, 0, 0, $month, 0, $year)); 
     
    22652267    // Á°·î¤ÎËöÆü¤òµá¤á¤ë¡£ 
    22662268    $start_last_day = date("d", mktime(0, 0, 0, $month, 0, $year)); 
    2267      
     2269 
    22682270    // Á°·î¤ÎËöÆü¤¬Äù¤áÆü¤è¤ê¾¯¤Ê¤¤¾ì¹ç 
    22692271    if ($start_last_day < $close_day) { 
     
    22732275        $tmp_day = $close_day; 
    22742276    } 
    2275      
     2277 
    22762278    // Àè·î¤ÎËöÆü¤ÎÍâÆü¤ò¼èÆÀ¤¹¤ë 
    22772279    $start_year = date("Y", mktime(0, 0, 0, $tmp_month, $tmp_day + 1, $tmp_year)); 
    22782280    $start_month = date("m", mktime(0, 0, 0, $tmp_month, $tmp_day + 1, $tmp_year)); 
    22792281    $start_day = date("d", mktime(0, 0, 0, $tmp_month, $tmp_day + 1, $tmp_year)); 
    2280      
     2282 
    22812283    // ÆüÉդκîÀ® 
    22822284    $start_date = sprintf("%d/%d/%d 00:00:00", $start_year, $start_month, $start_day); 
    22832285    $end_date = sprintf("%d/%d/%d 23:59:59", $end_year, $end_month, $end_day); 
    2284      
     2286 
    22852287    return array($start_date, $end_date); 
    22862288} 
     
    22902292    $hex = substr($hexrgb, 0, 2); 
    22912293    $r = hexdec($hex) / 255; 
    2292      
     2294 
    22932295    $hex = substr($hexrgb, 2, 2); 
    22942296    $g = hexdec($hex) / 255; 
    2295      
     2297 
    22962298    $hex = substr($hexrgb, 4, 2); 
    22972299    $b = hexdec($hex) / 255; 
    2298      
    2299     return array($r, $g, $b);    
     2300 
     2301    return array($r, $g, $b); 
    23002302} 
    23012303 
     
    23052307    $objConn = new SC_DBConn(); 
    23062308    $objPage = new LC_Page(); 
    2307      
     2309 
    23082310    $random_id = sfGetUniqRandomId(); 
    23092311    $arrRegistMailMagazine["mail_flag"] = $mail_flag; 
     
    23122314    $arrRegistMailMagazine["end_flag"]='0'; 
    23132315    $arrRegistMailMagazine["update_date"] = 'now()'; 
    2314      
     2316 
    23152317    //¥á¥ë¥Þ¥¬²¾ÅÐÏ¿Íѥե饰 
    23162318    $flag = $objQuery->count("dtb_customer_mail_temp", "email=?", array($email)); 
     
    23202322        $objConn->autoExecute("dtb_customer_mail_temp",$arrRegistMailMagazine); 
    23212323        break; 
    2322      
     2324 
    23232325        case '1': 
    23242326        $objConn->autoExecute("dtb_customer_mail_temp",$arrRegistMailMagazine, "email = '" .addslashes($email). "'"); 
     
    23332335        $objPage->tpl_kindname = "HTML"; 
    23342336        break; 
    2335          
     2337 
    23362338        case '2': 
    23372339        $objPage->tpl_name = "ÅÐÏ¿"; 
    23382340        $objPage->tpl_kindname = "¥Æ¥­¥¹¥È"; 
    23392341        break; 
    2340          
     2342 
    23412343        case '3': 
    23422344        $objPage->tpl_name = "²ò½ü"; 
     
    23842386    } else { 
    23852387        $path = $_SERVER["REQUEST_URI"]; 
    2386     }    
     2388    } 
    23872389 
    23882390    if($_GET['tpl'] != "") { 
     
    23972399 
    23982400    if($is_mobile === true) { 
    2399         $objView = new SC_MobileView();          
     2401        $objView = new SC_MobileView(); 
    24002402        $objView->assignobj($objPage); 
    2401         $objView->display(SITE_FRAME);       
     2403        $objView->display(SITE_FRAME); 
    24022404    } else if(file_exists($template_path)) { 
    24032405        $objView = new SC_UserView(TEMPLATE_FTP_DIR, COMPILE_FTP_DIR); 
     
    24142416function sfEditCustomerData($array, $arrRegistColumn) { 
    24152417    $objQuery = new SC_Query(); 
    2416      
     2418 
    24172419    foreach ($arrRegistColumn as $data) { 
    24182420        if ($data["column"] != "password") { 
     
    24312433 
    24322434    //-- ¥Ñ¥¹¥ï¡¼¥É¤Î¹¹¿·¤¬¤¢¤ë¾ì¹ç¤Ï°Å¹æ²½¡£¡Ê¹¹¿·¤¬¤Ê¤¤¾ì¹ç¤ÏUPDATEʸ¤ò¹½À®¤·¤Ê¤¤¡Ë 
    2433     if ($array["password"] != DEFAULT_PASSWORD) $arrRegist["password"] = sha1($array["password"] . ":" . AUTH_MAGIC);  
     2435    if ($array["password"] != DEFAULT_PASSWORD) $arrRegist["password"] = sha1($array["password"] . ":" . AUTH_MAGIC); 
    24342436    $arrRegist["update_date"] = "NOW()"; 
    2435      
     2437 
    24362438    //-- ÊÔ½¸ÅÐÏ¿¼Â¹Ô 
    24372439    if (defined('MOBILE_SITE')) { 
     
    24472449function sf_mb_convert_encoding($str, $encode = 'CHAR_CODE') { 
    24482450    return  mb_convert_encoding($str, $encode); 
    2449 }    
     2451} 
    24502452 
    24512453// PHP¤Îmktime´Ø¿ô¤òSmarty¤Ç¤â»È¤¨¤ë¤è¤¦¤Ë¤¹¤ë 
    24522454function sf_mktime($format, $hour=0, $minute=0, $second=0, $month=1, $day=1, $year=1999) { 
    24532455    return  date($format,mktime($hour, $minute, $second, $month, $day, $year)); 
    2454 }    
     2456} 
    24552457 
    24562458// PHP¤Îdate´Ø¿ô¤òSmarty¤Ç¤â»È¤¨¤ë¤è¤¦¤Ë¤¹¤ë 
     
    24782480function sfCategory_Count($objQuery){ 
    24792481    $sql = ""; 
    2480      
     2482 
    24812483    //¥Æ¡¼¥Ö¥ëÆâÍƤκï½ü 
    24822484    $objQuery->query("DELETE FROM dtb_category_count"); 
    24832485    $objQuery->query("DELETE FROM dtb_category_total_count"); 
    2484      
     2486 
    24852487    //³Æ¥«¥Æ¥´¥êÆâ¤Î¾¦ÉÊ¿ô¤ò¿ô¤¨¤Æ³ÊǼ 
    24862488    $sql = " INSERT INTO dtb_category_count(category_id, product_count, create_date) "; 
     
    24902492    $sql .= " GROUP BY T1.category_id, T2.category_id "; 
    24912493    $objQuery->query($sql); 
    2492      
     2494 
    24932495    //»Ò¥«¥Æ¥´¥êÆâ¤Î¾¦ÉÊ¿ô¤ò½¸·×¤¹¤ë 
    24942496    $arrCat = $objQuery->getAll("SELECT * FROM dtb_category"); 
    2495      
     2497 
    24962498    $sql = ""; 
    24972499    foreach($arrCat as $key => $val){ 
    2498          
     2500 
    24992501        // »ÒID°ìÍ÷¤ò¼èÆÀ 
    2500         $arrRet = sfGetChildrenArray('dtb_category', 'parent_category_id', 'category_id', $val['category_id']);  
     2502        $arrRet = sfGetChildrenArray('dtb_category', 'parent_category_id', 'category_id', $val['category_id']); 
    25012503        $line = sfGetCommaList($arrRet); 
    2502          
     2504 
    25032505        $sql = " INSERT INTO dtb_category_total_count(category_id, product_count, create_date) "; 
    25042506        $sql .= " SELECT ?, SUM(product_count), now() FROM dtb_category_count "; 
    25052507        $sql .= " WHERE category_id IN (" . $line . ")"; 
    2506                  
     2508 
    25072509        $objQuery->query($sql, array($val['category_id'])); 
    25082510    } 
     
    25132515 
    25142516    if(count($arrKeys) <= 0 and count($arrValues) <= 0) return array(); 
    2515      
     2517 
    25162518    $keys = array_values($arrKeys); 
    2517     $vals = array_values($arrValues);  
    2518      
    2519     $max = max( count( $keys ), count( $vals ) );  
    2520     $combine_ary = array();  
    2521     for($i=0; $i<$max; $i++) {  
    2522         $combine_ary[$keys[$i]] = $vals[$i];  
    2523     }  
    2524     if(is_array($combine_ary)) return $combine_ary;  
    2525      
    2526     return false;  
     2519    $vals = array_values($arrValues); 
     2520 
     2521    $max = max( count( $keys ), count( $vals ) ); 
     2522    $combine_ary = array(); 
     2523    for($i=0; $i<$max; $i++) { 
     2524        $combine_ary[$keys[$i]] = $vals[$i]; 
     2525    } 
     2526    if(is_array($combine_ary)) return $combine_ary; 
     2527 
     2528    return false; 
    25272529} 
    25282530 
     
    25322534    $col = $pid_name . "," . $id_name; 
    25332535    $arrData = $objQuery->select($col, $table); 
    2534      
     2536 
    25352537    $arrPID = array(); 
    25362538    $arrPID[] = $id; 
    25372539    $arrChildren = array(); 
    25382540    $arrChildren[] = $id; 
    2539      
     2541 
    25402542    $arrRet = sfGetChildrenArraySub($arrData, $pid_name, $id_name, $arrPID); 
    2541      
     2543 
    25422544    while(count($arrRet) > 0) { 
    25432545        $arrChildren = array_merge($arrChildren, $arrRet); 
    25442546        $arrRet = sfGetChildrenArraySub($arrData, $pid_name, $id_name, $arrRet); 
    25452547    } 
    2546      
     2548 
    25472549    return $arrChildren; 
    25482550} 
     
    25522554    $arrChildren = array(); 
    25532555    $max = count($arrData); 
    2554      
     2556 
    25552557    for($i = 0; $i < $max; $i++) { 
    25562558        foreach($arrPID as $val) { 
     
    25592561            } 
    25602562        } 
    2561     }    
     2563    } 
    25622564    return $arrChildren; 
    25632565} 
     
    25692571    $col = $pid_name . "," . $id_name; 
    25702572    $arrData = $objQuery->select($col, $table); 
    2571      
     2573 
    25722574    $arrParents = array(); 
    25732575    $arrParents[] = $id; 
    25742576    $child = $id; 
    2575      
     2577 
    25762578    $ret = sfGetParentsArraySub($arrData, $pid_name, $id_name, $child); 
    25772579 
     
    25802582        $ret = sfGetParentsArraySub($arrData, $pid_name, $id_name, $ret); 
    25812583    } 
    2582      
     2584 
    25832585    $arrParents = array_reverse($arrParents); 
    2584      
     2586 
    25852587    return $arrParents; 
    25862588} 
     
    26022604function sfGetBrothersArray($arrData, $pid_name, $id_name, $arrPID) { 
    26032605    $max = count($arrData); 
    2604      
     2606 
    26052607    $arrBrothers = array(); 
    26062608    foreach($arrPID as $id) { 
     
    26172619                $arrBrothers[] = $arrData[$i][$id_name]; 
    26182620            } 
    2619         }                    
     2621        } 
    26202622    } 
    26212623    return $arrBrothers; 
     
    26252627function sfGetUnderChildrenArray($arrData, $pid_name, $id_name, $parent) { 
    26262628    $max = count($arrData); 
    2627      
     2629 
    26282630    $arrChildren = array(); 
    26292631    // »ÒID¤ò¸¡º÷¤¹¤ë 
     
    26322634            $arrChildren[] = $arrData[$i][$id_name]; 
    26332635        } 
    2634     }                    
     2636    } 
    26352637    return $arrChildren; 
    26362638} 
     
    26502652    $col .= " cat.update_date,"; 
    26512653    $col .= " cat.del_flg, "; 
    2652     $col .= " ttl.product_count";    
     2654    $col .= " ttl.product_count"; 
    26532655    $from = "dtb_category as cat left join dtb_category_total_count as ttl on ttl.category_id = cat.category_id"; 
    26542656    // ÅÐÏ¿¾¦ÉÊ¿ô¤Î¥Á¥§¥Ã¥¯ 
     
    26602662    $objQuery->setoption("ORDER BY rank DESC"); 
    26612663    $arrRet = $objQuery->select($col, $from, $where); 
    2662      
     2664 
    26632665    $arrParentID = sfGetParents($objQuery, 'dtb_category', 'parent_category_id', 'category_id', $parent_category_id); 
    2664      
     2666 
    26652667    foreach($arrRet as $key => $array) { 
    26662668        foreach($arrParentID as $val) { 
     
    26792681    // ¾¦Éʤ¬Â°¤¹¤ë¥«¥Æ¥´¥êID¤ò½Ä¤Ë¼èÆÀ 
    26802682    $objQuery = new SC_Query(); 
    2681     $arrCatID = sfGetParents($objQuery, "dtb_category", "parent_category_id", "category_id", $category_id);  
     2683    $arrCatID = sfGetParents($objQuery, "dtb_category", "parent_category_id", "category_id", $category_id); 
    26822684    $ConbName = ""; 
    2683      
     2685 
    26842686    // ¥«¥Æ¥´¥ê¡¼Ì¾¾Î¤ò¼èÆÀ¤¹¤ë 
    26852687    foreach($arrCatID as $key => $val){ 
     
    26912693    // ºÇ¸å¤Î ¡Ã ¤ò¥«¥Ã¥È¤¹¤ë 
    26922694    $ConbName = substr_replace($ConbName, "", strlen($ConbName) - 2, 2); 
    2693      
     2695 
    26942696    return $ConbName; 
    26952697} 
     
    27002702    $objQuery = new SC_Query(); 
    27012703    $arrRet = array(); 
    2702     $arrCatID = sfGetParents($objQuery, "dtb_category", "parent_category_id", "category_id", $category_id);  
     2704    $arrCatID = sfGetParents($objQuery, "dtb_category", "parent_category_id", "category_id", $category_id); 
    27032705    $arrRet['id'] = $arrCatID[0]; 
    2704      
     2706 
    27052707    // ¥«¥Æ¥´¥ê¡¼Ì¾¾Î¤ò¼èÆÀ¤¹¤ë 
    27062708    $sql = "SELECT category_name FROM dtb_category WHERE category_id = ?"; 
    27072709    $arrVal = array($arrRet['id']); 
    27082710    $arrRet['name'] = $objQuery->getOne($sql,$arrVal); 
    2709      
     2711 
    27102712    return $arrRet; 
    27112713} 
     
    27152717    // ²þ¹Ô¡¢¥¿¥Ö¤ò1¥¹¥Ú¡¼¥¹¤ËÊÑ´¹ 
    27162718    $sql = preg_replace("/[\r\n\t]/"," ",$sql); 
    2717      
     2719 
    27182720    $sql = sfChangeView($sql);      // viewɽ¤ò¥¤¥ó¥é¥¤¥ó¥Ó¥å¡¼¤ËÊÑ´¹¤¹¤ë 
    27192721    $sql = sfChangeILIKE($sql);     // ILIKE¸¡º÷¤òLIKE¸¡º÷¤ËÊÑ´¹¤¹¤ë 
     
    27382740// SQL¥·¥ó¥°¥ë¥¯¥©¡¼¥ÈÂбþ 
    27392741function sfQuoteSmart($in){ 
    2740      
     2742 
    27412743    if (is_int($in) || is_double($in)) { 
    27422744        return $in; 
     
    27492751    } 
    27502752} 
    2751      
     2753 
    27522754// viewɽ¤ò¥¤¥ó¥é¥¤¥ó¥Ó¥å¡¼¤ËÊÑ´¹¤¹¤ë 
    27532755function sfChangeView($sql){ 
    27542756    global $arrView; 
    27552757    global $arrViewWhere; 
    2756      
     2758 
    27572759    $arrViewTmp = $arrView; 
    27582760 
     
    27612763        $arrViewTmp[$key] = strtr($arrViewTmp[$key], $arrViewWhere); 
    27622764    } 
    2763      
     2765 
    27642766    // view¤òÊÑ´¹ 
    27652767    $changesql = strtr($sql, $arrViewTmp); 
     
    27992801    $oldmask = umask(0); 
    28002802    $mod= stat($src); 
    2801      
     2803 
    28022804    // ¥Ç¥£¥ì¥¯¥È¥ê¤¬¤Ê¤±¤ì¤ÐºîÀ®¤¹¤ë 
    28032805    if(!file_exists($des)) { 
     
    28062808        } 
    28072809    } 
    2808      
     2810 
    28092811    $fileArray=glob( $src."*" ); 
    28102812    foreach( $fileArray as $key => $data_ ){ 
     
    28192821            break; 
    28202822        } 
    2821          
     2823 
    28222824        mb_ereg("^(.*[\/])(.*)",$data_, $matches); 
    28232825        $data=$matches[2]; 
     
    28532855            $ret = sfDelFile($del_file); 
    28542856        } 
    2855          
     2857 
    28562858        if(!$ret){ 
    28572859            return $ret; 
    28582860        } 
    28592861    } 
    2860      
     2862 
    28612863    // ÊĤ¸¤ë 
    28622864    closedir($dh); 
    2863      
     2865 
    28642866    // ¥Õ¥©¥ë¥À¤òºï½ü 
    28652867    return rmdir($dir); 
    28662868} 
    28672869 
    2868 /*  
     2870/* 
    28692871 * ´Ø¿ô̾¡§sfWriteFile 
    28702872 * °ú¿ô1 ¡§½ñ¤­¹þ¤à¥Ç¡¼¥¿ 
     
    28932895        chmod($path, $permission); 
    28942896    } 
    2895      
     2897 
    28962898    return true; 
    28972899} 
    2898      
     2900 
    28992901function sfFlush($output = " ", $sleep = 0){ 
    29002902    // ¼Â¹Ô»þ´Ö¤òÀ©¸Â¤·¤Ê¤¤ 
     
    29022904    // ½ÐÎϤò¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤·¤Ê¤¤(==ÆüËܸ켫ưÊÑ´¹¤â¤·¤Ê¤¤) 
    29032905    ob_end_clean(); 
    2904      
     2906 
    29052907    // IE¤Î¤¿¤á¤Ë256¥Ð¥¤¥È¶õʸ»ú½ÐÎÏ 
    29062908    echo str_pad('',256); 
    2907      
     2909 
    29082910    // ½ÐÎϤϥ֥é¥ó¥¯¤À¤±¤Ç¤â¤¤¤¤¤È»×¤¦ 
    29092911    echo $output; 
    29102912    // ½ÐÎϤò¥Õ¥é¥Ã¥·¥å¤¹¤ë 
    29112913    flush(); 
    2912      
     2914 
    29132915    ob_end_flush(); 
    2914     ob_start();  
    2915      
     2916    ob_start(); 
     2917 
    29162918    // »þ´Ö¤Î¤«¤«¤ë½èÍý 
    29172919    sleep($sleep); 
     
    29392941function sfSendPostData($url, $arrData, $arrOkCode = array()){ 
    29402942    require_once(DATA_PATH . "module/Request.php"); 
    2941      
     2943 
    29422944    // Á÷¿®¥¤¥ó¥¹¥¿¥ó¥¹À¸À® 
    29432945    $req = new HTTP_Request($url); 
    2944      
     2946 
    29452947    $req->addHeader('User-Agent', 'DoCoMo/2.0¡¡P2101V(c100)'); 
    29462948    $req->setMethod(HTTP_REQUEST_METHOD_POST); 
    2947      
     2949 
    29482950    // POST¥Ç¡¼¥¿Á÷¿® 
    29492951    $req->addPostDataArray($arrData); 
    2950      
     2952 
    29512953    // ¥¨¥é¡¼¤¬Ìµ¤±¤ì¤Ð¡¢±þÅú¾ðÊó¤ò¼èÆÀ¤¹¤ë 
    29522954    if (!PEAR::isError($req->sendRequest())) { 
    2953          
     2955 
    29542956        // ¥ì¥¹¥Ý¥ó¥¹¥³¡¼¥É¤¬¥¨¥é¡¼È½Äê¤Ê¤é¡¢¶õ¤òÊÖ¤¹ 
    29552957        $res_code = $req->getResponseCode(); 
    2956          
     2958 
    29572959        if(!in_array($res_code, $arrOkCode)){ 
    29582960            $response = ""; 
     
    29602962            $response = $req->getResponseBody(); 
    29612963        } 
    2962          
     2964 
    29632965    } else { 
    29642966        $response = ""; 
    29652967    } 
    2966      
     2968 
    29672969    // POST¥Ç¡¼¥¿¥¯¥ê¥¢ 
    2968     $req->clearPostData();   
    2969      
     2970    $req->clearPostData(); 
     2971 
    29702972    return $response; 
    29712973} 
Note: See TracChangeset for help on using the changeset viewer.