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

$formname = "ALERTS";
$file = "dashboardsk.php";
$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$myyear = $_SESSION[$myyear];
$zroot = $_SESSION["zdbroot"];
$zyear = right($zdb, 4);
$mfrdate = getzdates($zyear, 'S');
// $mtodate = getzdates($zyear, 'E');
$mtodate = date('Y-m-d');

mysqli_select_db($conn, $zdb);

$bseries = $_SESSION["user_series"];

include("includes/linkshead.php");
?>

<style>
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:'Segoe UI',sans-serif;
    background:#f4f6f9;
    color:#2c3e50;
    min-height:100vh;
}

/* Top Filter Area */

.filter-section{
    background:#fff;
    border-radius:12px;
    padding:15px;
    box-shadow:0 2px 10px rgba(0,0,0,.05);
    margin-bottom:20px;
}

/* Dashboard */

.dashboard{
    padding:20px;
}

.content{
    padding:0;
}

.widgets{
    display:flex;
    flex-wrap:wrap;
    gap:20px;
}

/* Cards */

.widget{
    flex:1;
    min-width:280px;
    background:rgba(255,255,255,.75);
    backdrop-filter:blur(8px);
    -webkit-backdrop-filter:blur(8px);

    border:1px solid rgba(255,255,255,.4);
    border-radius:18px;

    padding:25px;

    box-shadow:
        0 4px 20px rgba(0,0,0,.06);

    transition:.3s;
}

.widget:hover{
    transform:translateY(-4px);
    box-shadow:
        0 10px 30px rgba(0,0,0,.10);
}

/* Card Header */

.widget h5{
    color:#6c757d;
    font-size:14px;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:1px;
    margin-bottom:15px;
}

/* Amount */

.widget span{
    color:#0b4c78;
    font-size:38px !important;
    font-weight:700;
    line-height:1;
}

.widget a{
    text-decoration:none;
}

.table{
    margin-bottom:0;
}

.table td{
    border:none !important;
    padding:0;
}

/* Date Box */

#borderimg{
    background:#fff;
    border:1px solid #dbe2ea;
    border-radius:10px;
    padding:8px;
    box-shadow:0 2px 6px rgba(0,0,0,.04);
}

.currdt{
    width:100%;
    border:none !important;
    background:transparent !important;
    color:#2c3e50 !important;
    font-weight:500;
    outline:none;
}

/* Label */

.txttnew{
    color:#0b4c78;
    background:none;
    margin-bottom:5px;
    font-size:14px;
    font-weight:600;
    text-transform:uppercase;
}

/* Button */

.button-29{
    background:#0b4c78;
    border:none;
    color:#fff;
    border-radius:10px;
    height:42px;
    width:120px;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    transition:.3s;
}

.button-29:hover{
    background:#083554;
}

/* Different Card Colors */

.sales-card{
    border-left:5px solid #0b4c78;
}

.receipt-card{
    border-left:5px solid #16a085;
}

.payment-card{
    border-left:5px solid #e67e22;
}

.expense-card{
    border-left:5px solid #e74c3c;
}

.contra-card{
    border-left:5px solid #8e44ad;
}

.jv-card{
    border-left:5px solid #34495e;
}

/* Remove old styling */

.card-title,
.card-title2,
.pattern-bar,
.BackDiv,
.sksahil2{
    display:none;
}

/* Mobile */

@media(max-width:768px){

    .dashboard{
        padding:10px;
    }

    .widgets{
        flex-direction:column;
    }

    .widget{
        min-width:100%;
    }

    .widget span{
        font-size:28px !important;
    }

    .chkindiv{
        width:100%;
    }
}
</style>

<script type="text/javascript">
    $(document).ready(function() {
        $("body").on("click", ".proc", getData);
        getData();

        function getData() {
            var currdt = $(".currdt").val();
            if (currdt) {
                $(".dashboard").html("");

                $.post("getDashboardData.php", {
                    currdt: currdt
                }, function(data) {
                    $(".dashboard").html(data);
                });
            }
        }
    })
</script>

</head>

<body>

    <div class="row table-responsive " align="center">
        <div class="col-md-5"></div>
        <div class="col-md-2 chkindiv">
            <label class="txttnew"><b>DATE</b></label>
            <p id="borderimg">
                <input type="date" name="currdt" class="currdt" id="currdt" style="color:black;border-bottom:none;border:none" value="<?= date('Y-m-d'); ?>">
            </p>
        </div>
        <div class="col-md-1" style="margin-top:18px">
            <button class="button-29 sksearch proc" type="button">Proceed</button>
        </div>
    </div>


    <div class="dashboard">

    </div>

    <!-- ////// VISA SLAB END/////////////// -->

    <?php include("includes/linksfoot.php"); ?>
</body>

</html>