-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
302 lines (153 loc) · 7.76 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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<?php
require_once("includes/head.php");
require_once("contact.php");
require_once("signin.php");
require_once("register.php");
?>
<!-- MAIN WORK -->
<section class="view hm-gradient" id="backDiv">
<div class="full-bg-img d-flex align-items-center">
<div class="container">
<div class="row no-gutters">
<div class="col-md-10 col-lg-12 text-center text-md-left margins">
<div class="white-text">
<div class="wow flipInY text-center" data-wow-delay="3.1s">
<h1 class="h1-responsive font-bold mt-sm-5">WELCOME TO SKETCH</h1>
<h5 class="wow rollIn" data-wow-delay="4.5s">
...developing the best contents without considering who is watching them
</h5>
<form method="post" action="searched.php">
<div class="md-form input-group mb-3 wow bounceInUp" data-wow-delay="4.7s">
<input type="text" name="search_input" id="defaultLoginFormEmail" class="form-control white-text" placeholder="Enter search keyword..." aria-label="Search keyword"
aria-describedby="MaterialButton-addon2">
<div class="input-group-append">
<button name="search_btn" class="btn btn-md green white-text m-0 px-3" type="sumit" id="MaterialButton-addon2"><i class="fa fa-search"></i> Search</button>
</div>
</div>
</form>
Popular search for contents
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<div class="container wow fadeInRight text-center" id="desc_top" data-wow-delay="1.2s">
<h4><b>Why <!-- <span class="green-text"> -->Sketch?<!-- </span> --></b></h4>
<img src="/Sketches/img/pa.png" class="img-fluid" width="200">
<p class="article__content monospace">Sketch as an online application is a platform which provides you with the best possible ways to manage your photos. It's primary priorities is to give you the best right when you need it the most not just because we want to be in service for serving you gives us more happiness. Sketch's development started on March 2020 with Object Oriented Methodology using Php, it was developed with the sole aim of helping it's developer to acquire more knowledge of OOP and to aid users in ways possible.</p>
</div>
<div class="container" id="main_desc">
<div class="row">
<div class="col-12 col-lg-4 col-sm-12 wow fadeInLeft " data-wow-delay="2.1s">
<div class="card border-success mb-3" >
<div class="card-header"><b><i class='green-text'><b><i class='fa fa-check-circle'></i></b></i> Photo Categories</b></div>
<div class="card-body text-success">
<div class="list-group-flush">
<ul class="list-group">
<!-- <a href="index.php" class="green-text">All Categories</a> -->
<?php
$cats = Category::select();
foreach ($cats as $cat) {
?>
<li class="list-group-item ">
<div class="md-v-line"></div><p class="mb-0 black-text zoom"><a href="cat_post.php?cat=<?php echo $cat->id ?>"><img src="/Sketches/Admin/cat_imgs_upload/<?php echo $cat->cat_img ?>" class=" mr-4 p-3 white-text rounded-circle " width="100" aria-hidden="true"></a><a href="cat_post.php?cat=<?php echo $cat->id ?>" class="black-text"><?php echo $cat->cat_title?></a></p><i class="badge badge-success pr-3 pl-3 float-right"><?php echo date('d-M-y - h:i:a', strtotime($cat->date)) ?></i>
</li>
<?php
}
?>
</ul>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-8 col-sm-12 ">
<h4 class="text-center wow zoomIn" data-wow-delay="2.0s"><img src="img/seen.png" width="50"><b>All Categories</b></h4><br>
<!-- Card deck -->
<div class="card-deck" >
<?php
$page = !empty($_GET['page'])? (int)$_GET['page']: 1;
$items_per_page = 6;
$items_total_count = Photo::count_table('photos');
$pagination = new Pagination($page, $items_per_page, $items_total_count);
$sql = "SELECT * FROM photos WHERE status = 'Approved' ORDER BY id DESC LIMIT {$items_per_page} OFFSET {$pagination->offset()} ";
$photos = Photo::find_query($sql);
foreach ($photos as $photo ) {
?>
<!-- Card -->
<div class="card mb-4 card_style wow fadeInRight" data-wow-delay="2.2s">
<!--Card image-->
<div class="view overlay zoom" >
<a data-toggle="modal" data-target="#gallary">
<img class="card-img-top img-fluid" src="/Sketches/Admin/photo_uploads/<?php echo $photo->filename?>"
alt="Card image cap">
<div class="mask flex-center waves-effect waves-light rgba-grey-light">
<p class="white-text"><?php echo $photo->title?></p>
</div>
</a>
</div>
<!--Card content-->
<div class="card-body">
<!--Title-->
<h4 class="card-title"><?php echo $photo->title?></h4>
<h5 class="blue-text pb-2"><strong><?php echo $photo->author ?></strong></h5>
<!--Text-->
<p class="card-text"><?php echo substr($photo->description, 0,100) ?></p>
<!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
<a href="single.php?single_post=<?php echo $photo->id ?>" class="btn green accent-4 btn-md">Read more</a>
</div>
</div>
<!-- Card -->
<?php
}
?>
</div>
<!-- Card deck -->
<!-- PAGINATION -->
<nav aria-label="Page navigation example">
<ul class="pagination pagination-circle pg-teal ">
<?php
if($pagination->page_total() > 1){
if($pagination->has_previous()){
?>
<li class="page-item"><a href="index.php?page=<?php echo $pagination->previous() ?>" class="green-text page-link">Previous</a></li>
<?php
}
for ($i=1; $i <= $pagination->page_total() ; $i++) {
if($i == $pagination->current_page){
?>
<li class="page-item active"><a href="index.php?page=<?php echo $i ?>" class="white-text page-link"><?php echo $i ?></a></li>
<?php
}else{
?>
<li class="page-item "><a href="index.php?page=<?php echo $i ?>" class="green-text page-link"><?php echo $i ?></a></li>
<?php
}
}
if($pagination->has_next()){
?>
<li class="page-item"><a href="index.php?page=<?php echo $pagination->next() ?>" class="green-text page-link">Next</a></li>
<?php
}
}
?>
</ul>
</nav>
<!-- END OF PAGINATION -->
</div>
</div>
</div>
<?php include "photo_library.php" ?>
<div>
<?php include "includes/foot.php" ?>
</div>
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/popper.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/mdb.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<!-- <script type="text/javascript" src="js/materialize.min.js"></script> -->
<script>new WOW().init();</script>
</body>
</html>