<?php


// include 'xs_login.php';
// include 'xs_template.php';
include 'xs_config.php';
include 'xs_db.php';
include 'template.php';

$debug_mode = 1; // 1 shows verbose output

  global $dbhost, $dbuser, $dbpass, $dbname;
  
   
   $conn  =  new mysqli($dbhost, $dbuser, $dbpass, $dbname);
  
   $query =  "SELECT * from `home_banners` where IsActive='Y' ORDER BY SortOrder ASC";
    
    $result = mysqli_query($conn,"$query;")
    or die(mysqli_error());

    $sideBannerQuery =  "SELECT * from `home_sidebars` where IsActive='Y' ORDER BY SortOrder ASC limit 8";
    
    $sideBannerResult = mysqli_query($conn,"$sideBannerQuery;")
    or die(mysqli_error());

    $sideLinesQuery =  "SELECT * from `home_sidelines` where IsActive='Y' ORDER BY SortOrder ASC"; 
    
    $sideLinesResult = mysqli_query($conn,"$sideLinesQuery;")
    or die(mysqli_error());

    $testquery =  "SELECT * from `ptests` where 1 ORDER BY ReferenceID ASC";
    
    $testresult = mysqli_query($conn,"$testquery;")
    or die(mysqli_error());

   
    
    
   


?>

