function update_auction_list() { $ebatns_dir = DIR_WS_INCLUDES . 'EbatNs' . SLASH; require_once $ebatns_dir . 'EbatNs_ServiceProxy.php'; require_once $ebatns_dir . 'EbatNs_Logger.php'; require_once $ebatns_dir . 'GetSellerEventsRequestType.php'; $mySession = create_ebay_session(); if ($mySession) { //look for auction details of ended auctions update_auction_details($session); $resultstring = AUCTIONS_TEXT_AUCTION_LIST_STATUS_SUCCESS; $mynewstarttime = toGMT(date(AUCTIONS_DATE_FORMAT)); $eventarray = get_new_Events($mySession, $mynewstarttime); $auctionssql = SELECT_ALL . TABLE_AUCTION_LIST . SQL_WHERE . "auction_list.ended!=1 AND auction_list.starttime <= '" . $mynewstarttime . "' " . $ordersql; $myauctions = olc_db_query($auctionssql); while ($auctions_values = olc_db_fetch_array($myauctions)) { $mybidcount = $auctions_values['bidcount']; //look if spec. auctionitem has some new events $auction_id = $auctions_values['auction_id']; $current_eventarray = $eventarray[$auction_id]; if (isset($current_eventarray)) { $endtime = $auctions_values['endtime']; $starttime = $auctions_values['starttime']; $bidcount = $current_eventarray['bidcount']; $bidprice = $current_eventarray['price']; $endtime = $current_eventarray['endtime']; if ($bidcount > $mybidcount && $endtime <= $endtime) { update_bidcount($starttime, $endtime, $bidcount, $bidprice, $auction_id); } else { if ($endtime > $endtime) { update_ended($starttime, $endtime, $auction_id); } } } else { if ($endtime <= $mynewstarttime) { update_ended($starttime, $endtime, $auction_id); } } } return true; } else { return false; } }
Released under the GNU General Public License --------------------------------------------------------------*/ require 'includes/application_top.php'; require_once $ebatns_dir . 'EbatNs_ServiceProxy.php'; require_once $ebatns_dir . 'EbatNs_Logger.php'; require_once $ebatns_dir . 'GetSellerEventsRequestType.php'; require_once $ebatns_dir . 'GetSellerTransactionsRequestType.php'; $mySession = new EbatNs_Session(AUCTIONS_EBAY_CONFIG); //check if button for pickup new data is clicked if (isset($_POST['pickup'])) { //if last click was more than 30 min ago if (check_time_dif()) { //update auction list if (update_auction_list()) { $session = create_ebay_session(); if ($session) { //look for auction details of ended auctions update_auction_details($session); $resultstring = AUCTIONS_TEXT_AUCTION_LIST_STATUS_SUCCESS; } else { $resultstring = EBAY_SESSION_ERROR; } } else { $resultstring = EBAY_SESSION_ERROR; } } else { $resultstring = AUCTIONS_TEXT_AUCTION_LIST_STATUS_FAILED; } if ($resultstring) { $main_content = "<span class='smallText'>" . $resultstring . "</span><br/>";