-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
127 lines (121 loc) · 4.44 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
<!-- tested work properly -->
<?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">
<h3 class="text-white">Welcome to <?php echo $_SESSION['system']['name']; ?></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 e.*,v.venue FROM events e inner join venue v on v.id=e.venue_id where date_format(e.schedule,'%Y-%m%-d') >= '".date('Y-m-d')."' and e.type = 1 order by unix_timestamp(e.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['description']),$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'])): ?>
<!-- banner spaling is incoorect -->
<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['event']) ?></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()
// chcek o/.p here
$('.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>