Exemplo n.º 1
0
function RenderPage_myauctions()
{
    global $config, $html;
    $output = '';
    $UseAjaxSource = FALSE;
    $config['title'] = 'My Auctions';
    // load page html
    $outputs = RenderHTML::LoadHTML('pages/myauctions.php');
    $html->addTags(array('messages' => ''));
    // load javascript
    $html->addToHeader($outputs['header']);
    // display error
    if (isset($config['error'])) {
        $config['tags']['messages'] .= str_replace('{message}', $config['error'], $outputs['error']);
    }
    if (isset($_SESSION['error'])) {
        $config['tags']['messages'] .= str_replace('{message}', $_SESSION['error'], $outputs['error']);
        unset($_SESSION['error']);
    }
    // display success
    if (isset($_SESSION['success'])) {
        $config['tags']['messages'] .= str_replace('{message}', $_SESSION['success'], $outputs['success']);
        unset($_SESSION['success']);
    }
    // list auctions
    $auctions = QueryAuctions::QueryMy();
    $outputRows = '';
    while (TRUE) {
        $auction = $auctions->getNext();
        if (!$auction) {
            break;
        }
        $Item = $auction->getItem();
        if (!$Item) {
            continue;
        }
        $tags = array('auction id' => (int) $auction->getTableRowId(), 'seller name' => $auction->getSeller(), 'item' => $Item->getDisplay(), 'qty' => (int) $Item->getItemQty(), 'price each' => FormatPrice($auction->getPrice()), 'price total' => FormatPrice($auction->getPriceTotal()), 'created' => $auction->getCreated(), 'expire' => $auction->getExpire(), 'market price percent' => '--', 'rowclass' => 'gradeU');
        //  if($Item->itemType=='tool'){
        //    $output.='<br />'.$Item->getDamagedChargedStr();
        //    foreach($Item->getEnchantmentsArray() as $ench){
        //      $output.='<br /><span style="font-size: smaller;"><i>'.$ench['enchName'].' '.numberToRoman($ench['level']).'</i></span>';
        //    }
        //  }
        //$marketPrice=getMarketPrice($id, 1);
        //if($marketPrice>0){
        //  $marketPercent=round((($price/$marketPrice)*100), 1);
        //}else{
        //  $marketPercent='N/A';
        //}if($marketPercent=='N/A'){
        //  $grade='gradeU';
        //}elseif($marketPercent<=50){
        //  $grade='gradeA';
        //}elseif($marketPercent<=150){
        //  $grade='gradeC';
        //}else{
        //  $grade='gradeX';
        //}
        $htmlRow = $outputs['body row'];
        RenderHTML::RenderTags($htmlRow, $tags);
        $outputRows .= $htmlRow;
    }
    unset($auctions, $Item);
    return $outputs['body top'] . "\n" . $outputRows . "\n" . $outputs['body bottom'];
}