-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwork_add_end.php
More file actions
65 lines (58 loc) · 2.21 KB
/
Copy pathwork_add_end.php
File metadata and controls
65 lines (58 loc) · 2.21 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
if(!isset($_SESSION)) {session_start();}
include "db.php";
$wid = $_POST['mid'];
$begin = date('Y-m-d');
$dead = $_POST['deadline'];
$wname = $_POST['wtitle'];
$wcontent = $_POST['wcontent'];
$pindex = $_POST['pindex'];
$tincrease_path = "/project/".$pindex."/things/increase";
$tincrease = $firebase->get($tincrease_path);
$tincrease++;
$newbegin_path = "/project/".$pindex."/things/".$tincrease."/beginline";
$newcontent_path = "/project/".$pindex."/things/".$tincrease."/content";
$newdead_path = "/project/".$pindex."/things/".$tincrease."/deadline";
$newid_path = "/project/".$pindex."/things/".$tincrease."/id";
$newstate_path = "/project/".$pindex."/things/".$tincrease."/state";
$newname_path = "/project/".$pindex."/things/".$tincrease."/wname";
$tt_path = "/project/".$pindex."/pInfo/wnum";
$tt = $firebase->get($tt_path);
$tt++;
if($wid != '0'){
$i=1;
do{
$check_path = "/project/".$pindex."/member/".$i."/id";
$check = $firebase->get($check_path);
$check = explode("\"", $check)[1];
if($check == $wid){
break;
}
$i++;
$check_path = "/project/".$pindex."/member/".$i."/id";
$check = $firebase->get($check_path);
}while($check != 'null');
$addbegin_path = "/project/".$pindex."/member/".$i."/work/".$wname."/beginline";
$addcontent_path = "/project/".$pindex."/member/".$i."/work/".$wname."/content";
$adddead_path = "/project/".$pindex."/member/".$i."/work/".$wname."/deadline";
$addstate_path = "/project/".$pindex."/member/".$i."/work/".$wname."/state";
$addwname_path = "/project/".$pindex."/member/".$i."/work/".$wname."/wname";
$firebase->set($addbegin_path, $begin);
$firebase->set($addcontent_path, $wcontent);
$firebase->set($adddead_path, $dead);
$firebase->set($addstate_path, 1);
$firebase->set($newstate_path, 1);
$firebase->set($addwname_path, $wname);
$firebase->set($newid_path, $wid);
}else{
$firebase->set($newstate_path, 0);
$firebase->set($newid_path, (int)$wid);
}
$firebase->set($newbegin_path, $begin);
$firebase->set($newcontent_path, $wcontent);
$firebase->set($newdead_path, $dead);
$firebase->set($newname_path, $wname);
$firebase->set($tincrease_path, $tincrease);
$firebase->set($tt_path, $tt);
?>
<script>alert("일감추가완료!");history.back();history.back();</script>