-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
89 lines (82 loc) · 2.85 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
<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Let's Discuss - Coding Forum</title>
<!--------- Bootstrap CSS ------------->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
/>
<link rel="stylesheet" href="./css/index.css" />
</head>
<body>
<?php
include './partials/_dbconnect.php';
include './partials/_header.php';
$currpage = $_SERVER['REQUEST_URI'];
$_SESSION['currpageaddress'] = $currpage;
?>
<?php
include './partials/_carsousel.php';
?>
<div class="container main-con">
<div class="heading my-3">
<h2 class="text-center text-muted">
Let's Discuss - <span style="color: green">Categories</span>
</h2>
</div>
<div class="container">
<div class="row">
<?php
$sqlfetch = "SELECT * FROM `categories`";
$ressqlfetch = mysqli_query($conn,$sqlfetch);
$nrow = mysqli_num_rows($ressqlfetch);
if($nrow >
0){ while($row = mysqli_fetch_assoc($ressqlfetch)){ $id =
$row['category_id']; $catname = $row['category_name']; $catdesc =
$row['category_description']; echo '
<div class="col-md-4 my-4">
<div class="card" style="width: 20rem">
<img
class="card-img-top"
src="./images/'.$catname.'.jpg"
alt="Card image cap"
/>
<div class="card-body">
<h5 class="card-title text-capitalize">
<a href="/forums/threadlist.php?catid='.$id.'"
>'.$catname.'</a
>
</h5>
<p class="card-text">'.substr($catdesc,0,90).'....</p>
<a
href="/forums/threadlist.php?catid='.$id.'"
class="btn btn-outline-success"
>View Threads</a
>
</div>
</div>
</div>
'; } } ?>
</div>
</div>
</div>
<!--------footer--------->
<?php
include './partials/_footer.php';
?>
<!-------------- Jquery CDN ----------------->
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xU+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"
></script>
<!-- ------- Bootstrap JS ----------- -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="./js/index.js"></script>
</body>
</html>