Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('core/init.php');
- $host = '127.0.0.1';
- $db = 'jb';
- $user = 'root';
- $pass = '';
- $charset = 'utf8mb4';
- $dsn = "mysql:host=$host;dbname=$db;charset=$charset";
- $options = [
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
- PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
- PDO::ATTR_EMULATE_PREPARES => false,
- ];
- try {
- $pdo = new PDO($dsn, $user, $pass, $options);
- } catch (\PDOException $e) {
- throw new \PDOException($e->getMessage(), (int)$e->getCode());
- }
- /* check connection */
- if (mysqli_connect_errno()) {
- printf("Connect failed: %s\n", mysqli_connect_error());
- exit();
- }
- $link = mysqli_connect("127.0.0.1", "root", "", "jb");
- $query2 = mysqli_query($link, "SELECT * FROM orders WHERE delivery_date = '2019-11-15'");
- $count = mysqli_num_rows($query2);
- ?>
- <html>
- <head>
- <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" type="text/css" href="includes/adminstyle.css">
- <script
- src="https://code.jquery.com/jquery-3.4.1.js"
- integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
- crossorigin="anonymous"></script>
- <script src="https://kit.fontawesome.com/8a370e7594.js" crossorigin="anonymous"></script>
- <title> Admin Panel </title>
- </head>
- <body>
- <nav class="navbar navbar-expand-sm bg-dark navbar-dark">
- <a href="#" class="navbar-brand"><i class="fas fa-list" id="menu-toggle"></i> JBSubs Admin Panel</a>
- <ul class="navbar-nav">
- <li class="nav-item">
- <a href="#" class="nav-link"></a>
- </li>
- </ul>
- </nav>
- <div id="wrapper">
- <!-- Sidebar -->
- <div id="sidebar-wrapper">
- <ul class="sidebar-nav">
- <li><a href="#">Overview</a></li>
- <li><a href="#">Orders</a></li>
- <li><a href="#">Reports</a></li>
- <li><a href="#">Customer Information</a></li>
- <li><a href="#">Invoices</a></li>
- <li><a href="#">Users</a></li>
- <li><a href="#">Stores</a></li>
- <li><a href="#">Settings</a></li>
- <li><a href="#">Logout</a></li>
- </ul>
- </div>
- <!-- main -->
- <div id="page-content-wrapper">
- <div class="container">
- <div class="row">
- <div class="col-lg-4">
- <h1> Recent Orders (<?php echo $count; ?>)</h1>
- <table class="table table-hover">
- <?php
- //Query for database for all results where date = today
- $query = mysqli_query($link, "SELECT DISTINCT school_name FROM orders WHERE delivery_date = '2019-11-15'");
- while($row = mysqli_fetch_assoc($query)){
- $school_name = $row['school_name'];
- echo "<tr>";
- echo "<td><a href='results.php?school=" . $row['school_name'] ."'>". $row['school_name'] . "</a></td>";
- echo "</tr>";
- }
- // second td shows total count of rows for query
- //school name links to another page to display orders from that school for today
- ?>
- </table>
- </div>
- <div class="col-lg-4">
- <h1> Reports </h1>
- <table class="table">
- <th> Report Name </th>
- <th> Report Description </th>
- <tr>
- <td> <a href="#"> Orders Placed Today </a> </td>
- <td> This will print a summary of all the orders placed today. </td>
- </tr>
- <tr>
- <td> <a href="#"> Unpaid Orders Today </a></td>
- <td> This report shows only the unpaid orders for today, in order of school. </td>
- </tr>
- <tr>
- <td> <a href="#"> Declined Transactions </a></td>
- <td> This report shows all orders that have been declined in the last week.</td>
- </tr>
- </table>
- </div>
- <div class="col-lg-4">
- <h1> User Mangement </h1>
- <ul>
- <li> <a href=""> Add User </a></li>
- <li> <a href=""> Add Store</a></li>
- <li> <a href=""> Change User Permissions</a></li>
- <li> <a href=""> Change Views</a></li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- Menu Toggle Script -->
- <script>
- $("#menu-toggle").click( function (e) {
- e.preventDefault();
- $("#wrapper").toggleClass("menuDisplayed");
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement