source: branches/version-1/html/products/detail_image.php @ 17699

Revision 17699, 1.5 KB checked in by takegami, 15 years ago (diff)

#394 解決
1.4.9リリース

Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8require_once("../require.php");
9
10class LC_Page {
11    function LC_Page() {
12        /** ɬ¤º»ØÄꤹ¤ë **/
13        $this->tpl_mainpage = 'products/detail_image.tpl';          // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È
14    }
15}
16
17$objPage = new LC_Page();
18$objView = new SC_SiteView();
19$objCartSess = new SC_CartSession("", false);
20
21// ´ÉÍý¥Ú¡¼¥¸¤«¤é¤Î³Îǧ¤Î¾ì¹ç¤Ï¡¢Èó¸ø³«¤Î¾¦Éʤâɽ¼¨¤¹¤ë¡£
22if($_GET['admin'] == 'on') {
23    $where = "del_flg = 0";
24} else {
25    $where = "del_flg = 0 AND status = 1";
26}
27
28// ÃͤÎÀµÅöÀ­¥Á¥§¥Ã¥¯
29if(!sfIsInt($_GET['product_id']) || !sfIsRecord("dtb_products", "product_id", $_GET['product_id'], $where)) {
30    sfDispSiteError(PRODUCT_NOT_FOUND);
31}
32
33
34$image_key = $_GET['image'];
35
36
37$col = "name, $image_key";
38if(!sfColumnExists("dtb_products",$_GET['image'])){
39    sfDispSiteError(PRODUCT_NOT_FOUND);
40}
41$arrRet = $objQuery->select($col, "dtb_products", "product_id = ?", array($_GET['product_id']));
42
43list($width, $height) = getimagesize(IMAGE_SAVE_DIR . $arrRet[0][$image_key]);
44$objPage->tpl_width = $width;
45$objPage->tpl_height = $height;
46
47$objPage->tpl_table_width = $objPage->tpl_width + 20;
48$objPage->tpl_table_height = $objPage->tpl_height + 20;
49
50$objPage->tpl_image = $arrRet[0][$image_key];
51$objPage->tpl_name = $arrRet[0]['name'];
52
53$objView->assignobj($objPage);
54$objView->display($objPage->tpl_mainpage);
55//-----------------------------------------------------------------------------------------------------------------------------------
56?>
Note: See TracBrowser for help on using the repository browser.