Example #1
0
    }
}
if (isset($_POST["UpdateTimeslotOrder"])) {
    $order_number = 0;
    foreach ($_POST["timeslotNames"] as $value) {
        TimeslotTable::update_timeslot_order($value, $order_number);
        $order_number++;
    }
}
/*----------------edit_categories.php----------------*/
if (isset($_POST["UpdateItemsCategory"])) {
    ItemTable::update_items_category($_POST["categoryName"], $_POST["itemName"]);
}
/*---------user_account.php--------------*/
if (isset($_POST["userName"])) {
    if (UserTable::verify_credentials($_POST["userName"], $_POST['password'])) {
        echo "true";
    } else {
        echo "false";
    }
}
/*-------------------------user_account.php----------------------*/
if (isset($_POST["timeZoneRegion"])) {
    $timezones = array("Africa" => "1", "America" => "2", "Asia" => "16", "Australia" => "64", "Europe" => "128");
    foreach (timezone_identifiers_list($timezones[$_POST["timeZoneRegion"]]) as $tz) {
        $tzs = explode("/", $tz, 2);
        echo '<option value="' . $tzs[1] . '">' . $tzs[1] . '</option>';
    }
}
/*--------------------------messages.php----------------------------*/
if (isset($_POST["sessionName"])) {
Example #2
0
<?php

session_start();
require_once "database/user_table.php";
require_once "database/conversation_table.php";
if (isset($_SESSION["username"])) {
    header("Location: category_status.php");
    exit;
}
if (isset($_POST["username"])) {
    try {
        if (UserTable::verify_credentials($_POST["username"], $_POST["password"])) {
            UserTable::set_session_variables($_POST["username"]);
            ConversationTable::set_destroy_status($_SESSION["username"], gmdate("Y-m-d"));
            header("Location: category_status.php");
            exit;
        } else {
            echo '<div class="error">Incorrect username or password</div>';
        }
    } catch (Exception $e) {
        echo '<div class="error">' . $e->getMessage() . '</div>';
    }
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login</title>
    <link rel="stylesheet" href="styles.css">