-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwatcheddisplay.php
More file actions
160 lines (140 loc) · 4.69 KB
/
watcheddisplay.php
File metadata and controls
160 lines (140 loc) · 4.69 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
session_start();
if (!isset($_SESSION['username'])) {
header('location:mainpage.php');
}
else{
if ($_SESSION['status'] == "admin") {
header('mainpage.php');
}
}
// $list = $_SESSION['list'];
// $total = $_SESSION['total'];
include('connectdb.php');
//Validation
$username=$_SESSION['username'];
$sql = "SELECT * FROM movies where movie_id in(select movie_id from watched where username='$username')";
$result = $conn->query($sql);
$list = '';
$total = $result->num_rows;
if($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$sql2="SELECT * from director where director_id='$row[director_id]'";
$dirname=mysqli_query($conn,$sql2,);
$row2=mysqli_fetch_assoc($dirname);
$pos=$row["poster"];
$list = $list.'
<div class="row box">
<div class="col-md-2 box4">
<img src="'.$row["poster"].'" alt="user" class="user-profile" style="border-radius:0%;height:9.5rem;">
</div>
<div class="col-md-6 box5">
<p> <span style="color: #9a9a9a;">Movie Id: </span> '.$row["movie_id"].'<br>
<span style="color: #9a9a9a;">Movie Name: </span>'.$row["movie_name"].'<br>
<span style="color: #9a9a9a;"> Genre: </span>'.$row["genre"].'<br>
<span style="color: #9a9a9a;">Industry: </span> '.$row["industry"].'<br>
<span style="color: #9a9a9a;">Director: </span> '.@$row2["director_name"].'
</p>
</div>
<div class="col-md-4 box5">
<a href="deletewatch.php?id='.$row["movie_id"].'" class="btn btn-danger"> Delete</a>
</div>
</div>
';
}
} else {
$list = "There is no movies added yet";
}
// $_SESSION['list']= $list;
// $_SESSION['total']= $total;
$conn->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="index.css">
<link href='https://fonts.googleapis.com/css?family=Arimo' rel='stylesheet'>
<link rel=" stylesheet " href="bootstrap.min.css ">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="mr.css">
<link rel="stylesheet" href="popup.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Audiowide">
<script src='https://kit.fontawesome.com/a076d05399.js' crossorigin='anonymous'></script>
</head>
<style>
li img,li h3
{
color:#FADCD9;
font-size:32px;
white-space: nowrap;
float:left;
border-radius:50%;
width:100px;
}
header
{
position: sticky;
height:100px;
}
li a {
float:right;
font-weight: bold;
font-size :20px;
display: block;
color:goldenrod;
text-align: center;
padding: 16px;
text-decoration: none;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: rgba(7, 58, 145, 0.0);
}
li a:hover {
height:100px;;
background-color:rgba(3, 3, 74, 0.822);
}
</style>
<header>
<ul>
<li><img id="logo" src="logo (2).png"></li>
<LI><H3>MforMovies.com</H3></LI>
<li><a href="userindex.php">Home</a></li>
<li><a href="userbrowse.php">Browse</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</header>
<div class="container req-box" >
<form action="" method="post">
<div class="row">
<div class="col-md-10 box1" style="margin-left:100px;">
<h3 style="margin-bottom:50px;"><span style="font-weight:bold; color: #6AC045">Watched List </span>(<?php echo $total ?>)</h3>
<?php
echo $list;
?>
</div>
</div>
</form>
</div>
<div id="updatesuccess" class="popup-overlay">
<div class="log-popup">
<h2>Success</h2>
<a class="close-window" href="#">×</a>
<div class="log-content">
<p style="color:black">Movie Data successfuly Updated :)</p>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
</body>
</html>