-
Notifications
You must be signed in to change notification settings - Fork 3
/
home.php
131 lines (121 loc) · 4.53 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
<?php
include 'admin/db_connect.php';
?>
<style>
#portfolio .img-fluid{
width: calc(100%);
height: 30vh;
z-index: -1;
position: relative;
padding: 1em;
}
.event-list{
cursor: pointer;
}
span.hightlight{
background: yellow;
}
.banner{
display: flex;
justify-content: center;
align-items: center;
min-height: 26vh;
width: calc(30%);
}
.banner img{
width: calc(100%);
height: calc(100%);
cursor :pointer;
}
.event-list{
cursor: pointer;
border: unset;
flex-direction: inherit;
}
.event-list .banner {
width: calc(40%)
}
.event-list .card-body {
width: calc(60%)
}
.event-list .banner img {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
min-height: 50vh;
}
span.hightlight{
background: yellow;
}
.banner{
min-height: calc(100%)
}
</style>
<header class="masthead">
<div class="container-fluid h-100">
<div class="row h-100 align-items-center justify-content-center text-center">
<div class="col-lg-8 align-self-end mb-4 page-title">
<h1 class="text-white">Welcome to Alumnet <br><h4 class="text-white"> Connect </h4>
<!-- <h3><b>Connect</b> -->
</h1>
</h3>
<hr class="divider my-4" />
<div class="col-md-12 mb-2 justify-content-center">
</div>
</div>
</div>
</div>
</header>
<div class="container mt-3 pt-2">
<h4 class="text-center text-white">Upcoming Events</h4>
<hr class="divider">
<?php
$event = $conn->query("SELECT * FROM events where date_format(schedule,'%Y-%m%-d') >= '".date('Y-m-d')."' order by unix_timestamp(schedule) asc");
while($row = $event->fetch_assoc()):
$trans = get_html_translation_table(HTML_ENTITIES,ENT_QUOTES);
unset($trans["\""], $trans["<"], $trans[">"], $trans["<h2"]);
$desc = strtr(html_entity_decode($row['content']),$trans);
$desc=str_replace(array("<li>","</li>"), array("",","), $desc);
?>
<div class="card event-list" data-id="<?php echo $row['id'] ?>">
<div class='banner'>
<?php if(!empty($row['banner'])): ?>
<img src="admin/assets/uploads/<?php echo($row['banner']) ?>" alt="">
<?php endif; ?>
</div>
<div class="card-body">
<div class="row align-items-center justify-content-center text-center h-100">
<div class="">
<h3><b class="filter-txt"><?php echo ucwords($row['title']) ?></b></h3>
<div><small><p><b><i class="fa fa-calendar"></i> <?php echo date("F d, Y h:i A",strtotime($row['schedule'])) ?></b></p></small></div>
<hr>
<larger class="truncate filter-txt"><?php echo strip_tags($desc) ?></larger>
<br>
<hr class="divider" style="max-width: calc(80%)">
<button class="btn btn-primary float-right read_more" data-id="<?php echo $row['id'] ?>">Read More</button>
</div>
</div>
</div>
</div>
<br>
<?php endwhile; ?>
</div>
<script>
$('.read_more').click(function(){
location.href = "index.php?page=view_event&id="+$(this).attr('data-id')
})
$('.banner img').click(function(){
viewer_modal($(this).attr('src'))
})
$('#filter').keyup(function(e){
var filter = $(this).val()
$('.card.event-list .filter-txt').each(function(){
var txto = $(this).html();
txt = txto
if((txt.toLowerCase()).includes((filter.toLowerCase())) == true){
$(this).closest('.card').toggle(true)
}else{
$(this).closest('.card').toggle(false)
}
})
})
</script>