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

$formname = "Schedule";
$file = "";
$zroot = $_SESSION["zdbroot"];

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$myyear = $_SESSION[$myyear];
mysqli_select_db($conn, $zdb);

include("includes/linkshead.php");
?>
<script src="MyScript/calendar.js" type="text/javascript"></script>
</head>
<body>
    <div class="container">
        <div class="row">
            <div class="col-lg-3 text-right">
                <label class="label-control marg" style="font-size: 18px">Month</label>
            </div>
            <div class="col-lg-2">
                <select class="form-control monthno" name="month">
                    
                    <?php
                    $date = date("Y-m-d");
                    
                    $getmnt1 = mysqli_query($conn,"Select * from $zroot.month where moncode = month('$date') ");
                    $fetmnth1 = mysqli_fetch_array($getmnt1);
                        echo "<option value='$fetmnth1[moncode]'>$fetmnth1[moncode] - $fetmnth1[monname]</option>";
                    $getmnt = mysqli_query($conn,"Select * from $zroot.month order by moncode");
                    while($fetmnth = mysqli_fetch_array($getmnt)){
                        echo "<option value='$fetmnth[moncode]'> $fetmnth[moncode] - $fetmnth[monname]</option>";
                    }
                    ?>
                </select>
            </div>
            <div class="col-lg-1">
                <label class="label-control marg" style="font-size: 18px">Year</label>
            </div>
            <div class="col-lg-2">
                <select class="form-control yearno" name="yearno">
                    <?php
                    $getyr1 = mysqli_query($conn,"Select * from $zroot.yeartab where yearname = year('$date') ");
                    $fetyr1 = mysqli_fetch_array($getyr1);
                        echo "<option value='$fetyr1[yearname]'>$fetyr1[yearname]</option>";
                    $getyear = mysqli_query($conn,"Select * from $zroot.yeartab order by yearname");
                    while($fetyear = mysqli_fetch_array($getyear)){
                        echo "<option value='$fetyear[yearname]'>$fetyear[yearname]</option>";
                    }
                    ?>
                </select>
            </div>
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pad">

                <table class="table-bordered table-hover table-striped" width="80%" align="center">
                    <tbody class="tbody">
                        
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="9">
                                <hr/>
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </div>

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