<?php

require_once 'lib.php';
if (isset($_SESSION["last_acted_on"]) && time() - $_SESSION["last_acted_on"] > 60 * 15 || !isset($_SESSION['user_name'])) {
    session_unset();
    // unset $_SESSION variable for the run-time
    session_destroy();
    // destroy session data in storage
    header('Location:index.php');
} else {
    session_regenerate_id(true);
    $_SESSION["last_acted_on"] = time();
    if (isset($_GET['order'])) {
        $order = $_GET['order'];
        $data = getReserve($order);
        $from = $data[0]['arrival_date'];
        $to = $data[0]['departure_date'];
    }
    if (isset($_POST['add'])) {
        $from = $_POST['arrival_date'];
        $to = $_POST['departure_date'];
        $order = $_POST['order'];
        $book = $_POST['book-date'];
        $tp = $_POST['room_type'];
        $des = $_POST['room_description'];
        $no = $_POST['room_no'];
        //$children=$_POST['children'];
        $fname = $_POST['fname'];
        $mname = "";
        $lname = $_POST['lname'];
        $email = $_POST['email'];
Beispiel #2
0
while ($row = $stmt->fetch()) {
    // ..and for each one, display a form with the work image, a link to workview,php, the work tombstone,
    // the amount of time left in the auction, and basic auction data (curent bid, minimum bid if nobody
    // has bid yet, buy-it-now price); includes text input for bid amount and button(s) for placing
    // a bid / buying outright, if applicable.  Buttons are handled in (document).ready() above.
    echo "<form>\n";
    echo "<input type=\"hidden\" name=\"aid\" value=\"" . $row['id'] . "\"/>";
    echo "<input type=\"hidden\" name=\"seller\" value=\"" . $row['uid'] . "\"/>";
    echo "<input type=\"hidden\" name=\"work\" value=\"" . $row['wid'] . "\"/> ";
    echo "<div style=\"background-color:lightgray;width:100%;height:200px;padding:8px;\">\n";
    echo "<div style=\"float:left;display:inline;\"><a rel=\"shadowbox\" href=\"workview.php?wid=" . $row['wid'] . "\"><img src=\"img.php?img=" . $row['wid'] . "\" style=\"height:150px;\"/></a>\n";
    echo "</div><div style=\"float:left;display:inline;width:80%;padding:10px;\">";
    echo "<span style=\"font-size:1.5em;\">" . getTombstoneOrBlank($row['wid'], true) . "</span><br/>";
    echo "Offered by " . getUsername($row['uid']) . " (ends in <b>" . secondsToString(strtotime($row['end']) - strtotime('-0 seconds')) . "</b>, on " . $row['end'] . ")<p/>Current high bid: " . getHighBidderForAuction($row['id']);
    echo " (" . $CURRENCY_SYMBOL . getHighBidAmountForAuction($row['id']);
    if (getReserve($row['id'] > 0)) {
        echo ", reserve" . (didAuctionMeetReserve($row['id']) > 0 ? " met" : " not met");
    }
    echo ")<p/>\n";
    echo "<input type=\"text\" name=\"amount\" size=\"5\"/>\n";
    echo "<button type=\"submit\" style=\"\" class=\"buyClassified\" name=\"" . $row['id'] . "\" id=\"#buy" . $row['wid'] . "\">Place Bid";
    if (getMinimumBidForAuction($row['id']) > getHighBidAmountForAuction($row['id'])) {
        echo " (Minimum bid: " . $CURRENCY_SYMBOL . getMinimumBidForAuction($row['id']) . ")";
    }
    echo "</button>\n";
    if (getAuctionBIN($row['id']) > 0 && getHighBidAmountForAuction($row['id']) <= getMinimumBidForAuction($row['id'])) {
        echo "<input type=\"hidden\" name=\"amountOutright\" value=\"" . getAuctionBIN($row['id']) . "\"/>\n";
        echo "<button class=\"buyBIN\" name=\"" . $row['id'] . "\" id=\"#bin" . $row['wid'] . "\">Buy outright for " . $CURRENCY_SYMBOL . getAuctionBIN($row['id']) . "</button>\n";
    }
    echo "</div></div><p/>\n";
    echo "</form>\n";