-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
63 lines (58 loc) · 2.26 KB
/
home.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
60
61
62
63
<?php include('db_connect.php') ?>
<!-- Info boxes -->
<?php if($_SESSION['login_type'] == 1): ?>
<div class="row">
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box">
<span class="info-box-icon bg-info elevation-1"><i class="fas fa-users"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total Subscribers</span>
<span class="info-box-number">
<?php echo $conn->query("SELECT * FROM users where type = 3")->num_rows; ?>
</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box mb-3">
<span class="info-box-icon bg-primary elevation-1"><i class="fas fa-poll-h"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total Survey</span>
<span class="info-box-number">
<?php echo $conn->query("SELECT * FROM survey_set")->num_rows; ?>
</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
</div>
<?php else: ?>
<div class="col-12">
<div class="card">
<div class="card-body">
Welcome <?php echo $_SESSION['login_name'] ?>!
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box">
<span class="info-box-icon bg-primary elevation-1"><i class="fas fa-poll-h"></i></span>
<div class="info-box-content">
<span class="info-box-text">Total Surveys Taken</span>
<span class="info-box-number">
<?php echo $conn->query("SELECT distinct(survey_id) FROM answers where user_id = {$_SESSION['login_id']}")->num_rows; ?>
</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
</div>
<?php endif; ?>