Exemple #1
0
        echo '<h1>' . $JSONmovies->{$screening}['movie']->title . '</h1>';
        echo '<br><br>';
        echo '<p> <b>Day:</b> ' . $screening['day'] . '</p>';
        echo '<p> <b>Time:</b> ' . $screening['time'] . '</p>';
        echo '</section>';
        /* Selected Seats Information */
        echo '<section class="fixed300">';
        foreach ($screening['seats'] as $booking) {
            echo '<div class="cartticket">';
            echo '<p> <b>Ticket Type: </b>' . $seatType[$booking['type']] . ' (' . toDollars($booking['price']) . ')</p>';
            echo '<p> <b>Quantity: </b>' . $booking['quantity'] . '</p>';
            echo '<p> <b>Seats: </b> ';
            echo implode(', ', $booking['seats']);
            echo '</p>';
            $total = $total + $booking['price'] * $booking['quantity'];
            echo '<p> <b>Subtotal Price: </b>' . toDollars($booking['price'] * $booking['quantity']) . '</p>';
            echo '</div>';
            if ($booking !== end($screening['seats'])) {
                echo '<br>';
            }
        }
        echo '</section>';
        echo '</container>';
        echo '<hr class="horizontalline">';
    }
    echo '<container>';
    echo '<a href="' . base_url() . 'index.php/booking/purchase"><button class="myButton">Back to History</button></a>';
    echo '</container>';
} else {
    echo '<h1> Your cart is empty! </h1>';
    echo '<hr class="horizontalline">';
Exemple #2
0
function putInGrid($id, $category, $subcategory, $name, $image, $price, $description)
{
    //Sets default values if the database is empty
    if (empty($image)) {
        $image = "http://oave1516.github.io/img/placeholder.png";
    }
    //Prices entered in DB should not be empty -- Should be a real price or -1
    if (empty($price)) {
        $price = toDollars(0);
    }
    //Good 'ol lorem ipsum
    if (empty($description)) {
        $description = "Morbi blandit semper neque, eget tincidunt massa interdum a. Morbi quis risus dolor. Donec aliquet malesuada pharetra.";
    }
    //Non priced items (multipliers) are logged as -1 in the database
    /* if ($price < 0){
           if ($category == "theme"){
               //All themes are to provide a multiplier of 0.4 to the price
               $price = toDollars($_SESSION["totalPrice"] * 0.4);
           }
       }
       else{*/
    //If it's an addon, flat rate regardless of size, except for $subcategory = 0, food
    //if ($category == "add-on[]" && $subcategory != 0){
    //$price = toDollars($price);
    //}
    //Otherwise, we multiply price by the $size multiplier
    //else{
    $price = toDollars($price * $_SESSION["size"]);
    $buttonText = "Add \$" . $price;
    $contactUs = " Please <a href='/contact' target='_blank'>contact us</a> if you would like to order this item.";
    if ($category != "add-on[]") {
        $type = "radio";
    } else {
        $type = "checkbox";
    }
    $image = "/img/products/" . $image;
    //Uses a template to print data into the html grid
    if ($category == "add-on[]" && $price < 0) {
        echo "<div class='grid-3'>" . "<h3>" . $name . "</h3>" . "<img src='" . $image . "'>" . "<p>" . $description . $contactUs . "</p></div>";
    } else {
        echo "<div class='grid-3'>" . "<h3>" . $name . "</h3>" . "<img src='" . $image . "'>" . "<label><input type='" . $type . "' name='" . $category . "' value='" . $name . "' id='" . $id . "' data-price='" . $price * $_SESSION["size"] . "'><span>" . $buttonText . "</span></label>" . "<p>" . $description . "</p></div>";
    }
}
Exemple #3
0
        }
        echo '</section>';
        echo '</container>';
        echo '<container>';
        echo '<a href="' . site_url('Booking/delete/') . '/' . ($i + 1) . '" onclick="deleteAllCookies()">
					<button class="myButton">Remove From Cart</button></a><br><br>';
        echo '</container>';
        echo '<hr class="horizontalline">';
    }
    echo '<h2>Voucher Code: </h2>';
    echo '<input type="text" name="voucher" value="' . $data['voucher'] . '" required/>';
    echo '<button onclick="checkVoucher()"> Apply</button>';
    if (!empty($data['voucher'])) {
        echo '<h1 class="totalprice"> <b> Total Price ( Discounted Price ): </b> ' . toDollars($data['total'] * 0.8) . '</h1>';
    } else {
        echo '<h1 class="totalprice"> <b> Total Price: </b> ' . toDollars($data['total']) . '</h1>';
    }
    echo '<hr class="horizontalline">';
} else {
    echo '<h1> Your cart is empty! </h1>';
    echo '<hr class="horizontalline">';
}
?>

		<!-- [Add More Movies] and [Checkout] buttons -->
		<container>
			<section>
			<a href="<?php 
echo base_url();
?>
index.php/movies/"