Changeset 6387 for temp


Ignore:
Timestamp:
2006/10/16 22:58:25 (20 years ago)
Author:
naka
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/data/update/products/detail.php

    r6386 r6387  
    11<?php 
    2     print("test"); 
     2/* 
     3 * Copyright(c) 2000-2006 LOCKON CO.,LTD. All Rights Reserved. 
     4 * 
     5 * http://www.lockon.co.jp/ 
     6 */ 
     7 
     8require_once("../require.php"); 
     9require_once(DATA_PATH . "include/page_layout.inc"); 
     10 
     11class UC_Page { 
     12    function UC_Page() { 
     13        /** ɬ¤º»ØÄꤹ¤ë **/ 
     14        global $arrSTATUS; 
     15        $this->arrSTATUS = $arrSTATUS; 
     16        global $arrSTATUS_IMAGE; 
     17        $this->arrSTATUS_IMAGE = $arrSTATUS_IMAGE; 
     18        global $arrDELIVERYDATE; 
     19        $this->arrDELIVERYDATE = $arrDELIVERYDATE; 
     20        global $arrRECOMMEND; 
     21        $this->arrRECOMMEND = $arrRECOMMEND; 
     22        session_cache_limiter('private-no-expire'); 
     23    } 
     24} 
     25 
     26ufDetailPHP(); 
     27 
     28function ufDetailPHP() { 
     29    global $objPage; 
     30    global $objView; 
     31    global $objCustomer; 
     32    global $objQuery; 
     33    global $objUpFile; 
     34     
     35    $objPage = new UC_Page(); 
     36    $objView = new SC_SiteView(); 
     37    $objCustomer = new SC_Customer(); 
     38    $objQuery = new SC_Query(); 
     39     
     40    // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ 
     41    $objPage = sfGetPageLayout($objPage, false, "products/detail.php"); 
     42     
     43    // ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹ 
     44    $objFormParam = new SC_FormParam(); 
     45    // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ 
     46    lfInitParam(); 
     47    // POSTÃͤμèÆÀ 
     48    $objFormParam->setParam($_POST); 
     49     
     50    // ¥Õ¥¡¥¤¥ë´ÉÍý¥¯¥é¥¹ 
     51    $objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR); 
     52    // ¥Õ¥¡¥¤¥ë¾ðÊó¤Î½é´ü²½ 
     53    lfInitFile(); 
     54     
     55    // ´ÉÍý¥Ú¡¼¥¸¤«¤é¤Î³Îǧ¤Î¾ì¹ç¤Ï¡¢Èó¸ø³«¤Î¾¦Éʤâɽ¼¨¤¹¤ë¡£ 
     56    if($_GET['admin'] == 'on') { 
     57        $where = "del_flg = 0"; 
     58    } else { 
     59        $where = "del_flg = 0 AND status = 1"; 
     60    } 
     61     
     62    if($_POST['mode'] != "") { 
     63        $tmp_id = $_POST['product_id']; 
     64    } else { 
     65        $tmp_id = $_GET['product_id']; 
     66    } 
     67     
     68    // ÃͤÎÀµÅöÀ­¥Á¥§¥Ã¥¯ 
     69    if(!sfIsInt($_GET['product_id']) || !sfIsRecord("dtb_products", "product_id", $tmp_id, $where)) { 
     70        sfDispSiteError(PRODUCT_NOT_FOUND); 
     71    } 
     72    // ¥í¥°¥¤¥óȽÄê 
     73    if($objCustomer->isLoginSuccess()) { 
     74        //¤ªµ¤¤ËÆþ¤ê¥Ü¥¿¥óɽ¼¨ 
     75        $objPage->tpl_login = true; 
     76         
     77        $table = "dtb_customer_reading"; 
     78        $where = "customer_id = ? "; 
     79        $arrval[] = $objCustomer->getValue('customer_id'); 
     80        //¸ÜµÒ¤Î±ÜÍ÷¾¦ÉÊ¿ô 
     81        $rpcnt = $objQuery->count($table, $where, $arrval); 
     82     
     83        //±ÜÍ÷¿ô¤¬ÀßÄê¿ô°Ê²¼ 
     84        if ($rpcnt < CUSTOMER_READING_MAX){ 
     85            //±ÜÍ÷ÍúÎò¤Ë¿·µ¬Äɲà
     86            lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id')); 
     87        } else { 
     88            //±ÜÍ÷ÍúÎò¤ÎÃæ¤Ç°ìÈָŤ¤¤â¤Î¤òºï½ü¤·¤Æ¿·µ¬Äɲà
     89            $where = "customer_id = ? AND update_date = (SELECT MIN(update_date) FROM ".$table." WHERE customer_id = ? ) "; 
     90            $arrval = array($objCustomer->getValue("customer_id"), $objCustomer->getValue("customer_id")); 
     91            //ºï½ü 
     92            $objQuery->delete($table, $where, $arrval); 
     93            //Äɲà
     94            lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id')); 
     95        } 
     96    } 
     97     
     98     
     99    // µ¬³ÊÁªÂò¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ÎºîÀ® 
     100    $objPage = lfMakeSelect($objPage, $tmp_id); 
     101     
     102    // ¾¦ÉÊID¤òFORMÆâ¤ËÊÝ»ý¤¹¤ë¡£ 
     103    $objPage->tpl_product_id = $tmp_id; 
     104     
     105    switch($_POST['mode']) { 
     106    case 'cart': 
     107        // ÆþÎÏÃͤÎÊÑ´¹ 
     108        $objFormParam->convParam(); 
     109        $objPage->arrErr = lfCheckError(); 
     110        if(count($objPage->arrErr) == 0) { 
     111            $objCartSess = new SC_CartSession(); 
     112            $classcategory_id1 = $_POST['classcategory_id1']; 
     113            $classcategory_id2 = $_POST['classcategory_id2']; 
     114                     
     115            // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç 
     116            if(!$objPage->tpl_classcat_find1) { 
     117                $classcategory_id1 = '0'; 
     118            } 
     119             
     120            // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç 
     121            if(!$objPage->tpl_classcat_find2) { 
     122                $classcategory_id2 = '0'; 
     123            } 
     124     
     125            $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $objFormParam->getValue('quantity')); 
     126            header("Location: " . URL_CART_TOP); 
     127     
     128            exit; 
     129        } 
     130        break; 
     131             
     132    default: 
     133        break; 
     134    } 
     135     
     136    $objQuery = new SC_Query(); 
     137    // DB¤«¤é¾¦ÉʾðÊó¤ò¼èÆÀ¤¹¤ë¡£ 
     138    $arrRet = $objQuery->select("*", "vw_products_allclass_detail AS alldtl", "product_id = ?", array($tmp_id)); 
     139    $objPage->arrProduct = $arrRet[0]; 
     140     
     141    // ¹ØÆþÀ©¸Â¿ô¤ò¼èÆÀ 
     142    if($objPage->arrProduct['sale_unlimited'] == 1 || $objPage->arrProduct['sale_limit'] > SALE_LIMIT_MAX) { 
     143      $objPage->tpl_sale_limit = SALE_LIMIT_MAX; 
     144    } else { 
     145      $objPage->tpl_sale_limit = $objPage->arrProduct['sale_limit']; 
     146    } 
     147     
     148    // ¥µ¥Ö¥¿¥¤¥È¥ë¤ò¼èÆÀ 
     149    $arrFirstCat = GetFirstCat($arrRet[0]['category_id']); 
     150    $tpl_subtitle = $arrFirstCat['name']; 
     151    $objPage->tpl_subtitle = $tpl_subtitle; 
     152     
     153    // DB¤«¤é¤Î¥Ç¡¼¥¿¤ò°ú¤­·Ñ¤° 
     154    $objUpFile->setDBFileList($objPage->arrProduct); 
     155    // ¥Õ¥¡¥¤¥ëɽ¼¨ÍÑÇÛÎó¤òÅϤ¹ 
     156    $objPage->arrFile = $objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL); 
     157    // »ÙʧÊýË¡¤Î¼èÆÀ 
     158    $objPage->arrPayment = lfGetPayment(); 
     159    // ÆþÎϾðÊó¤òÅϤ¹ 
     160    $objPage->arrForm = $objFormParam->getFormParamList(); 
     161    //¥ì¥Ó¥å¡¼¾ðÊó¤Î¼èÆÀ 
     162    $objPage->arrReview = lfGetReviewData($tmp_id); 
     163    // ¥¿¥¤¥È¥ë¤Ë¾¦ÉÊ̾¤òÆþ¤ì¤ë 
     164    $objPage->tpl_title = "¾¦Éʾܺ٠". $objPage->arrProduct["name"]; 
     165    //¥ª¥¹¥¹¥á¾¦ÉʾðÊóɽ¼¨ 
     166    $objPage->arrRecommend = lfPreGetRecommendProducts($tmp_id); 
     167    //¤³¤Î¾¦ÉʤòÇã¤Ã¤¿¿Í¤Ï¤³¤ó¤Ê¾¦ÉʤâÇã¤Ã¤Æ¤¤¤Þ¤¹ 
     168    $objPage->arrRelateProducts = lfGetRelateProducts($tmp_id); 
     169     
     170    $objView->assignobj($objPage); 
     171    $objView->display(SITE_FRAME); 
     172} 
     173//----------------------------------------------------------------------------------------------------------------------------------- 
    3174?> 
Note: See TracChangeset for help on using the changeset viewer.