-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateTripLocation.php
More file actions
71 lines (57 loc) · 1.87 KB
/
Copy pathupdateTripLocation.php
File metadata and controls
71 lines (57 loc) · 1.87 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
66
67
68
69
70
71
<?php session_start(); ?>
<?php
require_once 'config.php';
$locationid = $_SESSION["locationid"];
$city = $_REQUEST['city'];
$state = $_REQUEST['state'];
$country = $_REQUEST['country'];
$date = $_REQUEST['date'];
if ($city != ''){
$sql = "UPDATE Location
SET city = '".$city."'
WHERE location_ID = '".$locationid."'";
if(mysqli_query($link, $sql)){
echo '<script>alert("Success, updating city")</script>';
}
else{
echo '<script>alert("Error, could not update city")</script>';
}
}
if ($state != ''){
$sql = "UPDATE Location
SET state = '".$state."'
WHERE location_ID = '".$locationid."'";
if(mysqli_query($link, $sql)){
echo '<script>alert("Success, updating state")</script>';
}
else{
echo '<script>alert("Error, could not update state")</script>';
}
}
if ($country != ''){
$sql = "UPDATE Location
SET country = '".$country."'
WHERE location_ID = '".$locationid."'";
if(mysqli_query($link, $sql)){
echo '<script>alert("Success, updating country")</script>';
}
else{
echo '<script>alert("Error, could not update country")</script>';
}
}
if ($date != ''){
$sql = "UPDATE Location
SET date = '".$date."'
WHERE location_ID = '".$locationid."'";
if(mysqli_query($link, $sql)){
echo '<script>alert("Success, updating date")</script>';
}
else{
echo '<script>alert("Error, could not update date")</script>';
}
}
// echo "<script>location.href='ViewTrips.php'</script>";
$usrid = $_SESSION['usrid'];
$url = "ViewTrips.php?usrid=".$usrid;
echo '<script>location.href="'.$url.'"</script>';
?>