-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathadmin_home.php
More file actions
77 lines (70 loc) · 2.37 KB
/
admin_home.php
File metadata and controls
77 lines (70 loc) · 2.37 KB
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
<?php
require_once './includes/header.php';
LogInCheck();
require_once './includes/admin_nav.php';
//var_dump($_SESSION);
flash();
?>
<!--begin caurosol-->
<div>
<div class="row">
<?php if($_SESSION['role'] == 'admin'){?>
<div class="col-md-4">
<?php
require_once 'db.php';
$sql = "SELECT COUNT(`dept_id`) AS dept_available FROM `department` WHERE `dept_id` <> '1'";
$result0 = $conn->query($sql);
$row=$result0->fetch_assoc();
$alert_dept = ($row>0)? "<div class=''><h3 CLASS='alert alert-success'> Departments ".$row['dept_available']."</h3></div>":"<div class=''><h3 CLASS='alert alert-danger'> NO DEPARTMENTS AVAILABLE </h3></div>";
echo $alert_dept;
?>
</div>
<div class="col-md-4">
<?php
require_once 'db.php';
$sql = "SELECT COUNT(`supplier_id`) AS supplier_available FROM `supplier` WHERE 1";
$result1 = $conn->query($sql);
$row=$result1->fetch_assoc();
$alert_supplier = ($row>0)? "<div class=''><h3 class='alert alert-success text-center'> Suppliers ".$row['supplier_available']."</h3></div>":"<div class=''><h3 CLASS='alert alert-danger text-center'> NO SUPPLIER AVAILABLE </h3></div>";
echo $alert_supplier;
?>
</div>
<div class="col-md-4">
<?php
require_once 'db.php';
$sql = "SELECT COUNT(`item_id`) AS item_available FROM `item` WHERE `dept_id` = 1";
$result0 = $conn->query($sql);
$row=$result0->fetch_assoc();
$alert_item = ($row>0)? "<div class=''><h3 CLASS='alert alert-success'> Items in stock ".$row['item_available']."</h3></div>":"<div class=''><h3 CLASS='alert alert-danger'> NO ITEMS AVAILABLE </h3></div>";
echo $alert_item;
?>
</div>
<div class="row">
<div class="col-md-3">
</div>
<div class="col-md-3">
</div>
<div class="col-md-3">
</div>
<div class="col-md-3">
</div>
</div>
<?php
}?>
</div>
<div class="row">
<div class=" col-lg-offset-2 col-lg-8 col-lg-offset-2">
<?php require_once './includes/carusol.php';?>
</div>
</div>
</div>
<!---->
</div>
<?php
//code for taking backup
//$bak = backDb(DB_HOST,DB_USER,DB_PASS,DB_NAME);
if($bak==1){
echo '<script>alert("back up taken");</script>';
}
?>
<?php require_once './includes/footer.php'; ?>