-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_task.php
40 lines (31 loc) · 859 Bytes
/
get_task.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
include_once '../blu/ControllerFactory.php';
$controller = ControllerFactory::getInstance()->getTaskController();
$data="";
$taskObj = new Task;
$taskObj->processRequest();
// print_r($taskObj);
// print_r($_REQUEST);
// die();
if(FALSE == $taskObj->validateDeleteTask()){
$arr_result = array(RESULT => FAILED,
MESSAGE => "Please provide the data.",
DATA => "");
echo json_encode($arr_result);
exit;
}else{
$resObj = $controller->getTask($taskObj->task_id,$taskObj->current_datetime);
if($resObj!=0){
$arr_result = array(RESULT => SUCCESS,
MESSAGE => "Task detail fetched Successfully..!",
DATA => $resObj);
}else{
$arr_result = array(RESULT => FAILED,
MESSAGE => "No Task Found..!",
DATA => "");
}
$json = json_encode($arr_result);
echo preg_replace("/null/", '""', $json);
exit;
}
?>