dienstplancreator git · main
Dienstplan (roster) creator, PHP/JS web app
JavaScript 50% PHP 40.5% CSS 8.5%git clone https://git.christianimmanuel.de/web-tools/dienstplancreator.gitwget https://git.christianimmanuel.de/web-tools/dienstplancreator/archive/dienstplancreator.tar.gzapi/shift_labels/update.php raw
<?php
// required headers
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
session_start();
if ($_SESSION['administration'] === 'visitor' ) {return;}
require '../config/db_inc.php';
require '../objects/shift_labels_class.php';
$shift_labels = new Shift_labels();
$data = json_decode(file_get_contents("php://input"));
$data_id = $_SESSION["data_id"];
$id = $data->id;
$name = $data->name;
$cut = $data->cut;
try {
$shift_labels->update($data_id, $id, $name, $cut);
} catch (Exception $e) {
echo $e->getMessage();
die();
}
?>