-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.php
More file actions
executable file
·116 lines (106 loc) · 5.03 KB
/
Copy pathhome.php
File metadata and controls
executable file
·116 lines (106 loc) · 5.03 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
<?php
session_start();
//$currentpage="View Employees";
if (!isset($_SESSION['account_loggedin'])) {
header('Location: index.php');
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Rotten Potatoes</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<style type="text/css">
.wrapper{
width: 70%;
margin:0 auto;
}
table tr td:last-child a{
margin-right: 15px;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
$('.selectpicker').selectpicker();
</script>
</head>
<body>
<?php
// Include config file
require_once "config.php";
// include "header.php";
?>
<div class="wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="page-header clearfix">
<h2> Rotten Potatoes</h2>
<p> Project should include CRUD operations. In this website you can:
<ol> <li> CREATE new Users, Ratings, Friends and Watchlists </li>
<li> RETRIEVE Friends, Watchlists, Ratings for each user, Theaters showing movies, and Titles.</li>
<li> UPDATE Ratings</li>
<li> DELETE Users, Watchlists, Friends, and Ratings. </li>
</ol>
<h2 class="pull-left">Registered Titles</h2>
<a href="logout.php" class="btn btn-success pull-right">Logout</a>
<a href="viewTheater.php" class="btn btn-success pull-right">View Theaters</a>
<a href="viewRatings.php" class="btn btn-success pull-right">View Ratings</a>
<?php
echo '<a href="viewFriends.php?user_ID=' . $_SESSION['account_id'] . '&username=' . $_SESSION['account_name'] . '" class="btn btn-success pull-right">Friends</a>';
echo '<a href="viewWatchlist.php?user_ID=' . $_SESSION['account_id'] . '&username=' . $_SESSION['account_name'] . '" class="btn btn-success pull-right">Your Watchlist</a>';
?>
</div>
<?php
// Include config file
require_once "config.php";
// Select Department Stats
// You will need to Create a DEPT_STATS table
$sql2 = "SELECT * FROM Title";
if($result2 = mysqli_query($link, $sql2)){
if(mysqli_num_rows($result2) > 0){
echo "<table class='table table-bordered table-striped'>";
echo "<thead>";
echo "<tr>";
echo "<th width=10%>ID</th>";
echo "<th width = 15%>Name</th>";
echo "<th width = 10%>Release Date</th>";
echo "<th width = 10%>Genre</th>";
echo "<th width = 45%>Description</th>";
echo "<th width = 10%>Media Type</th>";
echo "</thead>";
echo "<tbody>";
while($row = mysqli_fetch_array($result2)){
echo "<tr>";
echo "<td>" . $row['title_ID'] . "</td>";
echo "<td>" . $row['title_name'] . "</td>";
echo "<td>" . $row['release_date'] . "</td>";
echo "<td>" . $row['genre'] . "</td>";
echo "<td>" . $row['description'] . "</td>";
echo "<td>" . $row['media_type'] . "</td>";
echo "</tr>";
}
echo "</tbody>";
echo "</table>";
// Free result set
mysqli_free_result($result2);
} else{
echo "<p class='lead'><em>No records were found for Dept Stats.</em></p>";
}
} else{
echo "ERROR: Could not able to execute $sql2. <br>" . mysqli_error($link);
}
// Close connection
mysqli_close($link);
?>
</body>
</html>