-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_task_image_attach.php
49 lines (35 loc) · 1.01 KB
/
add_task_image_attach.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
41
42
43
44
45
46
47
48
49
<?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{
$TASK_ARRAY = $controller->addTaskImages($taskObj);
$TASK_ID=$TASK_ARRAY[0];
$TOTAL_CNT=$TASK_ARRAY[1];
$UPLOAD_CNT=$TASK_ARRAY[2];
if(isset($UPLOAD_CNT) && $UPLOAD_CNT >0){
$resObj = $controller->getTask($TASK_ID);
$arr_result = array(RESULT => SUCCESS,
MESSAGE => "$UPLOAD_CNT out of $TOTAL_CNT images are uploaded Successfully..!",
DATA => $resObj);
}else{
$arr_result = array(RESULT => FAILED,
MESSAGE => "No image uploaded...!",
DATA => "");
}
$json = json_encode($arr_result);
echo preg_replace("/null/", '""', $json);
exit;
}
?>