/** * 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 = array($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 = buckys_trade_get_item_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); } } $query = $db->prepare("DELETE FROM " . TABLE_TRADE_ITEMS . " WHERE itemID=%d", $itemID); return; }
?> <div class="top-header-cont"> <div class="n1">My Item</div> <div class="n2">Their Item</div> <div class="n3">Actions</div> <div class="clear"></div> </div> <?php foreach ($offerMade as $offerData) { $userIns = new BuckysUser(); $offerData['basicInfo'] = $userIns->getUserBasicInfo($offerData['targetUserID']); $myItemImage = buckys_trade_get_item_thumb($offerData['offeredImages']); $theirItemImage = buckys_trade_get_item_thumb($offerData['targetImages']); $sendMessageLink = '/messages_compose.php?to=' . $offerData['targetUserID']; $theirID = $offerData['targetUserID']; $dateOffered = date('n/j/y', strtotime($offerData['offerCreatedDate'])); $strTimeLeft = ''; if (strtotime($offerData['targetCreatedDate']) > strtotime($offerData['offeredCreatedDate'])) { $strTimeLeft = buckys_trade_get_item_time_left($offerData['offeredCreatedDate']); } else { $strTimeLeft = buckys_trade_get_item_time_left($offerData['targetCreatedDate']); } $targetItemLink = '/trade/view.php?id=' . $offerData['targetItemID']; $offeredItemLink = '/trade/view.php?id=' . $offerData['offeredItemID']; $totalRating = 'No'; $positiveRating = ''; if (isset($offerData['totalRating']) && $offerData['totalRating'] > 0) { $totalRating = $offerData['totalRating'];
if (isset($view['items']) && count($view['items']) > 0) { ?> <div class="top-header-cont" style="color: #999999;"> <div class="n1"> </div> <div class="n2">Item</div> <div class="n3">Offers</div> <div class="n4">Time Left</div> <div class="n5">Actions</div> <div class="clear"></div> </div> <?php foreach ($view['items'] as $itemData) { $thumbFileUrl = buckys_trade_get_item_thumb($itemData['images']); if ($view['type'] == 'expired') { $timeLeftStr = 'Expired'; } else { $timeLeftStr = buckys_trade_get_item_time_left($itemData['createdDate']); } $editLink = '/trade/edititem.php?id=' . $itemData['itemID']; $relistLink = '/trade/edititem.php?id=' . $itemData['itemID'] . '&type=relist'; $offerViewLink = '/trade/offer_received.php?targetID=' . $itemData['itemID']; $viewLink = '/trade/view.php?id=' . $itemData['itemID']; ?> <div class="node"> <div class="n1"><a href="<?php echo $viewLink; ?>
if (isset($offerMade) && count($offerMade) > 0) { ?> <div class="top-header-cont"> <div class="n0"><input type="checkbox" class="select-all-offers" id="select_all_offers"></div> <div class="n1">My Item</div> <div class="n2">Their Item</div> <div class="n3">Date Declined</div> <div class="clear"></div> </div> <?php foreach ($offerMade as $offerData) { $targetItemImage = buckys_trade_get_item_thumb($offerData['targetImages']); $offeredItemImage = buckys_trade_get_item_thumb($offerData['offeredImages']); $sendMessageLink = '/messages_compose.php?to=' . $offerData['offeredUserID']; $dateOffered = date('n/j/y H:i', strtotime($offerData['offerCreatedDate'])); $targetItemLink = '/trade/view.php?id=' . $offerData['targetItemID']; $offeredItemLink = '/trade/view.php?id=' . $offerData['offeredItemID']; ?> <?php if ($view['type'] != 'byme') { ?> <div class="node"> <table cellpadding="0" cellspacing="0"> <tr> <td class="chk"> <input type="checkbox" id="chk_offer_row_<?php
$theirPrefix = ''; if ($tradeData['sellerID'] == $view['myID']) { //I'm seller for this tradeData $myPrefix = 'seller'; $theirPrefix = 'buyer'; } else { //I'm buyer for this tradeData $myPrefix = 'buyer'; $theirPrefix = 'seller'; } $userIns = new BuckysUser(); $tradeData['theirBasicInfo'] = $userIns->getUserBasicInfo($tradeData[$theirPrefix . 'ID']); $myTrackingNumber = $tradeData[$myPrefix . 'TrackingNo']; $theirTrackingNumber = $tradeData[$theirPrefix . 'TrackingNo']; $myItemImage = buckys_trade_get_item_thumb($tradeData[$myPrefix . 'ItemImages']); $theirItemImage = buckys_trade_get_item_thumb($tradeData[$theirPrefix . 'ItemImages']); $sendMessageLink = '/messages_compose.php?to=' . $tradeData[$theirPrefix . 'ID']; $dateCreated = date('n/j/y', strtotime($tradeData['tradeCreatedDate'])); $myItemLink = '/trade/view.php?id=' . $tradeData[$myPrefix . 'ItemID']; $theirItemLink = '/trade/view.php?id=' . $tradeData[$theirPrefix . 'ItemID']; $totalRating = 'No'; $positiveRating = ''; if (isset($tradeData[$theirPrefix . 'TotalRating']) && $tradeData[$theirPrefix . 'TotalRating'] > 0) { $totalRating = $tradeData[$theirPrefix . 'TotalRating']; if (is_numeric($tradeData[$theirPrefix . 'PositiveRating'])) { $positiveRating = number_format($tradeData[$theirPrefix . 'PositiveRating'] / $tradeData[$theirPrefix . 'TotalRating'] * 100, 2, '.', '') . '% Positive'; } } $theirID = $tradeData[$theirPrefix . 'ID']; ?>
<?php if ($view['offerDisabled'] == false) { ?> <div class="make-offer-panel"> <div><span class="titles">Select Items to Offer</span></div> <div class="inner-p needmask"> <input type="hidden" name="targetItemID" id="targetItemID" value="<?php echo $itemData['itemID']; ?> "> <ul id="offer_available_items"> <?php if (count($view['availableItems']) > 0) { foreach ($view['availableItems'] as $anItemData) { $thumbImagePath = buckys_trade_get_item_thumb($anItemData['images']); $itemUrl = '/trade/view.php?id=' . $anItemData['itemID']; ?> <li> <div class="rad"> <input type="hidden" name="" value="<?php echo $anItemData['itemID']; ?> "> <input type="radio" name="available_item"> </div> <div class="image"> <img src="<?php echo $thumbImagePath; ?> " >