}
        } else {
            $resultstring = EBAY_SESSION_ERROR;
        }
    } else {
        $resultstring = AUCTIONS_TEXT_AUCTION_LIST_STATUS_FAILED;
    }
    if ($resultstring) {
        $main_content = "<span class='smallText'>" . $resultstring . "</span><br/>";
    }
}
$orderby = "auction_id";
//Default order field
require_once DIR_WS_FUNCTIONS . 'list_sorting.php';
//show all auctions not ended and not sheduled
$mynewstarttime = toGMT(date(AUCTIONS_DATE_FORMAT));
$auctionssql = SELECT_ALL . TABLE_AUCTION_LIST . " where ended !=1 AND starttime <= '" . $mynewstarttime . "' " . $ordersql;
$myauctions = olc_db_query($auctionssql);
$main_content .= '
<p align="right">
' . olc_draw_form('pickup_form', $PHP_SELF) . olc_draw_submit_button('pickup', AUCTIONS_TEXT_AUCTION_LIST_STATUS_GET) . '
</form>
</p>
';
/* define Table Heading */
$heading = array(array($name_text => AUCTIONS_TEXT_AUCTION_AMOUNT, $attributes_text => $align_center_text, $sort_text => str_replace(HASH, $auction_title_text, $sort0), $link_text => $file . $auction_title_text), array($name_text => AUCTIONS_TEXT_AUCTION_LIST_EBAY_ID, $attributes_text => $align_center_text, $sort_text => str_replace(HASH, $auction_id_text, $sort0), $link_text => $file . $auction_id_text), array($name_text => AUCTIONS_TEXT_AUCTION_START_PRICE, $attributes_text => $align_right_text, $sort_text => str_replace(HASH, $startprice_text, $sort0), $link_text => $file . $startprice_text), array($name_text => AUCTIONS_TEXT_AUCTION_BUYNOW_PRICE, $attributes_text => $align_center_text, $sort_text => str_replace(HASH, $buynowprice_text, $sort0), $link_text => $file . $buynowprice_text), array($name_text => AUCTIONS_TEXT_AUCTION_LIST_START_TIME, $attributes_text => $align_center_text, $sort_text => str_replace(HASH, $starttime_text, $sort0), $link_text => $file . $starttime_text), array($name_text => AUCTIONS_TEXT_AUCTION_LIST_END_TIME, $attributes_text => $align_center_text, $sort_text => str_replace(HASH, $endtime_text, $sort0), $link_text => $file . $endtime_text), array($name_text => AUCTIONS_TEXT_AUCTION_LIST_BIDS, $attributes_text => $align_center_text, $sort_text => str_replace(HASH, $bidcount_text, $sort0), $link_text => $file . $bidcount_text), array($name_text => AUCTIONS_TEXT_AUCTION_LIST_HIGHEST_BID, $attributes_text => $align_center_text, $sort_text => str_replace(HASH, $bidprice_text, $sort0), $link_text => $file . $bidprice_text));
/* print table heading */
$main_content = tableheading($heading);
$i = 0;
while ($auctions_values = olc_db_fetch_array($myauctions)) {
    $mybidcount = $auctions_values[$bidcount_text];
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;
    }
}
     $error_location = true;
 }
 //set country
 $country = $_POST[$country_text];
 //set starttime
 $mystarttime = $_POST[$starttime_text];
 if ($mystarttime) {
     $future_auction = true;
     if (eregi("[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}", $mystarttime)) {
         //look if starttime is correct
         $mytime = substr($mystarttime, 11);
         $starttime_array = explode(":", $mytime);
         $mydate = substr($mystarttime, 0, 10);
         $startdate_array = explode("-", $mydate);
         //makte GTM Time of GTM+1
         $mynewstarttime = toGMT(date(AUCTIONS_DATE_FORMAT, mktime($starttime_array[0], $starttime_array[1], $starttime_array[2], $startdate_array[1], $startdate_array[2], $startdate_array[0])));
     } else {
         //starttime error
         $error_total = true;
         $error_starttime = true;
     }
 }
 //set pic_url
 //We don't really need the pictures on the server as they are already there,
 //but it is more convenient to use a "file" input for picture selection.
 //They are transferred to the "temp" directory and get deleted after selection.
 $temp_dir = DIR_FS_CATALOG . 'cache/cache';
 $pic_url = new upload($pic_url_text, $temp_dir);
 $pic_url = $pic_url['filename'];
 if ($pic_url) {
     $pic_file_name = basename($pic_url);