-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwork_delete.php
More file actions
34 lines (32 loc) · 1006 Bytes
/
Copy pathwork_delete.php
File metadata and controls
34 lines (32 loc) · 1006 Bytes
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
<?php
if(!isset($_SESSION)) {session_start();}
include "db.php";
$pindex = $_REQUEST['pindex'];
$windex = $_REQUEST['windex'];
$wid = $_REQUEST['wid'];
$wnum_path = "/project/".$pindex."/pInfo/wnum";
$delete_path = "/project/".$pindex."/things/".$windex;
$wname_path = "/project/".$pindex."/things/".$windex."/wname";
$wname = $firebase->get($wname_path);
$wname = explode("\"", $wname)[1];
$wnum = $firebase->get($wnum_path);
$wnum--;
$firebase->set($wnum_path,$wnum);
$firebase->delete($delete_path);
if($wid != '0'){
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');
$mdelete_path = "/project/".$pindex."/member/".$i."/work/".$wname;
$firebase->delete($mdelete_path);
}
?>
<script>alert("일감 삭제 완료!");history.back();history.back();</script>