-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDashboard.php
59 lines (55 loc) · 2.11 KB
/
Dashboard.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard</title>
</head>
<body>
<header>
<h2>
<nav>
<a href = "/Dashboard.php" id = "dashboard">Dashboard</a>
<a href = "/Sales.php" id = "sales">Sales</a>
<a href = "/Inventory.php" id = "inventory">Inventory</a>
<a href = "/Visualization.php" id = "visualization">Visualization</a>
<a href = "/Report.php" id = "reports">Reports</a>
</nav>
</h2>
<header>
<h1>DASHBOARD</h1>
<table>
<tr>
<th width = "20%"><h2>HIGHEST SALES TODAY</h2></th>
<th width = "40%"><h2>TOTAL SALES TODAY</h2></th>
</tr>
<tr>
<td width = "20%" style = "text-align: center;"><h3>A$250.25</h3></td><!--hardcoded value for now-->
<td width = "40%" style = "text-align: center;"><h3>A$1875.75</h3></td><!--hardcoded value for now-->
</tr>
</table>
<h1>NEWSLETTER</h1>
<?php
require "Credentials.php";
$mysqli = new mysqli($host, $user, $password, $db);
// Check connection
if ($mysqli -> connect_errno) {
echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
exit();
}
// check is database is avialable for use
$query = "Select * from newsletter Group by SNo Desc limit 1"; // query is assigned here
$result = mysqli_query ($mysqli, $query);
if ($result->num_rows > 0){
$rows = $result->fetch_assoc();
echo "<h2>".$rows["Heading"]."</h2>";
echo "<p>".$rows["News"]."</p>";
}
else{
echo "Failedddddd";
echo "<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Modi iste fugiat nulla tempore nostrum saepe asperiores placeat cum nemo, minus ipsam facilis pariatur corrupti porro vel perspiciatis voluptate quae doloremque!</p>";
}
?>
</body>
</html>