mirror of
https://github.com/tim-krehan/shopping-list.git
synced 2024-11-30 16:40:36 +01:00
28 lines
551 B
PHP
28 lines
551 B
PHP
|
<?php
|
||
|
session_start();
|
||
|
include $_SESSION["docroot"].'/php/classes.list.php';
|
||
|
$shopping = new shopping;
|
||
|
|
||
|
switch ($_POST["function"]) {
|
||
|
case 'new':
|
||
|
$shopping->newItem($_POST["anzahl"], $_POST["einheit"], $_POST["name"]);
|
||
|
header("Location: /list");
|
||
|
break;
|
||
|
|
||
|
case 'multiple':
|
||
|
$shopping->newItems($_POST["list"]);
|
||
|
break;
|
||
|
|
||
|
case 'del':
|
||
|
$shopping->removeChecked();
|
||
|
break;
|
||
|
|
||
|
case 'check':
|
||
|
$shopping->check($_POST["id"], $_POST["status"]);
|
||
|
|
||
|
default:
|
||
|
// code...
|
||
|
break;
|
||
|
}
|
||
|
?>
|