Beispiel #1
0
<?php

/**
 * Created by IntelliJ IDEA.
 * User: rorypb
 * Date: 01/12/2015
 * Time: 12:17 PM
 */
require_once 'garage.php';
require_once 'connection.php';
require_once 'garageTableGateway.php';
$connection = Connection::getInstance();
$gateway = new garageTableGateway($connection);
$statement = $gateway->getGarages();
echo "Connected to the database";
?>
<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">
        <link rel="stylesheet" href="css/global.css">
        <meta charset="UTF-8">
        <title>Base View of Garages</title>
        <script src="javascript/delete.js"></script>

    </head>
    <body>
        <div class="container_12">
            <table class="pure-table pure-table-bordered">
                <thead>
                    <tr>
Beispiel #2
0
<?php

require_once 'garageTableGateway.php';
//require the garage table gateway
require_once 'connection.php';
//require the connection to the database
require_once 'busTableGateway.php';
//tequire the bus table gateway
$connection = Connection::getInstance();
//Use the connection class getinstance of the connection
$gateway = new garageTableGateway($connection);
//use the connection to connect to the garage table
$garages = $gateway->getGarages();
//$garages will use the gateway to get Garages for viewing the garage a bus is assigned too
//Function to set the value of the formdata to the respective fieldname
function setValue($formdata, $fieldname)
{
    if (isset($formdata) && isset($formdata[$fieldname])) {
        echo $formdata[$fieldname];
    }
}
//Function to set the check boxs to the value
function setChecked($formdata, $fieldName, $fieldValue)
{
    if (isset($formdata[$fieldName]) && isset($formdata[$fieldName])) {
        if (is_array($formdata[$fieldName]) && in_array($fieldValue, $formdata[$fieldName])) {
            echo 'checked = "checked"';
        } else {
            if ($formdata[$fieldName] == $fieldValue) {
                echo 'checked = "checked"';
            }