-------------------------------Xeberler---------------

imgupload/<?= $xeberler["sehifesekli"] ?>

<?php
$cek = $db->query("SELECT * FROM xeberler WHERE veziyyeti='0' AND lan='{$dilsec["id"]}' ORDER BY sira ASC")->fetchAll(PDO::FETCH_ASSOC);
foreach ($cek as $goster) {
?>
<?php } ?>

<?= $xeberler["adi"] ?>
<?= $xeberler["aciklama"] ?>
<?= $xeberler["onaciklama"] ?>
<?= $goster["eklenme_tarihi"] ?>


sag ve ya sol side bar kateqoriyalari

<div class="col-xl-4">
    <div class="sidebar sidebar-rr-sticky">
        <div class="sidebar__widget">

        </div>
        <?php
        $sidebar_cek = $db->query("SELECT * FROM xeberler WHERE veziyyeti='0' AND lan='{$dilsec["id"]}' ORDER BY sira ASC LIMIT 8")->fetchAll(PDO::FETCH_ASSOC);
        if ($sidebar_cek) { // Eğer sidebar'da gösterilecek haber varsa
        ?>
            <div class="sidebar__widget">
                <h4 class="sidebar__widget-title"><?= $lan['diger-blog'] ?></h4>
                <?php foreach ($sidebar_cek as $sidebar_goster) { ?>
                    <div class="sidebar__widget-category">
                        <a href="<?= $sidebar_goster["seo"] ?>"><?= $sidebar_goster["adi"] ?></a>

                    </div>
                <?php } ?>
            </div>
        <?php } ?>


    </div>
</div>

-------------------------------layiheler------------------

imgupload/<?= $layiheler["sehifesekli"] ?>

<?php
$cek = $db->query("SELECT * FROM layiheler WHERE veziyyeti='0' AND lan='{$dilsec["id"]}' ORDER BY sira ASC")->fetchAll(PDO::FETCH_ASSOC);
foreach ($cek as $goster) {
?>
<?php } ?>

<?= $layiheler["adi"] ?>
<?= $layiheler["aciklama"] ?>
<?= $goster["elaveolunma_tarixi"] ?>
<?= $layiheler["baslama_tarixi"] ?>
<?= $layiheler["bitme_tarixi"] ?>



eyer elave sekil yukleme istenilesen qalareya bolmesinden yukleyirik kodu budur

<?php
$haber_id = $xeberler["id"]; // Hizmetin id'sini alıyoruz
$cek = $db->query("SELECT * FROM galeri WHERE veziyyeti='0' AND lan='{$dilsec["id"]}' AND kategori='{$haber_id}' ORDER BY sira ASC")->fetchAll(PDO::FETCH_ASSOC);
foreach ($cek as $goster) {
?>
    <div class="news_post_item">
        <div id="blod_slide" class="news_img">
            <img src="imgupload/<?= $goster["sehifesekli"] ?>" alt="">
        </div>
    </div>
<?php } ?>


-------------------------------Sertifikatlar------------------

imgupload/<?= $sertifikatlar["sehifesekli"] ?>

<?php
$cek = $db->query("SELECT * FROM sertifikatlar WHERE veziyyeti='0' AND lan='{$dilsec["id"]}' ORDER BY sira ASC")->fetchAll(PDO::FETCH_ASSOC);
foreach ($cek as $goster) {
?>
<?php } ?>

<?= $sertifikatlar["adi"] ?>
<?= $sertifikatlar["aciklama"] ?>
<?= $sertifikatlar["elaveolunma_tarixi"] ?>
<?= $sertifikatlar["baslama_tarixi"] ?>
<?= $sertifikatlar["bitme_tarixi"] ?>



eyer elave sekil yukleme istenilesen qalareya bolmesinden yukleyirik kodu budur

<?php
$sertifikat_id = $sertifikat["id"]; // sertifikat id'sini alıyoruz
$cek = $db->query("SELECT * FROM galeri WHERE veziyyeti='0' AND lan='{$dilsec["id"]}' AND kategori='{$sertifikat_id}' ORDER BY sira ASC")->fetchAll(PDO::FETCH_ASSOC);
foreach ($cek as $goster) {
?>
    <div class="news_post_item">
        <div id="blod_slide" class="news_img">
            <img src="imgupload/<?= $goster["sehifesekli"] ?>" alt="">
        </div>
    </div>
<?php } ?>




---------------------Mehsullar-----------------


imgupload/<?= $mehsullar["resim1"] ?>

imgupload/<?= $mehsullar["resim2"] ?>

<?= $mehsullar["fiyat"] ?><?php if ($mehsullar["kur"] == 0) {
                                echo '₼';
                            } else if ($mehsullar["kur"] == 1) {
                                echo '$';
                            } else {
                                echo "€";
                            } ?>

<div class="meta-action">
    <button class="btn btn-dark btn-hover-primary">
        <a href="https://wa.me/<?= $whatsappp ?>?text=Salam, bu məhsulu sifariş vermək istəyirəm: <?php echo urlencode($site . $mehsullar['seo']); ?>" style="color: inherit; text-decoration: none;">SİFARİŞ VER</a>

    </button>
