<?php
$faq = mysqli_query($GLOBALS['dbconn'], "select * from faq_tbl");
?>
<div class="faq_section">
    <div class="container">
    <div class="title_2 h2_title aboutTitle mt-0 wow fadeInDown animated animated">Frequently <span>Asked
                 Questions</span> </div>
         <p class="text-center w-75 mx-auto mb-3">Answers Await: Find solutions to common queries in our comprehensive FAQs section. Get clarity on orders, deliveries, warranties, and more for a seamless experience with Simplex Furniture.</p>
        <!-- <div class="title_2">FAQs</div> -->
        <div class="clearfix"></div>
        <div class="row">
             <div class="col-lg-8">
             <div class="accordion" id="accordionExample">

<?php
$i = 1;
while ($faq_res = mysqli_fetch_array($faq)) { ?>

    <div class="accordion-item wow fadeInLeft" data-wow-delay=".2s">
        <div class="accordion-header" id="heading_<?= $i ?>">
            <span class="accordion-button" role="button" data-bs-toggle="collapse" data-bs-target="#faq_<?= $i ?>" aria-expanded="true" aria-controls="heading_<?= $i ?>"><?= $faq_res['question']; ?>
            </span>
        </div>
        <div id="faq_<?= $i ?>" class="accordion-collapse collapse <?php if ($i == 1) {
                                                                        echo 'show';
                                                                    } ?>" aria-labelledby="heading_<?= $i ?>" data-bs-parent="#accordionExample">
            <div class="accordion-body">
                <p><?= $faq_res['answer'] ?></p>
            </div>
        </div>
    </div>

<?php $i++;
} ?>

</div>
             </div>
             <div class="col-lg-4 d-none d-lg-block">
                <div class="images overflow-hidden">
                    <img src="<?=site_url;?>/designer/images/chair.webp" alt="">
                </div>
             </div>
         </div>
        <div class="accordion" id="accordionExample">

            <?php
            $i = 1;
            while ($faq_res = mysqli_fetch_array($faq)) { ?>

                <div class="accordion-item wow fadeInLeft" data-wow-delay=".2s">
                    <div class="accordion-header" id="heading_<?= $i ?>">
                        <span class="accordion-button" role="button" data-bs-toggle="collapse" data-bs-target="#faq_<?= $i ?>" aria-expanded="true" aria-controls="heading_<?= $i ?>"><?= $faq_res['question']; ?>
                        </span>
                    </div>
                    <div id="faq_<?= $i ?>" class="accordion-collapse collapse <?php if ($i == 1) {
                                                                                    echo 'show';
                                                                                } ?>" aria-labelledby="heading_<?= $i ?>" data-bs-parent="#accordionExample">
                        <div class="accordion-body">
                            <p><?= $faq_res['answer'] ?></p>
                        </div>
                    </div>
                </div>

            <?php $i++;
            } ?>

        </div>
    </div>

</div>