// auction specific details $template->assign_vars(array('AUCTION_TITLE' => strtoupper($title), 'ITEM_QUANTITY' => $data['qty'], 'UNIT_PRICE' => $system->print_money($unitexcl, true, false), 'UNIT_PRICE_WITH_TAX' => $system->print_money($unitpriceincl, true, false), 'TOTAL' => $system->print_money($subtotal, true, false), 'TOTAL_WITH_TAX' => $system->print_money($totalinc, true, false))); } else { // get fee data $query = "SELECT * FROM " . $DBPrefix . "useraccounts WHERE useracc_id = :user_id"; $params = array(); $params[] = array(':user_id', $_GET['id'], 'int'); $db->query($query, $params); // check its real if ($db->numrows() < 1) { invalidinvoice(); } $data = $db->result(); // do you have permission to view this? if (!$fromadmin && $data['user_id'] != $user->user_data['id']) { invalidinvoice(); } //$seller = getSeller($user->user_data['id']); // used as user: ?? $seller = getSeller($data['user_id']); $vat = getTax(true, $seller['country']); $winner['nick'] = ''; $winner_address = ''; $data['shipping_terms'] = ''; $data['id'] = $data['useracc_id']; $shipping_cost = 0; $title = $system->SETTINGS['sitename'] . ' - ' . $MSG['766'] . '#' . $data['id']; $payvalue = $data['total']; $totalvat = 0; // create fee data ready for template & get totals $totals = setfeetemplate($data); // fee specific details
***************************************************************************/ 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 = :auc_id AND w.id = :winner_id"; $params = array(); $params[] = array(':auc_id', $_POST['pfval'], 'int'); $params[] = array(':winner_id', $_POST['pfwon'], 'int'); $db->query($query, $params); // check its real if ($db->numrows() < 1) { invalidinvoice(true); } $data = $db->result(); $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'] . ' - ' . $system->uncleanvars($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'] + $system->tdiff), 'PAYMENT' => $data['payment'], 'ITEM_QUANTITY' => $data['qty'], 'B_INVOICE' => true)); $template->set_filenames(array('body' => 'order_packingslip.tpl')); $template->display('body');