$hn_article = 'Articles';
$hn_custock = 'Current<br />Stock';
$hn_cbooked = 'Total Booked<br />in Active Orders';
$hn_cbohere = 'Booked in<br />This Order';
$product_table_header = array();
$product_table_header['0 long_id'] = $hn_product;
$product_table_header['1 source'] = $hn_article;
$product_table_header['2 source'] = $hn_custock;
$product_table_header['3 source'] = $hn_cbooked;
$product_table_header['4 source'] = $hn_cbohere;
$id = tep_db_prepare_input($_GET['id']);
$booking = new stock_booking($id);
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'UPDATENAME') {
        $new_name = tep_db_prepare_input($_POST['name']);
        $booking->update(null, $new_name);
        echo utf8_encode($booking->name);
        exit;
    } elseif ($_POST['me_action'] == 'UPDATESTATUS') {
        $old_status = $booking->status;
        $new_status = tep_db_prepare_input($_POST['status']);
        $booking->updateStatus($old_status, $new_status, $session_userinfo['username']);
        echo utf8_encode($booking->status);
        exit;
    }
}
$content .= '<div style="width:710px;">';
$content .= $booking->drawStatusIcon('booking-status', '', 'float:right;');
$content .= '<h2><span id="booking-name" class="pointer" title="Click to rename order">' . $booking->name . '</span><input id="booking-name-edit" type="text" class="input2" style="display:none;" /></h2>';
$content .= '</div>';
$content .= '<div class="draw-table" style="clear:both;">';