| author | ymh <ymh.work@gmail.com> |
| Sun, 14 Jul 2024 22:00:08 +0200 | |
| changeset 666 | 9d6550026232 |
| parent 444 | 19f0b7803aed |
| permissions | -rw-r--r-- |
| 442 | 1 |
<?php |
2 |
||
3 |
require_once(realpath(dirname(__FILE__) . "/../resources/config.php")); |
|
4 |
||
5 |
require_once(LIBRARY_PATH . "/templateFunctions.php"); |
|
6 |
require_once(LIBRARY_PATH . "/utilsFunctions.php"); |
|
7 |
require_once(LIBRARY_PATH . "/renkanFunctions.php"); |
|
8 |
require_once(LIBRARY_PATH . "/dbFunctions.php"); |
|
9 |
||
10 |
$self_url = selfURL(); |
|
|
444
19f0b7803aed
add schema version + dataloaders to ensure data migrations + small correction for php server exmple + a readme for the php server example
ymh <ymh.work@gmail.com>
parents:
442
diff
changeset
|
11 |
$index_url = selfBaseURL().'index.php'; |
| 442 | 12 |
|
13 |
if ($_SERVER['REQUEST_METHOD'] === 'PUT' || $_SERVER['REQUEST_METHOD'] === 'POST') { |
|
14 |
||
15 |
//TODO implement CSRF with https://github.com/BKcore/NoCSRF for example |
|
16 |
$renkanId = isset($_POST['renkanId']) ? $_POST['renkanId'] : false; |
|
17 |
||
18 |
if(!empty($renkanId)) { |
|
19 |
deleteProject($renkanId); |
|
20 |
} |
|
21 |
header("Location: $index_url"); |
|
22 |
die(); |
|
23 |
} |
|
24 |
||
25 |
if(!isset($_GET['renkanId'])) { |
|
26 |
header("Location: $index_url"); |
|
27 |
die(); |
|
28 |
} |
|
29 |
$renkanId = $_GET['renkanId']; |
|
30 |
$resRenkan = selectProject($renkanId); |
|
31 |
||
32 |
if(count($resRenkan) === 0) { |
|
33 |
header("Location: $index_url"); |
|
34 |
die(); |
|
35 |
} |
|
36 |
||
37 |
$variables = [ 'renkan' => $resRenkan[0], 'self_url' => selfURL(), 'self_base_url' => selfBaseURL()]; |
|
38 |
$css = []; |
|
39 |
||
40 |
renderLayoutWithContentFile("renkan_del.php", $variables, $css); |