partially implemented todo tracker
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
include 'functions/functions.php';
|
||||
|
||||
if (isset($_POST['ajax_id'])) {
|
||||
switch ($_POST['ajax_id']) {
|
||||
case 'todo':
|
||||
handle_todo();
|
||||
break;
|
||||
}
|
||||
} else
|
||||
echo 'Received malformed request.';
|
||||
|
||||
function handle_todo()
|
||||
{
|
||||
$response = [];
|
||||
|
||||
include 'functions/todo_functions.php';
|
||||
|
||||
if (isset($_POST['todo_id']) && isset($_POST['action_id']) && isset($_POST['status'])) {
|
||||
switch ($_POST['action_id']) {
|
||||
case 'status':
|
||||
$response['todo_status'] = $_POST['status'];
|
||||
change_status($_POST['todo_id'], $_POST['status']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($response);
|
||||
}
|
||||
Reference in New Issue
Block a user