</div>



---------------------------sehife-------------------

imgupload/<?= $sehifeler["resim"] ?>

<?= $sehifeler["adi"] ?>
<?= $sehifeler["onaciklama"] ?>
<?= $sehifeler["ciklama"] ?>


ara bosluq kodudur
&nbsp;
&nbsp;
&nbsp;
&nbsp;



----------------------------------xidmetler---------------------------

imgupload/<?= $xidmetler["sehifesekli"] ?>

<?php
$cek = $db->query("SELECT * FROM xidmetler WHERE veziyyeti='0' AND lan='{$dilsec["id"]}' ORDER BY sira ASC")->fetchAll(PDO::FETCH_ASSOC);
foreach ($cek as $goster) {
?>
<?php } ?>



İkinci sekil yukleneme istenilerse qalreyada yukleyirik



<?php
$hizmet_id = $xidmetler["id"]; // Hizmetin id'sini alıyoruz
$cek = $db->query("SELECT * FROM galeri WHERE veziyyeti='0' AND lan='{$dilsec["id"]}' AND xidmet_kateqoriya='{$hizmet_id}' ORDER BY sira ASC")->fetchAll(PDO::FETCH_ASSOC);
foreach ($cek as $goster) {
?>
    <div class="news_post_item">
        <div id="blod_slide" class="news_img">
            <img src="imgupload/<?= $goster["resim1"] ?>" alt="">
        </div>
    </div>
<?php } ?>


-----------------------------------Mehsul detals diger meshullar selct secem kodlu------------------------

<div class="section section-padding-02">
    <div class="container">
        <div class="product-section-wrapper">
            <div class="row">
                <div class="col-lg-6">
                    <div class="product-details-images">
                        <div class="details-gallery-images" id="img-container">
                            <div class="swiper-container">
                                <div class="swiper-wrapper">
                                    <div class="swiper-slide single-img zoom">
                                        <img src="imgupload/<?= $mehsullar["resim"] ?>" width="570" height="604" alt="Product Image" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="details-gallery-images" id="img-container">
                            <div class="swiper-container">
                                <div class="swiper-wrapper">
                                    <div class="swiper-slide single-img zoom">
                                        <img src="imgupload/<?= $mehsullar["resim2"] ?>" width="570" height="604" alt="Product Image" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        &nbsp;
                        &nbsp;
                        &nbsp;
                        &nbsp;
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="product-details-description">
                        <h4 class="product-name">
                            <?= $mehsullar["adi"] ?>
                        </h4>
                        <div class="price">
                            <span class="sale-price"><?= $mehsullar["fiyat"] ?><?php if ($mehsullar["kur"] == 0) {
                                                                                    echo '₼';
                                                                                } else if ($mehsullar["kur"] == 1) {
                                                                                    echo '$';
                                                                                } else {
                                                                                    echo "€";
                                                                                } ?></span>
                        </div>
                        <div class="review-wrapper">
                            <div class="review-star">
                                <div class="star" style="width: 80%"></div>
                            </div>
                            <p>
                                <a href="#reviews"></a>
                            </p>
                        </div>

                        <p>
                            <?= $mehsullar["aciklama"] ?>
                        </p>
                        <div class="col-sm-12">
                            <div class="single-select2">
                                <div class="form-select2">
                                    <select class="select2" onchange="redirectToProduct(this)">
                                        <option value="">
                                            Select an District *
                                        </option>
                                        <?php
                                        // Assuming $db is your PDO connection and $dilsec["id"] is defined
                                        $cek = $db->query("select * from mehsullar where durum='0' and dil='{$dilsec["id"]}' order by sira asc")->fetchAll(PDO::FETCH_ASSOC);
                                        foreach ($cek as $goster) {
                                        ?>
                                            <option value="<?= $goster["seo"] ?>">
                                                <?= $goster["adi"] ?>
                                            </option>
                                        <?php } ?>
                                    </select>
                                </div>
                            </div>
                        </div>

                        <div class="product-meta">
                            <div class="meta-action">
                                <button class="btn btn-dark btn-hover-primary">
                                    <a href="https://wa.me/<?= $whatsappp ?>?text=Salam, bu məhsulu sifariş vermək istəyirəm: <?php echo urlencode($site . $mehsullar['seo']); ?>" style="color: inherit; text-decoration: none;">SİFARİŞ VER</a>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- bu savascript kodu secilen mehsulu secelt terfinden secileni urule olarak o secilen mehsulu getren koddur -->

<script>
    function redirectToProduct(selectElement) {
        const selectedValue = selectElement.value;
        if (selectedValue) {
            // Assuming your product URLs are structured like 'yourwebsite.com/product-seo-slug'
            // You might need to adjust 'window.location.origin' if your product pages have a different base path.
            window.location.href = window.location.origin + '/' + selectedValue;
            // If your site is in a subdirectory, you might need something like:
            // window.location.href = window.location.origin + '/your_subdirectory/' + selectedValue;
        }
    }
</script>