コード例 #1
0
    echo true;
}
// Try to make the connection with the database.
$connection = new Connection();
$conn = $connection->createConnection();
// Connection successfuly.
if ($conn) {
    // Get the action from the admin factory.
    $action = $_REQUEST['action'];
    if ($action === "persons") {
        loadPersons($conn);
    } else {
        if ($action === 'sessions') {
            loadSessions($conn);
        } else {
            if ($action === 'remove') {
                removePerson($conn);
            } else {
                if ($action === 'increment') {
                    incrementCapacity($conn);
                } else {
                    if ($action === "changeReceiptState") {
                        changeReceiptState($conn);
                    }
                }
            }
        }
    }
} else {
    echo false;
}
コード例 #2
0
ファイル: userModule.php プロジェクト: CMPUT391/c391proj
                $continueFlag = false;
            } else {
                // Check if person id entered exists
                $results = validatePersonID($personID, $conn);
                // if person id entered doesn't exists, display message & return
                if (empty($results)) {
                    echo '<ul class="list-group">
							<li class="list-group-item list-group-item-danger">PersonID : ' . (int) $personID . ' does not exist in the database.</li>
						  </ul>';
                    $continueFlag = false;
                }
                // else remove all subscriptions associated with the person id, remove all users associated with the person id then remove the person
                if ($continueFlag) {
                    removeSubscriptions($personID, $conn);
                    removeUserFromPersonID($personID, $conn);
                    removePerson($personID, $conn);
                }
            }
        }
        // retrieve contents of persons table to display
        function get_all_persons($conn)
        {
            $arr = array();
            $sql = 'SELECT * FROM persons';
            $stid = oci_parse($conn, $sql);
            $res = oci_execute($stid);
            if (!$res) {
                $err = oci_error($stid);
                echo htmlentities($err['message']);
            }
            while ($row = oci_fetch_array($stid, OCI_ASSOC)) {