-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_task.php
44 lines (43 loc) · 982 Bytes
/
add_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
41
42
43
44
<?php
include "cUrls.php";
function task()
{
$admin = $_GET['admin_id'];
$element = $_GET['element_id'];
$text = $_GET['text_task'];
$id = $_GET['introduced_id'];
$data = [
'add' => [
0 => [
'element_id' => $id,
'element_type' => $element,
'complete_till' => time() + (7 * 24 * 60 * 60),
'task_type' => '1',
'text' => $text,
'responsible_user_id' => $admin,
],
],
];
Send_amo('tasks',$data);
}
function close(){
$id = $_GET['id_task'];
$data = [
'update' => [
0 => [
'id' => $id,
'updated_at' => time(),
'text' => 'qwer',
'is_completed' => '1',
],
],
];
Send_amo('tasks',$data);
}
if (isset($_GET['buttom'])){
task();
}
if(isset($_GET['buttom2'])){
close();
}
header('Location:task.php');