Changeset 16166 for branches/feature-module-update/data/class
- Timestamp:
- 2007/09/28 20:34:45 (19 years ago)
- Location:
- branches/feature-module-update/data/class/pages/products
- Files:
-
- 1 added
- 1 edited
-
LC_Page_Products_CategoryList.php (added)
-
LC_Page_Products_Detail.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/data/class/pages/products/LC_Page_Products_Detail.php
r16030 r16166 244 244 } 245 245 246 /** 247 * モバイルページを初期化する. 248 * 249 * @return void 250 */ 251 function mobileInit() { 252 $this->init(); 253 $this->tpl_mainpage = "products/detail.tpl"; 254 } 255 256 /** 257 * Page のプロセス(モバイル). 258 * 259 * @return void 260 */ 261 function mobileProcess() { 262 $objView = new SC_MobileView(); 263 $objCustomer = new SC_Customer(); 264 $objQuery = new SC_Query(); 265 $objDb = new SC_Helper_DB_Ex(); 266 267 // レイアウトデザインを取得 268 // $objPage = sfGetPageLayout($objPage, false, "products/detail.php"); 269 270 // パラメータ管理クラス 271 $this->objFormParam = new SC_FormParam(); 272 // パラメータ情報の初期化 273 $this->lfInitParam(); 274 // POST値の取得 275 $this->objFormParam->setParam($_POST); 276 277 // ファイル管理クラス 278 $this->objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR); 279 // ファイル情報の初期化 280 $this->lfInitFile(); 281 282 // 管理ページからの確認の場合は、非公開の商品も表示する。 283 if($_GET['admin'] == 'on') { 284 $where = "del_flg = 0"; 285 } else { 286 $where = "del_flg = 0 AND status = 1"; 287 } 288 289 if($_POST['mode'] != "") { 290 $tmp_id = $_POST['product_id']; 291 } else { 292 $tmp_id = $_GET['product_id']; 293 } 294 295 // 値の正当性チェック 296 /*if(!SC_Utils_Ex::sfIsInt($_GET['product_id']) || !$objDb->sfIsRecord("dtb_products", "product_id", $tmp_id, $where)) { 297 SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND, "", false, "", true); 298 }*/ 299 // ログイン判定 300 if($objCustomer->isLoginSuccess()) { 301 //お気に入りボタン表示 302 $this->tpl_login = true; 303 304 /* 閲覧ログ機能は現在未使用 305 306 $table = "dtb_customer_reading"; 307 $where = "customer_id = ? "; 308 $arrval[] = $objCustomer->getValue('customer_id'); 309 //顧客の閲覧商品数 310 $rpcnt = $objQuery->count($table, $where, $arrval); 311 312 //閲覧数が設定数以下 313 if ($rpcnt < CUSTOMER_READING_MAX){ 314 //閲覧履歴に新規追加 315 lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id')); 316 } else { 317 //閲覧履歴の中で一番古いものを削除して新規追加 318 $oldsql = "SELECT MIN(update_date) FROM ".$table." WHERE customer_id = ?"; 319 $old = $objQuery->getone($oldsql, array($objCustomer->getValue("customer_id"))); 320 $where = "customer_id = ? AND update_date = ? "; 321 $arrval = array($objCustomer->getValue("customer_id"), $old); 322 //削除 323 $objQuery->delete($table, $where, $arrval); 324 //追加 325 lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id')); 326 } 327 */ 328 } 329 330 331 // 規格選択セレクトボックスの作成 332 $this->lfMakeSelect($tmp_id); 333 334 // 商品IDをFORM内に保持する。 335 $this->tpl_product_id = $tmp_id; 336 337 switch($_POST['mode']) { 338 case 'select': 339 // 規格1が設定されている場合 340 if($this->tpl_classcat_find1) { 341 // templateの変更 342 $this->tpl_mainpage = "products/select_find1.tpl"; 343 break; 344 } 345 346 case 'select2': 347 $this->arrErr = $this->lfCheckError(); 348 349 // 規格1が設定されている場合 350 if($this->tpl_classcat_find1 and $this->arrErr['classcategory_id1']) { 351 // templateの変更 352 $this->tpl_mainpage = "products/select_find1.tpl"; 353 break; 354 } 355 356 // 規格2が設定されている場合 357 if($this->tpl_classcat_find2) { 358 $this->arrErr = array(); 359 360 $this->tpl_mainpage = "products/select_find2.tpl"; 361 break; 362 } 363 364 case 'selectItem': 365 $this->arrErr = $this->lfCheckError(); 366 367 // 規格1が設定されている場合 368 if($this->tpl_classcat_find2 and $this->arrErr['classcategory_id2']) { 369 // templateの変更 370 $this->tpl_mainpage = "products/select_find2.tpl"; 371 break; 372 } 373 // 商品数の選択を行う 374 $this->tpl_mainpage = "products/select_item.tpl"; 375 break; 376 377 case 'cart': 378 // 入力値の変換 379 $this->objFormParam->convParam(); 380 $this->arrErr = $this->lfCheckError(); 381 if(count($this->arrErr) == 0) { 382 $objCartSess = new SC_CartSession(); 383 $classcategory_id1 = $_POST['classcategory_id1']; 384 $classcategory_id2 = $_POST['classcategory_id2']; 385 386 // 規格1が設定されていない場合 387 if(!$this->tpl_classcat_find1) { 388 $classcategory_id1 = '0'; 389 } 390 391 // 規格2が設定されていない場合 392 if(!$this->tpl_classcat_find2) { 393 $classcategory_id2 = '0'; 394 } 395 396 $objCartSess->setPrevURL($_SERVER['REQUEST_URI']); 397 $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity')); 398 $this->sendRedirect(SC_Helper_Mobile_Ex::gfAddSessionId(MOBILE_URL_CART_TOP)); 399 exit; 400 } 401 break; 402 403 default: 404 break; 405 } 406 407 $objQuery = new SC_Query(); 408 // DBから商品情報を取得する。 409 $arrRet = $objQuery->select("*", "vw_products_allclass_detail AS alldtl", "product_id = ?", array($tmp_id)); 410 $this->arrProduct = $arrRet[0]; 411 412 // 商品コードの取得 413 $code_sql = "SELECT product_code FROM dtb_products_class AS prdcls WHERE prdcls.product_id = ? GROUP BY product_code ORDER BY product_code"; 414 $arrProductCode = $objQuery->getall($code_sql, array($tmp_id)); 415 $arrProductCode = SC_Utils_Ex::sfswaparray($arrProductCode); 416 $this->arrProductCode = $arrProductCode["product_code"]; 417 418 // 購入制限数を取得 419 if($this->arrProduct['sale_unlimited'] == 1 || $this->arrProduct['sale_limit'] > SALE_LIMIT_MAX) { 420 $this->tpl_sale_limit = SALE_LIMIT_MAX; 421 } else { 422 $this->tpl_sale_limit = $this->arrProduct['sale_limit']; 423 } 424 425 // サブタイトルを取得 426 $arrFirstCat = $objDb->sfGetFirstCat($arrRet[0]['category_id']); 427 $tpl_subtitle = $arrFirstCat['name']; 428 $this->tpl_subtitle = $tpl_subtitle; 429 430 // DBからのデータを引き継ぐ 431 $this->objUpFile->setDBFileList($this->arrProduct); 432 // ファイル表示用配列を渡す 433 $this->arrFile = $this->objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL, true); 434 // 支払方法の取得 435 $this->arrPayment = $this->lfGetPayment(); 436 // 入力情報を渡す 437 $this->arrForm = $this->objFormParam->getFormParamList(); 438 //レビュー情報の取得 439 $this->arrReview = $this->lfGetReviewData($tmp_id); 440 // タイトルに商品名を入れる 441 $this->tpl_title = "商品詳細 ". $this->arrProduct["name"]; 442 //オススメ商品情報表示 443 $this->arrRecommend = $this->lfPreGetRecommendProducts($tmp_id); 444 //この商品を買った人はこんな商品も買っています 445 $this->arrRelateProducts = $this->lfGetRelateProducts($tmp_id); 446 447 // 拡大画像のウィンドウサイズをセット 448 list($large_width, $large_height) = getimagesize(IMAGE_SAVE_DIR . basename($this->arrFile["main_large_image"]["filepath"])); 449 $this->tpl_large_width = $large_width + 60; 450 $this->tpl_large_height = $large_height + 80; 451 452 $objView->assignobj($this); 453 $objView->display(SITE_FRAME); 454 } 455 246 456 /* ファイル情報の初期化 */ 247 457 function lfInitFile() {
Note: See TracChangeset
for help on using the changeset viewer.
