コード例 #1
0
if (isset($view['products']) && count($view['products']) > 0) {
    ?>

                <div class="top-header-cont" style="color: #999999;">
                    <div class="n1">&nbsp;</div>
                    <div class="n2">Item</div>
                    <div class="n3" style="color:#999999;">Price</div>
                    <div class="n4">Time Left</div>
                    <div class="n5">Actions</div>
                    <div class="clear"></div>
                </div>


                <?php 
    foreach ($view['products'] as $prodData) {
        $thumbFileUrl = fn_buckys_get_item_first_image_thumb($prodData['images']);
        if ($view['type'] == 'expired') {
            $timeLeftStr = 'Expired';
        } else {
            $timeLeftStr = fn_buckys_get_item_time_left($prodData['expiryDate']);
        }
        $editLink = '/shop/edititem.php?id=' . $prodData['productID'];
        $relistLink = '/shop/edititem.php?id=' . $prodData['productID'] . '&type=relist';
        $viewLink = '/shop/view.php?id=' . $prodData['productID'];
        ?>

                    <div class="node">
                        <div class="n1"><a href="<?php 
        echo $viewLink;
        ?>
"><img src="<?php 
コード例 #2
0
 /**
  * Remove Products by product ID list
  *
  * @param array $prodIDList
  */
 public function removeProducts($prodIDList)
 {
     global $db;
     if (is_numeric($prodIDList) && $prodIDList > 0) {
         $prodIDList = [$prodIDList];
     }
     if (is_array($prodIDList) && count($prodIDList) > 0) {
         $idCondStr = implode(',', $prodIDList);
         $query = sprintf('SELECT * FROM %s WHERE productID IN (%s) AND STATUS=%d', TABLE_SHOP_PRODUCTS, $idCondStr, BuckysShopProduct::STATUS_ACTIVE);
         $prodList = $db->getResultsArray($query);
         if (count($prodList) > 0) {
             //remove product images first
             foreach ($prodList as $prodData) {
                 if ($prodData['images'] != '') {
                     $imageList = explode('|', $prodData['images']);
                     if (count($imageList) > 0) {
                         foreach ($imageList as $key => $val) {
                             if ($val != '') {
                                 $val = ltrim($val, '/');
                                 $thumb = fn_buckys_get_item_first_image_thumb($val, false);
                                 @unlink(DIR_FS_ROOT . $val);
                                 @unlink(DIR_FS_ROOT . $thumb);
                             }
                         }
                     }
                 }
             }
             //Delete products
             $query = sprintf('DELETE FROM %s WHERE productID IN (%s) AND STATUS=%d', TABLE_SHOP_PRODUCTS, $idCondStr, BuckysShopProduct::STATUS_ACTIVE);
             $db->query($query);
             $query = sprintf('DELETE FROM %s WHERE productID IN (%s)', TABLE_SHOP_ORDERS, $idCondStr);
             $db->query($query);
         }
     }
     return;
 }
コード例 #3
0
            <?php 
if (isset($soldList) && count($soldList) > 0) {
    ?>

                <div class="top-header-cont">
                    <div class="n1">Item</div>
                    <div class="n2">Price</div>
                    <div class="n3">Order Details</div>
                    <div class="n4">Actions</div>
                    <div class="clear"></div>
                </div>


                <?php 
    foreach ($soldList as $data) {
        $prodImage = fn_buckys_get_item_first_image_thumb($data['images']);
        $sendMessageLink = '/messages_compose.php?to=' . $data['buyerID'];
        $prodViewLink = '/shop/view.php?id=' . $data['productID'];
        ?>

                    <div class="node">

                        <table cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="n1">
                                    <div class="image">
                                        <a href="<?php 
        echo $prodViewLink;
        ?>
"><img src="<?php 
        echo $prodImage;
コード例 #4
0
 /**
  * Remove Trade Items
  * This function will be used by Super admin. Others will use removeItemByUserID
  *
  * @param integer /array $itemIDList
  */
 public function removeItems($itemIDList)
 {
     global $db;
     if (is_numeric($itemIDList) && $itemIDList > 0) {
         $itemIDList = [$itemIDList];
     }
     if (is_array($itemIDList) && count($itemIDList) > 0) {
         $idCondStr = implode(',', $itemIDList);
         $query = sprintf('SELECT * FROM %s WHERE itemID IN (%s) AND STATUS=%d', TABLE_TRADE_ITEMS, $idCondStr, BuckysTradeItem::STATUS_ITEM_ACTIVE);
         $itemList = $db->getResultsArray($query);
         if (count($itemList) > 0) {
             //remove item images first
             foreach ($itemList as $itemData) {
                 if ($itemData['images'] != '') {
                     $imageList = explode('|', $itemData['images']);
                     if (count($imageList) > 0) {
                         foreach ($imageList as $key => $val) {
                             if ($val != '') {
                                 $val = ltrim($val, '/');
                                 $thumb = fn_buckys_get_item_first_image_thumb($val);
                                 @unlink(DIR_FS_ROOT . $val);
                                 @unlink(DIR_FS_ROOT . $thumb);
                             }
                         }
                     }
                 }
             }
             //Delete items
             $query = sprintf('DELETE FROM %s WHERE itemID IN (%s) AND STATUS=%d', TABLE_TRADE_ITEMS, $idCondStr, BuckysTradeItem::STATUS_ITEM_ACTIVE);
             $db->query($query);
         }
     }
     return;
 }