Exemple #1
0
                 $db->direct_query($query);
                 $query = "UPDATE " . $DBPrefix . "auctions SET current_bid = :bid, num_bids = num_bids + 2 WHERE id = :auc_id";
                 $params = array();
                 $params[] = array(':auc_id', $id, 'int');
                 $params[] = array(':bid', $cbid, 'float');
                 $db->query($query, $params);
                 if ($customincrement == 0) {
                     // get new increment
                     $increment = get_increment($cbid);
                 } else {
                     $increment = $customincrement;
                 }
                 $next_bid = $cbid + $increment;
             }
         }
         extend_auction($item_id, $c);
     }
 } elseif ($atype == 2 && !isset($errmsg)) {
     // If the bidder already bid on this auction there new bbid must be higher
     $query = "SELECT bid, quantity FROM " . $DBPrefix . "bids WHERE bidder = :bidder_id AND auction = :auc_id ORDER BY bid DESC LIMIT 1";
     $params = array();
     $params[] = array(':auc_id', $id, 'int');
     $params[] = array(':bidder_id', $bidder_id, 'int');
     $db->query($query, $params);
     if ($db->numrows() > 0) {
         $PREVIOUSBID = result();
         if ($bid * $qty <= $PREVIOUSBID['bid'] * $PREVIOUSBID['quantity']) {
             $errmsg = $ERR_059;
         }
     }
     if (!isset($errmsg)) {
Exemple #2
0
                 $query = "UPDATE " . $DBPrefix . "auctions SET current_bid = :bid, current_bid_id = :current_bid_id, num_bids = num_bids + 2 WHERE id = :auc_id";
                 $params = array();
                 $params[] = array(':auc_id', $id, 'int');
                 $params[] = array(':current_bid_id', $current_bid_id, 'int');
                 $params[] = array(':bid', $cbid, 'float');
                 $db->query($query, $params);
                 if ($customincrement == 0) {
                     // get new increment
                     $increment = get_increment($cbid);
                 } else {
                     $increment = $customincrement;
                 }
                 $next_bid = $cbid + $increment;
             }
         }
         extend_auction($item_id, $Data['ends']);
     }
 } elseif ($atype == 2 && !isset($errmsg)) {
     // If the bidder already bid on this auction there new bbid must be higher
     $query = "SELECT bid, quantity FROM " . $DBPrefix . "bids WHERE bidder = :bidder_id AND auction = :auc_id ORDER BY bid DESC LIMIT 1";
     $params = array();
     $params[] = array(':auc_id', $id, 'int');
     $params[] = array(':bidder_id', $bidder_id, 'int');
     $db->query($query, $params);
     if ($db->numrows() > 0) {
         $PREVIOUSBID = $db->result();
         if ($bid * $qty <= $PREVIOUSBID['bid'] * $PREVIOUSBID['quantity']) {
             $errmsg = $ERR_059;
         }
     }
     if (!isset($errmsg)) {