<?php
include('veza/le.php');
require('xwaf.php'); // Before all your code starts.
$xWAF = new xWAF();
$xWAF->start();

$colname_cat = stripslashes($_GET['content_cat']);
$query_menu_sub = "SELECT * FROM le_menu_subcat_sr WHERE menu_subcat_active = 'y' AND menu_subcat_cat = '".$colname_cat."'";
$result_menu_sub = mysqli_query($leld,$query_menu_sub);
$totalRows_menu_sub = mysqli_num_rows($result_menu_sub);

$query_cat = "SELECT * FROM le_menu_category_sr WHERE menu_cat_active = 'y' AND menu_cat_id = '".$colname_cat."'";
$result_cat = mysqli_query($leld,$query_cat);
$row_cat = mysqli_fetch_assoc($result_cat);
$totalRows_cat = mysqli_num_rows($result_cat);

$images_dir = "";
?>
<!DOCTYPE html>

<html>
    <head>
        <meta charset="utf-8">
        <title>Luxury Event Catering Tivat - Menu - <?php echo $row_cat['menu_cat_name']; ?> - </title>
        <meta name="description" content="Luxury Event Catering Tivat MONTENEGRO - Menu">
		<meta name="robots" content="index,follow" />
        <meta name="author" content="LaktusDev">
        <meta name="keywords" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <!-- Stylesheets -->
		<link rel="icon" href="icon.jpg">
        <link rel="stylesheet" href="css/bootstrap.min.css"/><!-- bootstrap grid -->
        <link rel="stylesheet" href="css/bootstrap-theme.min.css"/><!-- bootstrap theme -->
        <link rel="stylesheet" href="css/style.css"/><!-- template styles -->
        <link rel="stylesheet" href="css/color-default.css"/><!-- default template color styles -->
        <link rel="stylesheet" href="css/retina.css"/><!-- retina ready styles -->
        <link rel="stylesheet" href="css/responsive.css"/><!-- responsive styles -->
        <link rel="stylesheet" href="css/animate.css"/><!-- animation for content -->
        <link rel="stylesheet" href="css/nivo-slider.css"/><!-- Nivo Slider styles -->
        <link rel='stylesheet' href='owl-carousel/owl.carousel.css'/><!-- Carousels css -->
        <link rel='stylesheet' href='owl-carousel/owl.theme.css'/><!-- Carousels -->

        <!-- Google Web fonts -->
        <link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
        <link href='https://fonts.googleapis.com/css?family=Suranna' rel='stylesheet' type='text/css'>
        <link href='https://fonts.googleapis.com/css?family=Montez' rel='stylesheet' type='text/css'>

        <!-- Font icons -->
        <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css"/><!-- Font awesome icons -->
    </head>

    <body>

 <?php include("inc/header_sr.php"); ?>

        <!-- .page-content start -->
        <div class="page-content custom-img-background dark page-title page-title-4 mb-100">
            <div class="container">
                <!-- .row start -->
                <div class="row">
                    <!-- .col-md-12 start -->
                    <div class="col-md-12 centered">
                        <div class="custom-heading style-1 triggerAnimation animated" data-animate='fadeInUp'>
                            <h1><span>Luxury Event</span></h1>
                            <h1><?php echo $row_cat['menu_cat_name']; ?></h1>
                        </div><!-- .custom-heading.style-1 end -->
                    </div><!-- .col-md-12 end -->
                </div><!-- .row end -->
            </div><!-- .container end -->
        </div><!-- .page-content end -->

        <div class="page-content">
            <!-- .container start -->
            <div class="container">
                <!-- .row start -->
                <div class="row mb-0">
                    <div class="col-md-12 mb-20 centered triggerAnimation animated" data-animate='fadeIn'>
                        <div class="custom-heading style-1">
                            <h3>Meni paketi</h3>

                            <!-- .divider.style-1 start -->
                            <div class="divider style-1 center">
                                <span class="hr-simple left"></span>
                                <i class="fa fa-circle hr-icon"></i>
                                <span class="hr-simple right"></span>
                            </div>
                        </div><!-- .custom-heading.style-1 end -->
                    </div><!-- .col-md-12 end -->                    
                </div><!-- .row end -->
                <!-- .row start -->
                <div class="row">
<?php
$menusubcat_images_dir = "uploads/menu/subcat/";

$colname_cat = $_GET['content_cat'];

if (isset($_GET['page_no']) && $_GET['page_no']!="") {
$page_no = $_GET['page_no'];
} else {
	$page_no = 1;
	}

$total_records_per_page = 20;
$offset = ($page_no-1) * $total_records_per_page;
$previous_page = $page_no - 1;
$next_page = $page_no + 1;
$adjacents = "2"; 

$result_count = mysqli_query($leld,"SELECT COUNT(*) As total_records FROM le_menu_subcat_sr WHERE menu_subcat_cat='$colname_cat'");
$total_records = mysqli_fetch_array($result_count);
$total_records = $total_records['total_records'];
$total_no_of_pages = ceil($total_records / $total_records_per_page);
$second_last = $total_no_of_pages - 1; // total page minus 1

$result_sub = mysqli_query($leld,"SELECT * FROM le_menu_subcat_sr as c LEFT JOIN le_menu_subcat_subcat_sr as s ON c.menu_subcat_id = s.menu_subcat_subcat WHERE c.menu_subcat_cat='$colname_cat' AND c.menu_subcat_active = 'y' GROUP BY c.menu_subcat_id LIMIT $offset, $total_records_per_page");

