Mini Kabibi Habibi
<?php
// view_inventory.php
session_start();
include('db_connection.php'); // Include the database connection
// Make sure the user is logged in
if (!isset($_SESSION['username']) || $_SESSION['role'] !== 'school') {
header("Location: index.php"); // Redirect to login page if not logged in
exit();
}
// Retrieve the inventory ID from the session
$inventory_id = $_SESSION['inventory_id'];
// Fetch the inventory data from the database
$sql = "SELECT * FROM dcp_inventory WHERE id = '$inventory_id'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
// Fetch the data
$row = mysqli_fetch_assoc($result);
} else {
echo "No data found.";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View Inventory - DCP Inventory Management</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f8f8f8;
}
.inventory-details {
width: 80%;
max-width: 800px;
padding: 30px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
h2 {
color: #333;
text-align: center;
}
.details {
font-size: 18px;
margin: 15px 0;
}
.details label {
font-weight: bold;
}
.logout-btn {
background-color: red;
color: white;
padding: 10px 20px;
border: none;
cursor: pointer;
font-size: 16px;
border-radius: 5px;
position: absolute;
top: 20px;
right: 20px;
}
.logout-btn:hover {
background-color: #ff4d4d;
}
</style>
</head>
<body>
<!-- View Inventory Details -->
<div class="inventory-details">
<h2>Your DCP Inventory Submission</h2>
<div class="details">
<label>School ID:</label> <?php echo $row['school_id']; ?>
</div>
<div class="details">
<label>School Name:</label> <?php echo $row['school_name']; ?>
</div>
<div class="details">
<label>School Category:</label> <?php echo $row['school_category']; ?>
</div>
<div class="details">
<label>DCP Batch Number:</label> <?php echo $row['dcp_batch_number']; ?>
</div>
<div class="details">
<label>Date Received:</label> <?php echo $row['date_received']; ?>
</div>
<div class="details">
<label>Current Status:</label> <?php echo $row['current_status']; ?>
</div>
<a href="school_dashboard.php" class="logout-btn">Go Back</a>
</div>
</body>
</html>