示例#1
0
 }
 if ($_SESSION['SELL_action'] == 'edit' || $_SESSION['SELL_action'] == 'relist') {
     $auction_id = $_SESSION['SELL_auction_id'];
 } else {
     // insert auction
     addauction();
     $auction_id = $db->lastInsertId();
     //print_r($db);
     $_SESSION['SELL_auction_id'] = $auction_id;
 }
 $addcounter = true;
 // work out & add fee
 if ($system->SETTINGS['fees'] == 'y') {
     $feeupdate = false;
     // attach the new invoice to users account
     addoutstanding();
     // deal with the auction
     if ($system->SETTINGS['fee_type'] == 2 && $fee > 0) {
         $query = "UPDATE " . $DBPrefix . "auctions SET suspended = 9 WHERE id = :auction_id";
         $params = array();
         $params[] = array(':auction_id', $auction_id, 'int');
         $db->query($query, $params);
         $addcounter = false;
     } else {
         $query = "UPDATE " . $DBPrefix . "users SET balance = balance - :fee WHERE id = :user_id";
         $params = array();
         $params[] = array(':fee', $fee, 'float');
         $params[] = array(':user_id', $user->user_data['id'], 'int');
         $db->query($query, $params);
     }
 }
示例#2
0
 $system->check_mysql($res, $query, __LINE__, __FILE__);
 if ($_SESSION['SELL_action'] == 'edit' || $_SESSION['SELL_action'] == 'relist') {
     $auction_id = $_SESSION['SELL_auction_id'];
 } else {
     $query = "SELECT LAST_INSERT_ID() as id";
     $res = mysql_query($query);
     $system->check_mysql($res, $query, __LINE__, __FILE__);
     $auction_id = mysql_result($res, 0, 'id');
     $_SESSION['SELL_auction_id'] = $auction_id;
 }
 $addcounter = true;
 // work out & add fee
 if ($system->SETTINGS['fees'] == 'y') {
     $feeupdate = false;
     // attach the new invoice to users account
     $query = addoutstanding();
     $res = mysql_query($query);
     $system->check_mysql($res, $query, __LINE__, __FILE__);
     // deal with the auction
     if ($system->SETTINGS['fee_type'] == 2 && $fee > 0) {
         $query = "UPDATE " . $DBPrefix . "auctions SET suspended = 9 WHERE id = " . $auction_id;
         $system->check_mysql(mysql_query($query), $query, __LINE__, __FILE__);
         $addcounter = false;
     } else {
         $query = "UPDATE " . $DBPrefix . "users SET balance = balance - " . $fee . " WHERE id = " . $user->user_data['id'];
         $system->check_mysql(mysql_query($query), $query, __LINE__, __FILE__);
     }
 }
 if ($addcounter && $_SESSION['SELL_action'] != 'edit') {
     $query = "UPDATE " . $DBPrefix . "counters SET auctions = auctions + 1";
     $system->check_mysql(mysql_query($query), $query, __LINE__, __FILE__);