Changeset 8390 for temp


Ignore:
Timestamp:
2006/11/16 17:38:49 (20 years ago)
Author:
uehara
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/html/admin/contents/recommend.php

    r8388 r8390  
    1919 
    2020$conn = new SC_DBConn(); 
    21 $objQuery = new SC_Query(); 
    2221$objPage = new LC_Page(); 
    2322$objView = new SC_AdminView(); 
     
    4847    if ( ! $objPage->arrErr[$objPage->arrForm['rank']]) { 
    4948        // ¸Å¤¤¤Î¤ò¾Ã¤¹ 
    50         $sql = "DELETE FROM dtb_best_products WHERE product_id = ?"; 
    51         $conn->query($sql, array($objPage->arrForm['product_id'])); 
     49        $sql = "DELETE FROM dtb_best_products WHERE category_id = ? AND rank = ?"; 
     50        $conn->query($sql, array($objPage->arrForm['category_id'] ,$objPage->arrForm['rank'])); 
    5251     
    5352        // £Ä£ÂÅÐÏ¿ 
     
    5655        $objPage->arrForm['create_date'] = "NOW()"; 
    5756         
     57        $objQuery = new SC_Query(); 
    5858        $objQuery->insert("dtb_best_products", $objPage->arrForm ); 
     59//      $conn->autoExecute("dtb_best_products", $objPage->arrForm ); 
    5960    }    
    6061 
     
    6263// ºï½ü»þ 
    6364 
    64     $sql = "DELETE FROM dtb_best_products WHERE product_id = ?"; 
    65     $conn->query($sql, array($_POST['product_id'])); 
     65    $sql = "DELETE FROM dtb_best_products WHERE category_id = ? AND rank = ?"; 
     66    $conn->query($sql, array($_POST['category_id'] ,$_POST['rank'])); 
    6667     
     68} 
     69 
     70// ¥«¥Æ¥´¥êID¼èÆÀ ̵¤¤¤È¤­¤Ï¥È¥Ã¥×¥Ú¡¼¥¸ 
     71if ( sfCheckNumLength($_POST['category_id']) ){ 
     72    $objPage->category_id = $_POST['category_id']; 
     73} else { 
     74    $objPage->category_id = 0; 
     75} 
     76 
     77// ´û¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÆâÍÆ¤ò¼èÆÀ¤¹¤ë 
     78$sql = "SELECT B.name, B.main_list_image, A.* FROM dtb_best_products as A INNER JOIN dtb_products as B USING (product_id) 
     79         WHERE A.del_flg = 0 ORDER BY rank"; 
     80$arrItems = $conn->getAll($sql, array($objPage->category_id)); 
     81foreach( $arrItems as $data ){ 
     82    $objPage->arrItems[$data['rank']] = $data; 
    6783} 
    6884 
     
    8197} 
    8298 
    83 // ¥ª¥¹¥¹¥á¾¦ÉʼèÆÀ 
    84 lfGetRecommentdProduct(); 
    85  
    8699//³Æ¥Ú¡¼¥¸¶¦ÄÌ 
    87100$objPage->cnt_question = 6; 
    88101$objPage->arrActive = $arrActive; 
    89102$objPage->arrQuestion = $arrQuestion; 
     103 
     104// ¥«¥Æ¥´¥ê¼èÆÀ 
     105$objPage->arrCatList = sfGetCategoryList("level = 1"); 
    90106 
    91107//----¡¡¥Ú¡¼¥¸É½¼¨ 
     
    124140} 
    125141 
    126 /* ¾¦ÉʤΰìÍ÷¤ò¼èÆÀ */ 
    127 function lfGetRecommentdProduct() { 
    128      
    129     global $objQuery; 
    130     global $objPage; 
    131      
    132     // ´û¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÆâÍÆ¤ò¼èÆÀ¤¹¤ë 
    133     $sql = "SELECT B.name, B.main_list_image, A.* FROM dtb_best_products as A INNER JOIN dtb_products as B USING (product_id) 
    134              WHERE A.del_flg = 0 ORDER BY rank"; 
    135     $arrItems = $objQuery->getAll($sql); 
    136     foreach( $arrItems as $data ){ 
    137         $objPage->arrItems[$data['rank']] = $data; 
    138     } 
    139 } 
    140142?> 
Note: See TracChangeset for help on using the changeset viewer.