Ignore:
Timestamp:
2007/07/20 15:58:59 (17 years ago)
Author:
nanasess
Message:

r15064 から svn cp
とりあえず暫定コミット.

  • UTF-8 に変更
  • slib.php, glib.php のクラス化
  • LC_Page の抽象化(一部)
Location:
branches/feature-module-update
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update

    • Property svn:ignore set to
      .cache

      .settings

      .projectOptions
  • branches/feature-module-update/html/mobile/products/category_list.php

    r12157 r15078  
    77 *  
    88 * 
    9  * ¥â¥Ð¥¤¥ë¥µ¥¤¥È/¥«¥Æ¥´¥ê¡¼°ìÍ÷ 
     9 * モバイルサイト/カテゴリー一覧 
    1010 */ 
    1111 
     
    1414class LC_Page { 
    1515    function LC_Page() { 
    16         /** ɬ¤º»ØÄꤹ¤ë **/ 
    17         $this->tpl_mainpage = 'products/category_list.tpl';         // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È 
    18         $this->tpl_title = '¥«¥Æ¥´¥ê°ìÍ÷¥Ú¡¼¥¸'; 
     16        /** 必ず指定する **/ 
     17        $this->tpl_mainpage = 'products/category_list.tpl';         // メインテンプレート 
     18        $this->tpl_title = 'カテゴリ一覧ページ'; 
    1919    } 
    2020} 
     
    2323$objView = new SC_MobileView(); 
    2424 
    25 // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ 
     25// レイアウトデザインを取得 
    2626$objPage = sfGetPageLayout($objPage, false, DEF_LAYOUT); 
    2727 
    28 // ¥«¥Æ¥´¥ê¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ 
     28// カテゴリー情報を取得する。 
    2929lfGetCategories(@$_GET['category_id'], true, $objPage); 
    3030 
     
    3535 
    3636/** 
    37  * ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤È¤½¤Î»Ò¥«¥Æ¥´¥ê¡¼¤Î¾ðÊó¤ò¼èÆÀ¤·¡¢ 
    38  * ¥Ú¡¼¥¸¥ª¥Ö¥¸¥§¥¯¥È¤Ë³ÊǼ¤¹¤ë¡£ 
     37 * 選択されたカテゴリーとその子カテゴリーの情報を取得し、 
     38 * ページオブジェクトに格納する。 
    3939 * 
    40  * @param string $category_id ¥«¥Æ¥´¥ê¡¼ID 
    41  * @param boolean $count_check Í­¸ú¤Ê¾¦Éʤ¬¤Ê¤¤¥«¥Æ¥´¥ê¡¼¤ò½ü¤¯¤«¤É¤¦¤« 
    42  * @param object &$objPage ¥Ú¡¼¥¸¥ª¥Ö¥¸¥§¥¯¥È 
     40 * @param string $category_id カテゴリーID 
     41 * @param boolean $count_check 有効な商品がないカテゴリーを除くかどうか 
     42 * @param object &$objPage ページオブジェクト 
    4343 * @return void 
    4444 */ 
    4545function lfGetCategories($category_id, $count_check = false, &$objPage) { 
    46     // ¥«¥Æ¥´¥ê¡¼¤ÎÀµ¤·¤¤ID¤ò¼èÆÀ¤¹¤ë¡£ 
     46    // カテゴリーの正しいIDを取得する。 
    4747    $category_id = sfGetCategoryId('', $category_id); 
    4848    if ($category_id == 0) { 
     
    5050    } 
    5151 
    52     $arrCategory = null;    // ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼ 
    53     $arrChildren = array(); // »Ò¥«¥Æ¥´¥ê¡¼ 
     52    $arrCategory = null;    // 選択されたカテゴリー 
     53    $arrChildren = array(); // 子カテゴリー 
    5454 
    5555    $arrAll = sfGetCatTree($category_id, $count_check); 
    5656    foreach ($arrAll as $category) { 
    57         // ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤Î¾ì¹ç 
     57        // 選択されたカテゴリーの場合 
    5858        if ($category['category_id'] == $category_id) { 
    5959            $arrCategory = $category; 
     
    6161        } 
    6262 
    63         // ´Ø·¸¤Î¤Ê¤¤¥«¥Æ¥´¥ê¡¼¤Ï¥¹¥­¥Ã¥×¤¹¤ë¡£ 
     63        // 関係のないカテゴリーはスキップする。 
    6464        if ($category['parent_category_id'] != $category_id) { 
    6565            continue; 
    6666        } 
    6767 
    68         // »Ò¥«¥Æ¥´¥ê¡¼¤Î¾ì¹ç¤Ï¡¢Â¹¥«¥Æ¥´¥ê¡¼¤¬Â¸ºß¤¹¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£ 
     68        // 子カテゴリーの場合は、孫カテゴリーが存在するかどうかを調べる。 
    6969        $arrGrandchildrenID = sfGetUnderChildrenArray($arrAll, 'parent_category_id', 'category_id', $category['category_id']); 
    7070        $category['has_children'] = count($arrGrandchildrenID) > 0; 
     
    7676    } 
    7777 
    78     // »Ò¥«¥Æ¥´¥ê¡¼¤Î¾¦ÉÊ¿ô¤ò¹ç·×¤¹¤ë¡£ 
     78    // 子カテゴリーの商品数を合計する。 
    7979    $children_product_count = 0; 
    8080    foreach ($arrChildren as $category) { 
     
    8282    } 
    8383 
    84     // ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤Ëľ°¤Î¾¦Éʤ¬¤¢¤ë¾ì¹ç¤Ï¡¢»Ò¥«¥Æ¥´¥ê¡¼¤ÎÀèƬ¤ËÄɲ乤롣 
     84    // 選択されたカテゴリーに直属の商品がある場合は、子カテゴリーの先頭に追加する。 
    8585    if ($arrCategory['product_count'] > $children_product_count) { 
    86         $arrCategory['product_count'] -= $children_product_count;   // »Ò¥«¥Æ¥´¥ê¡¼¤Î¾¦ÉÊ¿ô¤ò½ü¤¯¡£ 
    87         $arrCategory['has_children'] = false;   // ¾¦ÉÊ°ìÍ÷¥Ú¡¼¥¸¤ËÁ«°Ü¤µ¤»¤ë¤¿¤á¡£ 
     86        $arrCategory['product_count'] -= $children_product_count;   // 子カテゴリーの商品数を除く。 
     87        $arrCategory['has_children'] = false;   // 商品一覧ページに遷移させるため。 
    8888        array_unshift($arrChildren, $arrCategory); 
    8989    } 
    9090 
    91     // ·ë²Ì¤ò³ÊǼ¤¹¤ë¡£ 
     91    // 結果を格納する。 
    9292    $objPage->arrCategory = $arrCategory; 
    9393    $objPage->arrChildren = $arrChildren; 
  • branches/feature-module-update/html/mobile/products/detail.php

    r12157 r15078  
    1212class LC_Page { 
    1313    function LC_Page() { 
    14         /** ɬ¤º»ØÄꤹ¤ë **/ 
     14        /** 必ず指定する **/ 
    1515        global $arrSTATUS; 
    1616        $this->arrSTATUS = $arrSTATUS; 
     
    2525         
    2626        /* 
    27          session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç 
    28          ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£ 
    29          private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£ 
     27         session_start時のno-cacheヘッダーを抑制することで 
     28         「戻る」ボタン使用時の有効期限切れ表示を抑制する。 
     29         private-no-expire:クライアントのキャッシュを許可する。 
    3030        */ 
    3131        session_cache_limiter('private-no-expire'); 
     
    3838$objQuery = new SC_Query(); 
    3939 
    40 // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ 
     40// レイアウトデザインを取得 
    4141$objPage = sfGetPageLayout($objPage, false, "products/detail.php"); 
    4242 
    43 // ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹ 
     43// パラメータ管理クラス 
    4444$objFormParam = new SC_FormParam(); 
    45 // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ 
     45// パラメータ情報の初期化 
    4646lfInitParam(); 
    47 // POSTÃͤμèÆÀ 
     47// POST値の取得 
    4848$objFormParam->setParam($_POST); 
    4949 
    50 // ¥Õ¥¡¥¤¥ë´ÉÍý¥¯¥é¥¹ 
     50// ファイル管理クラス 
    5151$objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR); 
    52 // ¥Õ¥¡¥¤¥ë¾ðÊó¤Î½é´ü²½ 
     52// ファイル情報の初期化 
    5353lfInitFile(); 
    5454 
    55 // ´ÉÍý¥Ú¡¼¥¸¤«¤é¤Î³Îǧ¤Î¾ì¹ç¤Ï¡¢Èó¸ø³«¤Î¾¦Éʤâɽ¼¨¤¹¤ë¡£ 
     55// 管理ページからの確認の場合は、非公開の商品も表示する。 
    5656if($_GET['admin'] == 'on') { 
    5757    $where = "del_flg = 0"; 
     
    6666} 
    6767 
    68 // ÃͤÎÀµÅöÀ­¥Á¥§¥Ã¥¯ 
     68// 値の正当性チェック 
    6969if(!sfIsInt($_GET['product_id']) || !sfIsRecord("dtb_products", "product_id", $tmp_id, $where)) { 
    7070    sfDispSiteError(PRODUCT_NOT_FOUND, "", false, "", true); 
    7171} 
    72 // ¥í¥°¥¤¥óȽÄê 
     72// ログイン判定 
    7373if($objCustomer->isLoginSuccess()) { 
    74     //¤ªµ¤¤ËÆþ¤ê¥Ü¥¿¥óɽ¼¨ 
     74    //お気に入りボタン表示 
    7575    $objPage->tpl_login = true; 
    7676 
    77 /* ±ÜÍ÷¥í¥°µ¡Ç½¤Ï¸½ºß̤»ÈÍÑ 
     77/* 閲覧ログ機能は現在未使用 
    7878     
    7979    $table = "dtb_customer_reading"; 
    8080    $where = "customer_id = ? "; 
    8181    $arrval[] = $objCustomer->getValue('customer_id'); 
    82     //¸ÜµÒ¤Î±ÜÍ÷¾¦ÉÊ¿ô 
     82    //顧客の閲覧商品数 
    8383    $rpcnt = $objQuery->count($table, $where, $arrval); 
    8484 
    85     //±ÜÍ÷¿ô¤¬ÀßÄê¿ô°Ê²¼ 
     85    //閲覧数が設定数以下 
    8686    if ($rpcnt < CUSTOMER_READING_MAX){ 
    87         //±ÜÍ÷ÍúÎò¤Ë¿·µ¬Äɲà
     87        //閲覧履歴に新規追加 
    8888        lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id')); 
    8989    } else { 
    90         //±ÜÍ÷ÍúÎò¤ÎÃæ¤Ç°ìÈָŤ¤¤â¤Î¤òºï½ü¤·¤Æ¿·µ¬Äɲà
     90        //閲覧履歴の中で一番古いものを削除して新規追加 
    9191        $oldsql = "SELECT MIN(update_date) FROM ".$table." WHERE customer_id = ?"; 
    9292        $old = $objQuery->getone($oldsql, array($objCustomer->getValue("customer_id"))); 
    9393        $where = "customer_id = ? AND update_date = ? "; 
    9494        $arrval = array($objCustomer->getValue("customer_id"), $old); 
    95         //ºï½ü 
     95        //削除 
    9696        $objQuery->delete($table, $where, $arrval); 
    97         //Äɲà
     97        //追加 
    9898        lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id')); 
    9999    } 
     
    102102 
    103103 
    104 // µ¬³ÊÁªÂò¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ÎºîÀ® 
     104// 規格選択セレクトボックスの作成 
    105105$objPage = lfMakeSelect($objPage, $tmp_id); 
    106106 
    107 // ¾¦ÉÊID¤òFORMÆâ¤ËÊÝ»ý¤¹¤ë¡£ 
     107// 商品IDをFORM内に保持する。 
    108108$objPage->tpl_product_id = $tmp_id; 
    109109 
    110110switch($_POST['mode']) { 
    111111case 'select': 
    112     // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç 
     112    // 規格1が設定されている場合 
    113113    if($objPage->tpl_classcat_find1) { 
    114         // template¤ÎÊѹ¹ 
     114        // templateの変更 
    115115        $objPage->tpl_mainpage = "products/select_find1.tpl"; 
    116116        break; 
     
    120120    $objPage->arrErr = lfCheckError(); 
    121121 
    122     // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç 
     122    // 規格1が設定されている場合 
    123123    if($objPage->tpl_classcat_find1 and $objPage->arrErr['classcategory_id1']) { 
    124         // template¤ÎÊѹ¹ 
     124        // templateの変更 
    125125        $objPage->tpl_mainpage = "products/select_find1.tpl"; 
    126126        break; 
    127127    } 
    128128 
    129     // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç 
     129    // 規格2が設定されている場合 
    130130    if($objPage->tpl_classcat_find2) { 
    131131        $objPage->arrErr = array(); 
     
    138138    $objPage->arrErr = lfCheckError(); 
    139139 
    140     // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç 
     140    // 規格1が設定されている場合 
    141141    if($objPage->tpl_classcat_find2 and $objPage->arrErr['classcategory_id2']) { 
    142         // template¤ÎÊѹ¹ 
     142        // templateの変更 
    143143        $objPage->tpl_mainpage = "products/select_find2.tpl"; 
    144144        break; 
    145145    } 
    146     // ¾¦ÉÊ¿ô¤ÎÁªÂò¤ò¹Ô¤¦ 
     146    // 商品数の選択を行う 
    147147    $objPage->tpl_mainpage = "products/select_item.tpl"; 
    148148    break; 
    149149 
    150150case 'cart': 
    151     // ÆþÎÏÃͤÎÊÑ´¹ 
     151    // 入力値の変換 
    152152    $objFormParam->convParam(); 
    153153    $objPage->arrErr = lfCheckError(); 
     
    157157        $classcategory_id2 = $_POST['classcategory_id2']; 
    158158                 
    159         // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç 
     159        // 規格1が設定されていない場合 
    160160        if(!$objPage->tpl_classcat_find1) { 
    161161            $classcategory_id1 = '0'; 
    162162        } 
    163163         
    164         // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç 
     164        // 規格2が設定されていない場合 
    165165        if(!$objPage->tpl_classcat_find2) { 
    166166            $classcategory_id2 = '0'; 
     
    181181 
    182182$objQuery = new SC_Query(); 
    183 // DB¤«¤é¾¦ÉʾðÊó¤ò¼èÆÀ¤¹¤ë¡£ 
     183// DBから商品情報を取得する。 
    184184$arrRet = $objQuery->select("*", "vw_products_allclass_detail AS alldtl", "product_id = ?", array($tmp_id)); 
    185185$objPage->arrProduct = $arrRet[0]; 
    186186 
    187 // ¾¦ÉÊ¥³¡¼¥É¤Î¼èÆÀ 
     187// 商品コードの取得 
    188188$code_sql = "SELECT product_code FROM dtb_products_class AS prdcls WHERE prdcls.product_id = ? GROUP BY product_code ORDER BY product_code"; 
    189189$arrProductCode = $objQuery->getall($code_sql, array($tmp_id)); 
     
    191191$objPage->arrProductCode = $arrProductCode["product_code"]; 
    192192 
    193 // ¹ØÆþÀ©¸Â¿ô¤ò¼èÆÀ 
     193// 購入制限数を取得 
    194194if($objPage->arrProduct['sale_unlimited'] == 1 || $objPage->arrProduct['sale_limit'] > SALE_LIMIT_MAX) { 
    195195  $objPage->tpl_sale_limit = SALE_LIMIT_MAX; 
     
    198198} 
    199199 
    200 // ¥µ¥Ö¥¿¥¤¥È¥ë¤ò¼èÆÀ 
     200// サブタイトルを取得 
    201201$arrFirstCat = sfGetFirstCat($arrRet[0]['category_id']); 
    202202$tpl_subtitle = $arrFirstCat['name']; 
    203203$objPage->tpl_subtitle = $tpl_subtitle; 
    204204 
    205 // DB¤«¤é¤Î¥Ç¡¼¥¿¤ò°ú¤­·Ñ¤° 
     205// DBからのデータを引き継ぐ 
    206206$objUpFile->setDBFileList($objPage->arrProduct); 
    207 // ¥Õ¥¡¥¤¥ëɽ¼¨ÍÑÇÛÎó¤òÅϤ¹ 
     207// ファイル表示用配列を渡す 
    208208$objPage->arrFile = $objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL, true); 
    209 // »ÙʧÊýË¡¤Î¼èÆÀ 
     209// 支払方法の取得 
    210210$objPage->arrPayment = lfGetPayment(); 
    211 // ÆþÎϾðÊó¤òÅϤ¹ 
     211// 入力情報を渡す 
    212212$objPage->arrForm = $objFormParam->getFormParamList(); 
    213 //¥ì¥Ó¥å¡¼¾ðÊó¤Î¼èÆÀ 
     213//レビュー情報の取得 
    214214$objPage->arrReview = lfGetReviewData($tmp_id); 
    215 // ¥¿¥¤¥È¥ë¤Ë¾¦ÉÊ̾¤òÆþ¤ì¤ë 
    216 $objPage->tpl_title = "¾¦Éʾܺ٠". $objPage->arrProduct["name"]; 
    217 //¥ª¥¹¥¹¥á¾¦ÉʾðÊóɽ¼¨ 
     215// タイトルに商品名を入れる 
     216$objPage->tpl_title = "商品詳細 ". $objPage->arrProduct["name"]; 
     217//オススメ商品情報表示 
    218218$objPage->arrRecommend = lfPreGetRecommendProducts($tmp_id); 
    219 //¤³¤Î¾¦ÉʤòÇã¤Ã¤¿¿Í¤Ï¤³¤ó¤Ê¾¦ÉʤâÇã¤Ã¤Æ¤¤¤Þ¤¹ 
     219//この商品を買った人はこんな商品も買っています 
    220220$objPage->arrRelateProducts = lfGetRelateProducts($tmp_id); 
    221221 
    222 // ³ÈÂç²èÁü¤Î¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤ò¥»¥Ã¥È 
     222// 拡大画像のウィンドウサイズをセット 
    223223list($large_width, $large_height) = getimagesize(IMAGE_SAVE_DIR . basename($objPage->arrFile["main_large_image"]["filepath"])); 
    224224$objPage->tpl_large_width = $large_width + 60; 
     
    228228$objView->display(SITE_FRAME); 
    229229//----------------------------------------------------------------------------------------------------------------------------------- 
    230 /* ¥Õ¥¡¥¤¥ë¾ðÊó¤Î½é´ü²½ */ 
     230/* ファイル情報の初期化 */ 
    231231function lfInitFile() { 
    232232    global $objUpFile; 
    233     $objUpFile->addFile("°ìÍ÷-¥á¥¤¥ó²èÁü", 'main_list_image', array('jpg','gif'),IMAGE_SIZE, true, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); 
    234     $objUpFile->addFile("¾ÜºÙ-¥á¥¤¥ó²èÁü", 'main_image', array('jpg'), IMAGE_SIZE, true, NORMAL_IMAGE_WIDTH, NORMAL_IMAGE_HEIGHT); 
    235     $objUpFile->addFile("¾ÜºÙ-¥á¥¤¥ó³ÈÂç²èÁü", 'main_large_image', array('jpg'), IMAGE_SIZE, false, LARGE_IMAGE_HEIGHT, LARGE_IMAGE_HEIGHT); 
     233    $objUpFile->addFile("一覧-メイン画像", 'main_list_image', array('jpg','gif'),IMAGE_SIZE, true, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); 
     234    $objUpFile->addFile("詳細-メイン画像", 'main_image', array('jpg'), IMAGE_SIZE, true, NORMAL_IMAGE_WIDTH, NORMAL_IMAGE_HEIGHT); 
     235    $objUpFile->addFile("詳細-メイン拡大画像", 'main_large_image', array('jpg'), IMAGE_SIZE, false, LARGE_IMAGE_HEIGHT, LARGE_IMAGE_HEIGHT); 
    236236    for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) { 
    237         $objUpFile->addFile("¾ÜºÙ-¥µ¥Ö²èÁü$cnt", "sub_image$cnt", array('jpg'), IMAGE_SIZE, false, NORMAL_SUBIMAGE_HEIGHT, NORMAL_SUBIMAGE_HEIGHT);  
    238         $objUpFile->addFile("¾ÜºÙ-¥µ¥Ö³ÈÂç²èÁü$cnt", "sub_large_image$cnt", array('jpg'), IMAGE_SIZE, false, LARGE_SUBIMAGE_HEIGHT, LARGE_SUBIMAGE_HEIGHT); 
    239     } 
    240     $objUpFile->addFile("¾¦ÉÊÈæ³Ó²èÁü", 'file1', array('jpg'), IMAGE_SIZE, false, NORMAL_IMAGE_HEIGHT, NORMAL_IMAGE_HEIGHT); 
    241     $objUpFile->addFile("¾¦Éʾܺ٥ե¡¥¤¥ë", 'file2', array('pdf'), PDF_SIZE, false, 0, 0, false); 
    242 } 
    243  
    244 /* µ¬³ÊÁªÂò¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ÎºîÀ® */ 
     237        $objUpFile->addFile("詳細-サブ画像$cnt", "sub_image$cnt", array('jpg'), IMAGE_SIZE, false, NORMAL_SUBIMAGE_HEIGHT, NORMAL_SUBIMAGE_HEIGHT);    
     238        $objUpFile->addFile("詳細-サブ拡大画像$cnt", "sub_large_image$cnt", array('jpg'), IMAGE_SIZE, false, LARGE_SUBIMAGE_HEIGHT, LARGE_SUBIMAGE_HEIGHT); 
     239    } 
     240    $objUpFile->addFile("商品比較画像", 'file1', array('jpg'), IMAGE_SIZE, false, NORMAL_IMAGE_HEIGHT, NORMAL_IMAGE_HEIGHT); 
     241    $objUpFile->addFile("商品詳細ファイル", 'file2', array('pdf'), PDF_SIZE, false, 0, 0, false); 
     242} 
     243 
     244/* 規格選択セレクトボックスの作成 */ 
    245245function lfMakeSelect($objPage, $product_id) { 
    246246    global $objPage; 
    247247    $classcat_find1 = false; 
    248248    $classcat_find2 = false; 
    249     // ºß¸Ë¤¢¤ê¤Î¾¦ÉʤÎ̵ͭ 
     249    // 在庫ありの商品の有無 
    250250    $stock_find = false; 
    251251     
    252     // µ¬³Ê̾°ìÍ÷ 
     252    // 規格名一覧 
    253253    $arrClassName = sfGetIDValueList("dtb_class", "class_id", "name"); 
    254     // µ¬³ÊʬÎà̾°ìÍ÷ 
     254    // 規格分類名一覧 
    255255    $arrClassCatName = sfGetIDValueList("dtb_classcategory", "classcategory_id", "name"); 
    256     // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ    
     256    // 商品規格情報の取得     
    257257    $arrProductsClass = lfGetProductsClass($product_id); 
    258258     
    259     // µ¬³Ê1¥¯¥é¥¹Ì¾¤Î¼èÆÀ 
     259    // 規格1クラス名の取得 
    260260    $objPage->tpl_class_name1 = $arrClassName[$arrProductsClass[0]['class_id1']]; 
    261     // µ¬³Ê2¥¯¥é¥¹Ì¾¤Î¼èÆÀ 
     261    // 規格2クラス名の取得 
    262262    $objPage->tpl_class_name2 = $arrClassName[$arrProductsClass[0]['class_id2']]; 
    263263     
    264     // ¤¹¤Ù¤Æ¤ÎÁȤ߹ç¤ï¤»¿ô  
     264    // すべての組み合わせ数    
    265265    $count = count($arrProductsClass); 
    266266     
     
    272272     
    273273    $list_id = 0; 
    274     $arrList[0] = "\tlist0 = new Array('ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤'"; 
     274    $arrList[0] = "\tlist0 = new Array('選択してください'"; 
    275275    $arrVal[0] = "\tval0 = new Array(''"; 
    276276     
    277277    for ($i = 0; $i < $count; $i++) { 
    278         // ºß¸Ë¤Î¥Á¥§¥Ã¥¯ 
     278        // 在庫のチェック 
    279279        if($arrProductsClass[$i]['stock'] <= 0 && $arrProductsClass[$i]['stock_unlimited'] != '1') { 
    280280            continue; 
     
    283283        $stock_find = true; 
    284284         
    285         // µ¬³Ê1¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ 
     285        // 規格1のセレクトボックス用 
    286286        if($classcat_id1 != $arrProductsClass[$i]['classcategory_id1']){ 
    287287            $arrList[$list_id].=");\n"; 
     
    291291        } 
    292292 
    293         // µ¬³Ê2¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ 
     293        // 規格2のセレクトボックス用 
    294294        if($arrProductsClass[$i]['classcategory_id1'] == $_POST['classcategory_id1'] and $classcat_id2 != $arrProductsClass[$i]['classcategory_id2']) { 
    295295            $classcat_id2 = $arrProductsClass[$i]['classcategory_id2']; 
     
    299299        $list_id++; 
    300300 
    301         // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹É½¼¨ÃÍ 
     301        // セレクトボックス表示値 
    302302        if($arrList[$list_id] == "") { 
    303             $arrList[$list_id] = "\tlist".$list_id." = new Array('ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤', '".$arrClassCatName[$classcat_id2]."'"; 
     303            $arrList[$list_id] = "\tlist".$list_id." = new Array('選択してください', '".$arrClassCatName[$classcat_id2]."'"; 
    304304        } else { 
    305305            $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."'"; 
    306306        } 
    307307         
    308         // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹POSTÃÍ 
     308        // セレクトボックスPOST値 
    309309        if($arrVal[$list_id] == "") { 
    310310            $arrVal[$list_id] = "\tval".$list_id." = new Array('', '".$classcat_id2."'"; 
     
    317317    $arrVal[$list_id].=");\n"; 
    318318         
    319     // µ¬³Ê1 
     319    // 規格1 
    320320    $objPage->arrClassCat1 = $arrSele1; 
    321321    $objPage->arrClassCat2 = $arrSele2; 
     
    349349    //$objPage->tpl_javascript.=$vals.");\n"; 
    350350     
    351     // ÁªÂò¤µ¤ì¤Æ¤¤¤ëµ¬³Ê2ID 
     351    // 選択されている規格2ID 
    352352    $objPage->tpl_onload = "lnSetSelect('form1', 'classcategory_id1', 'classcategory_id2', '" . $_POST['classcategory_id2'] . "');"; 
    353353 
    354     // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë 
     354    // 規格1が設定されている 
    355355    if($arrProductsClass[0]['classcategory_id1'] != '0') { 
    356356        $classcat_find1 = true; 
    357357    } 
    358358     
    359     // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë 
     359    // 規格2が設定されている 
    360360    if($arrProductsClass[0]['classcategory_id2'] != '0') { 
    361361        $classcat_find2 = true; 
     
    369369} 
    370370 
    371 /* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */ 
     371/* パラメータ情報の初期化 */ 
    372372function lfInitParam() { 
    373373    global $objFormParam; 
    374374 
    375     $objFormParam->addParam("µ¬³Ê1", "classcategory_id1", INT_LEN, "n", array("NUM_CHECK", "MAX_LENGTH_CHECK")); 
    376     $objFormParam->addParam("µ¬³Ê2", "classcategory_id2", INT_LEN, "n", array("NUM_CHECK", "MAX_LENGTH_CHECK")); 
    377     $objFormParam->addParam("¸Ä¿ô", "quantity", INT_LEN, "n", array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
    378 } 
    379  
    380 /* ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ */ 
     375    $objFormParam->addParam("規格1", "classcategory_id1", INT_LEN, "n", array("NUM_CHECK", "MAX_LENGTH_CHECK")); 
     376    $objFormParam->addParam("規格2", "classcategory_id2", INT_LEN, "n", array("NUM_CHECK", "MAX_LENGTH_CHECK")); 
     377    $objFormParam->addParam("個数", "quantity", INT_LEN, "n", array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
     378} 
     379 
     380/* 商品規格情報の取得 */ 
    381381function lfGetProductsClass($product_id) { 
    382382    $arrRet = array(); 
    383383    if(sfIsInt($product_id)) { 
    384         // ¾¦Éʵ¬³Ê¼èÆÀ 
     384        // 商品規格取得 
    385385        $objQuery = new SC_Query(); 
    386386        $col = "product_class_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited"; 
     
    393393} 
    394394 
    395 /* ÅÐÏ¿ºÑ¤ß¥ª¥¹¥¹¥á¾¦ÉʤÎÆɤ߹þ¤ß */ 
     395/* 登録済みオススメ商品の読み込み */ 
    396396function lfPreGetRecommendProducts($product_id) { 
    397397    $objQuery = new SC_Query(); 
     
    414414} 
    415415 
    416 /* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */ 
     416/* 入力内容のチェック */ 
    417417function lfCheckError() { 
    418418    global $objFormParam; 
    419419    global $objPage; 
    420     // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£ 
     420    // 入力データを渡す。 
    421421    $arrRet =  $objFormParam->getHashArray(); 
    422422    $objErr = new SC_CheckError($arrRet); 
    423423    $objErr->arrErr = $objFormParam->checkError(); 
    424424         
    425     // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯ 
     425    // 複数項目チェック 
    426426    if ($objPage->tpl_classcat_find1) { 
    427         $objErr->doFunc(array("µ¬³Ê1", "classcategory_id1"), array("EXIST_CHECK")); 
     427        $objErr->doFunc(array("規格1", "classcategory_id1"), array("EXIST_CHECK")); 
    428428    } 
    429429    if ($objPage->tpl_classcat_find2) { 
    430         $objErr->doFunc(array("µ¬³Ê2", "classcategory_id2"), array("EXIST_CHECK")); 
     430        $objErr->doFunc(array("規格2", "classcategory_id2"), array("EXIST_CHECK")); 
    431431    } 
    432432 
     
    434434} 
    435435 
    436 //±ÜÍ÷ÍúÎò¿·µ¬ÅÐÏ¿ 
     436//閲覧履歴新規登録 
    437437function lfRegistReadingData($tmp_id, $customer_id){ 
    438438    $objQuery = new SC_Query; 
     
    444444} 
    445445 
    446 //¤³¤Î¾¦ÉʤòÇã¤Ã¤¿¿Í¤Ï¤³¤ó¤Ê¾¦ÉʤâÇã¤Ã¤Æ¤¤¤Þ¤¹ 
     446//この商品を買った人はこんな商品も買っています 
    447447function lfGetRelateProducts($tmp_id) { 
    448448    $objQuery = new SC_Query; 
    449     //¼«Æ°Ãê½Ð 
     449    //自動抽出 
    450450    $objQuery->setorder("random()"); 
    451     //ɽ¼¨·ï¿ô¤ÎÀ©¸Â 
     451    //表示件数の制限 
    452452    $objQuery->setlimit(RELATED_PRODUCTS_MAX); 
    453     //¸¡º÷¾ò·ï 
     453    //検索条件 
    454454    $col = "name, main_list_image, price01_min, price02_min, price01_max, price02_max, point_rate"; 
    455455    $from = "vw_products_allclass AS allcls "; 
    456456    $where = "del_flg = 0 AND status = 1 AND (stock_max <> 0 OR stock_max IS NULL) AND product_id = ? "; 
    457457    $arrval[] = $tmp_id; 
    458     //·ë²Ì¤Î¼èÆÀ 
     458    //結果の取得 
    459459    $arrProducts = $objQuery->select($col, $from, $where, $arrval); 
    460460     
     
    462462} 
    463463 
    464 //¾¦Éʤ´¤È¤Î¥ì¥Ó¥å¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë 
     464//商品ごとのレビュー情報を取得する 
    465465function lfGetReviewData($id) { 
    466466    $objQuery = new SC_Query; 
    467     //¾¦Éʤ´¤È¤Î¥ì¥Ó¥å¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë 
     467    //商品ごとのレビュー情報を取得する 
    468468    $col = "create_date, reviewer_url, reviewer_name, recommend_level, title, comment"; 
    469469    $from = "dtb_review"; 
     
    474474} 
    475475 
    476 //»ÙʧÊýË¡¤Î¼èÆÀ 
    477 //payment_id    1:¥¯¥ì¥¸¥Ã¥È¡¡2:¥·¥ç¥Ã¥Ô¥ó¥°¥í¡¼¥ó   
     476//支払方法の取得 
     477//payment_id    1:クレジット 2:ショッピングローン  
    478478function lfGetPayment() { 
    479479    $objQuery = new SC_Query; 
  • branches/feature-module-update/html/mobile/products/list.php

    r12157 r15078  
    77 *  
    88 * 
    9  * ¥â¥Ð¥¤¥ë¥µ¥¤¥È/¾¦ÉÊ°ìÍ÷ 
     9 * モバイルサイト/商品一覧 
    1010 */ 
    1111 
     
    2323        $this->arrPRODUCTLISTMAX = $arrPRODUCTLISTMAX;       
    2424        /* 
    25          session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç 
    26          ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£ 
    27          private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£ 
     25         session_start時のno-cacheヘッダーを抑制することで 
     26         「戻る」ボタン使用時の有効期限切れ表示を抑制する。 
     27         private-no-expire:クライアントのキャッシュを許可する。 
    2828        */ 
    2929        session_cache_limiter('private-no-expire'); 
     
    3434$conn = new SC_DBConn(); 
    3535 
    36 //ɽ¼¨·ï¿ô¤ÎÁªÂò 
     36//表示件数の選択 
    3737if(sfIsInt($_REQUEST['disp_number'])) { 
    3838    $objPage->disp_number = $_REQUEST['disp_number']; 
    3939} else { 
    40     //ºÇ¾®É½¼¨·ï¿ô¤òÁªÂò 
     40    //最小表示件数を選択 
    4141    $objPage->disp_number = current(array_keys($arrPRODUCTLISTMAX)); 
    4242} 
    4343 
    44 //ɽ¼¨½ç½ø¤ÎÊݸ 
     44//表示順序の保存 
    4545$objPage->orderby = $_REQUEST['orderby']; 
    4646 
    47 // GET¤Î¥«¥Æ¥´¥êID¤ò¸µ¤ËÀµ¤·¤¤¥«¥Æ¥´¥êID¤ò¼èÆÀ¤¹¤ë¡£ 
     47// GETのカテゴリIDを元に正しいカテゴリIDを取得する。 
    4848$category_id = sfGetCategoryId("", $_GET['category_id']); 
    4949 
    50 // ¥¿¥¤¥È¥ëÊÔ½¸ 
     50// タイトル編集 
    5151$tpl_subtitle = ""; 
    5252$tpl_search_mode = false; 
    5353if($_GET['mode'] == 'search'){ 
    54     $tpl_subtitle = "¸¡º÷·ë²Ì"; 
     54    $tpl_subtitle = "検索結果"; 
    5555    $tpl_search_mode = true; 
    5656}elseif ($category_id == "" ) { 
    57     $tpl_subtitle = "Á´¾¦ÉÊ"; 
     57    $tpl_subtitle = "全商品"; 
    5858}else{ 
    5959    $arrFirstCat = sfGetFirstCat($category_id); 
     
    6464$count = $objQuery->count("dtb_best_products", "category_id = ?", array($category_id)); 
    6565 
    66 // °Ê²¼¤Î¾ò·ï¤ÇBEST¾¦Éʤòɽ¼¨¤¹¤ë 
    67 // ¡¦BESTºÇÂç¿ô¤Î¾¦Éʤ¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¡£ 
    68 // ¡¦¥«¥Æ¥´¥êID¤¬¥ë¡¼¥ÈID¤Ç¤¢¤ë¡£ 
    69 // ¡¦¸¡º÷¥â¡¼¥É¤Ç¤Ê¤¤¡£ 
     66// 以下の条件でBEST商品を表示する 
     67// ・BEST最大数の商品が登録されている。 
     68// ・カテゴリIDがルートIDである。 
     69// ・検索モードでない。 
    7070if(($count >= BEST_MIN) && lfIsRootCategory($category_id) && ($_GET['mode'] != 'search') ) { 
    71     // ¾¦ÉÊTOP¤Îɽ¼¨½èÍý 
    72     /** ɬ¤º»ØÄꤹ¤ë **/ 
    73     $objPage->tpl_mainpage = "products/list.tpl";       // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È    
     71    // 商品TOPの表示処理 
     72    /** 必ず指定する **/ 
     73    $objPage->tpl_mainpage = "products/list.tpl";       // メインテンプレート     
    7474     
    7575    $objPage->arrBestItems = sfGetBestProducts($conn, $category_id); 
     
    7777} else { 
    7878    if ($_GET['mode'] == 'search' && strlen($_GET['category_id']) == 0 ){ 
    79         // ¸¡º÷»þ¤Ëcategory_id¤¬GET¤Ë¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢²¾¤ËËä¤á¤¿ID¤ò¶õÇò¤ËÌ᤹ 
     79        // 検索時にcategory_idがGETに存在しない場合は、仮に埋めたIDを空白に戻す 
    8080        $category_id = '';   
    8181    } 
    8282     
    83     // ¾¦ÉÊ°ìÍ÷¤Îɽ¼¨½èÍý 
     83    // 商品一覧の表示処理 
    8484    $objPage = lfDispProductsList($category_id, $_GET['name'], $objPage->disp_number, $_REQUEST['orderby']); 
    8585     
    86     // ¸¡º÷¾ò·ï¤ò²èÌ̤Ëɽ¼¨ 
    87     // ¥«¥Æ¥´¥ê¡¼¸¡º÷¾ò·ï 
     86    // 検索条件を画面に表示 
     87    // カテゴリー検索条件 
    8888    if (strlen($_GET['category_id']) == 0) { 
    89         $arrSearch['category'] = "»ØÄê¤Ê¤·"; 
     89        $arrSearch['category'] = "指定なし"; 
    9090    }else{ 
    9191        $arrCat = $conn->getOne("SELECT category_name FROM dtb_category WHERE category_id = ?",array($category_id)); 
     
    9393    } 
    9494     
    95     // ¾¦ÉÊ̾¸¡º÷¾ò·ï 
     95    // 商品名検索条件 
    9696    if ($_GET['name'] === "") { 
    97         $arrSearch['name'] = "»ØÄê¤Ê¤·"; 
     97        $arrSearch['name'] = "指定なし"; 
    9898    }else{ 
    9999        $arrSearch['name'] = $_GET['name']; 
     
    101101} 
    102102 
    103 // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ 
     103// レイアウトデザインを取得 
    104104$objPage = sfGetPageLayout($objPage, false, "products/list.php"); 
    105105 
    106106if($_POST['mode'] == "cart" && $_POST['product_id'] != "") { 
    107     // ÃͤÎÀµÅöÀ­¥Á¥§¥Ã¥¯ 
     107    // 値の正当性チェック 
    108108    if(!sfIsInt($_POST['product_id']) || !sfIsRecord("dtb_products", "product_id", $_POST['product_id'], "del_flg = 0 AND status = 1")) { 
    109109        sfDispSiteError(PRODUCT_NOT_FOUND, "", false, "", true); 
    110110    } else { 
    111         // ÆþÎÏÃͤÎÊÑ´¹ 
     111        // 入力値の変換 
    112112        $objPage->arrErr = lfCheckError($_POST['product_id']); 
    113113        if(count($objPage->arrErr) == 0) { 
     
    117117            $classcategory_id2 = $_POST[$classcategory_id. '_2']; 
    118118            $quantity = "quantity". $_POST['product_id']; 
    119             // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç 
     119            // 規格1が設定されていない場合 
    120120            if(!$objPage->tpl_classcat_find1[$_POST['product_id']]) { 
    121121                $classcategory_id1 = '0'; 
    122122            } 
    123             // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç 
     123            // 規格2が設定されていない場合 
    124124            if(!$objPage->tpl_classcat_find2[$_POST['product_id']]) { 
    125125                $classcategory_id2 = '0'; 
     
    134134 
    135135 
    136 // ¥Ú¡¼¥¸Á÷¤êµ¡Ç½ÍѤÎURL¤òºîÀ®¤¹¤ë¡£ 
     136// ページ送り機能用のURLを作成する。 
    137137$objURL = new Net_URL($_SERVER['PHP_SELF']); 
    138138foreach ($_REQUEST as $key => $value) { 
     
    156156$objPage->tpl_search_mode = $tpl_search_mode; 
    157157 
    158 // »ÙʧÊýË¡¤Î¼èÆÀ 
     158// 支払方法の取得 
    159159$objPage->arrPayment = lfGetPayment(); 
    160 // ÆþÎϾðÊó¤òÅϤ¹ 
     160// 入力情報を渡す 
    161161$objPage->arrForm = $_POST; 
    162162 
     
    167167 
    168168//----------------------------------------------------------------------------------------------------------------------------------- 
    169 /* ¥«¥Æ¥´¥êID¤¬¥ë¡¼¥È¤«¤É¤¦¤«¤ÎȽÄê */ 
     169/* カテゴリIDがルートかどうかの判定 */ 
    170170function lfIsRootCategory($category_id) { 
    171171    $objQuery = new SC_Query(); 
     
    177177} 
    178178 
    179 /* ¾¦ÉÊ°ìÍ÷¤Îɽ¼¨ */ 
     179/* 商品一覧の表示 */ 
    180180function lfDispProductsList($category_id, $name, $disp_num, $orderby) { 
    181181    global $objPage; 
     
    183183    $objPage->tpl_pageno = $_REQUEST['pageno']; 
    184184 
    185     //ɽ¼¨·ï¿ô¤Ç¥Æ¥ó¥×¥ì¡¼¥È¤òÀÚ¤êÂؤ¨¤ë 
    186     $objPage->tpl_mainpage = "products/list.tpl";       // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È        
    187  
    188     //ɽ¼¨½ç½ø 
     185    //表示件数でテンプレートを切り替える 
     186    $objPage->tpl_mainpage = "products/list.tpl";       // メインテンプレート         
     187 
     188    //表示順序 
    189189    switch($orderby) { 
    190     //²Á³Ê½ç 
     190    //価格順 
    191191    case 'price': 
    192192        $order = "price02_min ASC"; 
    193193        break; 
    194     //¿·Ãå½ç 
     194    //新着順 
    195195    case 'date': 
    196196        $order = "create_date DESC"; 
     
    201201    } 
    202202     
    203     // ¾¦Éʸ¡º÷¾ò·ï¤ÎºîÀ®¡Ê̤ºï½ü¡¢É½¼¨¡Ë 
     203    // 商品検索条件の作成(未削除、表示) 
    204204    $where = "del_flg = 0 AND status = 1 "; 
    205     // ¥«¥Æ¥´¥ê¤«¤é¤ÎWHEREʸ»úÎó¼èÆÀ 
     205    // カテゴリからのWHERE文字列取得 
    206206    if ( $category_id ) { 
    207207        $where .= 'AND category_id = ?'; 
     
    209209    } 
    210210         
    211     // ¾¦ÉÊ̾¤òwhereʸ¤Ë 
     211    // 商品名をwhere文に 
    212212    $name = ereg_replace(",", "", $name); 
    213213    if ( strlen($name) > 0 ){ 
     
    218218    } 
    219219             
    220     // ¹Ô¿ô¤Î¼èÆÀ 
     220    // 行数の取得 
    221221    $linemax = $objQuery->count("vw_products_allclass AS allcls", $where, $arrval); 
    222     $objPage->tpl_linemax = $linemax;   // ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ 
    223      
    224     // ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ 
     222    $objPage->tpl_linemax = $linemax;   // 何件が該当しました。表示用 
     223     
     224    // ページ送りの取得 
    225225    $objNavi = new SC_PageNavi($_REQUEST['pageno'], $linemax, $disp_num, "fnNaviPage", NAVI_PMAX); 
    226226     
    227227    $strnavi = $objNavi->strnavi; 
    228228    $strnavi = str_replace('onclick="fnNaviPage', 'onclick="form1.mode.value=\''.'\'; fnNaviPage', $strnavi); 
    229     $objPage->tpl_strnavi = $strnavi;       // ɽ¼¨Ê¸»úÎó 
    230     $startno = $objNavi->start_row;                 // ³«»Ï¹Ô 
    231      
    232     // ¼èÆÀÈϰϤλØÄê(³«»Ï¹ÔÈֹ桢¹Ô¿ô¤Î¥»¥Ã¥È) 
     229    $objPage->tpl_strnavi = $strnavi;       // 表示文字列 
     230    $startno = $objNavi->start_row;                 // 開始行 
     231     
     232    // 取得範囲の指定(開始行番号、行数のセット) 
    233233    $objQuery->setlimitoffset($disp_num, $startno); 
    234     // ɽ¼¨½ç½ø 
     234    // 表示順序 
    235235    $objQuery->setorder($order); 
    236     // ¸¡º÷·ë²Ì¤Î¼èÆÀ 
     236    // 検索結果の取得 
    237237    $objPage->arrProducts = $objQuery->select("*", "vw_products_allclass AS allcls", $where, $arrval); 
    238238     
    239     // µ¬³Ê̾°ìÍ÷ 
     239    // 規格名一覧 
    240240    $arrClassName = sfGetIDValueList("dtb_class", "class_id", "name"); 
    241     // µ¬³ÊʬÎà̾°ìÍ÷ 
     241    // 規格分類名一覧 
    242242    $arrClassCatName = sfGetIDValueList("dtb_classcategory", "classcategory_id", "name"); 
    243     // ´ë²è¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÀßÄê 
     243    // 企画セレクトボックス設定 
    244244    if($disp_num == 15) { 
    245245        for($i = 0; $i < count($objPage->arrProducts); $i++) { 
    246246            $objPage = lfMakeSelect($objPage->arrProducts[$i]['product_id'], $arrClassName, $arrClassCatName); 
    247             // ¹ØÆþÀ©¸Â¿ô¤ò¼èÆÀ 
     247            // 購入制限数を取得 
    248248            $objPage = lfGetSaleLimit($objPage->arrProducts[$i]); 
    249249        } 
     
    254254} 
    255255 
    256 /* µ¬³Ê¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ÎºîÀ® */ 
     256/* 規格セレクトボックスの作成 */ 
    257257function lfMakeSelect($product_id, $arrClassName, $arrClassCatName) { 
    258258    global $objPage; 
     
    260260    $classcat_find1 = false; 
    261261    $classcat_find2 = false; 
    262     // ºß¸Ë¤¢¤ê¤Î¾¦ÉʤÎ̵ͭ 
     262    // 在庫ありの商品の有無 
    263263    $stock_find = false; 
    264264     
    265     // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ    
     265    // 商品規格情報の取得     
    266266    $arrProductsClass = lfGetProductsClass($product_id); 
    267267     
    268     // µ¬³Ê1¥¯¥é¥¹Ì¾¤Î¼èÆÀ 
     268    // 規格1クラス名の取得 
    269269    $objPage->tpl_class_name1[$product_id] = $arrClassName[$arrProductsClass[0]['class_id1']]; 
    270     // µ¬³Ê2¥¯¥é¥¹Ì¾¤Î¼èÆÀ 
     270    // 規格2クラス名の取得 
    271271    $objPage->tpl_class_name2[$product_id] = $arrClassName[$arrProductsClass[0]['class_id2']]; 
    272272     
    273     // ¤¹¤Ù¤Æ¤ÎÁȤ߹ç¤ï¤»¿ô  
     273    // すべての組み合わせ数    
    274274    $count = count($arrProductsClass); 
    275275     
     
    280280     
    281281    $list_id = 0; 
    282     $arrList[0] = "\tlist". $product_id. "_0 = new Array('ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤'"; 
     282    $arrList[0] = "\tlist". $product_id. "_0 = new Array('選択してください'"; 
    283283    $arrVal[0] = "\tval". $product_id. "_0 = new Array(''"; 
    284284     
    285285    for ($i = 0; $i < $count; $i++) { 
    286         // ºß¸Ë¤Î¥Á¥§¥Ã¥¯ 
     286        // 在庫のチェック 
    287287        if($arrProductsClass[$i]['stock'] <= 0 && $arrProductsClass[$i]['stock_unlimited'] != '1') { 
    288288            continue; 
     
    291291        $stock_find = true; 
    292292         
    293         // µ¬³Ê1¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ 
     293        // 規格1のセレクトボックス用 
    294294        if($classcat_id1 != $arrProductsClass[$i]['classcategory_id1']){ 
    295295            $arrList[$list_id].=");\n"; 
     
    300300        } 
    301301         
    302         // µ¬³Ê2¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ 
     302        // 規格2のセレクトボックス用 
    303303        $classcat_id2 = $arrProductsClass[$i]['classcategory_id2']; 
    304304         
    305         // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹É½¼¨ÃÍ 
     305        // セレクトボックス表示値 
    306306        if($arrList[$list_id] == "") { 
    307             $arrList[$list_id] = "\tlist". $product_id. "_". $list_id. " = new Array('ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤', '". $arrClassCatName[$classcat_id2]. "'"; 
     307            $arrList[$list_id] = "\tlist". $product_id. "_". $list_id. " = new Array('選択してください', '". $arrClassCatName[$classcat_id2]. "'"; 
    308308        } else { 
    309309            $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."'"; 
    310310        } 
    311311         
    312         // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹POSTÃÍ 
     312        // セレクトボックスPOST値 
    313313        if($arrVal[$list_id] == "") { 
    314314            $arrVal[$list_id] = "\tval". $product_id. "_". $list_id. " = new Array('', '". $classcat_id2. "'"; 
     
    321321    $arrVal[$list_id].=");\n"; 
    322322         
    323     // µ¬³Ê1 
     323    // 規格1 
    324324    $objPage->arrClassCat1[$product_id] = $arrSele; 
    325325     
     
    350350    $objPage->tpl_javascript.= $vals.");\n"; 
    351351     
    352     // ÁªÂò¤µ¤ì¤Æ¤¤¤ëµ¬³Ê2ID 
     352    // 選択されている規格2ID 
    353353    $classcategory_id = "classcategory_id". $product_id; 
    354354    $objPage->tpl_onload .= "lnSetSelect('".$classcategory_id."_1','".$classcategory_id."_2','".$product_id."','".$_POST[$classcategory_id."_2"]."'); "; 
    355355 
    356     // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë 
     356    // 規格1が設定されている 
    357357    if($arrProductsClass[0]['classcategory_id1'] != '0') { 
    358358        $classcat_find1 = true; 
    359359    } 
    360360     
    361     // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë 
     361    // 規格2が設定されている 
    362362    if($arrProductsClass[0]['classcategory_id2'] != '0') { 
    363363        $classcat_find2 = true; 
     
    370370    return $objPage; 
    371371} 
    372 /* ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ */ 
     372/* 商品規格情報の取得 */ 
    373373function lfGetProductsClass($product_id) { 
    374374    $arrRet = array(); 
    375375    if(sfIsInt($product_id)) { 
    376         // ¾¦Éʵ¬³Ê¼èÆÀ 
     376        // 商品規格取得 
    377377        $objQuery = new SC_Query(); 
    378378        $col = "product_class_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited"; 
     
    385385} 
    386386 
    387 /* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */ 
     387/* 入力内容のチェック */ 
    388388function lfCheckError($id) { 
    389389    global $objPage; 
    390390     
    391     // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£ 
     391    // 入力データを渡す。 
    392392    $objErr = new SC_CheckError(); 
    393393     
     
    395395    $classcategory_id2 = "classcategory_id". $id. "_2"; 
    396396    $quantity = "quantity". $id; 
    397     // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯ 
     397    // 複数項目チェック 
    398398    if ($objPage->tpl_classcat_find1[$id]) { 
    399         $objErr->doFunc(array("µ¬³Ê1", $classcategory_id1, INT_LEN), array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
     399        $objErr->doFunc(array("規格1", $classcategory_id1, INT_LEN), array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
    400400    } 
    401401    if ($objPage->tpl_classcat_find2[$id]) { 
    402         $objErr->doFunc(array("µ¬³Ê2", $classcategory_id2, INT_LEN), array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
    403     } 
    404     $objErr->doFunc(array("¸Ä¿ô", $quantity, INT_LEN), array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
     402        $objErr->doFunc(array("規格2", $classcategory_id2, INT_LEN), array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
     403    } 
     404    $objErr->doFunc(array("個数", $quantity, INT_LEN), array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
    405405             
    406406    return $objErr->arrErr; 
    407407} 
    408408 
    409 // ¹ØÆþÀ©¸Â¿ô¤ÎÀßÄê 
     409// 購入制限数の設定 
    410410function lfGetSaleLimit($product) { 
    411411    global $objPage; 
    412     //ºß¸Ë¤¬Ìµ¸Â¤Þ¤¿¤Ï¹ØÆþÀ©¸ÂÃͤ¬ÀßÄêÃͤè¤êÂ礭¤¤¾ì¹ç 
     412    //在庫が無限または購入制限値が設定値より大きい場合 
    413413    if($product['sale_unlimited'] == 1 || $product['sale_limit'] > SALE_LIMIT_MAX) { 
    414414        $objPage->tpl_sale_limit[$product['product_id']] = SALE_LIMIT_MAX; 
     
    420420} 
    421421 
    422 //»ÙʧÊýË¡¤Î¼èÆÀ 
    423 //payment_id    1:Âå¶â°ú´¹¡¡2:¶ä¹Ô¿¶¤ê¹þ¤ß¡¡3:¸½¶â½ñα 
     422//支払方法の取得 
     423//payment_id    1:代金引換 2:銀行振り込み 3:現金書留 
    424424function lfGetPayment() { 
    425425    $objQuery = new SC_Query; 
  • branches/feature-module-update/html/mobile/products/search.php

    r12157 r15078  
    77 *  
    88 * 
    9  * ¥â¥Ð¥¤¥ë¥µ¥¤¥È/¾¦Éʸ¡º÷¥Õ¥©¡¼¥à 
     9 * モバイルサイト/商品検索フォーム 
    1010 */ 
    1111 
     
    1414class LC_Page { 
    1515    function LC_Page() { 
    16         /** ɬ¤º»ØÄꤹ¤ë **/ 
    17         $this->tpl_mainpage = 'products/search.tpl';            // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È 
    18         $this->tpl_title = '¾¦Éʸ¡º÷'; 
     16        /** 必ず指定する **/ 
     17        $this->tpl_mainpage = 'products/search.tpl';            // メインテンプレート 
     18        $this->tpl_title = '商品検索'; 
    1919    } 
    2020} 
     
    2323$objView = new SC_MobileView(); 
    2424 
    25 // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ 
     25// レイアウトデザインを取得 
    2626$objPage = sfGetPageLayout($objPage, false, DEF_LAYOUT); 
    2727 
Note: See TracChangeset for help on using the changeset viewer.