<?php
ob_start();
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');

$src = "";
$action = isset($_GET["misaction"]) ? $_GET["misaction"] : "";
switch ($action) {

    case "monthsale";
        $src = "monthsale.php";
        break;

    case "weeklysale";
        $src = "weeklysale.php";
        break;

    case "dailysale";
        $src = "dailysale.php";
        break;

    case "prodsalecompare";
        $src = "prodsalecompare.php";
        break;

    case "topsellprod";
        $src = "topsellprod.php";
        break;

    case "slowsellprod";
        $src = "slowsellprod.php";
        break;

    case "nonperfcust";
        $src = "nonperfcust.php";
        break;

    case "dailysale";
        $src = "dailysale.php";
        break;

    default:
        $head = "monthsale";
        $src = "monthsale.php";
        break;
}

$dispyear = right(($_SESSION["zdbyear_" . $dbname]), 4);
//browse($dispyear);
//browse($bseries);

$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
include("includes/linkshead.php");
?>
<style>
    h4 {
        font-weight: 600;
        color: #1C1C59;
    }

    img {
        height: 100px;
    }

    /*    .col-lg-2{
        width: 12.5% !important;
    }*/

    .col-lg-1 {
        width: 6.33% !important;
    }
</style>
</head>

<body>
    <div class="container-fluid">

        <!--sidebar left start-->
        <!--sidebar left end-->
        <!--main content start-->

        <div class="container-fluid">

            <div class="row">
                <!--<div class='col-lg-1 col-md-1 col-sm-12 col-xs-12 text-center'></div>-->
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 text-center'>
                    <h4>Monthly Sales</h4>
                </div>
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 text-center'>
                    <h4>Daily Sales</h4>
                </div>
                <!-- <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 text-center'>
                    <h4>Weekly Sales</h4>
                </div> -->
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 text-center'>
                    <h4>Product Sale Comparison</h4>
                </div>
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 text-center'>
                    <h4>Top Selling Products</h4>
                </div>
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 text-center'>
                    <h4>Slow Moving Products</h4>
                </div>
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 text-center'>
                    <h4>Non Performing Customers</h4>
                </div>
            </div>
            


            <div class="row">
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 pad'>
                    <a href="misdashboard.php"><img src="images/monthlysale.png" alt="Monthly Sales"></a>
                </div>
                <!-- <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 pad'>
                    <a href="misdashboard.php?misaction=weeklysale"><img src="images/weeklysale.png" alt="Weekly Sales"></a>
                </div> -->
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 pad'>
                    <a href="misdashboard.php?misaction=dailysale"><img src="images/dailysale.png" alt="Daily Sale"></a>
                </div>
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 pad'>
                    <a href="misdashboard.php?misaction=prodsalecompare"><img src="images/prodsalecomp.png" alt="Product Sale Comparison"></a>
                </div>
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 pad'>
                    <a href="misdashboard.php?misaction=topsellprod"><img src="images/topsellprod.png" alt="Top Selling Products"></a>
                </div>
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 pad'>
                    <a href="misdashboard.php?misaction=slowsellprod"><img src="images/slowsellprod.png" alt="Slow Moving Products"></a>
                </div>
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 pad'>
                    <a href="misdashboard.php?misaction=nonperfcust"><img src="images/nonperfcust.png" alt="Non Performing Customers"></a>
                </div>
            </div>
        </div>

        <!-- <div class="container-fluid">
            <div class="row">
                 <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 text-center'>
                    <h4>Daily Sales</h4>
                </div>
            </div>
            <div class="row">
                <div class='col-lg-2 col-md-2 col-sm-12 col-xs-12 pad'>
                    <a href="misdashboard.php?misaction=dailysale"><img src="images/nonperfcust.png" alt="Daily Sale"></a>
                </div>
            </div>
        </div> -->

        <section class="main-content-wrapper" style="margin-left: 0px;">
            <section id="main-content">
                <div class="row">
                    <div class="col-md-12">
                        <iframe src="<?php echo $src; ?>" name="frame2" style="width: 100%; height:4000px;" frameBorder="0" scrolling="no"></iframe>
                    </div>
                </div>
            </section>
        </section>
    </div>
    <!--main content end-->
    <?php include("includes/linksfoot.php") ?>
</body>

</html>