Exemple #1
0
                                        <span class="prefix">SGD</span>
                                    </div>
                                    <div class="large-10 left columns">
                                        <input type="text" id="ridingcost" name="passengerPayment" placeholder="Price Per Passenger" />
                                    </div>
                                </div>
                            </label>
                            <label>
                                <b>Car</b>
                                <div class="row collapse">
                                    <div class="large-12 left columns">
                                        <!--Query to Get Car-->
                                        <select name="carType" class="text-center" id="carDropdown">
                                            <option class="placeholder" selected="selected" value= "" disabled="disabled">Choose your car:</option>
                                            <?php 
$userID = getProfileID();
//Associative array to be passed to javascript, so that it can determine the max value of the following dropdown bar
$maxVehicleCapacity = array();
$query = "SELECT PLATENO, MODEL, NUMOFSEATS FROM VEHICLE WHERE PROFILEID =" . $userID;
$result = oci_parse($connect, $query);
$check = oci_execute($result, OCI_DEFAULT);
if ($check == true) {
    while ($row = oci_fetch_array($result)) {
        echo '<option value="' . $row['PLATENO'] . '">' . $row['MODEL'] . ' (' . $row['PLATENO'] . ')</option>';
        //Building associative array
        $maxVehicleCapacity[$row['PLATENO']] = $row['NUMOFSEATS'];
    }
    oci_free_statement($result);
}
?>
                                        </select>
Exemple #2
0
    echo '<tr>
                <td class="profileid">' . $row['PROFILEID'] . '</td>
                <td class="email">' . $row['EMAIL'] . '</td>
                <td class="password">' . $row['PASSWORD'] . '</td>
                <td class="firstname">' . $row['FIRSTNAME'] . '</td>
                <td class="lastname">' . $row['LASTNAME'] . '</td>
                <td class="postalcode">' . $row['POSTALCODE'] . '</td>
                <td class="contactnum">' . $row['CONTACTNUM'] . '</td>
                <td class="dateofbirth">' . $row['DATEOFBIRTH'] . '</td>
                <td class="creditcardnum">' . $row['CREDITCARDNUM'] . '</td>
                <td class="cardsecuritycode">' . $row['CARDSECURITYCODE'] . '</td>
                <td class="cardholdername">' . $row['CARDHOLDERNAME'] . '</td>
                <td class="accbalance">' . $row['ACCBALANCE'] . '</td>
                <td class="admin">' . $row['ADMIN'] . '</td>
                <td><a title="Edit" class="ui-icon ui-icon-pencil editProfileButton"></a></td>';
    if ($row['PROFILEID'] != getProfileID()) {
        echo '<td><a title="Delete" class="ui-icon ui-icon-trash delProfileButton"></a></td>';
    }
    echo '</tr>';
}
oci_free_statement($result);
?>
    </table>
</div>

<form id="editProfileForm" >
    <label for="idprofile">ID:</label>
    <input required type="text" name="profile" id="idprofile">
    <label for="idfrname">First Name:</label>
    <input required type="text" name="frname" id="idfrname">
    <label for="idlstname">Last Name:</label>
Exemple #3
0
<?php

if (!isset($connect)) {
    include '../libaries.php';
    include '../sqlconn.php';
}
if (isset($_POST['tripID'])) {
    $tripID = json_decode($_POST['tripID']);
    $query = "CALL BookingTransaction(:passengerID, :tripID)";
    $result = oci_parse($connect, $query);
    oci_bind_by_name($result, ':passengerID', getProfileID());
    oci_bind_by_name($result, ':tripID', $tripID);
    $check = oci_execute($result, OCI_DEFAULT);
    if ($check == true) {
        oci_commit($connect);
        echo "Booking successful!";
    } else {
        echo $query;
    }
    oci_free_statement($result);
}
exit;
Exemple #4
0
<?php

if (!isset($connect)) {
    include '../libaries.php';
    include '../sqlconn.php';
}
if (isset($_POST['startlocation']) && isset($_POST['endlocation']) && isset($_POST['tripdate']) && isset($_POST['price']) && isset($_POST['plateno']) && isset($_POST['numOfSeats'])) {
    $startlocation = strtoupper($_POST['startlocation']);
    $endlocation = strtoupper($_POST['endlocation']);
    $tripdate = $_POST['tripdate'];
    $price = intval(json_decode($_POST['price']));
    $plateno = strtoupper($_POST['plateno']);
    $numOfSeats = intval(json_decode($_POST['numOfSeats']));
    $query = "INSERT INTO TRIPS(START_LOCATION, END_LOCATION, RIDING_COST, SEATS_AVAILABLE, TRIP_DATE, PLATENO, PROFILEID)\n    VALUES(" . $startlocation . "," . $endlocation . "," . $price . "," . $numOfSeats . ",(TO_DATE(" . $tripdate . ",'DD-Mon-YY HH24:MI'))," . $plateno . "," . getProfileID() . ")";
    $result = oci_parse($connect, $query);
    $check = oci_execute($result, OCI_DEFAULT);
    if ($check == false) {
        echo "Posting unsuccessful...\n";
        echo $query;
    } else {
        echo "Successfully posted!";
        oci_commit($connect);
    }
    oci_free_statement($result);
}