-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
171 lines (165 loc) · 6.21 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php include 'conn_db.php' ?>
<style>
span.float-right.summary_icon {
font-size: 3rem;
position: absolute;
right: 1rem;
color: #ffffff96;
}
.imgs{
margin: .5em;
max-width: calc(100%);
max-height: calc(100%);
}
.imgs img{
max-width: calc(100%);
max-height: calc(100%);
cursor: pointer;
}
#imagesCarousel,#imagesCarousel .carousel-inner,#imagesCarousel .carousel-item{
height: 60vh !important;background: black;
}
#imagesCarousel .carousel-item.active{
display: flex !important;
}
#imagesCarousel .carousel-item-next{
display: flex !important;
}
#imagesCarousel .carousel-item img{
margin: auto;
}
#imagesCarousel img{
width: auto!important;
height: auto!important;
max-height: calc(100%)!important;
max-width: calc(100%)!important;
}
</style>
<div class="containe-fluid">
<div class="row mt-3 ml-3 mr-3">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<?php echo "Welcome back ". $_SESSION['login_name']."!" ?>
<hr>
<div class="row">
<div class="col-md-4">
<div class="card">
<div class="card-body pink">
<div class="card-body text-white">
<span class="float-right summary_icon"><i class="fa fa-users"></i></span>
<h4><b>
<?php echo $conn->query("SELECT * FROM member")->num_rows; ?>
</b></h4>
<p><b>Users</b></p>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body blue">
<div class="card-body text-white">
<span class="float-right summary_icon"><i class="fa fa-comments"></i></span>
<h4><b>
<?php echo $conn->query("SELECT * FROM topics")->num_rows; ?>
</b></h4>
<p><b>Forum Topics</b></p>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-body green">
<div class="card-body text-white">
<span class="float-right summary_icon"><i class="fa fa-tags"></i></span>
<h4><b>
<?php echo $conn->query("SELECT * FROM categories")->num_rows; ?>
</b></h4>
<p><b>Tags</b></p>
</div>
</div>
</div>
</div>
</div>
<hr class="divider" style="max-width: 100%">
<h4><i class="fa fa-tags pink2"></i> Tags</h4>
<div class="row">
<?php
$tags = $conn->query("SELECT * FROM categories order by name asc");
while($row=$tags->fetch_assoc()):
?>
<div class="col-md-3">
<div class="card mb-3">
<div class="card-body">
<p>
<large><i class="fa fa-tag pink2"></i> <b><?php echo $row['name'] ?></b></large>
</p>
<hr class="divider" style="max-width: 100%">
<p><small><i><?php echo $row['description'] ?></i></small></p>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$('#manage-records').submit(function(e){
e.preventDefault()
start_load()
$.ajax({
url:'ajax.php?action=save_track',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
resp=JSON.parse(resp)
if(resp.status==1){
alert_toast("Data successfully saved",'success')
setTimeout(function(){
location.reload()
},800)
}
}
})
})
$('#tracking_id').on('keypress',function(e){
if(e.which == 13){
get_person()
}
})
$('#check').on('click',function(e){
get_person()
})
function get_person(){
start_load()
$.ajax({
url:'ajax.php?action=get_pdetails',
method:"POST",
data:{tracking_id : $('#tracking_id').val()},
success:function(resp){
if(resp){
resp = JSON.parse(resp)
if(resp.status == 1){
$('#name').html(resp.name)
$('#address').html(resp.address)
$('[name="person_id"]').val(resp.id)
$('#details').show()
end_load()
}else if(resp.status == 2){
alert_toast("Unknow tracking id.",'danger');
end_load();
}
}
}
})
}
</script>