Last change
on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 6 days ago |
Upload project files
|
-
Property mode
set to
100644
|
File size:
2.1 KB
|
Rev | Line | |
---|
[e3d4e0a] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | session_start();
|
---|
| 4 |
|
---|
| 5 | if(!isset($_SESSION['user_ID']) || !isset($_SESSION['is_admin']) || !$_SESSION['is_admin']) {
|
---|
| 6 | header("Location: ./Log In.php");
|
---|
| 7 | }
|
---|
| 8 |
|
---|
| 9 | require_once('connect.php');
|
---|
| 10 | $query = " select * from products";
|
---|
| 11 | $result = mysqli_query($conn, $query);
|
---|
| 12 |
|
---|
| 13 | ?>
|
---|
| 14 |
|
---|
| 15 | <!DOCTYPE html>
|
---|
| 16 | <html lang="en">
|
---|
| 17 | <head>
|
---|
| 18 | <meta charset="UTF-8">
|
---|
| 19 | <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
---|
| 20 | <title>Fetcher</title>
|
---|
| 21 | <link rel="stylesheet" href="./CSS/FetchData.css">
|
---|
| 22 | </head>
|
---|
| 23 | <body>
|
---|
| 24 | <div class="container">
|
---|
| 25 | <div class="row">
|
---|
| 26 | <div class="col">
|
---|
| 27 | <div class="card">
|
---|
| 28 | <div class="card-header">
|
---|
| 29 | <h2>Fetcher</h2>
|
---|
| 30 | </div>
|
---|
| 31 | <div class="card-body">
|
---|
| 32 | <table class="table-container">
|
---|
| 33 | <tr>
|
---|
| 34 | <th>Product ID</th>
|
---|
| 35 | <th>Product Name</th>
|
---|
| 36 | <th>Product Price</th>
|
---|
| 37 | <th>Product InStock</th>
|
---|
| 38 | <th>Product Category</th>
|
---|
| 39 | <th>Model Number</th>
|
---|
| 40 | <th>Edit</th>
|
---|
| 41 | </tr>
|
---|
| 42 | <tr>
|
---|
| 43 | <?php
|
---|
| 44 | while($row = mysqli_fetch_assoc($result)){
|
---|
| 45 | ?>
|
---|
| 46 | <td><?php echo $row['product_id']?></td>
|
---|
| 47 | <td><?php echo $row['name']?></td>
|
---|
| 48 | <td><?php echo $row['price']?></td>
|
---|
| 49 | <td><?php echo $row['in_stock']?></td>
|
---|
| 50 | <td><?php echo $row['category']?></td>
|
---|
| 51 | <td><?php echo $row['model_number']?></td>
|
---|
| 52 | <td><?php echo '<a href="FetchEditer.php?product_id=' . $row['product_id'] . '">Edit</a>'; ?></td>
|
---|
| 53 | </tr>
|
---|
| 54 | <?php
|
---|
| 55 | }
|
---|
| 56 | ?>
|
---|
| 57 | </table>
|
---|
| 58 | </div>
|
---|
| 59 | </div>
|
---|
| 60 | </div>
|
---|
| 61 | </div>
|
---|
| 62 | </div>
|
---|
| 63 |
|
---|
| 64 |
|
---|
| 65 | </body>
|
---|
| 66 | </html> |
---|
Note:
See
TracBrowser
for help on using the repository browser.