?>
<?php while($row_sub = mysqli_fetch_assoc($result_sub)) { ?>
                    <div class="col-md-4 col-sm-6 menu-package">
                        <div class="menu-sample style-2 border-decor centered">                                
                            <figure>
                                <div class="menu-image">
<?php
$me = $row_sub['menu_subcat_id'];
$query_sub_photo = "SELECT * FROM le_menu_subcat_photo WHERE lemsubcatid = '".$me."'";
$sub_photo = mysqli_query($leld,$query_sub_photo);
$row_sub_photo = mysqli_fetch_assoc($sub_photo);
$totalRows_sub_photo = mysqli_num_rows($sub_photo);
?>
<?php if ($row_sub_photo['photo_id'] >= '0') { ?>
									<img src="<?php echo $menusubcat_images_dir ?><?php echo $row_sub_photo['slika']; ?>" alt="Luxury Event Catering Tivat"/>
<?php } else { ?>
									<img src="<?php echo $menusubcat_images_dir ?>default.jpg" alt="Luxury Event Catering Tivat"/>
<?php } ?>
                                </div>

                                <figcaption>
<?php if ($row_sub['menu_subcat_total'] > '0') { ?>
									<div class="menu-price">
                                        <p>€<?php $final_price = $row_sub['menu_subcat_total']; echo number_format($final_price); ?></p>
                                    </div>
<?php } ?>
									<div class="custom-heading style-1">
                                        <h3><span>Meni</span></h3>
                                        <h3><?php echo $row_sub['menu_subcat_name']; ?></h3>

                                        <!-- .divider.style-1 start -->
                                        <div class="divider style-1 center">
                                            <span class="hr-simple left"></span>
                                            <i class="fa fa-circle hr-icon"></i>
                                            <span class="hr-simple right"></span>
                                        </div>
                                    </div><!-- .custom-heading.style-1 end -->
<?php
$category = $row_sub['menu_subcat_cat'];
$catsub = $row_sub['menu_subcat_id'];
$query_subcat2 = "SELECT * FROM le_menu_subcat_sr as c LEFT JOIN le_menu_subcat_subcat_sr as s ON c.menu_subcat_id = s.menu_subcat_subcat WHERE c.menu_subcat_cat='$category' and c.menu_subcat_id='$catsub' AND c.menu_subcat_active = 'y'";
$subcat2 = mysqli_query($leld,$query_subcat2);
$row_subcat2 = mysqli_fetch_assoc($subcat2);
$totalRows_subcat2 = mysqli_num_rows($subcat2);
?>
<?php if ($row_subcat2['menu_subcat_subcat_id'] == '') { ?>
                                    <p></p>
                                    <a href="menu_content_sr.php?content_cat=<?php echo $row_subcat2['menu_subcat_cat']; ?>&amp;content_sub=<?php echo $row_subcat2['menu_subcat_id']; ?>" class="more-details " data-animate=''>Detaljnije <i class="fa fa-angle-double-right"></i></a>
<?php } else { ?>
									<a href="menu_subsub_sr.php?menu_subcat_subcat=<?php echo $row_subcat2['menu_subcat_id']; ?>" class="more-details " data-animate=''>Detaljnije <i class="fa fa-angle-double-right"></i></a>
<?php } ?>
                                </figcaption>   
                            </figure>
                        </div><!-- .menu-sample.style-2 end -->
                    </div><!-- .col-md-4 end -->
<?php } ?>
                </div><!-- .row end -->
<?php include("inc/pdf.php"); ?>
            </div><!-- .container end -->
        </div><!-- .page-content end -->


<?php include("inc/footer_sr.php"); ?>

<?php include("inc/copyright_sr.php"); ?>

        <script src="js/jquery-2.1.4.min.js"></script><!-- jQuery library -->
        <script src="js/bootstrap.min.js"></script><!-- .bootstrap script -->
        <script src="js/jquery.scripts.min.js"></script><!-- modernizr, retina, stellar for parallax -->  
        <script src="js/jquery.dlmenu.min.js"></script><!-- for responsive menu -->
        <script src="js/include.js"></script><!-- custom js functions -->
        <script src="js/jquery.nivo.slider.pack.js"></script><!-- Nivo Slider script -->
        <script src="owl-carousel/owl.carousel.min.js"></script><!-- Carousels script -->
        <script src="js/TweenMax.min.js"></script> <!-- Plugin for smooth scrolling-->
        <script src="js/ScrollToPlugin.min.js"></script> <!-- Plugin for smooth scrolling-->

        <script>
            /* <![CDATA[ */
            jQuery(document).ready(function ($) {
                'use strict';

                $('#featured-menu-nivo-slider').nivoSlider({
                    controlNav: false
                });

                // FEATURED MENU CAROUSEL START 
                $('#featured-menu-carousel').owlCarousel({
                    items: 3, //3 items above 1000px browser width
                    itemsCustom: [[0, 1], [600, 2], [1000, 3]],
                    autoPlay: true,
                    pagination: false,
                    navigation: true
                });

                // FANCY TESTIMONIAL CAROUSEL START 
                $('#fancy-testimonial-carousel').owlCarousel({
                    singleItem: true,
                    autoPlay: true,
                    pagination: false,
                    navigation: false
                });
                // TESTIMONIAL STYLE 1 CAROUSEL START 
                $('#testimonial-style-1-carousel').owlCarousel({
                    singleItem: true,
                    autoPlay: true,
                    pagination: false,
                    navigation: false
                });

                // TESTIMONIAL STYLE 2 CAROUSEL START 
                $('#testimonial-style-2-carousel').owlCarousel({
                    singleItem: true,
                    autoPlay: true,
                    pagination: false,
                    navigation: false
                });
                // TESTIMONIAL STYLE 3 CAROUSEL START 
                $('#testimonial-style-3-carousel').owlCarousel({
                    singleItem: true,
                    autoPlay: true,
                    pagination: false,
                    navigation: false
                });


            });
            /* ]]> */
        </script>

    </body>
</html>
