<?php
require_once("include/includes.php");
$m = new MasterClass;
$info = $m->getFAQs();
$faqCats = $m->getFAQCategories();

?>

<!DOCTYPE html>
<html lang="en">

<head>
    <?php
    include('./include/header/header.php');
    ?>
    <title>Frequently Asked Questions</title>
    <meta name="description" content="Frequently asked questions about abortion alternatives, womens health, family support options, prenatal care, pro-life options.">
    <meta name="keywords" content="lakes lifecare center, forest lake mn, abortion alternative, family services, pregnancy testing, prenatal care, womens health">
    <meta name="author" content="WebDuckDesigns MN">
    <meta name="robots" content="index,follow">
    <link rel="stylesheet" href="<?php echo WEBSITE_ADDY; ?>/assets/sass/faq-style.css">
    <link rel="stylesheet" href="<?php echo WEBSITE_ADDY; ?>/assets/sass/fontawesome.css">

</head>

<body>
    <?php
    include('./include/header/navigation.php');
    ?>
    <section class="container-fluid inner-banner" style="background-image: url(<?php echo WEBSITE_ADDY; ?>/assets/images/banner.png);">
        <div class="container">
            <div class="row d-flex align-items-center">
                <div class="col-lg-12 col-12 mx-auto d-block">
                    <div class="content">
                        <h3>Lakes LifeCare Center</h3>
                        <h1>FAQs</h1>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="container-fluid custom-website">
        <div class="container">
            <div class="row d-flex align-items-center">
                <div class="col-lg-12 col-12">
                    <h3 class="sec-h3">Lakes LifeCare Center</h3>
                    <h2 class="sec-h2 mt-lg-0 mt-2">Frequently Asked Questions</h2>
                    <div class="inner-bline cbg-secondary"></div>
                    <form>
                    <div class="form-group">							
                        <select  class="col-md-12 faqSelect" id="QuestionNbr" name="QuestionNbr" onchange="goToQuestion();">
                            <option value="" selected="selected">Choose Question</option>
                            <?php
                            for($i=0;$i<count($info);$i++){

                            echo '<option value="'.$info[$i]['Nbr'].'">'.$info[$i]['Question'].'</option>';
                            
                            }
                            ?>
                        </select>
                    </div>
                    </form>
                    </div>
                    <?php
                    if($info[0]['Nbr'] != ''){

                        for($k=0;$k<count($faqCats);$k++){

                            echo '<h3 name="Cat_'.$faqCats[$k]['Nbr'].'" id="Cat_'.$faqCats[$k]['Nbr'].'" style="margin:25px 0; float:left; width:100%;">'.$faqCats[$k]['Name'].'</h3>';

                            for($i=0;$i<count($info);$i++){

                                if($info[$i]['Category'] == $faqCats[$k]['Nbr']){

                                    echo '<div class="faq-block">';
                                    echo '<div class="question">';
                                    echo '<i class="fa-solid fa-question" style="font-size:22px;"></i> &nbsp;';
                                    echo '<strong>'.$info[$i]['Question'].'</strong>';
                                    echo '</div>';
                                    echo '<div class="answer"  id="'.$info[$i]['Nbr'].'">';
                                    echo $info[$i]['Answer'];
                                    echo '</div>';
                                    echo '</div>';

                                }

                            }  
                            
                        }

                    }else{

                        echo '<p style="padding-top:25px;">There are no FAQs in the system at this time.</p>';

                    }
                    ?>                
                </div>
            </div>
        </div>
    </section>
    <?php
    include('./include/footer/footer.php');
    ?>