<?php show_header($title='') ?>






    <!-- main slider -->
    <section class="example main-slider">
        
        <div class="container">
            <!-- Set up your HTML -->
            <div class="owl-carousel home-banner-slider">
                <?php while ($row = mysqli_fetch_array($result,MYSQLI_ASSOC)) { ?>

                <div> 
                    <a href="<?= $row['URL']; ?>">
                    <img alt="" class="rev-slidebg" src="content/banners/<?= $row['Image']; ?>"> 
                    </a>
                  

                    <div class="main-slider-caption">
                        <!-- <p>//$row['Title']</p> -->
                        <!-- <a href="// $row['URL']; " class="btn btn-primary">CLICK TO KNOW MORE</a> -->
                    </div>
                </div>
                <?php } ?>
                
            </div>
        </div>

        
    </section>
    <!-- main slider end -->






    <section id="test-below" class="main-organ">
        <div class="container">
            <div class="row">
             
                <h3>Search For Another Test</h3>
                <div class="col-md-6 col-sm-6 col-xs-12 footer-colmun search-another-text">
                    <div class="subscribe-widget footer-widget">

                        <div class="input-box dropdown">
                            <form action="ptests.php" method="get"> 
                                <div class="form-group">
                                    <select name="q" class="form-control" id="searchBySelect" style="padding:10px !important; border-radius:10px; background:#f2f2f7;">
                                        <option selected>Select One item</option>
                                        <?php while ($row = mysqli_fetch_array($testresult,MYSQLI_ASSOC)) { ?>
                                            <option value="<?= $row['ReferenceID']; ?>"><?= ucfirst($row['ReferenceID']) ?></option>

                                        <?php } ?>    
                                    </select>
                                </div>
                                <button type="submit" class="btn btn-info" id="submitSelectValue" style="display:none;">Submit></button>
                            </form>
                        </div>

                    </div>
                    <p class="or">or</p>
                </div>
                <div class="col-md-6 col-sm-6 col-xs-12 footer-colmun">
                    <div class="subscribe-widget footer-widget">
                        <div class="input-box">
                            <form action="search.php" method="get">
                                <input type="search" placeholder="Search Via Keywords" name="s">
                                <button type="submit"><i class="fa fa-search" aria-hidden="true"></i></button>
                            </form>
                        </div>

                    </div>
                </div>
            </div>
        </div>

    </section>




    <section class="organ-page centered">
        <div class="container">
            <div class="row">
                <div class="text-center">
                    <h3>Still can't find what you are looking for?</h3>
                    <p>Try clicking on these commonly searched tests</p>
                    <br>
                </div>
                <?php if($sideBannerResult){ 
                    while ($row = mysqli_fetch_array($sideBannerResult,MYSQLI_ASSOC)) {  ?>
                <div class="col-md-3 col-sm-6 col-xs-12 team-colmun ">
                    <div class="single-item">
                        <div class="img-box">
                            <figure>
                                <a href="<?php echo isset($row['URL']) ? $row['URL'] : '#';  ?>">
                                    <img src="content/sidebars/<?= $row['Image'] ?>" alt="">
                                </a>
                            </figure>

                        </div>
                        <div class="lower-content">

                            <p style="text-align:<?= $row['TextAlign']?>"><?= $row['Title'] ?></p>

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

    <section class="organ-page centered" style="margin-top:-61px;">
        <div class="container">
            <div class="row icons">
                <div class="col-md-4 col-sm-6 org-page-none col-xs-12 team-colmun"></div>
                
                <div class="col-md-4 col-sm-6 col-xs-12 organ-page-display-p team-colmun d-flex lib-content justify-content-center">
                    <div class="org-page-display">
                        <i class="fa fa-file-video-o px-5" style="font-size:85px;" aria-hidden="true"></i>
                        <p style="color:black; font-weight:600; font-size:15px;">Video Library</p>
                    </div>
                    <div class="org-page-display">
                        <i class="fa fa-file-text-o px-5" style="font-size:85px;" aria-hidden="true"></i>
                        <p style="color:black; font-weight:600; font-size:15px;">Info Sheets</p>
                    </div>
                    <div class="org-page-display">
                        <i class="fa fa-comments-o px-5" style="font-size:85px;" aria-hidden="true"></i>
                        <p style="color:black; font-weight:600; font-size:15px;">FAQs</p>
                    </div>
                    <div class="org-page-display">
                        <i class="fa fa-newspaper-o px-5" style="font-size:85px;" aria-hidden="true"></i>
                        <p style="color:black; font-weight:600; font-size:15px;">Latest News</p>
                    </div>
                </div>
                <div class="col-md-4 col-sm-6 org-page-none col-xs-12 team-colmun"></div>
            </div>
        </div>
    </section>

    <section class="organ-page centered">
        <div class="container">
            <div class="row">
            <?php if($sideLinesResult){ 
                
                    while ($row = mysqli_fetch_array($sideLinesResult,MYSQLI_ASSOC)) {  ?>
                <div class="col-md-3 col-sm-6 col-xs-12 team-colmun test-sec">
                    <div class="single-item">
                        <div class="img-box">
                            <figure><a href="<?= $row['URL']?>"><img src="content/sidelines/<?= $row['Image'] ?>" alt=""></a></figure>
                        </div>
                    </div>
                    <div class="content">
                        <a href="<?= $row['URL']?>"><h3 style="font-weight:600;"><?= ucfirst($row['Title']) ?></h3></a>
                        <p style="color:black;"><?= substr($row['Description'], 0, 120).'... <a href="'.$row['URL'].'" style="color:black; font-weight:600;">Read More</a>' ?></p>
                    </div>
                </div>
                <?php }}?>
                <!-- <div class="col-md-3 col-sm-6 col-xs-12 team-colmun">
                    <div class="single-item">
                        <div class="img-box">
                            <figure><img src="images/img3.jpeg" alt="kidney"></figure>
                        </div>
                    </div>
                </div>
                <div class="col-md-3 col-sm-6 col-xs-12 team-colmun">
                    <div class="single-item">
                        <div class="img-box">
                            <figure><img src="images/img3.jpeg" alt="kidney"></figure>
                        </div>
                    </div>
                </div>
                <div class="col-md-3 col-sm-6 col-xs-12 team-colmun">
                    <div class="single-item">
                        <div class="img-box">
                            <figure><img src="images/img3.jpeg" alt="kidney"></figure>
                        </div>
                    </div>
                </div> -->
            </div>
        </div>
    </section>

    

    <?php show_footer() ?>







