-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHidden_elements.php
139 lines (104 loc) · 2.8 KB
/
Hidden_elements.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
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hide-show</title>
<meta name="description" content="">
<meta name="author" content="">
</head>
<body>
<?php include_once("header.php");?>
<div class="container">
<div class="text-center">
<h1>Marine</h1>
<p class="lead">Confirmation of changed values</p>
</div>
</div>
<div class="container">
<?php
if(isset($_POST['submit'])){
$table = $_POST['table'];
if($table = 'station'){
if(!empty($_POST['station_hide'])) {
include("db.php");
$id = $_POST['station_hide'];
$showhide = $_POST['todo'];
$sql = "UPDATE Stations
SET Shidden = 1-'$showhide'
WHERE Sname IN ('" . implode("','", $id) ."')
;
";
if (mysqli_query($conn, $sql)) {
echo "<br> <br> Hidden values changed for Station";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
$sql = "UPDATE Physical
SET Phidden = 1-'$showhide'
WHERE Pstationname IN ('" . implode("','", $id) ."')
;
";
if (mysqli_query($conn, $sql)) {
echo "<br> <br> Hidden values changed for Physical";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
$sql = "UPDATE Biological
SET Bhidden = 1-'$showhide'
WHERE Bstationname IN ('" . implode("','", $id) ."')
;
";
if (mysqli_query($conn, $sql)) {
echo "<br> <br> Hidden values changed for Biological";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
}
else{
echo "<br><br><b>No stations selected to modify Stations table and/or Physical and/or Biological.</b> </p>";
}
}
if($table = 'physical'){
if(!empty($_POST['physical_hide'])) {
include("db.php");
$id = $_POST['physical_hide'];
$showhide = $_POST['todo'];
$sql = "UPDATE Physical
SET Phidden = 1-'$showhide'
WHERE PID IN ('" . implode("','", $id) ."')
;
";
if (mysqli_query($conn, $sql)) {
echo "<br> Hidden values changed for Physical";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
}
else{
echo "<br><br><b>No stations selected to modify only Physical.</b> </p>";
}
}
if($table = 'biological'){
if(!empty($_POST['biological_hide'])) {
include("db.php");
$id = $_POST['biological_hide'];
$showhide = $_POST['todo'];
$sql = "UPDATE Biological
SET Bhidden = 1-'$showhide'
WHERE BID IN ('" . implode("','", $id) ."')
;
";
if (mysqli_query($conn, $sql)) {
echo "<br> Hidden values changed for Biological";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
}
else{
echo "<br><br><b>No stations selected to modify only Biological.</b> </p>";
}
}
}
?>
</div><!-- /.container -->
</body>
</html>