Exemplo n.º 1
0
function browseItems($query, $params, $query_feat, $params_feat, $total, $current_page, $extravar = '')
{
    global $system, $uploaded_path, $MSG, $ERR_114, $db;
    global $template, $PAGES, $PAGE;
    $feat_items = false;
    if ($query_feat != '') {
        $db->query($query_feat, $params_feat);
        $k = 0;
        while ($row = $db->fetch()) {
            // get the data we need
            $row = build_items($row);
            // time left till the end of this auction
            $difference = $row['ends'] - time();
            $bgcolour = $k % 2 ? 'bgcolor="#FFFEEE"' : '';
            $template->assign_block_vars('featured_items', array('ID' => $row['id'], 'ROWCOLOUR' => $row['highlighted'] == 'y' ? 'bgcolor="#fea100"' : $bgcolour, 'IMAGE' => $row['pict_url'], 'TITLE' => $system->uncleanvars($row['title']), 'SUBTITLE' => $system->uncleanvars($row['subtitle']), 'BUY_NOW' => $difference < 0 ? '' : $row['buy_now'], 'BID' => $row['current_bid'], 'BIDFORM' => $system->print_money($row['current_bid']), 'CLOSES' => ArrangeDateNoCorrection($row['ends'] + $system->tdiff), 'NUMBIDS' => sprintf($MSG['950'], $row['num_bids']), 'B_BOLD' => $row['bold'] == 'y'));
            $k++;
            $feat_items = true;
        }
    }
    $db->query($query, $params);
    $k = 0;
    while ($row = $db->fetch()) {
        // get the data we need
        $row = build_items($row);
        // time left till the end of this auction
        $difference = $row['ends'] - time();
        $bgcolour = $k % 2 ? 'bgcolor="#FFFEEE"' : '';
        $template->assign_block_vars('items', array('ID' => $row['id'], 'ROWCOLOUR' => $row['highlighted'] == 'y' ? 'bgcolor="#fea100"' : $bgcolour, 'IMAGE' => $row['pict_url'], 'TITLE' => $system->uncleanvars($row['title']), 'SUBTITLE' => $system->uncleanvars($row['subtitle']), 'BUY_NOW' => $difference < 0 ? '' : $row['buy_now'], 'BID' => $row['current_bid'], 'BIDFORM' => $system->print_money($row['current_bid']), 'CLOSES' => ArrangeDateNoCorrection($row['ends'] + $system->tdiff), 'NUMBIDS' => sprintf($MSG['950'], $row['num_bids']), 'B_BOLD' => $row['bold'] == 'y'));
        $k++;
    }
    $extravar = empty($extravar) ? '' : '&' . $extravar;
    $PREV = intval($PAGE - 1);
    $NEXT = intval($PAGE + 1);
    if ($PAGES > 1) {
        $LOW = $PAGE - 5;
        if ($LOW <= 0) {
            $LOW = 1;
        }
        $COUNTER = $LOW;
        while ($COUNTER <= $PAGES && $COUNTER < $PAGE + 6) {
            $template->assign_block_vars('pages', array('PAGE' => $PAGE == $COUNTER ? '<b>' . $COUNTER . '</b>' : '<a href="' . $system->SETTINGS['siteurl'] . $current_page . '?PAGE=' . $COUNTER . $extravar . '"><u>' . $COUNTER . '</u></a>'));
            $COUNTER++;
        }
    }
    $template->assign_vars(array('B_FEATURED_ITEMS' => $feat_items, 'B_SUBTITLE' => $system->SETTINGS['subtitle'] == 'y', 'NUM_AUCTIONS' => $total == 0 ? $ERR_114 : $total, 'PREV' => $PAGES > 1 && $PAGE > 1 ? '<a href="' . $system->SETTINGS['siteurl'] . $current_page . '?PAGE=' . $PREV . $extravar . '"><u>' . $MSG['5119'] . '</u></a>&nbsp;&nbsp;' : '', 'NEXT' => $PAGE < $PAGES ? '<a href="' . $system->SETTINGS['siteurl'] . $current_page . '?PAGE=' . $NEXT . $extravar . '"><u>' . $MSG['5120'] . '</u></a>' : '', 'PAGE' => $PAGE, 'PAGES' => $PAGES));
}
Exemplo n.º 2
0
    }
}
$payment_options = unserialize($system->SETTINGS['payment_options']);
foreach ($payment_options as $k => $v) {
    if (_in_array($k, $payment)) {
        if (!$p_first) {
            $payment_methods .= ', ';
        } else {
            $p_first = false;
        }
        $payment_methods .= $v;
    }
}
$bn_link = !$has_ended ? ' <a href="' . $system->SETTINGS['siteurl'] . 'buy_now.php?id=' . $id . '"><img border="0" align="absbottom" alt="' . $MSG['496'] . '" src="' . get_lang_img('buy_it_now.gif') . '"></a>' : '';
$page_title = $system->uncleanvars($auction_data['title']);
$sslurl = $system->SETTINGS['usersauth'] == 'y' && $system->SETTINGS['https'] == 'y' ? str_replace('http://', 'https://', $system->SETTINGS['siteurl']) : $system->SETTINGS['siteurl'];
$sslurl = !empty($system->SETTINGS['https_url']) ? $system->SETTINGS['https_url'] : $sslurl;
$shipping = '';
if ($auction_data['shipping'] == 1) {
    $shipping = $MSG['031'];
} elseif ($auction_data['shipping'] == 2) {
    $shipping = $MSG['032'];
} elseif ($auction_data['shipping'] == 3) {
    $shipping = $MSG['867'];
}
$template->assign_vars(array('ID' => $auction_data['id'], 'TITLE' => $system->uncleanvars($auction_data['title']), 'SUBTITLE' => $system->uncleanvars($auction_data['subtitle']), 'AUCTION_DESCRIPTION' => $auction_data['description'], 'PIC_URL' => $uploaded_path . $id . '/' . $auction_data['pict_url'], 'SHIPPING_COST' => $auction_data['shipping_cost'] > 0 ? $system->print_money($auction_data['shipping_cost']) : $MSG['1152'], 'ADDITIONAL_SHIPPING_COST' => $system->print_money($auction_data['shipping_cost_additional']), 'COUNTRY' => $auction_data['country'], 'ZIP' => $auction_data['zip'], 'QTY' => $auction_data['quantity'], 'ENDS' => $ending_time, 'ENDS_IN' => $ends - time(), 'STARTTIME' => ArrangeDateNoCorrection($start + $system->tdiff), 'ENDTIME' => ArrangeDateNoCorrection($ends + $system->tdiff), 'BUYNOW1' => $auction_data['buy_now'], 'BUYNOW2' => $auction_data['buy_now'] > 0 ? $system->print_money($auction_data['buy_now']) . $bn_link : $system->print_money($auction_data['buy_now']), 'NUMBIDS' => $num_bids, 'MINBID' => $min_bid, 'MAXBID' => $high_bid, 'NEXTBID' => $next_bid, 'INTERNATIONAL' => $auction_data['international'] == 1 ? $MSG['033'] : $MSG['043'], 'SHIPPING' => $shipping, 'SHIPPINGTERMS' => nl2br($system->uncleanvars($auction_data['shipping_terms'])), 'PAYMENTS' => $payment_methods, 'AUCTION_VIEWS' => $auction_data['counter'], 'AUCTION_TYPE' => $auction_data['bn_only'] == 'n' ? $system->SETTINGS['auction_types'][$auction_type] : $MSG['933'], 'ATYPE' => $auction_type, 'THUMBWIDTH' => $system->SETTINGS['thumb_show'], 'VIEW_HISTORY1' => empty($view_history) ? '' : $view_history . ' | ', 'VIEW_HISTORY2' => $view_history, 'TOPCATSPATH' => $system->SETTINGS['extra_cat'] == 'y' && isset($_SESSION['browse_id']) && $_SESSION['browse_id'] == $auction_data['secondcat'] ? $secondcat_value : $cat_value, 'CATSPATH' => $cat_value, 'SECCATSPATH' => $secondcat_value, 'CAT_ID' => $auction_data['category'], 'UPLOADEDPATH' => $uploaded_path, 'BNIMG' => get_lang_img('buy_it_now.gif'), 'SELLER_REG' => $seller_reg, 'SELLER_ID' => $auction_data['user'], 'SELLER_NICK' => $auction_data['nick'], 'SELLER_TOTALFB' => $total_rate, 'SELLER_FBICON' => !empty($seller_rate_icon) && $seller_rate_icon != 'transparent.gif' ? '<img src="' . $system->SETTINGS['siteurl'] . 'images/icons/' . $seller_rate_icon . '" alt="' . $seller_rate_icon . '" class="fbstar">' : '', 'SELLER_NUMFB' => $num_feedbacks, 'SELLER_FBPOS' => $num_feedbacks > 0 ? '(' . ceil($fb_pos * 100 / $num_feedbacks) . '%)' : $MSG['000'], 'SELLER_FBNEG' => $fb_neg > 0 ? $MSG['5507'] . ' (' . ceil($fb_neg * 100 / $total_rate) . '%)' : '0', 'WATCH_VAR' => $watch_var, 'WATCH_STRING' => $watch_string, 'YOURBIDMSG' => isset($yourbidmsg) ? $yourbidmsg : '', 'YOURBIDCLASS' => isset($yourbidclass) ? $yourbidclass : '', 'BIDURL' => $sslurl, 'B_HASENDED' => $has_ended, 'B_CANEDIT' => $user->logged_in && $user->user_data['id'] == $auction_data['user'] && $num_bids == 0 && $difference > 0, 'B_CANCONTACTSELLER' => ($system->SETTINGS['contactseller'] == 'always' || $system->SETTINGS['contactseller'] == 'logged' && $user->logged_in) && (!$user->logged_in || $user->user_data['id'] != $auction_data['user']), 'B_HASIMAGE' => !empty($auction_data['pict_url']), 'B_NOTBNONLY' => $auction_data['bn_only'] == 'n', 'B_HASRESERVE' => $auction_data['reserve_price'] > 0 && $auction_data['reserve_price'] > $auction_data['current_bid'], 'B_BNENABLED' => $system->SETTINGS['buy_now'] == 2, 'B_HASGALELRY' => count($UPLOADED_PICTURES) > 0, 'B_SHOWHISTORY' => isset($_GET['history']) && $num_bids > 0, 'B_BUY_NOW' => $auction_data['buy_now'] > 0 && ($auction_data['bn_only'] == 'y' || $auction_data['bn_only'] == 'n' && ($auction_data['num_bids'] == 0 || $auction_data['reserve_price'] > 0 && $auction_data['current_bid'] < $auction_data['reserve_price'])), 'B_BUY_NOW_ONLY' => $auction_data['bn_only'] == 'y', 'B_ADDITIONAL_SHIPPING_COST' => $auction_data['auction_type'] == '2', 'B_USERBID' => $userbid, 'B_BIDDERPRIV' => $system->SETTINGS['buyerprivacy'] == 'y' && (!$user->logged_in || $user->logged_in && $user->user_data['id'] != $auction_data['user']), 'B_HASBUYER' => count($hbidder_data) > 0, 'B_COUNTDOWN' => $system->SETTINGS['hours_countdown'] > ($ends - time()) / 3600, 'B_HAS_QUESTIONS' => $num_questions > 0, 'B_CAN_BUY' => $user->can_buy && !($start > time()), 'B_SHOWENDTIME' => $showendtime, 'B_SHOW_ADDITIONAL_SHIPPING_COST' => $auction_data['shipping_cost_additional'] > 0));
include 'header.php';
$template->set_filenames(array('body' => 'item.tpl'));
$template->display('body');
include 'footer.php';
unset($_SESSION['browse_id']);
Exemplo n.º 3
0
    //Count date
    $ends = mysql_result($res, $i, 'ends');
    $difference = $ends - time();
    if ($difference > 0) {
        $ends_string = FormatTimeLeft($difference);
    } else {
        $ends_string = $MSG['911'];
    }
    if (mysql_result($res, $i, 'category') != 212) {
        if ($i <= 11) {
            $template->assign_block_vars('auc_last', array('BGCOLOUR' => $bgcolor, 'DATE' => ArrangeDateNoCorrection($date), 'ID' => mysql_result($res, $i, 'id'), 'TITLE' => mysql_result($res, $i, 'title'), 'IMAGE' => mysql_result($res, $i, 'pict_url'), 'FBID' => $system->print_money($max_bid), 'BIDURL' => $system->SETTINGS['usersauth'] == 'y' && $system->SETTINGS['https'] == 'y' ? str_replace('http://', 'https://', $system->SETTINGS['siteurl']) : $system->SETTINGS['siteurl'], 'ENDS' => $ends_string, 'NICK' => mysql_result($res, $i, 'nick'), 'PNEXTBID' => $system->print_money($next_bidp, false), 'BID' => $next_bidp, 'CAT_ID' => mysql_result($res, $i, 'category'), 'SELLER_ID' => mysql_result($res, $i, 'user')));
        } else {
            $template->assign_block_vars('end_soon', array('BGCOLOUR' => $bgcolor, 'DATE' => ArrangeDateNoCorrection($date), 'ID' => mysql_result($res, $i, 'id'), 'TITLE' => mysql_result($res, $i, 'title'), 'IMAGE' => mysql_result($res, $i, 'pict_url'), 'FBID' => $system->print_money($max_bid), 'BIDURL' => $system->SETTINGS['usersauth'] == 'y' && $system->SETTINGS['https'] == 'y' ? str_replace('http://', 'https://', $system->SETTINGS['siteurl']) : $system->SETTINGS['siteurl'], 'ENDS' => $ends_string, 'NICK' => mysql_result($res, $i, 'nick'), 'PNEXTBID' => $system->print_money($next_bidp, false), 'BID' => $next_bidp, 'CAT_ID' => mysql_result($res, $i, 'category'), 'SELLER_ID' => mysql_result($res, $i, 'user')));
        }
    } else {
        $template->assign_block_vars('auc_main', array('BGCOLOUR' => $bgcolor, 'DATE' => ArrangeDateNoCorrection($date), 'ID' => mysql_result($res, $i, 'id'), 'TITLE' => mysql_result($res, $i, 'title'), 'IMAGE' => mysql_result($res, $i, 'pict_url'), 'FBID' => $system->print_money($max_bid), 'BIDURL' => $system->SETTINGS['usersauth'] == 'y' && $system->SETTINGS['https'] == 'y' ? str_replace('http://', 'https://', $system->SETTINGS['siteurl']) : $system->SETTINGS['siteurl'], 'ENDS' => $ends_string, 'NICK' => mysql_result($res, $i, 'nick'), 'PNEXTBID' => $system->print_money($next_bidp, false), 'BID' => $next_bidp, 'CAT_ID' => mysql_result($res, $i, 'category'), 'SELLER_ID' => mysql_result($res, $i, 'user')));
    }
    $i++;
}
$auc_last = $i > 0 ? true : false;
// get ending soon auctions
$query = "SELECT ends, id, title FROM " . $DBPrefix . "auctions\r\n         WHERE closed = 0 AND suspended = 0 AND starts <= " . $NOW . "\r\n         ORDER BY ends LIMIT " . $system->SETTINGS['endingsoonnumber'];
$res = mysql_query($query);
$system->check_mysql($res, $query, __LINE__, __FILE__);
$num_auction = mysql_num_rows($res);
$i = 0;
$bgcolor = '#FFFFFF';
while ($i < $num_auction) {
    if ($bgcolor == '#FFFFFF') {
        $bgcolor = '#FFFEEE';
    } else {
Exemplo n.º 4
0
    $PAGE = 1;
}
$_SESSION['RETURN_LIST'] = 'listsuspendedauctions.php';
$_SESSION['RETURN_LIST_OFFSET'] = $PAGE;
$query = "SELECT COUNT(id) As auctions FROM " . $DBPrefix . "auctions WHERE suspended != 0";
$db->direct_query($query);
$num_auctions = $db->result('auctions');
$PAGES = $num_auctions == 0 ? 1 : ceil($num_auctions / $system->SETTINGS['perpage']);
$query = "SELECT a.id, u.nick, a.title, a.starts, a.ends, a.suspended, c.cat_name FROM " . $DBPrefix . "auctions a\n\t\tLEFT JOIN " . $DBPrefix . "users u ON (u.id = a.user)\n\t\tLEFT JOIN " . $DBPrefix . "categories c ON (c.cat_id = a.category)\n\t\tWHERE a.suspended != 0 ORDER BY nick LIMIT :offset, :perpage";
$params = array();
$params[] = array(':offset', $OFFSET, 'int');
$params[] = array(':perpage', $system->SETTINGS['perpage'], 'int');
$db->query($query, $params);
$bg = '';
while ($row = $db->fetch()) {
    $template->assign_block_vars('auctions', array('SUSPENDED' => $row['suspended'], 'ID' => $row['id'], 'TITLE' => $system->uncleanvars($row['title']), 'START_TIME' => ArrangeDateNoCorrection($row['starts']), 'END_TIME' => ArrangeDateNoCorrection($row['ends']), 'USERNAME' => $row['nick'], 'CATEGORY' => $row['cat_name'], 'B_HASWINNERS' => false, 'BG' => $bg));
    $bg = $bg == '' ? 'class="bg"' : '';
}
// get pagenation
$PREV = intval($PAGE - 1);
$NEXT = intval($PAGE + 1);
if ($PAGES > 1) {
    $LOW = $PAGE - 5;
    if ($LOW <= 0) {
        $LOW = 1;
    }
    $COUNTER = $LOW;
    while ($COUNTER <= $PAGES && $COUNTER < $PAGE + 6) {
        $template->assign_block_vars('pages', array('PAGE' => $PAGE == $COUNTER ? '<b>' . $COUNTER . '</b>' : '<a href="' . $system->SETTINGS['siteurl'] . 'admin/listsuspendedauctions.php?PAGE=' . $COUNTER . '"><u>' . $COUNTER . '</u></a>'));
        $COUNTER++;
    }
Exemplo n.º 5
0
 *   (at your option) any later version. Although none of the code may be
 *   sold. If you have been sold this script, get a refund.
 ***************************************************************************/
include 'common.php';
include $include_path . 'functions_invoices.php';
// If user is not logged in redirect to login page
if (!$user->is_logged_in()) {
    header('location: user_login.php');
    exit;
}
$sender = getSeller($user->user_data['id']);
$query = "SELECT w.id, w.winner, w.closingdate, a.id AS auc_id, a.title, w.qty,\tw.seller As uid \n\t\tFROM " . $DBPrefix . "auctions a\n\t\tLEFT JOIN " . $DBPrefix . "winners w ON (a.id = w.auction)\n\t\tWHERE a.id = " . intval($_POST['pfval']) . " AND w.id =" . intval($_POST['pfwon']);
$res = mysql_query($query);
$system->check_mysql($res, $query, __LINE__, __FILE__);
// check its real
if (mysql_num_rows($res) < 1) {
    invaildinvoice(true);
}
$data = mysql_fetch_assoc($res);
$winner = getAddresswinner($data['winner']);
// build winners address
$winner_address = '';
$winner_address .= !empty($winner['address']) ? '<br>' . $winner['address'] : '';
$winner_address .= !empty($winner['city']) ? '<br>' . $winner['city'] : '';
$winner_address .= !empty($winner['prov']) ? '<br>' . $winner['prov'] : '';
$winner_address .= !empty($winner['country']) ? '<br>' . $winner['country'] : '';
$winner_address .= !empty($winner['zip']) ? '<br>' . $winner['zip'] : '';
$title = $system->SETTINGS['sitename'] . ' - ' . $data['title'];
$template->assign_vars(array('DOCDIR' => $DOCDIR, 'LOGO' => $system->SETTINGS['siteurl'] . 'themes/' . $system->SETTINGS['theme'] . '/' . $system->SETTINGS['logo'], 'CHARSET' => $CHARSET, 'LANGUAGE' => $language, 'SENDER' => $sender['nick'], 'WINNER_NICK' => $winner['nick'], 'WINNER_ADDRESS' => $winner_address, 'AUCTION_TITLE' => strtoupper($title), 'AUCTION_ID' => $data['auc_id'], 'SHIPPING_METHOD' => "N/A", 'PAYMENT_METHOD' => "N/A", 'CLOSING_DATE' => ArrangeDateNoCorrection($data['closingdate']), 'PAYMENT' => $data['payment'], 'ITEM_QUANTITY' => $data['qty'], 'B_INVOICE' => true));
$template->set_filenames(array('body' => 'order_packingslip.tpl'));
$template->display('body');
<?php

/***************************************************************************
 *   copyright				: (C) 2008 - 2015 WeBid
 *   site					: http://www.webidsupport.com/
 ***************************************************************************/
/***************************************************************************
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version. Although none of the code may be
 *   sold. If you have been sold this script, get a refund.
 ***************************************************************************/
if (!defined('InWeBid')) {
    exit;
}
if ($user->user_data['startemailmode'] == 'yes') {
    $emailer = new email_handler();
    $emailer->assign_vars(array('SITE_URL' => $system->SETTINGS['siteurl'], 'SITENAME' => $system->SETTINGS['sitename'], 'A_ID' => $auction_id, 'A_TITLE' => $title, 'A_TYPE' => $atype == 1 ? $MSG['642'] : $MSG['641'], 'A_PICURL' => $pict_url != '' ? $uploaded_path . $auction_id . '/' . $pict_url : 'images/email_alerts/default_item_img.jpg', 'A_MINBID' => $system->print_money($minimum_bid), 'A_RESERVE' => $system->print_money($reserve_price), 'A_BNPRICE' => $system->print_money($buy_now_price), 'A_ENDS' => ArrangeDateNoCorrection($a_ends + $system->tdiff), 'C_NAME' => $user->user_data['name']));
    $emailer->email_uid = $user->user_data['id'];
    $subject = $system->SETTINGS['sitename'] . ' ' . $MSG['099'] . ': ' . $title . ' (' . $auction_id . ')';
    $emailer->email_sender($user->user_data['email'], 'auctionmail.inc.php', $subject);
}
Exemplo n.º 7
0
        }
        if ($row['buyer'] != 0) {
            $info .= $MSG['775'] . ' ' . $system->print_money($row['buyer']) . '<br>';
            $auc_id = true;
        }
        if ($row['finalval'] != 0) {
            $info .= $MSG['791'] . ' ' . $system->print_money($row['finalval']) . '<br>';
            $auc_id = true;
        }
        if ($row['balance'] != 0) {
            $info .= $MSG['935'] . ' ' . $system->print_money($row['balance']) . '<br>';
        }
        if ($auc_id) {
            $info = '<strong>' . $MSG['1034'] . ': ' . $row['auc_id'] . '</strong><br>' . $info;
        }
        $template->assign_block_vars('topay', array('INVOICE' => $row['useracc_id'], 'AUC_ID' => $row['auc_id'], 'DATE' => ArrangeDateNoCorrection($DATE), 'INFO' => $info, 'TOTAL' => $system->print_money($row['total']), 'PAID' => $row['paid'] == 1, 'PDF' => $system->SETTINGS['siteurl'] . 'item_invoice.php?id=' . $row['auc_id']));
    }
}
// get pagenation
$PREV = intval($PAGE - 1);
$NEXT = intval($PAGE + 1);
if ($PAGES > 1) {
    $LOW = $PAGE - 5;
    if ($LOW <= 0) {
        $LOW = 1;
    }
    $COUNTER = $LOW;
    while ($COUNTER <= $PAGES && $COUNTER < $PAGE + 6) {
        $template->assign_block_vars('pages', array('PAGE' => $PAGE == $COUNTER ? '<b>' . $COUNTER . '</b>' : '<a href="' . $system->SETTINGS['siteurl'] . 'outstanding.php?PAGE=' . $COUNTER . '"><u>' . $COUNTER . '</u></a>'));
        $COUNTER++;
    }
Exemplo n.º 8
0
    if ($difference > 0) {
        $ends_string = FormatTimeLeft($difference);
    } else {
        $ends_string = $MSG['911'];
    }
    $high_bid = $row['num_bids'] == 0 ? $row['minimum_bid'] : $row['current_bid'];
    $high_bid = $row['bn_only'] == 'y' ? $row['buy_now'] : $high_bid;
    $template->assign_block_vars('featured', array('ENDS' => $ends_string, 'ID' => $row['id'], 'BID' => $system->print_money($high_bid), 'IMAGE' => !empty($row['pict_url']) ? 'getthumb.php?w=' . $system->SETTINGS['thumb_show'] . '&fromfile=' . $uploaded_path . $row['id'] . '/' . $row['pict_url'] : 'images/email_alerts/default_item_img.jpg', 'TITLE' => $row['title']));
}
// get last created auctions
$query = "SELECT id, title, starts from " . $DBPrefix . "auctions\n\t\t WHERE closed = 0 AND suspended = 0\n\t\t AND starts <= " . $NOW . "\n\t\t ORDER BY starts DESC\n\t\t LIMIT " . $system->SETTINGS['lastitemsnumber'];
$res = mysql_query($query);
$system->check_mysql($res, $query, __LINE__, __FILE__);
$i = 0;
while ($row = mysql_fetch_assoc($res)) {
    $template->assign_block_vars('auc_last', array('BGCOLOUR' => !($i % 2) ? '' : 'class="alt-row"', 'DATE' => ArrangeDateNoCorrection($row['starts'] + $system->tdiff), 'ID' => $row['id'], 'TITLE' => $row['title']));
    $i++;
}
$auc_last = $i > 0 ? true : false;
// get ending soon auctions
$query = "SELECT ends, id, title FROM " . $DBPrefix . "auctions\n\t\t WHERE closed = 0 AND suspended = 0 AND starts <= " . $NOW . "\n\t\t ORDER BY ends LIMIT " . $system->SETTINGS['endingsoonnumber'];
$res = mysql_query($query);
$system->check_mysql($res, $query, __LINE__, __FILE__);
$i = 0;
while ($row = mysql_fetch_assoc($res)) {
    $difference = $row['ends'] - time();
    if ($difference > 0) {
        $ends_string = FormatTimeLeft($difference);
    } else {
        $ends_string = $MSG['911'];
    }
Exemplo n.º 9
0
        $template->assign_block_vars('accounts', array('DATE' => $date, 'AMOUNT' => $system->print_money($row['amount'], true, false), 'BG' => $bg, 'TOTAL' => !empty($row['total']) ? $row['total'] : ''));
        $bg = $bg == '' ? 'class="bg"' : '';
    }
} else {
    $_SESSION['RETURN_LIST'] = 'accounts.php';
    $_SESSION['RETURN_LIST_OFFSET'] = $PAGE;
    $show_pagnation = true;
    $query = "SELECT COUNT(id) As accounts FROM " . $DBPrefix . "accounts" . (!empty($where_sql) ? ' WHERE ' . $where_sql : '');
    $db->direct_query($query);
    $num_accounts = $db->numrows();
    $PAGES = $num_accounts == 0 ? 1 : ceil($num_accounts / $system->SETTINGS['perpage']);
    $query = "SELECT * FROM " . $DBPrefix . "accounts\n\t\t\t" . (!empty($where_sql) ? ' WHERE ' . $where_sql : '') . " ORDER BY paid_date LIMIT " . $OFFSET . ", " . $system->SETTINGS['perpage'];
    $db->direct_query($query);
    $bg = '';
    while ($row = $db->fetch()) {
        $template->assign_block_vars('accounts', array('ID' => $row['id'], 'NICK' => $row['nick'], 'RNAME' => $row['name'], 'DATE' => ArrangeDateNoCorrection($row['paid_date']), 'AMOUNT' => $system->print_money($row['amount'], true, false), 'TEXT' => $row['text'], 'BG' => $bg));
        $bg = $bg == '' ? 'class="bg"' : '';
    }
}
// get pagenation
$PREV = intval($PAGE - 1);
$NEXT = intval($PAGE + 1);
if ($PAGES > 1) {
    $LOW = $PAGE - 5;
    if ($LOW <= 0) {
        $LOW = 1;
    }
    $COUNTER = $LOW;
    while ($COUNTER <= $PAGES && $COUNTER < $PAGE + 6) {
        $template->assign_block_vars('pages', array('PAGE' => $PAGE == $COUNTER ? '<b>' . $COUNTER . '</b>' : '<a href="' . $system->SETTINGS['siteurl'] . 'admin/accounts.php?PAGE=' . $COUNTER . '"><u>' . $COUNTER . '</u></a>'));
        $COUNTER++;
Exemplo n.º 10
0
if (!isset($USERLANG)) {
    $USERLANG = $language;
}
$buffer = file($main_path . "language/" . $USERLANG . "/mail_auctionmail.inc.php");
$i = 0;
$j = 0;
while ($i < count($buffer)) {
    if (!ereg("^#(.)*\$", $buffer[$i])) {
        $skipped_buffer[$j] = $buffer[$i];
        $j++;
    }
    $i++;
}
// Handle time correction
$ENDS = explode(' ', $a_ends);
$ENDS_DATE = ArrangeDateNoCorrection($a_ends + $system->tdiff);
$message = implode($skipped_buffer, '');
//--Change TAGS with variables content
$message = ereg_replace("<#c_name#>", $userrec['name'], $message);
$message = ereg_replace("<#c_nick#>", $userrec['nick'], $message);
$message = ereg_replace("<#c_address#>", $userrec['address'], $message);
$message = ereg_replace("<#c_city#>", $userrec['city'], $message);
$message = ereg_replace("<#c_country#>", $userrec['country'], $message);
$message = ereg_replace("<#c_zip#>", $userrec['zip'], $message);
$message = ereg_replace("<#c_email#>", $userrec['email'], $message);
if ($_SESSION['SELL_atype'] == 1) {
    $message = ereg_replace("<#a_type#>", $MSG['642'], $message);
} else {
    $message = ereg_replace("<#a_type#>", $MSG['641'], $message);
}
$message = ereg_replace("<#a_buyitnow#>", $system->print_money($buy_now_price), $message);
Exemplo n.º 11
0
        }
    }
}
// history
$query = "SELECT b.*, u.nick FROM " . $DBPrefix . "bids b\r\n\t\tLEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder)\r\n\t\tWHERE b.auction = " . $id . " ORDER BY b.bid DESC, b.id DESC";
$result_numbids = mysql_query($query);
$system->check_mysql($result_numbids, $query, __LINE__, __FILE__);
$num_bids = mysql_num_rows($result_numbids);
$i = 0;
while ($bidrec = mysql_fetch_assoc($result_numbids)) {
    // -- Format bid date
    $bidrec['bidwhen'] = ArrangeDateNoCorrection($bidrec['bidwhen'] + $system->tdiff) . ":" . gmdate('s', $bidrec['bidwhen']);
    $BGCOLOR = !($i % 2) ? '' : 'class="alt-row"';
    if (!isset($bidderarray[$bidrec['nick']])) {
        if ($system->SETTINGS['buyerprivacy'] == 'y' && $_SESSION['WEBID_LOGGED_IN'] != $auction_data['user'] && $_SESSION['WEBID_LOGGED_IN'] != $bidrec['bidder']) {
            $bidderarray[$bidrec['nick']] = $MSG['176'] . ' ' . $bidderarraynum;
            $bidderarraynum++;
        } else {
            $bidderarray[$bidrec['nick']] = $bidrec['nick'];
        }
    }
    $template->assign_block_vars('bidhistory', array('BGCOLOUR' => $BGCOLOR, 'ID' => $bidrec['bidder'], 'NAME' => $bidderarray[$bidrec['nick']], 'BID' => $system->print_money($bidrec['bid']), 'WHEN' => $bidrec['bidwhen'], 'QTY' => $bidrec['quantity']));
}
if (!$has_ended) {
    $bn_link = ' <a href="' . $system->SETTINGS['siteurl'] . 'buy_now.php?id=' . $id . '"><img border="0" align="absbottom" alt="' . $MSG['496'] . '" src="' . $system->SETTINGS['siteurl'] . 'images/buy_it_now.gif"></a>';
}
$template->assign_vars(array('ID' => $auction_data['id'], 'TITLE' => $auction_data['title'], 'AUCTION_DESCRIPTION' => stripslashes($auction_data['description']), 'PIC_URL' => $uploaded_path . $id . "/" . $pict_url_plain, 'SHIPPING_COST' => $auction_data['shipping_cost'] > 0 ? $system->print_money($auction_data['shipping_cost']) : $system->print_money($auction_data['shipping_cost']), 'COUNTRY' => $auction_data['country'], 'ZIP' => $auction_data['zip'], 'QTY' => $auction_data['quantity'], 'ENDS' => $ending_time, 'STARTTIME' => ArrangeDateNoCorrection($start + $system->tdiff), 'ENDTIME' => ArrangeDateNoCorrection($ends + $system->tdiff), 'BUYNOW1' => $auction_data['buy_now'], 'BUYNOW2' => $auction_data['buy_now'] > 0 ? $system->print_money($auction_data['buy_now']) . $bn_link : $system->print_money($auction_data['buy_now']), 'NUMBIDS' => $num_bids, 'MINBID' => $min_bid, 'MAXBID' => $high_bid, 'NEXTBID' => $next_bid, 'PNEXTBID' => $next_bidp, 'INTERNATIONAL' => $auction_data['international'] == 1 ? $MSG['033'] : $MSG['043'], 'SHIPPING' => $auction_data['shipping'] == '1' ? $MSG['031'] : $MSG['032'], 'SHIPPINGTERMS' => nl2br($auction_data['shipping_terms']), 'PAYMENTS' => str_replace("\n", ', ', $auction_data['payment']), 'AUCTION_VIEWS' => $auction_data['counter'], 'AUCTION_TYPE' => $auction_types[$auction_type], 'ATYPE' => $auction_type, 'THUMBWIDTH' => $system->SETTINGS['thumb_show'], 'VIEW_HISTORY1' => empty($view_history) ? '' : $view_history . ' | ', 'VIEW_HISTORY2' => $view_history, 'CATSPATH' => $cat_value, 'CAT_ID' => $auction_data['category'], 'UPLOADEDPATH' => $uploaded_path, 'SELLER_REG' => $seller_reg, 'SELLER_ID' => $auction_data['user'], 'SELLER_NICK' => $auction_data['nick'], 'SELLER_TOTALFB' => $total_rate, 'SELLER_FBICON' => !empty($seller_rate_icon) && $seller_rate_icon != 'transparent.gif' ? '<img src="' . $system->SETTINGS['siteurl'] . 'images/icons/' . $seller_rate_icon . '" alt="' . $seller_rate_icon . '" class="fbstar">' : '', 'SELLER_NUMFB' => $num_feedbacks, 'SELLER_FBPOS' => $num_feedbacks > 0 ? "(" . ceil($fb_pos * 100 / $total_rate) . "%)" : '100%', 'SELLER_FBNEG' => $fb_neg > 0 ? $MSG['5507'] . " (" . ceil($fb_neg * 100 / $total_rate) . "%)" : '0', 'BUYER_ID' => $hbidder_data['bidder'], 'BUYER_NAME' => $bidderarray[$hbidder_data['nick']], 'BUYER_FB' => $hbidder_data['rate_sum'], 'BUYER_FB_ICON' => !empty($buyer_rate_icon) && $buyer_rate_icon != 'transparent.gif' ? '<img src="' . $system->SETTINGS['siteurl'] . 'images/icons/' . $buyer_rate_icon . '" alt="' . $buyer_rate_icon . '" class="fbstar">' : '', 'WATCH_VAR' => $watch_var, 'WATCH_STRING' => $watch_string, 'YOURBIDMSG' => $yourbidmsg, 'YOURBIDCLASS' => $yourbidclass, 'BIDURL' => $system->SETTINGS['usersauth'] == 'y' && $system->SETTINGS['https'] == 'y' ? str_replace('http://', 'https://', $system->SETTINGS['siteurl']) : $system->SETTINGS['siteurl'], 'B_HASENDED' => $has_ended, 'B_CANEDIT' => $_SESSION['WEBID_LOGGED_IN'] == $auction_data['user'] && $num_bids == 0 && $difference > 0, 'B_CANCONTACTSELLER' => $system->SETTINGS['contactseller'] == 'always' || $system->SETTINGS['contactseller'] == 'logged' && isset($_SESSION['WEBID_LOGGED_IN']), 'B_HASIMAGE' => !empty($pict_url_plain), 'B_NOTBNONLY' => $auction_data['bn_only'] == 'n', 'B_HASRESERVE' => $auction_data['reserve_price'] > 0 && $auction_data['reserve_price'] > $auction_data['current_bid'], 'B_BNENABLED' => $system->SETTINGS['buy_now'] == 2, 'B_HASGALELRY' => count($UPLOADED_PICTURES) > 0, 'B_SHOWHISTORY' => isset($_GET['history']) && $num_bids > 0, 'B_BUY_NOW' => $auction_data['buy_now'] > 0 && ($auction_data['bn_only'] == 'y' || $auction_data['bn_only'] == 'n' && ($auction_data['num_bids'] == 0 || $auction_data['reserve_price'] > 0 && $auction_data['current_bid'] < $auction_data['reserve_price'])), 'B_BUY_NOW_ONLY' => $auction_data['bn_only'] == 'y', 'B_USERBID' => $userbid, 'B_BIDDERPRIV' => $system->SETTINGS['buyerprivacy'] == 'y' && $_SESSION['WEBID_LOGGED_IN'] != $auction_data['user']));
require "header.php";
$template->set_filenames(array('body' => 'item.html'));
$template->display('body');
include "footer.php";