File "category.php"
Full path: /home/fsibplc/public_html/firstcash/category.php
File
size: 4.7 B (4.7 KB bytes)
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
include('./all/config.php');
if(isset($_GET['title']))
{
$slug = mysqli_real_escape_string($con, $_GET['title']);
$category = "SELECT slug,meta_title, meta_description,meta_keyword FROM categories WHERE slug = '$slug' AND status ='0' LIMIT 1";
$category_run = mysqli_query($con, $category);
if(mysqli_num_rows($category_run) > 0)
{
$categoryItem = mysqli_fetch_array($category_run);
$page_title = $categoryItem['meta_title'];
$meta_description = $categoryItem['meta_description'];
$meta_keywords = $categoryItem['meta_keyword'];
}else{
$page_title = "Category Page";
$meta_description = "FirstCash Home page description";
$meta_keywords = "FirstCash, MFS, SureCash, FSIBL, Mobile Finance, FSIB";
}
}else{
$page_title = "Category Page";
$meta_description = "FirstCash Home page description";
$meta_keywords = "FirstCash, MFS, SureCash, FSIBL, Mobile Finance, FSIB";
}
include('./all/header.php');
include('./all/navbar.php'); ?>
<section data-bs-version="5.1" class="header12 cid-tyCfvuk4ue mbr-parallax-background" id="header12-k">
<div class="container mt-5">
<?php
if(isset($_GET['title']))
{
$slug = mysqli_real_escape_string($con, $_GET['title']);
$category = "SELECT id,slug,name_bn FROM categories WHERE slug = '$slug' AND status ='0' LIMIT 1";
$category_run = mysqli_query($con, $category);
if(mysqli_num_rows($category_run) > 0)
{
$categoryItem = mysqli_fetch_array($category_run);
$category_id = $categoryItem['id'];
$category_name = $categoryItem['name_bn'];
?> <h1 class="mb-3 text-center" style="font-weight:bold;color:#2D3192"><?=$category_name;?></h1>
<?php
$posts = "SELECT category_id, image, name_bn, slug, date FROM posts WHERE category_id = '$category_id' AND status ='0'";
$posts_run = mysqli_query($con, $posts);
if(mysqli_num_rows($posts_run) > 0)
{
foreach( $posts_run as $postItem)
{
?>
<a href="<?= base_url('post/'.$postItem['slug']); ?>" class="text-primary dropdown-item display-4">
<div class="container box mb-5 text-wrap p-3">
<h3 style="line-height:1.5;font-size:16px;font-weight:700"><?=$postItem['name_bn'];?></h3>
<img src="<?= base_url('uploads/posts/'.$postItem['image']); ?>" width="100" class="w-50">
<label class="text-dark me-2">Posted on: <?= date('d-M-Y', strtotime($postItem['date'])); ?></label>
</div>
</a>
<?php
}
}else{
?>
<h4>No Posts Available.</h4>
<?php
}
}
else
{
?>
<h4>No Such Category Found</h4>
<?php
}
}
else
{
?>
<h4>No Such URL Found</h4>
<?php
}
?>
</div>
</section>
<?php include('./all/footer.php') ?>
</body>
</html>