<?php
$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
if ($id > 0) {
require_once __DIR__ . '/../../Models/DetailsManager.php';
$label='';
$description='';
$img_path1 = "service/images/details/";
$ctrl = new DetailsManager();
$row = $ctrl->getDetailsById($id);
$imagePath ="";
if ($row !== null) {
if (!empty($row['img_ext'])) {
$imagePath = $img_path1 . 'img_' . $row['item_id'] . '.' . $row['img_ext'];
}
if($lang==='ar'){
$label = $row['details_title'] ?? '';
$description = $row['details_description'] ?? '';
}
else if($lang==='ku'){
$label = $row['details1_title'] ?? '';
$description = $row['details1_description'] ?? '';
}
else if($lang==='en'){
$label = $row['details2_title'] ?? '';
$description = $row['details2_description'] ?? '';
}
} else {
$list = $ctrl->getMenu();
$item = findById($list, $id);
if ($item !== null) {
$label= $item['title'][$lang];
}
}
}
?>
<main id="content">
<div class="container">
<div class="row">
<!--breadcrumb-->
<div class="col-12">
<div class="breadcrumb u-breadcrumb pt-3 px-0 mb-0 bg-transparent small">
<a class="breadcrumb-item" href="index.php?lang=<?= $lang ?>"><?= $L['home'] ?></a>
» <?=$label; ?></div>
</div>
<!--end breadcrumb-->
<div class="col-md-8">
<article class="post-397 page type-page status-publish hentry" id="post-397">
<header class="entry-header post-title">
<h1 class="entry-title h1 text-center display-4-md display-3-lg mt-2"><?= $label; ?></h1>
<hr class="hr-after mx-auto">
</header><!-- .entry-header -->
<div class="entry-content post-content post-page">
<?php if ($imagePath): ?>
<div class="ratio_360-202 image-wrapper mb-4">
<a href="#" onclick="event.preventDefault();">
<img class="img-fluid lazy"
src="assets/img/lazy-empty.png"
data-src="<?= htmlspecialchars($imagePath) ?>"
alt="<?= htmlspecialchars($label) ?>">
</a>
</div>
<?php endif; ?>
<div class="mb-5"></div>
<div class="inside-text">
<?php
echo html_entity_decode($description);
?>
</div>
<hr class="my-4" />
<div class="gap-1"></div>
</div><!-- .entry-content -->
</article><!-- #post-## -->
</div>
<?php include('right_sidebar.php'); ?>
</div>
</div>
</main>