Пример #1
0
session_start();
include 'index.php';
require_once 'class.Database.php';
require_once 'class.Potion.php';
require_once 'class.CRUDE.php';
//This makes it so it doesn't try and create a new entry everytime you refresh
$check = strlen($_POST["name"]);
if ($check != 0) {
    $callClass = new Data_Class();
    $callClass->createData($_POST["name"], $_POST["effects"], $_POST["ingredients"], $_POST["stock"]);
}
if (isset($_POST["delete"])) {
    $callClass->deleteData($_POST["delete"]);
}
if (isset($_POST["sort"])) {
    $criteria = $_POST["sort"];
    $callForm = new Data_Class();
    $callForm->displayData($criteria);
}
if (isset($_POST["search"])) {
    $search = $_POST["search"];
    $callForm = new Data_Class();
    $callForm->searchData($search);
}
if (isset($_POST["update"])) {
    $callForm = new Data_Class();
    $changeID = $callForm->getID($_POST["update"]);
}
?>

Пример #2
0
    $callClass->createData($_POST["name"], $_POST["address"], $_POST["item"], $due_date);
    $callOther = new Category_Class();
    $date = date('Y-m-d');
    $callOther->createDelivery($date);
}
if (isset($_POST["delete"])) {
    $callClass->deleteData($_POST["delete"]);
}
if (isset($_POST["update"]) && !empty($_POST["update"])) {
    $callForm = new Data_Class();
    $changeID = $callForm->getID($_POST["update"]);
}
if (isset($_POST["status"]) && $_POST["status"] != "--Get Status--") {
    $callClass = new Data_Class();
    switch ($_POST["status"]) {
        case "Still Assembling":
            $callClass->displayData(3);
            break;
        case "Being Prepared":
            $callClass->displayData(2);
            break;
        case "Shipped":
            $callClass->displayData(1);
            break;
        default:
            $callClass->displayData(0);
    }
}
?>