Changeset 15078 for branches/feature-module-update/html/mobile/products
- Timestamp:
- 2007/07/20 15:58:59 (16 years ago)
- 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
-
Property
svn:ignore
set to
-
branches/feature-module-update/html/mobile/products/category_list.php
r12157 r15078 7 7 * 8 8 * 9 * ¥â¥Ð¥¤¥ë¥µ¥¤¥È/¥«¥Æ¥´¥ê¡¼°ìÍ÷9 * モバイルサイト/カテゴリー一覧 10 10 */ 11 11 … … 14 14 class LC_Page { 15 15 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 = 'カテゴリ一覧ページ'; 19 19 } 20 20 } … … 23 23 $objView = new SC_MobileView(); 24 24 25 // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ25 // レイアウトデザインを取得 26 26 $objPage = sfGetPageLayout($objPage, false, DEF_LAYOUT); 27 27 28 // ¥«¥Æ¥´¥ê¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£28 // カテゴリー情報を取得する。 29 29 lfGetCategories(@$_GET['category_id'], true, $objPage); 30 30 … … 35 35 36 36 /** 37 * ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤È¤½¤Î»Ò¥«¥Æ¥´¥ê¡¼¤Î¾ðÊó¤ò¼èÆÀ¤·¡¢38 * ¥Ú¡¼¥¸¥ª¥Ö¥¸¥§¥¯¥È¤Ë³ÊǼ¤¹¤ë¡£37 * 選択されたカテゴリーとその子カテゴリーの情報を取得し、 38 * ページオブジェクトに格納する。 39 39 * 40 * @param string $category_id ¥«¥Æ¥´¥ê¡¼ID41 * @param boolean $count_check ͸ú¤Ê¾¦Éʤ¬¤Ê¤¤¥«¥Æ¥´¥ê¡¼¤ò½ü¤¯¤«¤É¤¦¤«42 * @param object &$objPage ¥Ú¡¼¥¸¥ª¥Ö¥¸¥§¥¯¥È40 * @param string $category_id カテゴリーID 41 * @param boolean $count_check 有効な商品がないカテゴリーを除くかどうか 42 * @param object &$objPage ページオブジェクト 43 43 * @return void 44 44 */ 45 45 function lfGetCategories($category_id, $count_check = false, &$objPage) { 46 // ¥«¥Æ¥´¥ê¡¼¤ÎÀµ¤·¤¤ID¤ò¼èÆÀ¤¹¤ë¡£46 // カテゴリーの正しいIDを取得する。 47 47 $category_id = sfGetCategoryId('', $category_id); 48 48 if ($category_id == 0) { … … 50 50 } 51 51 52 $arrCategory = null; // ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼53 $arrChildren = array(); // »Ò¥«¥Æ¥´¥ê¡¼52 $arrCategory = null; // 選択されたカテゴリー 53 $arrChildren = array(); // 子カテゴリー 54 54 55 55 $arrAll = sfGetCatTree($category_id, $count_check); 56 56 foreach ($arrAll as $category) { 57 // ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤Î¾ì¹ç57 // 選択されたカテゴリーの場合 58 58 if ($category['category_id'] == $category_id) { 59 59 $arrCategory = $category; … … 61 61 } 62 62 63 // ´Ø·¸¤Î¤Ê¤¤¥«¥Æ¥´¥ê¡¼¤Ï¥¹¥¥Ã¥×¤¹¤ë¡£63 // 関係のないカテゴリーはスキップする。 64 64 if ($category['parent_category_id'] != $category_id) { 65 65 continue; 66 66 } 67 67 68 // »Ò¥«¥Æ¥´¥ê¡¼¤Î¾ì¹ç¤Ï¡¢Â¹¥«¥Æ¥´¥ê¡¼¤¬Â¸ºß¤¹¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£68 // 子カテゴリーの場合は、孫カテゴリーが存在するかどうかを調べる。 69 69 $arrGrandchildrenID = sfGetUnderChildrenArray($arrAll, 'parent_category_id', 'category_id', $category['category_id']); 70 70 $category['has_children'] = count($arrGrandchildrenID) > 0; … … 76 76 } 77 77 78 // »Ò¥«¥Æ¥´¥ê¡¼¤Î¾¦ÉÊ¿ô¤ò¹ç·×¤¹¤ë¡£78 // 子カテゴリーの商品数を合計する。 79 79 $children_product_count = 0; 80 80 foreach ($arrChildren as $category) { … … 82 82 } 83 83 84 // ÁªÂò¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¤Ëľ°¤Î¾¦Éʤ¬¤¢¤ë¾ì¹ç¤Ï¡¢»Ò¥«¥Æ¥´¥ê¡¼¤ÎÀèÆ¬¤ËÄɲ乤롣84 // 選択されたカテゴリーに直属の商品がある場合は、子カテゴリーの先頭に追加する。 85 85 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; // 商品一覧ページに遷移させるため。 88 88 array_unshift($arrChildren, $arrCategory); 89 89 } 90 90 91 // ·ë²Ì¤ò³ÊǼ¤¹¤ë¡£91 // 結果を格納する。 92 92 $objPage->arrCategory = $arrCategory; 93 93 $objPage->arrChildren = $arrChildren; -
branches/feature-module-update/html/mobile/products/detail.php
r12157 r15078 12 12 class LC_Page { 13 13 function LC_Page() { 14 /** ɬ¤º»ØÄꤹ¤ë**/14 /** 必ず指定する **/ 15 15 global $arrSTATUS; 16 16 $this->arrSTATUS = $arrSTATUS; … … 25 25 26 26 /* 27 session_start »þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç28 ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤Î͸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£29 private-no-expire: ¥¯¥é¥¤¥¢¥ó¥È¤Î¥¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£27 session_start時のno-cacheヘッダーを抑制することで 28 「戻る」ボタン使用時の有効期限切れ表示を抑制する。 29 private-no-expire:クライアントのキャッシュを許可する。 30 30 */ 31 31 session_cache_limiter('private-no-expire'); … … 38 38 $objQuery = new SC_Query(); 39 39 40 // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ40 // レイアウトデザインを取得 41 41 $objPage = sfGetPageLayout($objPage, false, "products/detail.php"); 42 42 43 // ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹43 // パラメータ管理クラス 44 44 $objFormParam = new SC_FormParam(); 45 // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½45 // パラメータ情報の初期化 46 46 lfInitParam(); 47 // POST ÃͤμèÆÀ47 // POST値の取得 48 48 $objFormParam->setParam($_POST); 49 49 50 // ¥Õ¥¡¥¤¥ë´ÉÍý¥¯¥é¥¹50 // ファイル管理クラス 51 51 $objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR); 52 // ¥Õ¥¡¥¤¥ë¾ðÊó¤Î½é´ü²½52 // ファイル情報の初期化 53 53 lfInitFile(); 54 54 55 // ´ÉÍý¥Ú¡¼¥¸¤«¤é¤Î³Îǧ¤Î¾ì¹ç¤Ï¡¢Èó¸ø³«¤Î¾¦Éʤâɽ¼¨¤¹¤ë¡£55 // 管理ページからの確認の場合は、非公開の商品も表示する。 56 56 if($_GET['admin'] == 'on') { 57 57 $where = "del_flg = 0"; … … 66 66 } 67 67 68 // ÃͤÎÀµÅöÀ¥Á¥§¥Ã¥¯68 // 値の正当性チェック 69 69 if(!sfIsInt($_GET['product_id']) || !sfIsRecord("dtb_products", "product_id", $tmp_id, $where)) { 70 70 sfDispSiteError(PRODUCT_NOT_FOUND, "", false, "", true); 71 71 } 72 // ¥í¥°¥¤¥óȽÄê72 // ログイン判定 73 73 if($objCustomer->isLoginSuccess()) { 74 // ¤ªµ¤¤ËÆþ¤ê¥Ü¥¿¥óɽ¼¨74 //お気に入りボタン表示 75 75 $objPage->tpl_login = true; 76 76 77 /* ±ÜÍ÷¥í¥°µ¡Ç½¤Ï¸½ºß̤»ÈÍÑ77 /* 閲覧ログ機能は現在未使用 78 78 79 79 $table = "dtb_customer_reading"; 80 80 $where = "customer_id = ? "; 81 81 $arrval[] = $objCustomer->getValue('customer_id'); 82 // ¸ÜµÒ¤Î±ÜÍ÷¾¦ÉÊ¿ô82 //顧客の閲覧商品数 83 83 $rpcnt = $objQuery->count($table, $where, $arrval); 84 84 85 // ±ÜÍ÷¿ô¤¬ÀßÄê¿ô°Ê²¼85 //閲覧数が設定数以下 86 86 if ($rpcnt < CUSTOMER_READING_MAX){ 87 // ±ÜÍ÷ÍúÎò¤Ë¿·µ¬ÄɲÃ87 //閲覧履歴に新規追加 88 88 lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id')); 89 89 } else { 90 // ±ÜÍ÷ÍúÎò¤ÎÃæ¤Ç°ìÈָŤ¤¤â¤Î¤òºï½ü¤·¤Æ¿·µ¬ÄɲÃ90 //閲覧履歴の中で一番古いものを削除して新規追加 91 91 $oldsql = "SELECT MIN(update_date) FROM ".$table." WHERE customer_id = ?"; 92 92 $old = $objQuery->getone($oldsql, array($objCustomer->getValue("customer_id"))); 93 93 $where = "customer_id = ? AND update_date = ? "; 94 94 $arrval = array($objCustomer->getValue("customer_id"), $old); 95 // ºï½ü95 //削除 96 96 $objQuery->delete($table, $where, $arrval); 97 // ÄɲÃ97 //追加 98 98 lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id')); 99 99 } … … 102 102 103 103 104 // µ¬³ÊÁªÂò¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ÎºîÀ®104 // 規格選択セレクトボックスの作成 105 105 $objPage = lfMakeSelect($objPage, $tmp_id); 106 106 107 // ¾¦ÉÊID¤òFORMÆâ¤ËÊÝ»ý¤¹¤ë¡£107 // 商品IDをFORM内に保持する。 108 108 $objPage->tpl_product_id = $tmp_id; 109 109 110 110 switch($_POST['mode']) { 111 111 case 'select': 112 // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç112 // 規格1が設定されている場合 113 113 if($objPage->tpl_classcat_find1) { 114 // template ¤ÎÊѹ¹114 // templateの変更 115 115 $objPage->tpl_mainpage = "products/select_find1.tpl"; 116 116 break; … … 120 120 $objPage->arrErr = lfCheckError(); 121 121 122 // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç122 // 規格1が設定されている場合 123 123 if($objPage->tpl_classcat_find1 and $objPage->arrErr['classcategory_id1']) { 124 // template ¤ÎÊѹ¹124 // templateの変更 125 125 $objPage->tpl_mainpage = "products/select_find1.tpl"; 126 126 break; 127 127 } 128 128 129 // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç129 // 規格2が設定されている場合 130 130 if($objPage->tpl_classcat_find2) { 131 131 $objPage->arrErr = array(); … … 138 138 $objPage->arrErr = lfCheckError(); 139 139 140 // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç140 // 規格1が設定されている場合 141 141 if($objPage->tpl_classcat_find2 and $objPage->arrErr['classcategory_id2']) { 142 // template ¤ÎÊѹ¹142 // templateの変更 143 143 $objPage->tpl_mainpage = "products/select_find2.tpl"; 144 144 break; 145 145 } 146 // ¾¦ÉÊ¿ô¤ÎÁªÂò¤ò¹Ô¤¦146 // 商品数の選択を行う 147 147 $objPage->tpl_mainpage = "products/select_item.tpl"; 148 148 break; 149 149 150 150 case 'cart': 151 // ÆþÎÏÃͤÎÊÑ´¹151 // 入力値の変換 152 152 $objFormParam->convParam(); 153 153 $objPage->arrErr = lfCheckError(); … … 157 157 $classcategory_id2 = $_POST['classcategory_id2']; 158 158 159 // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç159 // 規格1が設定されていない場合 160 160 if(!$objPage->tpl_classcat_find1) { 161 161 $classcategory_id1 = '0'; 162 162 } 163 163 164 // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç164 // 規格2が設定されていない場合 165 165 if(!$objPage->tpl_classcat_find2) { 166 166 $classcategory_id2 = '0'; … … 181 181 182 182 $objQuery = new SC_Query(); 183 // DB ¤«¤é¾¦ÉʾðÊó¤ò¼èÆÀ¤¹¤ë¡£183 // DBから商品情報を取得する。 184 184 $arrRet = $objQuery->select("*", "vw_products_allclass_detail AS alldtl", "product_id = ?", array($tmp_id)); 185 185 $objPage->arrProduct = $arrRet[0]; 186 186 187 // ¾¦ÉÊ¥³¡¼¥É¤Î¼èÆÀ187 // 商品コードの取得 188 188 $code_sql = "SELECT product_code FROM dtb_products_class AS prdcls WHERE prdcls.product_id = ? GROUP BY product_code ORDER BY product_code"; 189 189 $arrProductCode = $objQuery->getall($code_sql, array($tmp_id)); … … 191 191 $objPage->arrProductCode = $arrProductCode["product_code"]; 192 192 193 // ¹ØÆþÀ©¸Â¿ô¤ò¼èÆÀ193 // 購入制限数を取得 194 194 if($objPage->arrProduct['sale_unlimited'] == 1 || $objPage->arrProduct['sale_limit'] > SALE_LIMIT_MAX) { 195 195 $objPage->tpl_sale_limit = SALE_LIMIT_MAX; … … 198 198 } 199 199 200 // ¥µ¥Ö¥¿¥¤¥È¥ë¤ò¼èÆÀ200 // サブタイトルを取得 201 201 $arrFirstCat = sfGetFirstCat($arrRet[0]['category_id']); 202 202 $tpl_subtitle = $arrFirstCat['name']; 203 203 $objPage->tpl_subtitle = $tpl_subtitle; 204 204 205 // DB ¤«¤é¤Î¥Ç¡¼¥¿¤ò°ú¤·Ñ¤°205 // DBからのデータを引き継ぐ 206 206 $objUpFile->setDBFileList($objPage->arrProduct); 207 // ¥Õ¥¡¥¤¥ëɽ¼¨ÍÑÇÛÎó¤òÅϤ¹207 // ファイル表示用配列を渡す 208 208 $objPage->arrFile = $objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL, true); 209 // »ÙʧÊýË¡¤Î¼èÆÀ209 // 支払方法の取得 210 210 $objPage->arrPayment = lfGetPayment(); 211 // ÆþÎϾðÊó¤òÅϤ¹211 // 入力情報を渡す 212 212 $objPage->arrForm = $objFormParam->getFormParamList(); 213 // ¥ì¥Ó¥å¡¼¾ðÊó¤Î¼èÆÀ213 //レビュー情報の取得 214 214 $objPage->arrReview = lfGetReviewData($tmp_id); 215 // ¥¿¥¤¥È¥ë¤Ë¾¦ÉÊ̾¤òÆþ¤ì¤ë216 $objPage->tpl_title = " ¾¦ÉʾܺÙ". $objPage->arrProduct["name"];217 // ¥ª¥¹¥¹¥á¾¦ÉʾðÊóɽ¼¨215 // タイトルに商品名を入れる 216 $objPage->tpl_title = "商品詳細 ". $objPage->arrProduct["name"]; 217 //オススメ商品情報表示 218 218 $objPage->arrRecommend = lfPreGetRecommendProducts($tmp_id); 219 // ¤³¤Î¾¦ÉʤòÇã¤Ã¤¿¿Í¤Ï¤³¤ó¤Ê¾¦ÉʤâÇã¤Ã¤Æ¤¤¤Þ¤¹219 //この商品を買った人はこんな商品も買っています 220 220 $objPage->arrRelateProducts = lfGetRelateProducts($tmp_id); 221 221 222 // ³ÈÂç²èÁü¤Î¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤ò¥»¥Ã¥È222 // 拡大画像のウィンドウサイズをセット 223 223 list($large_width, $large_height) = getimagesize(IMAGE_SAVE_DIR . basename($objPage->arrFile["main_large_image"]["filepath"])); 224 224 $objPage->tpl_large_width = $large_width + 60; … … 228 228 $objView->display(SITE_FRAME); 229 229 //----------------------------------------------------------------------------------------------------------------------------------- 230 /* ¥Õ¥¡¥¤¥ë¾ðÊó¤Î½é´ü²½*/230 /* ファイル情報の初期化 */ 231 231 function lfInitFile() { 232 232 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); 236 236 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 /* 規格選択セレクトボックスの作成 */ 245 245 function lfMakeSelect($objPage, $product_id) { 246 246 global $objPage; 247 247 $classcat_find1 = false; 248 248 $classcat_find2 = false; 249 // ºß¸Ë¤¢¤ê¤Î¾¦ÉʤÎÍ̵249 // 在庫ありの商品の有無 250 250 $stock_find = false; 251 251 252 // µ¬³Ê̾°ìÍ÷252 // 規格名一覧 253 253 $arrClassName = sfGetIDValueList("dtb_class", "class_id", "name"); 254 // µ¬³ÊʬÎà̾°ìÍ÷254 // 規格分類名一覧 255 255 $arrClassCatName = sfGetIDValueList("dtb_classcategory", "classcategory_id", "name"); 256 // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ256 // 商品規格情報の取得 257 257 $arrProductsClass = lfGetProductsClass($product_id); 258 258 259 // µ¬³Ê1¥¯¥é¥¹Ì¾¤Î¼èÆÀ259 // 規格1クラス名の取得 260 260 $objPage->tpl_class_name1 = $arrClassName[$arrProductsClass[0]['class_id1']]; 261 // µ¬³Ê2¥¯¥é¥¹Ì¾¤Î¼èÆÀ261 // 規格2クラス名の取得 262 262 $objPage->tpl_class_name2 = $arrClassName[$arrProductsClass[0]['class_id2']]; 263 263 264 // ¤¹¤Ù¤Æ¤ÎÁȤ߹ç¤ï¤»¿ô264 // すべての組み合わせ数 265 265 $count = count($arrProductsClass); 266 266 … … 272 272 273 273 $list_id = 0; 274 $arrList[0] = "\tlist0 = new Array(' ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤'";274 $arrList[0] = "\tlist0 = new Array('選択してください'"; 275 275 $arrVal[0] = "\tval0 = new Array(''"; 276 276 277 277 for ($i = 0; $i < $count; $i++) { 278 // ºß¸Ë¤Î¥Á¥§¥Ã¥¯278 // 在庫のチェック 279 279 if($arrProductsClass[$i]['stock'] <= 0 && $arrProductsClass[$i]['stock_unlimited'] != '1') { 280 280 continue; … … 283 283 $stock_find = true; 284 284 285 // µ¬³Ê1¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ285 // 規格1のセレクトボックス用 286 286 if($classcat_id1 != $arrProductsClass[$i]['classcategory_id1']){ 287 287 $arrList[$list_id].=");\n"; … … 291 291 } 292 292 293 // µ¬³Ê2¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ293 // 規格2のセレクトボックス用 294 294 if($arrProductsClass[$i]['classcategory_id1'] == $_POST['classcategory_id1'] and $classcat_id2 != $arrProductsClass[$i]['classcategory_id2']) { 295 295 $classcat_id2 = $arrProductsClass[$i]['classcategory_id2']; … … 299 299 $list_id++; 300 300 301 // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹É½¼¨ÃÍ301 // セレクトボックス表示値 302 302 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]."'"; 304 304 } else { 305 305 $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."'"; 306 306 } 307 307 308 // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹POSTÃÍ308 // セレクトボックスPOST値 309 309 if($arrVal[$list_id] == "") { 310 310 $arrVal[$list_id] = "\tval".$list_id." = new Array('', '".$classcat_id2."'"; … … 317 317 $arrVal[$list_id].=");\n"; 318 318 319 // µ¬³Ê1319 // 規格1 320 320 $objPage->arrClassCat1 = $arrSele1; 321 321 $objPage->arrClassCat2 = $arrSele2; … … 349 349 //$objPage->tpl_javascript.=$vals.");\n"; 350 350 351 // ÁªÂò¤µ¤ì¤Æ¤¤¤ëµ¬³Ê2ID351 // 選択されている規格2ID 352 352 $objPage->tpl_onload = "lnSetSelect('form1', 'classcategory_id1', 'classcategory_id2', '" . $_POST['classcategory_id2'] . "');"; 353 353 354 // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë354 // 規格1が設定されている 355 355 if($arrProductsClass[0]['classcategory_id1'] != '0') { 356 356 $classcat_find1 = true; 357 357 } 358 358 359 // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë359 // 規格2が設定されている 360 360 if($arrProductsClass[0]['classcategory_id2'] != '0') { 361 361 $classcat_find2 = true; … … 369 369 } 370 370 371 /* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½*/371 /* パラメータ情報の初期化 */ 372 372 function lfInitParam() { 373 373 global $objFormParam; 374 374 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 /* 商品規格情報の取得 */ 381 381 function lfGetProductsClass($product_id) { 382 382 $arrRet = array(); 383 383 if(sfIsInt($product_id)) { 384 // ¾¦Éʵ¬³Ê¼èÆÀ384 // 商品規格取得 385 385 $objQuery = new SC_Query(); 386 386 $col = "product_class_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited"; … … 393 393 } 394 394 395 /* ÅÐÏ¿ºÑ¤ß¥ª¥¹¥¹¥á¾¦ÉÊ¤ÎÆÉ¤ß¹þ¤ß*/395 /* 登録済みオススメ商品の読み込み */ 396 396 function lfPreGetRecommendProducts($product_id) { 397 397 $objQuery = new SC_Query(); … … 414 414 } 415 415 416 /* ÆþÎÏÆâÍÆ¤Î¥Á¥§¥Ã¥¯*/416 /* 入力内容のチェック */ 417 417 function lfCheckError() { 418 418 global $objFormParam; 419 419 global $objPage; 420 // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£420 // 入力データを渡す。 421 421 $arrRet = $objFormParam->getHashArray(); 422 422 $objErr = new SC_CheckError($arrRet); 423 423 $objErr->arrErr = $objFormParam->checkError(); 424 424 425 // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯425 // 複数項目チェック 426 426 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")); 428 428 } 429 429 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")); 431 431 } 432 432 … … 434 434 } 435 435 436 // ±ÜÍ÷ÍúÎò¿·µ¬ÅÐÏ¿436 //閲覧履歴新規登録 437 437 function lfRegistReadingData($tmp_id, $customer_id){ 438 438 $objQuery = new SC_Query; … … 444 444 } 445 445 446 // ¤³¤Î¾¦ÉʤòÇã¤Ã¤¿¿Í¤Ï¤³¤ó¤Ê¾¦ÉʤâÇã¤Ã¤Æ¤¤¤Þ¤¹446 //この商品を買った人はこんな商品も買っています 447 447 function lfGetRelateProducts($tmp_id) { 448 448 $objQuery = new SC_Query; 449 // ¼«Æ°Ãê½Ð449 //自動抽出 450 450 $objQuery->setorder("random()"); 451 // ɽ¼¨·ï¿ô¤ÎÀ©¸Â451 //表示件数の制限 452 452 $objQuery->setlimit(RELATED_PRODUCTS_MAX); 453 // ¸¡º÷¾ò·ï453 //検索条件 454 454 $col = "name, main_list_image, price01_min, price02_min, price01_max, price02_max, point_rate"; 455 455 $from = "vw_products_allclass AS allcls "; 456 456 $where = "del_flg = 0 AND status = 1 AND (stock_max <> 0 OR stock_max IS NULL) AND product_id = ? "; 457 457 $arrval[] = $tmp_id; 458 // ·ë²Ì¤Î¼èÆÀ458 //結果の取得 459 459 $arrProducts = $objQuery->select($col, $from, $where, $arrval); 460 460 … … 462 462 } 463 463 464 // ¾¦Éʤ´¤È¤Î¥ì¥Ó¥å¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë464 //商品ごとのレビュー情報を取得する 465 465 function lfGetReviewData($id) { 466 466 $objQuery = new SC_Query; 467 // ¾¦Éʤ´¤È¤Î¥ì¥Ó¥å¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë467 //商品ごとのレビュー情報を取得する 468 468 $col = "create_date, reviewer_url, reviewer_name, recommend_level, title, comment"; 469 469 $from = "dtb_review"; … … 474 474 } 475 475 476 // »ÙʧÊýË¡¤Î¼èÆÀ477 //payment_id 1: ¥¯¥ì¥¸¥Ã¥È¡¡2:¥·¥ç¥Ã¥Ô¥ó¥°¥í¡¼¥ó476 //支払方法の取得 477 //payment_id 1:クレジット 2:ショッピングローン 478 478 function lfGetPayment() { 479 479 $objQuery = new SC_Query; -
branches/feature-module-update/html/mobile/products/list.php
r12157 r15078 7 7 * 8 8 * 9 * ¥â¥Ð¥¤¥ë¥µ¥¤¥È/¾¦ÉʰìÍ÷9 * モバイルサイト/商品一覧 10 10 */ 11 11 … … 23 23 $this->arrPRODUCTLISTMAX = $arrPRODUCTLISTMAX; 24 24 /* 25 session_start »þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç26 ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤Î͸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£27 private-no-expire: ¥¯¥é¥¤¥¢¥ó¥È¤Î¥¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£25 session_start時のno-cacheヘッダーを抑制することで 26 「戻る」ボタン使用時の有効期限切れ表示を抑制する。 27 private-no-expire:クライアントのキャッシュを許可する。 28 28 */ 29 29 session_cache_limiter('private-no-expire'); … … 34 34 $conn = new SC_DBConn(); 35 35 36 // ɽ¼¨·ï¿ô¤ÎÁªÂò36 //表示件数の選択 37 37 if(sfIsInt($_REQUEST['disp_number'])) { 38 38 $objPage->disp_number = $_REQUEST['disp_number']; 39 39 } else { 40 // ºÇ¾®É½¼¨·ï¿ô¤òÁªÂò40 //最小表示件数を選択 41 41 $objPage->disp_number = current(array_keys($arrPRODUCTLISTMAX)); 42 42 } 43 43 44 // ɽ¼¨½ç½ø¤ÎÊݸ44 //表示順序の保存 45 45 $objPage->orderby = $_REQUEST['orderby']; 46 46 47 // GET ¤Î¥«¥Æ¥´¥êID¤ò¸µ¤ËÀµ¤·¤¤¥«¥Æ¥´¥êID¤ò¼èÆÀ¤¹¤ë¡£47 // GETのカテゴリIDを元に正しいカテゴリIDを取得する。 48 48 $category_id = sfGetCategoryId("", $_GET['category_id']); 49 49 50 // ¥¿¥¤¥È¥ëÊÔ½¸50 // タイトル編集 51 51 $tpl_subtitle = ""; 52 52 $tpl_search_mode = false; 53 53 if($_GET['mode'] == 'search'){ 54 $tpl_subtitle = " ¸¡º÷·ë²Ì";54 $tpl_subtitle = "検索結果"; 55 55 $tpl_search_mode = true; 56 56 }elseif ($category_id == "" ) { 57 $tpl_subtitle = " Á´¾¦ÉÊ";57 $tpl_subtitle = "全商品"; 58 58 }else{ 59 59 $arrFirstCat = sfGetFirstCat($category_id); … … 64 64 $count = $objQuery->count("dtb_best_products", "category_id = ?", array($category_id)); 65 65 66 // °Ê²¼¤Î¾ò·ï¤ÇBEST¾¦Éʤòɽ¼¨¤¹¤ë67 // ¡¦BESTºÇÂç¿ô¤Î¾¦Éʤ¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¡£68 // ¡¦¥«¥Æ¥´¥êID¤¬¥ë¡¼¥ÈID¤Ç¤¢¤ë¡£69 // ¡¦¸¡º÷¥â¡¼¥É¤Ç¤Ê¤¤¡£66 // 以下の条件でBEST商品を表示する 67 // ・BEST最大数の商品が登録されている。 68 // ・カテゴリIDがルートIDである。 69 // ・検索モードでない。 70 70 if(($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"; // メインテンプレート 74 74 75 75 $objPage->arrBestItems = sfGetBestProducts($conn, $category_id); … … 77 77 } else { 78 78 if ($_GET['mode'] == 'search' && strlen($_GET['category_id']) == 0 ){ 79 // ¸¡º÷»þ¤Ëcategory_id¤¬GET¤Ë¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¢²¾¤ËËä¤á¤¿ID¤ò¶õÇò¤ËÌ᤹79 // 検索時にcategory_idがGETに存在しない場合は、仮に埋めたIDを空白に戻す 80 80 $category_id = ''; 81 81 } 82 82 83 // ¾¦ÉʰìÍ÷¤Îɽ¼¨½èÍý83 // 商品一覧の表示処理 84 84 $objPage = lfDispProductsList($category_id, $_GET['name'], $objPage->disp_number, $_REQUEST['orderby']); 85 85 86 // ¸¡º÷¾ò·ï¤ò²èÌ̤Ëɽ¼¨87 // ¥«¥Æ¥´¥ê¡¼¸¡º÷¾ò·ï86 // 検索条件を画面に表示 87 // カテゴリー検索条件 88 88 if (strlen($_GET['category_id']) == 0) { 89 $arrSearch['category'] = " »ØÄê¤Ê¤·";89 $arrSearch['category'] = "指定なし"; 90 90 }else{ 91 91 $arrCat = $conn->getOne("SELECT category_name FROM dtb_category WHERE category_id = ?",array($category_id)); … … 93 93 } 94 94 95 // ¾¦ÉÊ̾¸¡º÷¾ò·ï95 // 商品名検索条件 96 96 if ($_GET['name'] === "") { 97 $arrSearch['name'] = " »ØÄê¤Ê¤·";97 $arrSearch['name'] = "指定なし"; 98 98 }else{ 99 99 $arrSearch['name'] = $_GET['name']; … … 101 101 } 102 102 103 // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ103 // レイアウトデザインを取得 104 104 $objPage = sfGetPageLayout($objPage, false, "products/list.php"); 105 105 106 106 if($_POST['mode'] == "cart" && $_POST['product_id'] != "") { 107 // ÃͤÎÀµÅöÀ¥Á¥§¥Ã¥¯107 // 値の正当性チェック 108 108 if(!sfIsInt($_POST['product_id']) || !sfIsRecord("dtb_products", "product_id", $_POST['product_id'], "del_flg = 0 AND status = 1")) { 109 109 sfDispSiteError(PRODUCT_NOT_FOUND, "", false, "", true); 110 110 } else { 111 // ÆþÎÏÃͤÎÊÑ´¹111 // 入力値の変換 112 112 $objPage->arrErr = lfCheckError($_POST['product_id']); 113 113 if(count($objPage->arrErr) == 0) { … … 117 117 $classcategory_id2 = $_POST[$classcategory_id. '_2']; 118 118 $quantity = "quantity". $_POST['product_id']; 119 // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç119 // 規格1が設定されていない場合 120 120 if(!$objPage->tpl_classcat_find1[$_POST['product_id']]) { 121 121 $classcategory_id1 = '0'; 122 122 } 123 // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç123 // 規格2が設定されていない場合 124 124 if(!$objPage->tpl_classcat_find2[$_POST['product_id']]) { 125 125 $classcategory_id2 = '0'; … … 134 134 135 135 136 // ¥Ú¡¼¥¸Á÷¤êµ¡Ç½ÍѤÎURL¤òºîÀ®¤¹¤ë¡£136 // ページ送り機能用のURLを作成する。 137 137 $objURL = new Net_URL($_SERVER['PHP_SELF']); 138 138 foreach ($_REQUEST as $key => $value) { … … 156 156 $objPage->tpl_search_mode = $tpl_search_mode; 157 157 158 // »ÙʧÊýË¡¤Î¼èÆÀ158 // 支払方法の取得 159 159 $objPage->arrPayment = lfGetPayment(); 160 // ÆþÎϾðÊó¤òÅϤ¹160 // 入力情報を渡す 161 161 $objPage->arrForm = $_POST; 162 162 … … 167 167 168 168 //----------------------------------------------------------------------------------------------------------------------------------- 169 /* ¥«¥Æ¥´¥êID¤¬¥ë¡¼¥È¤«¤É¤¦¤«¤ÎȽÄê*/169 /* カテゴリIDがルートかどうかの判定 */ 170 170 function lfIsRootCategory($category_id) { 171 171 $objQuery = new SC_Query(); … … 177 177 } 178 178 179 /* ¾¦ÉʰìÍ÷¤Îɽ¼¨*/179 /* 商品一覧の表示 */ 180 180 function lfDispProductsList($category_id, $name, $disp_num, $orderby) { 181 181 global $objPage; … … 183 183 $objPage->tpl_pageno = $_REQUEST['pageno']; 184 184 185 // ɽ¼¨·ï¿ô¤Ç¥Æ¥ó¥×¥ì¡¼¥È¤òÀÚ¤êÂØ¤¨¤ë186 $objPage->tpl_mainpage = "products/list.tpl"; // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È187 188 // ɽ¼¨½ç½ø185 //表示件数でテンプレートを切り替える 186 $objPage->tpl_mainpage = "products/list.tpl"; // メインテンプレート 187 188 //表示順序 189 189 switch($orderby) { 190 // ²Á³Ê½ç190 //価格順 191 191 case 'price': 192 192 $order = "price02_min ASC"; 193 193 break; 194 // ¿·Ãå½ç194 //新着順 195 195 case 'date': 196 196 $order = "create_date DESC"; … … 201 201 } 202 202 203 // ¾¦Éʸ¡º÷¾ò·ï¤ÎºîÀ®¡Ê̤ºï½ü¡¢É½¼¨¡Ë203 // 商品検索条件の作成(未削除、表示) 204 204 $where = "del_flg = 0 AND status = 1 "; 205 // ¥«¥Æ¥´¥ê¤«¤é¤ÎWHEREʸ»úÎó¼èÆÀ205 // カテゴリからのWHERE文字列取得 206 206 if ( $category_id ) { 207 207 $where .= 'AND category_id = ?'; … … 209 209 } 210 210 211 // ¾¦ÉÊ̾¤òwhereʸ¤Ë211 // 商品名をwhere文に 212 212 $name = ereg_replace(",", "", $name); 213 213 if ( strlen($name) > 0 ){ … … 218 218 } 219 219 220 // ¹Ô¿ô¤Î¼èÆÀ220 // 行数の取得 221 221 $linemax = $objQuery->count("vw_products_allclass AS allcls", $where, $arrval); 222 $objPage->tpl_linemax = $linemax; // ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ223 224 // ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ222 $objPage->tpl_linemax = $linemax; // 何件が該当しました。表示用 223 224 // ページ送りの取得 225 225 $objNavi = new SC_PageNavi($_REQUEST['pageno'], $linemax, $disp_num, "fnNaviPage", NAVI_PMAX); 226 226 227 227 $strnavi = $objNavi->strnavi; 228 228 $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 // 取得範囲の指定(開始行番号、行数のセット) 233 233 $objQuery->setlimitoffset($disp_num, $startno); 234 // ɽ¼¨½ç½ø234 // 表示順序 235 235 $objQuery->setorder($order); 236 // ¸¡º÷·ë²Ì¤Î¼èÆÀ236 // 検索結果の取得 237 237 $objPage->arrProducts = $objQuery->select("*", "vw_products_allclass AS allcls", $where, $arrval); 238 238 239 // µ¬³Ê̾°ìÍ÷239 // 規格名一覧 240 240 $arrClassName = sfGetIDValueList("dtb_class", "class_id", "name"); 241 // µ¬³ÊʬÎà̾°ìÍ÷241 // 規格分類名一覧 242 242 $arrClassCatName = sfGetIDValueList("dtb_classcategory", "classcategory_id", "name"); 243 // ´ë²è¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÀßÄê243 // 企画セレクトボックス設定 244 244 if($disp_num == 15) { 245 245 for($i = 0; $i < count($objPage->arrProducts); $i++) { 246 246 $objPage = lfMakeSelect($objPage->arrProducts[$i]['product_id'], $arrClassName, $arrClassCatName); 247 // ¹ØÆþÀ©¸Â¿ô¤ò¼èÆÀ247 // 購入制限数を取得 248 248 $objPage = lfGetSaleLimit($objPage->arrProducts[$i]); 249 249 } … … 254 254 } 255 255 256 /* µ¬³Ê¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ÎºîÀ®*/256 /* 規格セレクトボックスの作成 */ 257 257 function lfMakeSelect($product_id, $arrClassName, $arrClassCatName) { 258 258 global $objPage; … … 260 260 $classcat_find1 = false; 261 261 $classcat_find2 = false; 262 // ºß¸Ë¤¢¤ê¤Î¾¦ÉʤÎÍ̵262 // 在庫ありの商品の有無 263 263 $stock_find = false; 264 264 265 // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ265 // 商品規格情報の取得 266 266 $arrProductsClass = lfGetProductsClass($product_id); 267 267 268 // µ¬³Ê1¥¯¥é¥¹Ì¾¤Î¼èÆÀ268 // 規格1クラス名の取得 269 269 $objPage->tpl_class_name1[$product_id] = $arrClassName[$arrProductsClass[0]['class_id1']]; 270 // µ¬³Ê2¥¯¥é¥¹Ì¾¤Î¼èÆÀ270 // 規格2クラス名の取得 271 271 $objPage->tpl_class_name2[$product_id] = $arrClassName[$arrProductsClass[0]['class_id2']]; 272 272 273 // ¤¹¤Ù¤Æ¤ÎÁȤ߹ç¤ï¤»¿ô273 // すべての組み合わせ数 274 274 $count = count($arrProductsClass); 275 275 … … 280 280 281 281 $list_id = 0; 282 $arrList[0] = "\tlist". $product_id. "_0 = new Array(' ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤'";282 $arrList[0] = "\tlist". $product_id. "_0 = new Array('選択してください'"; 283 283 $arrVal[0] = "\tval". $product_id. "_0 = new Array(''"; 284 284 285 285 for ($i = 0; $i < $count; $i++) { 286 // ºß¸Ë¤Î¥Á¥§¥Ã¥¯286 // 在庫のチェック 287 287 if($arrProductsClass[$i]['stock'] <= 0 && $arrProductsClass[$i]['stock_unlimited'] != '1') { 288 288 continue; … … 291 291 $stock_find = true; 292 292 293 // µ¬³Ê1¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ293 // 規格1のセレクトボックス用 294 294 if($classcat_id1 != $arrProductsClass[$i]['classcategory_id1']){ 295 295 $arrList[$list_id].=");\n"; … … 300 300 } 301 301 302 // µ¬³Ê2¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ302 // 規格2のセレクトボックス用 303 303 $classcat_id2 = $arrProductsClass[$i]['classcategory_id2']; 304 304 305 // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹É½¼¨ÃÍ305 // セレクトボックス表示値 306 306 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]. "'"; 308 308 } else { 309 309 $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."'"; 310 310 } 311 311 312 // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹POSTÃÍ312 // セレクトボックスPOST値 313 313 if($arrVal[$list_id] == "") { 314 314 $arrVal[$list_id] = "\tval". $product_id. "_". $list_id. " = new Array('', '". $classcat_id2. "'"; … … 321 321 $arrVal[$list_id].=");\n"; 322 322 323 // µ¬³Ê1323 // 規格1 324 324 $objPage->arrClassCat1[$product_id] = $arrSele; 325 325 … … 350 350 $objPage->tpl_javascript.= $vals.");\n"; 351 351 352 // ÁªÂò¤µ¤ì¤Æ¤¤¤ëµ¬³Ê2ID352 // 選択されている規格2ID 353 353 $classcategory_id = "classcategory_id". $product_id; 354 354 $objPage->tpl_onload .= "lnSetSelect('".$classcategory_id."_1','".$classcategory_id."_2','".$product_id."','".$_POST[$classcategory_id."_2"]."'); "; 355 355 356 // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë356 // 規格1が設定されている 357 357 if($arrProductsClass[0]['classcategory_id1'] != '0') { 358 358 $classcat_find1 = true; 359 359 } 360 360 361 // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë361 // 規格2が設定されている 362 362 if($arrProductsClass[0]['classcategory_id2'] != '0') { 363 363 $classcat_find2 = true; … … 370 370 return $objPage; 371 371 } 372 /* ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ*/372 /* 商品規格情報の取得 */ 373 373 function lfGetProductsClass($product_id) { 374 374 $arrRet = array(); 375 375 if(sfIsInt($product_id)) { 376 // ¾¦Éʵ¬³Ê¼èÆÀ376 // 商品規格取得 377 377 $objQuery = new SC_Query(); 378 378 $col = "product_class_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited"; … … 385 385 } 386 386 387 /* ÆþÎÏÆâÍÆ¤Î¥Á¥§¥Ã¥¯*/387 /* 入力内容のチェック */ 388 388 function lfCheckError($id) { 389 389 global $objPage; 390 390 391 // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£391 // 入力データを渡す。 392 392 $objErr = new SC_CheckError(); 393 393 … … 395 395 $classcategory_id2 = "classcategory_id". $id. "_2"; 396 396 $quantity = "quantity". $id; 397 // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯397 // 複数項目チェック 398 398 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")); 400 400 } 401 401 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")); 405 405 406 406 return $objErr->arrErr; 407 407 } 408 408 409 // ¹ØÆþÀ©¸Â¿ô¤ÎÀßÄê409 // 購入制限数の設定 410 410 function lfGetSaleLimit($product) { 411 411 global $objPage; 412 // ºß¸Ë¤¬Ìµ¸Â¤Þ¤¿¤Ï¹ØÆþÀ©¸ÂÃͤ¬ÀßÄêÃͤè¤êÂ礤¤¾ì¹ç412 //在庫が無限または購入制限値が設定値より大きい場合 413 413 if($product['sale_unlimited'] == 1 || $product['sale_limit'] > SALE_LIMIT_MAX) { 414 414 $objPage->tpl_sale_limit[$product['product_id']] = SALE_LIMIT_MAX; … … 420 420 } 421 421 422 // »ÙʧÊýË¡¤Î¼èÆÀ423 //payment_id 1: Âå¶â°ú´¹¡¡2:¶ä¹Ô¿¶¤ê¹þ¤ß¡¡3:¸½¶â½ñα422 //支払方法の取得 423 //payment_id 1:代金引換 2:銀行振り込み 3:現金書留 424 424 function lfGetPayment() { 425 425 $objQuery = new SC_Query; -
branches/feature-module-update/html/mobile/products/search.php
r12157 r15078 7 7 * 8 8 * 9 * ¥â¥Ð¥¤¥ë¥µ¥¤¥È/¾¦Éʸ¡º÷¥Õ¥©¡¼¥à9 * モバイルサイト/商品検索フォーム 10 10 */ 11 11 … … 14 14 class LC_Page { 15 15 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 = '商品検索'; 19 19 } 20 20 } … … 23 23 $objView = new SC_MobileView(); 24 24 25 // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ25 // レイアウトデザインを取得 26 26 $objPage = sfGetPageLayout($objPage, false, DEF_LAYOUT); 27 27
Note: See TracChangeset
for help on using the changeset viewer.