-
Notifications
You must be signed in to change notification settings - Fork 0
/
packagemod.php
34 lines (31 loc) · 899 Bytes
/
packagemod.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
<?php
$paID = $_GET["name"];
require "dbh.php";
echo $paID;
$visibility = 0;
$sql2 = "select Pa_Visibility from package where Pa_ID = $paID;";
$result = mysqli_query($conn, $sql2);
$row = mysqli_fetch_assoc($result);
$visibility = $row['Pa_Visibility'];
if ($conn->query($sql2)) {
} else {
echo "Error1" . $sql . "<br />" . $conn->error;
}
if ($visibility) {
$sql = "update package set Pa_Visibility = 0 where Pa_ID = $paID;";
mysqli_query($conn, $sql);
if ($conn->query($sql)) {
} else {
echo "Error2" . $sql . "<br />" . $conn->error;
}
} else {
$sql = "update package set Pa_Visibility = 1 where Pa_ID = $paID;";
mysqli_query($conn, $sql);
if ($conn->query($sql)) {
} else {
echo "Error2" . $sql . "<br />" . $conn->error;
}
}
echo $visibility;
echo "<script>alert('Updated!');window.location='package.php'</script>";
$conn->close();