Ejemplo n.º 1
0
echo get_current_user_id();
?>
" />
		<input type="hidden" name="auction_action" value="newbid">
		<input type="hidden" name="bidtype" value="bid"> 
        <input type="hidden" name="hidden_cp" id="hidden_cp" value="<?php 
echo get_maxprice_should($post_id);
?>
 "> 
         <div class="col-md-12">
         <h4>Enter your <b>max</b> bid</h4>
         </div>
         <div class="col-md-6">         
         	<div class="input-group">
			<input type="text" class="form-control input-lg" id="bid_amount" name="bidamount" placeholder="<?php 
echo get_nextbid_price($post_id);
?>
"> 
			<span class="input-group-addon">$</span>
			</div>          
        </div>        
        <div class="col-md-2">        
        	<button class="btn btn-lg btn-primary" type="submit">Confirm Bid</button>        
        </div>
        </form>
        <script>
		function CheckBidding(){		
			var bidprice = jQuery('#bid_amount').val();
			var ecp = jQuery('#hidden_cp').val();	
			var ecp = Math.round(parseFloat(ecp)*100)/100;
			var bidprice = Math.round(parseFloat(bidprice)*100)/100;
Ejemplo n.º 2
0
$current_time = strtotime(date("Y-m-d H:i:s"));
$data['sold_out'] = null;
if ($next_date <= $current_time) {
    $max_price = get_maxprice($post_id);
    if ($max_price == 0) {
        $next_new_time = $next_date + 60 * 5;
        $new_date = date("Y-m-d H:i:s", $next_new_time);
        update_post_meta($post_id, "expire_time", $new_date);
    } else {
        update_post_meta($post_id, "sold_out", "yes");
        $win_data = get_winner_data($post_id);
        $win_user_id = $win_data['uid'];
        $msg = "You win product with your bid " . $win_data['price'];
        $headers = 'From: Online Auction <*****@*****.**>' . "\r\n";
        $attachments = "";
        $data['sold_out'] = 1;
        $data['winner_price'] = $win_data['price'];
        $data['winner_uid'] = $win_data['uid'];
        $data['winner_name'] = get_the_author_meta("first_name", $win_user_id) . " " . get_the_author_meta("last_name", $win_user_id);
    }
}
$data['max_bid_userid'] = 1;
$data['number_of_bids'] = get_number_of_bids($post_id);
$data['max_bid'] = get_maxprice($post_id);
$data['get_nextbid_price'] = get_nextbid_price($post_id);
$data['post_view'] = getPostViews($post_id);
echo json_encode($data);
?>