-
Notifications
You must be signed in to change notification settings - Fork 0
/
status_options_for_location.php
131 lines (80 loc) · 3.56 KB
/
status_options_for_location.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php require_once("includes/Database.php"); ?>
<?php require_once("includes/functions.php"); ?>
<?php
if(isset($_GET['location'])) {
$location = escape_it($_GET["location"]);
if(empty($location)||$location == ""||$location == "undefined"){
$_SESSION["message"] = "**Please Select A location First**";
}
else{
$result = get_Status_Options_For_location($location);
if(mysqli_num_rows($result) === 0){
}
else{$_SESSION["message"] = "Status Options"; ?>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Delete</th>
<th>Status Options</th>
<th>Code</th>
</tr>
<tr>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_assoc($result )) {
$status_id = $row['status_id'];
$status_option = $row['status_option'];
$remarks_option = $row['remarks_option'];
echo "<tr>";
echo '<td><button rel="'.$status_id.'" class="btn btn-danger statusdeletebtn">Delete</button></td>';
echo '<td><div class="dropdown">
<button class="btn btn-primary dropdown-toggle" style="background:#006a4a;" type="button" data-toggle="dropdown">'.$status_option.'
<span class="caret"></span></button>
<ul class="dropdown-menu">';
$remarksresult = get_site_location_For_Statusoption($status_id);
while($remarksrow = mysqli_fetch_assoc($remarksresult )) {
$site_location = $remarksrow['site_location'];
echo '<li>'.$site_location.'<span class="deleteicon deleteremarkslink" title="delete" rel="'.$status_id.'" value="'.$site_location.'">×</span></li>';
}
echo'</ul>
</div></td>';
echo '<td>'.$remarks_option.'</td>';
echo "</tr>";
}
// while closes
}
// else closes
?>
</tbody>
</table>
<?php
}
// else close
}
//isset close
?>
<script type="text/javascript">
$(document).ready(function() {
// click handler for status button remove
$(".statusdeletebtn").on('click', function(e){
var target = $(this);
var status_id = $(this).attr("rel");
target.parent().parent().hide();
var url = "delete_status_option.php?status_id="+status_id;
$.get(url, function(data, status){
});
});
// click handler for removing remarks
$(".deleteremarkslink").on('click', function(e){
var target = $(this);
var remarks_status_id = target.attr("rel");
var site_location = target.attr("value");
var url = "delete_remarks.php?remarks_status_id="+remarks_status_id+"&site_location="+site_location;
target.parent().css({"display": "none"});
$.get(url, function(data, status){
});
});
});
</script>