Repository navigation
Expand file tree
/
Copy pathview.php
More file actions
125 lines (121 loc) · 4.46 KB
/
Copy pathview.php
File metadata and controls
125 lines (121 loc) · 4.46 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="assets/lib/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="assets/lib/css/login.css">
<script type="text/javascript" src="assets/lib/js/jquery.js"></script>
<script type="text/javascript" src="assets/lib/bootstrap/js/bootstrap.js"></script>
<title>View | westernNepal</title>
</head>
<?php include('include/userHeader.php');
if (isset($_GET['action']) && $_GET['action']=="addFav")
{
$sql="INSERT INTO `favorites` (`userID`, `placeID`) VALUES ('".$_SESSION['userID']."', '".$_GET['id']."')";
$query=mysqli_query($cn,$sql);
if (!$query)
{
$_SESSION['userError']="Opps ! Something went wrong. Invalid parameter or try again later";
}
else
{
$_SESSION['userInfo']='Successfully added to '.ucfirst($_SESSION['userName'])."'s favorites !";
}
}
if (isset($_GET['action']) && $_GET['action']=="remove")
{
$sql = "DELETE FROM `favorites` WHERE `favorites`.`userID` = '".$_SESSION['userID']."' AND `favorites`.`placeID` = '".$_GET['id']."'";
$query=mysqli_query($cn,$sql);
if (!$query)
{
$_SESSION['userError']="Opps ! Something went wrong. Invalid parameter or try again later";
}
else
{
$_SESSION['userInfo']='Successfully removed from '.ucfirst($_SESSION['userName'])."'s favorites !";
}
}
if(isset($_SESSION['userError'])):?>
<?php if (($_SESSION['userError'])!=null):
$_SESSION['userInfo']=""; ?>
<div class="alert alert-danger alert-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<div align="center"><?=$_SESSION['userError'];?></div>
</div>
<?php endif;
$_SESSION['userError']="";
endif;?>
<?php
if(isset($_SESSION['userInfo'])): ?>
<?php if (($_SESSION['userInfo'])!=null):
$_SESSION['userError']=""; ?>
<div class="alert alert-success alert-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<div align="center"><?=$_SESSION['userInfo'];?></div>
</div>
<?php endif;
$_SESSION['userInfo']="";
endif;?>
<body style="padding-top: 50px;">
<div class="container jumbotron">
<div class="">
<?php
$sql="SELECT * FROM places WHERE placeID='".$_GET['id']."'";
$result=$cn->query($sql);
$i=0;
if($result = mysqli_query($cn, $sql)):
if(mysqli_num_rows($result) > 0):
while($row = mysqli_fetch_array($result)):?>
<h1 align="center" style="color:#707070;">
<span class="glyphicon-lg glyphicon-minus" aria-hidden="true"></span>
<?=$row[1]?>
<span class="glyphicon-lg glyphicon-minus" aria-hidden="true"></span>
</h1>
<hr>
<div align="center">
<img src="admin/uploads/<?=$row[8]?>" class="img-responsive img-rounded" alt="Request Administrator to update preview of <?=$row[1]?>" width="400px" height="auto">
</div><hr>
<h4>
<strong>Location : </strong><?=$row[2]?>
</h4><hr class="hr">
<div >
<div class="col-md-6 well">
<h3 class="title">Natural Heritage :</h3>
<h4 class="content"><?=$row[3];?></h4>
<hr class="hr">
<h3 class="title">Cultural/Religious Heritages :</h3>
<h4 class="content"><?=$row[4];?></h4>
<hr class="hr">
<h3 class="title">Adventure Options :</h3>
<h4 class="content"><?=$row[6];?></h4>
<hr class="hr">
</div>
<div class="col-md-6 well">
<h3 class="title"> Other Attractions :</h3>
<h4 class="content"><?=$row[5];?></h4>
<hr class="hr">
<h3 class="title"> Best Time to Travel :</h3>
<h4 class="content"><?=$row[7];?></h4>
<hr class="hr">
</div>
</div>
</div>
<?php endwhile;endif; endif;
if(mysqli_num_rows($result) <= 0):?>
<h1 align="center" style="color:#707070;">
<span class="glyphicon-lg glyphicon-minus" aria-hidden="true"></span>
Invalid Refrence
<span class="glyphicon-lg glyphicon-minus" aria-hidden="true"></span>
</h1>
<div align="center" style="font-size: 150px;">
<span class="glyphicon glyphicon-eye-close" aria-hidden="true" ></span>
</div>
<h4 align="center">(Invalid refrence or Data not found. Please contct you database administrator.)</h4>
<?php endif; ?>
</div>
</body>
</html>