-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
218 lines (189 loc) · 7.65 KB
/
index.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?php
// get match highlights
function matchHighlight()
{
$conn = mysqli_connect("localhost", "root", "", "sport_watch");
$fetchNews = "SELECT * FROM posts WHERE category = 'Match Highlight' ";
$result = mysqli_query($conn, $fetchNews);
$totalRecords = mysqli_num_rows($result);
if($totalRecords > 0){
$data = [];
while ($row = mysqli_fetch_assoc($result)) {
# code...
$data[] = $row;
}
return $data;
}else{
$data = [];
return $data;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Sport Watch</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<?php include('includes/style.php'); ?>
</head>
<body>
<div class="site-wrap">
<div class="site-mobile-menu">
<div class="site-mobile-menu-header">
<div class="site-mobile-menu-logo">
<a href="#"><img src="public/images/logo.png" alt="Image"></a>
</div>
<div class="site-mobile-menu-close mt-3">
<span class="icon-close2 js-menu-toggle"></span>
</div>
</div>
<div class="site-mobile-menu-body"></div>
</div>
<?php include('includes/header.php'); ?>
<div class="slide-one-item home-slider owl-carousel">
<div class="site-blocks-cover overlay" style="background-image: url(public/images/swift.jpg);" data-aos="fade" data-stellar-background-ratio="0.5">
<div class="container">
<div class="row align-items-center justify-content-start">
<div class="col-md-6 text-center text-md-left" data-aos="fade-up" data-aos-delay="400">
<h1 class="bg-text-line">Catch Them Young.</h1>
</div>
</div>
</div>
</div>
<div class="site-blocks-cover overlay" style="background-image: url(public/images/football.jpg);" data-aos="fade" data-stellar-background-ratio="0.5">
<div class="container">
<div class="row align-items-center justify-content-start">
<div class="col-md-6 text-center text-md-left" data-aos="fade-up" data-aos-delay="400">
<h1 class="bg-text-line">Local Football Monitroring System.</h1>
</div>
</div>
</div>
</div>
</div>
<div class="site-section pt-0 feature-blocks-1" data-aos="fade" data-aos-delay="100">
<div class="container">
<div class="row" id="gen-news">
</div>
</div>
</div>
<div class="site-blocks-vs site-section bg-light">
<div class="container">
<!-- <div class="border mb-3 rounded d-block d-lg-flex align-items-center p-3 next-match"> -->
<!-- <div class="mr-auto order-md-1 w-60 text-center text-lg-left mb-3 mb-lg-0">
Next match -->
<!-- <div id="date-countdown"></div> -->
<!-- </div> -->
<!-- <div class="ml-auto pr-4 order-md-2">
<div class="h5 text-black text-uppercase text-center text-lg-left">
<div class="d-block d-md-inline-block mb-3 mb-lg-0">
<img src="public/images/img_1_sq.jpg" alt="Image" class="mr-3 image"><span class="d-block d-md-inline-block ml-0 ml-md-3 ml-lg-0">Sea Hawlks </span>
</div>
<span class="text-muted mx-3 text-normal mb-3 mb-lg-0 d-block d-md-inline ">vs</span>
<div class="d-block d-md-inline-block">
<img src="public/images/img_3_sq.jpg" alt="Image" class="mr-3 image"><span class="d-block d-md-inline-block ml-0 ml-md-3 ml-lg-0">Patriots</span>
</div>
</div>
</div>
</div> -->
<!-- <div class="bg-image overlay-success rounded mb-5" style="background-image: url('public/images/hero_bg_1.jpg');" data-stellar-background-ratio="0.5">
<div class="row align-items-center">
<div class="col-md-12 col-lg-4 mb-4 mb-lg-0">
<div class="text-center text-lg-left">
<div class="d-block d-lg-flex align-items-center">
<div class="image mx-auto mb-3 mb-lg-0 mr-lg-3">
<img src="public/images/img_1_sq.jpg" alt="Image" class="img-fluid">
</div>
<div class="text">
<h3 class="h5 mb-0 text-black">Sea Hawks</h3>
<span class="text-uppercase small country text-black">Brazil</span>
</div>
</div>
</div>
</div>
<div class="col-md-12 col-lg-4 text-center mb-4 mb-lg-0">
<div class="d-inline-block">
<p class="mb-2"><small class="text-uppercase text-black font-weight-bold">Premier League — Round 10</small></p>
<div class="bg-black py-2 px-4 mb-2 text-white d-inline-block rounded"><span class="h3">3:2</span></div>
<p class="mb-0"><small class="text-uppercase text-black font-weight-bold">10 September / 7:30 AM</small></p>
</div>
</div>
<div class="col-md-12 col-lg-4 text-center text-lg-right">
<div class="">
<div class="d-block d-lg-flex align-items-center">
<div class="image mx-auto ml-lg-3 mb-3 mb-lg-0 order-2">
<img src="public/images/img_4_sq.jpg" alt="Image" class="img-fluid">
</div>
<div class="text order-1">
<h3 class="h5 mb-0 text-black">Steelers</h3>
<span class="text-uppercase small country text-black">London</span>
</div>
</div>
</div>
</div>
</div>
</div>
-->
</div>
</div>
<div class="site-section block-13 bg-primary fixed overlay-primary bg-image" style="background-image: url('public/images/hero_bg_3.jpg');" data-stellar-background-ratio="0.5">
<div class="container">
<div class="row mb-5">
<div class="col-md-12 text-center">
<h2 class="text-white">More Game Highlights</h2>
</div>
</div>
<div class="row">
<div class="nonloop-block-13 owl-carousel">
<?php
$data = matchHighlight();
foreach($data as $row)
{
echo('<div class="item">');
echo('<div class="block-12">');
echo('<figure>');
echo('<img src="'.str_replace('../', '',$row["post_image"]).'" alt="Image" class="img-fluid" >');
echo('</figure>');
echo('<div class="text">');
echo('<span class="meta">'.date("M d Y", $row['post_date']).'</span>');
echo('<div class="text-inner">');
echo('<h2 class="heading mb-3"><a href="#" class="text-black">'.substr($row['heading'], 0).'</a></h2>');
echo('<p>'.substr($row['body'], 0,70).'</p>');
echo('</div>');
echo('</div>');
echo('</div>');
echo('</div>');
}
?>
</div>
</div>
</div>
</div>
<?php include("includes/footer.php"); ?>
</div>
<?php include("includes/script.php"); ?>
<script type="text/javascript">
$(document).ready(function(){
// get all general news
$.ajax({
type:"GET",
url:'__factory/fetch_general_news.php',
cache:false,
success:res=>{
$("#gen-news").html(res);
}
})
// get match highlight news
$.ajax({
type:"GET",
url:'__factory/fetch_match_news.php',
cache:false,
success:res=>{
$("#match-highlight").empty();
$("#match-highlight").html(res);
}
})
});
</script>
</body>
</html>