-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd.php
90 lines (80 loc) · 3.27 KB
/
add.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
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
<!doctype html>
<html>
<head>
<!-- App Title -->
<title>Project</title>
<!-- App Description -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="css/animate.css"/>
<link rel="stylesheet" type="text/css" href="css/main.css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/wow.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</head>
<body>
<!-- Header Section -->
<header>
<div class="container">
<div class="heading pull-left animated wow bounceInLeft">
<h1>QUICK GAME</h1>
</div>
<nav class="pull-left">
<ul class="list-unstyled">
<li class="animated wow bounceInLeft" data-wow-delay="0s"><a href="index.php"> Home</a></li>
<li class="animated wow bounceInLeft" data-wow-delsay="0s"><a href="index.php#about"> About</a></li>
<li class="animated wow bounceInLeft" data-wow-delay=".8s"><a href="css.html">upcoming games </a></li>
<li class="animated wow bounceInLeft" data-wow-delay="1.2s"><a href="index.php#copy">Contact Us</a></li>
</ul>
</nav>
</div>
</header>
<!-- End Header Section -->
<div class="container">
<div class="row text-center">
<div class="col-sm-12 col-md-12 details animated wow bounceInLeft" data-wow-delay="0s" style="border-radius:25px;">
<h2 align="center">My list</h2>
<table border="1px" width="100%">
<tr>
<th>Id</th>
<th>name</th>
<th>rating</th>
<th>voter</th>
<th>percentage</th>
<th>Edit</th>
<th>Delete</th>
</tr>
<?php
mysql_connect("localhost", "root","") or die(mysql_error()); //Connect to server
mysql_select_db("project") or die("Cannot connect to database"); //connect to database
$query = mysql_query("Select * from movie"); // SQL Query
while($row = mysql_fetch_array($query))
{
Print "<tr>";
Print '<td align="center">'. $row['id'] . "</td>";
Print '<td align="center">'. $row['name'] . "</td>";
Print '<td align="center">'. $row['rating']. "</td>";
Print '<td align="center">'. $row['voter']. "</td>";
Print '<td align="center">'. $row['percentage']."</td>";
Print '<td align="center"><a href="edit.php?id='. $row['id'] .'">edit</a> </td>';
Print '<td align="center"><a href="#" onclick="myFunction('.$row['id'].')">delete</a> </td>';
Print "</tr>";
}
?>
</table>
<script>
function myFunction(id)
{
var r=confirm("Are you sure you want to delete this record?");
if (r==true)
{
window.location.assign("delete.php?id=" + id);
}
}
</script>
</div>
<a href="index.php"> <button style="font-size:24;font-family:Copperplate Gothic Light;color: #FF6600;position:fixed;bottom:0px;right:0px;">LOG-out</button></a
> </div>
</body>
</html>