<?php
 
$baseurl="https://ringobells.in/";

include('website_adminpanel/config/db_config.php');

include('website_adminpanel/config/function.php');

$manage_website = new website();

if(isset($_POST['submit']))
{
  $manage_website->manage_query($_POST);
}

// $website_logo = $manage_website->self_query("select * from tbl_website_logo where id=1 ");
  $address = $manage_website->self_query("select * from tbl_address where id=1 ");
  $slider = $manage_website->self_query("select * from tbl_slider where status=1 order by id ");
  $about = $manage_website->self_query("select * from tbl_about where id=1 and  status=1 limit 1");
  $category = $manage_website->self_query("select * from tbl_category where  status=1 order by id");

//  $pages = explode('/',$_SERVER['REQUEST_URI']);
//  $page_info = explode('/',$_SERVER['PHP_SELF']);
 
// //   echo count($pages);
// //   echo $page_info[2];
  
//  $meta_key = "Printer";
//  $meta_desc = "Printer";
// if(count($pages)==4 && $page_info[2]=='products.php')
// {
//     // echo "select * from tbl_main_page where url='".end($pages)."' && status=1";die;
// $sql = "select * from tbl_main_page where url='".end($pages)."' && status=1";
    
// $product_detail = $manage_website->self_query($sql)[0];
// $meta_key = $product_detail['meta_keyword'];
// $meta_desc = $product_detail['meta_description'];
// }
// if($page_info[2]=='about-us.php')
// {
 
// $cat_key = $manage_website->self_query("select * from tbl_about_page where id='1' && status=1")[0];    
// $meta_key = $cat_key['meta_keyword'];
// $meta_desc = $cat_key['meta_description'];

 
 
// }

// if(count($pages)==4 && $page_info[2]=='properties.php')
// {
// $sql = "select * from tbl_main_page where url='".end($pages)."' && status=1";
    
// $page_detail = $manage_website->self_query($sql)[0];
// $meta_key = $page_detail['meta_keyword'];
// $meta_desc = $page_detail['meta_description'];
// }
// if(count($pages)==4 && $page_info[2]=='product-detail.php')
// {
//   //$category = $manage_website->self_query("select * from tbl_main_page where url='".$pages[count($pages)-2]."' && status=1")[0];

// $sql = "select * from tbl_sub_pages where url='".end($pages)."' && status=1";
    
// $page_detail = $manage_website->self_query($sql)[0];
// $meta_key = $page_detail['meta_keyword'];
// $meta_desc = $page_detail['meta_description'];
// }

// if(count($pages)==3 && $page_info[2]=='index.php')
// {    
// $meta_key = "Index page key";
// $meta_desc = "index page desc";
// }

// if(count($pages)==3 && $page_info[2]=='enquiry.php')
// {    
// $meta_key = "enquiry page key";
// $meta_desc = "enquiry page desc";
// }

// if(count($pages)==3 && $page_info[2]=='contact-us.php')
// {    
// $meta_key = "contact page key";
// $meta_desc = "contact page desc";
// }




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

<head>
    <meta charset="utf-8">
    <title>Kider - Preschool Website Template</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta content="" name="keywords">
    <meta content="" name="description">

    <!-- Favicon -->
    <link href="<?=$baseurl?>/img/favicon.ico" rel="icon">

    <!-- Google Web Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600&family=Inter:wght@600&family=Lobster+Two:wght@700&display=swap" rel="stylesheet">
    
    <!-- Icon Font Stylesheet -->
    <!-- <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet"> -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <!-- Libraries Stylesheet -->
    <link href="<?=$baseurl?>/lib/animate/animate.min.css" rel="stylesheet">
    <link href="<?=$baseurl?>/lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">

    <!-- Customized Bootstrap Stylesheet -->
    <link href="<?=$baseurl?>/css/bootstrap.min.css" rel="stylesheet">

    <!-- Template Stylesheet -->
    <link href="<?=$baseurl?>/css/style.css" rel="stylesheet">
</head>

