2018-10-24 15:00:27 +02:00
|
|
|
<?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"]);
|
2018-10-29 22:23:51 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'export':
|
|
|
|
echo json_encode($shopping);
|
|
|
|
break;
|
2018-10-24 15:00:27 +02:00
|
|
|
|
2018-11-14 16:25:50 +01:00
|
|
|
case 'import':
|
|
|
|
$shopping->import();
|
|
|
|
break;
|
|
|
|
|
2018-10-24 15:00:27 +02:00
|
|
|
default:
|
|
|
|
// code...
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
?>
|