<?php

include("connection.php");
include("header.php");

?>
<div class="main-content">

    <div class="page-content">
        <div class="container-fluid">

            <!-- start page title -->
            <div class="row">
                <div class="col-12">
                    <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                        <h4 class="mb-sm-0 font-size-18">Dashboard</h4>

                        <!-- <div class="page-title-right">
                            <ol class="breadcrumb m-0">
                                <li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
                                <li class="breadcrumb-item active">Dashboard</li>
                            </ol>
                        </div> -->

                    </div>
                </div>
            </div>
            <!-- end page title -->

            <div class="row">

                <div class="col-xl-12">
                    <div class="row">
                        <!-- slider -->
                        <?php
                        $result = mysqli_query($con, "SELECT COUNT(*) as total FROM slider");
                        $row = mysqli_fetch_assoc($result);
                        $total_sliders = $row['total'];
                        ?>
                        <!-- end slider -->
                        <div class="col-md-3">
                            <div class="card mini-stats-wid">
                                <div class="card-body">
                                    <div class="d-flex">
                                        <div class="flex-grow-1">
                                            <a href="viewslider.php">
                                            <p class="text-muted fw-medium">Slider</p>
                                            <h4 class="mb-0"><?php echo $total_sliders; ?></h4>
                                            </a>
                                        </div>

                                        <div class="flex-shrink-0 align-self-center">
                                            <div class="avatar-sm rounded-circle  mini-stat-icon">
                                                <span class="avatar-title rounded-circle ">
                                                    <i class="fas fa-sliders font-size-24"></i>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- video -->
                        <?php
                        $result = mysqli_query($con, "SELECT COUNT(*) as total FROM media");
                        $row = mysqli_fetch_assoc($result);
                        $total_video = $row['total'];
                        ?>
                        <!-- end video -->
                        <div class="col-md-3">
                            <div class="card mini-stats-wid">
                                <div class="card-body">
                                    <div class="d-flex">
                                        <div class="flex-grow-1">
                                            <a href="viewgallery.php">
                                                <p class="text-muted fw-medium">Galley/Video</p>
                                                <h4 class="mb-0"><?php echo $total_video; ?></h4>
                                            </a>
                                        </div>

                                        <div class="flex-shrink-0 align-self-center ">
                                            <div class="avatar-sm rounded-circle  mini-stat-icon">
                                                <span class="avatar-title rounded-circle ">
                                                    <i class="dripicons-photo-group font-size-24"></i>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- Blog -->
                        <?php
                        $result = mysqli_query($con, "SELECT COUNT(*) as total FROM blog");
                        $row = mysqli_fetch_assoc($result);
                        $total_blog = $row['total'];
                        ?>
                        <!-- end blog -->
                        <div class="col-md-3">
                            <div class="card mini-stats-wid">
                                <div class="card-body">
                                    <div class="d-flex">
                                        <div class="flex-grow-1">
                                            <a href="viewblog.php">
                                            <p class="text-muted fw-medium">Blog</p>
                                            <h4 class="mb-0"><?php echo $total_blog; ?></h4>
                                            </a>
                                        </div>

                                        <div class="flex-shrink-0 align-self-center">
                                            <div class="avatar-sm rounded-circle  mini-stat-icon">
                                                <span class="avatar-title rounded-circle ">
                                                    <i class="fas fa-lightbulb font-size-24"></i>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                       <!-- service -->
                        <?php
                        $result = mysqli_query($con, "SELECT COUNT(*) as total FROM upvc_door");
                        $row = mysqli_fetch_assoc($result);
                        $total_service = $row['total'];
                        ?>
                        
                        <div class="col-md-3">
                            <div class="card mini-stats-wid">
                                <div class="card-body">
                                    <div class="d-flex">
                                        <div class="flex-grow-1">
                                            <a href="view_upvc_door.php">
                                            <p class="text-muted fw-medium">UPVC DOOR</p>
                                            <h4 class="mb-0"><?php echo $total_service; ?></h4>
                                            </a>
                                        </div>

                                        <div class="flex-shrink-0 align-self-center">
                                            <div class="avatar-sm rounded-circle  mini-stat-icon">
                                                <span class="avatar-title rounded-circle ">
                                                    <i class="fas fa-wrench font-size-24"></i>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- End Services -->
                         <!-- service -->
                        <?php
                        $result = mysqli_query($con, "SELECT COUNT(*) as total FROM upvc_window");
                        $row = mysqli_fetch_assoc($result);
                        $total_service = $row['total'];
                        ?>
                        
                        <div class="col-md-3">
                            <div class="card mini-stats-wid">
                                <div class="card-body">
                                    <div class="d-flex">
                                        <div class="flex-grow-1">
                                            <a href="view_upvc_window.php">
                                            <p class="text-muted fw-medium">UPVC WINDOW</p>
                                            <h4 class="mb-0"><?php echo $total_service; ?></h4>
                                            </a>
                                        </div>

                                        <div class="flex-shrink-0 align-self-center">
                                            <div class="avatar-sm rounded-circle  mini-stat-icon">
                                                <span class="avatar-title rounded-circle ">
                                                    <i class="fas fa-wrench font-size-24"></i>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- End Services -->
                        <!-- Testimonial -->
                        <?php
                        $result = mysqli_query($con, "SELECT COUNT(*) as total FROM testimonial");
                        $row = mysqli_fetch_assoc($result);
                        $total_testimon = $row['total'];
                        ?>
                        <!-- end Testimonial -->
                        <div class="col-md-3">
                            <div class="card mini-stats-wid">
                                <div class="card-body">
                                    <div class="d-flex">
                                        <div class="flex-grow-1">
                                            <a href="viewtestimonial.php">
                                            <p class="text-muted fw-medium">Testimonial</p>
                                            <h4 class="mb-0"><?php echo $total_testimon; ?></h4>
                                            </a>
                                        </div>

                                        <div class="flex-shrink-0 align-self-center">
                                            <div class="avatar-sm rounded-circle  mini-stat-icon">
                                                <span class="avatar-title rounded-circle ">
                                                    <i class="fas fa-quote-left font-size-24"></i>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        
                    </div>
                    <!-- end row -->



                </div>
            </div>
            <!-- end row -->



            <!-- end row -->
        </div>
        <!-- container-fluid -->
    </div>
    <!-- End Page-content -->

    <?php
    include("footer.php");


    ?>