<body>
    <div class="container-xxl bg-white p-0">
        <!-- Spinner Start -->
        <!-- <div id="spinner" class="show bg-white position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center justify-content-center">
            <div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status">
                <span class="sr-only">Loading...</span>
            </div>
        </div> -->
        <!-- Spinner End -->


        <!-- Navbar Start -->
        <nav class="navbar navbar-expand-lg bg-white navbar-light sticky-top px-4 px-lg-5 py-lg-0">
            <a href="<?=$baseurl?>" class="navbar-brand">
                <h1 class="m-0 text-primary"><i class="fa fa-book-reader me-3"></i><img style="width:100%;height:130px;" class="logo logo-dark" src="<?=$baseurl?>/images/main_img/<?=$address[0]['image']?>" alt="Website Logo" /></h1>
            </a>
            <button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navbarCollapse">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarCollapse">
                <div class="navbar-nav mx-auto">
                    <a href="<?=$baseurl?>" class="nav-item nav-link active"><i class="fa fa-home " style="width:20%;font-size: 36px;"></i><br>Home</a>
                    <a href="<?=$baseurl?>/about.php" class="nav-item nav-link"><i class="fa fa-ship " style="width:20%;font-size: 36px;"></i><br>About Us</a>
                    <!--<a href="classes.php" class="nav-item nav-link"><i class="fa fa-balance-scale" style="width:20%;font-size: 36px;"></i><br>Classes</a>-->
                     <div class="nav-item dropdown">
                        <a href="<?=$baseurl?>/classes.php" class="nav-link dropdown-toggle" data-bs-toggle="dropdown"><i class="fa fa-balance-scale" style="width:20%;font-size: 36px;"></i><br>Classes</a>
                        <div class="dropdown-menu rounded-0 rounded-bottom border-0 shadow-sm m-0">
                         <?php
                           $service = $manage_website->self_query("select * from tbl_service where   status=1 limit 12");
                    for($ij=0;$ij<count($service);$ij++)
                {
                  ?>
                            <a href="<?=$baseurl?>/class-detail/<?=$service[$ij]['url']?>" class="dropdown-item"><?=$service[$ij]['title']?></a>
                            
                            <?php
                            }
                            ?>
                        </div>
                    </div>
                    <!--<div class="nav-item dropdown">-->
                    <!--    <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown"><i class="fa fa-binoculars" style="width:20%;font-size: 36px;"></i><br>Pages</a>-->
                    <!--    <div class="dropdown-menu rounded-0 rounded-bottom border-0 shadow-sm m-0">-->
                    <!--        <a href="facility.php" class="dropdown-item">School Facilities</a>-->
                    <!--        <a href="team.php" class="dropdown-item">Popular Teachers</a>-->
                    <!--        <a href="call-to-action.php" class="dropdown-item">Become A Teachers</a>-->
                    <!--        <a href="appointment.php" class="dropdown-item">Make Appointment</a>-->
                    <!--        <a href="testimonial.php" class="dropdown-item">Testimonial</a>-->
                    <!--        <a href="404.php" class="dropdown-item">404 Error</a>-->
                    <!--    </div>-->
                    <!--</div>-->

                     <a href="<?=$baseurl?>/gallery.php" class="nav-item nav-link"><i class="fa fa-image" style="width:20%;font-size: 36px;"></i><br>Gallery</a>
                      <a href="<?=$baseurl?>/videos.php" class="nav-item nav-link"><i class="fa fa-child" style="width:20%;font-size: 36px;"></i><br>Daycare</a>
                    <a href="<?=$baseurl?>/contact.php" class="nav-item nav-link"><i class="fa fa-address-card" style="width:20%;font-size: 36px;"></i><br>Contact Us</a>
                </div>
                <a href="<?=$baseurl?>/contact.php" class="btn btn-primary rounded-pill px-3 d-none d-lg-block">Enroll Today<i class="fa fa-arrow-right ms-3"></i></a>
                <br>
                <a href="<?=$baseurl?>/partner-with-us.php" class="btn btn-primary rounded-pill px-3 d-none d-lg-block">Partner With Us<i class="fa fa-arrow-right ms-3"></i></a>
            </div>
        </nav>
        <!-- Navbar End -->
