<?php 
    include'include/session.php';
?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Apply Leave | Lecturer | WAKA CMEC</title>
    <link rel="shortcut icon" href="../../../assets/img/logo.png" />
    <link rel="stylesheet" href="../../../assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Slab:300,400|Roboto:300,400,700">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">
    <link rel="stylesheet" href="../../../assets/fonts/font-awesome.min.css">
    <link rel="stylesheet" href="../../../assets/css/ebs-simple-login-form1.css">
    <link rel="stylesheet" href="../../../assets/css/ebs-simple-login-form2.css">
    <link rel="stylesheet" href="../../../assets/css/ebs-simple-login-form.css">
    <link rel="stylesheet" href="../../../assets/css/FPE-Gentella-form-elements.css">
    <link rel="stylesheet" href="../../../assets/css/FPE-Gentella-form-elements1.css">
    <link rel="stylesheet" href="../../../assets/css/MUSA_no-more-tables.css">
    <link rel="stylesheet" href="../../../assets/css/MUSA_no-more-tables1.css">
    <link rel="stylesheet" href="../../../assets/css/MUSA_panel-table.css">
    <link rel="stylesheet" href="../../../assets/css/MUSA_panel-table1.css">
    <link rel="stylesheet" href="../../../assets/css/nav.css">
    <link rel="stylesheet" href="../../../assets/css/Navbar-Fixed-Side1.css">
    <link rel="stylesheet" href="../../../assets/css/Profile-Edit.css">
    <link rel="stylesheet" href="../../../assets/css/Profile-Edit1.css">
    <link rel="stylesheet" href="../../../assets/css/Responsive-Form.css">
    <link rel="stylesheet" href="../../../assets/css/Responsive-Form1.css">
    <link rel="stylesheet" href="../../../assets/css/Sidebar-Menu.css">
    <link rel="stylesheet" href="../../../assets/css/Sidebar-Menu1.css">
    <link rel="stylesheet" href="../../../assets/css/styles.css">
    <link rel="stylesheet" href="../../../assets/css/Data-Table.css">
    <link rel="stylesheet" href="../../../assets/css/Data-Table1.css">
    <link rel="stylesheet" href="../../../assets/css/bootstrap-datetimepicker.min.css"  media="screen">
</head>

<body style="background-color:rgb(252,252,252);">
    <div></div>
    <div id="wrapper">
        <div id="sidebar-wrapper" style="background-color:rgb(62,140,228);">
            <ul class="sidebar-nav">
                <li class="sidebar-brand" style="color:rgb(255,255,255);"> 
                    <a href="#" style="font-weight:bold;color:rgb(254,254,254);">Lecturer | WAKA CMEC</a>
                </li>
                <li style="color:rgb(252,253,254);"> 
                    <a href="index.php" style="color:rgb(255,255,255);">Home</a>
                    <a href="course-work.php" style="color:rgb(255,255,255);">Course Work</a>
                    <a href="view-assignments.php" style="color:rgb(255,255,255);">View Assignments</a>
                    <a href="exam.php" style="color:rgb(255,255,255);">View Exam</a>
                    <a href="assigned-units.php" style="color:rgb(255,255,255);">View Units</a>
                </li>
            </ul>
        </div>
        <div class="page-content-wrapper">
            <div class="container-fluid"><a class="btn btn-link" role="button" href="#menu-toggle" id="menu-toggle"><i class="fa fa-bars"></i></a>
                <div class="dropdown" style="width:150px;float:right;margin-top:5px;">
                    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false" type="button" style="width:150px;background-color:rgb(252,252,252);color:rgb(20,19,19);border:1px solid rgb(252,252,252);text-align:right;"><i class="fa fa-user"></i> &nbsp; <?php echo $lec;?> <span class="caret"></span></button>
                    <ul role="menu" class="dropdown-menu dropdown-menu-right">
                        <li role="presentation"><a href="settings.php"><i class="fa fa-wrench"></i> &nbsp;Settings</a></li>
                        <li role="presentation"><a href="../validate/logout.php"><i class="fa fa-power-off"></i> &nbsp; Logout</a></li>
                    </ul>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css" rel='stylesheet' type='text/css'>

                        <div class="container">
                            <div class="row">

                                <div class="col-md-12 ">

                                    <div class="panel panel-default panel-table">
                                        <div class="panel-heading">
                                            <div class="row">
                                              <div class="col col-xs-12">
                                                <h3 class="panel-title">
                                                    <em class="fa fa-book"></em> 
                                                    <b>Apply for Leave</b>
                                                 </h3>
                                              </div>
                                            </div>
                                        </div>
                                        
                                        <form method="POST">
                                            <div class="row" style="padding:0px 10px 10px 10px;">
                                                <div class="col-md-12">
                                                    <div class="row" style="margin-bottom:10px;">
                                                        <div class="col-md-12 bg-info text-info" >
                                                            <p style="padding:10px;font-size:14px;"><b>NOTE:</b> Application should be made two weeks prior to your request time date off for approval</p>
                                                        </div>
                                                    </div>
                                                    <?php include 'validate/leave.php';?>

                                                    <div class="row">
                                                        <div class="col-md-6 bg-purple">
                                                            <div class="form-group">
                                                                <label for="dtp_input2" class="control-label">Start Date: <a style="color:red;">*</a></label>
                                                                <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                                                                    <input class="form-control" type="date" required="" value="<?php echo $startDate;?>" placeholder="yyyy-mm-dd" name="startDate" autocomplete="off">
                                                                    <span class="input-group-addon">
                                                                        <span class="fa fa-calendar">
                                                                    </span>
                                                                </div>
                                                            </div>
                                                            <input type="hidden" id="dtp_input2" value="" />
                                                        </div>
                                                        <div class="col-md-6 bg-green">
                                                            <div class="form-group">
                                                                <label for="dtp_input2" class="control-label">Reporting Date: <a style="color:red;">*</a></label>
                                                                <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                                                                    <input class="form-control" type="date" required="" value="<?php echo $reportDate; ?>" placeholder="yyyy-mm-dd" name="reportDate" autocomplete="off">
                                                                    <span class="input-group-addon">
                                                                        <span class="fa fa-calendar">
                                                                    </span>
                                                                </div>
                                                            </div>
                                                            <input type="hidden" id="dtp_input2" value="" />
                                                        </div>    
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-md-12">
                                                            <div class="col-md-12 col-sm-12">
                                                                <div class="form-group">
                                                                    <label class="control-label">Leave Type <a style="color:red;">*</a></label>
                                                                    <select class="form-control" name="reason" required style="cursor:pointer;">
                                                                        <option value="">-- Select Leave Type --</option>
                                                                        <?php 
                                                                            $selectx = "SELECT * FROM school_leave_type ORDER BY name ASC";
                                                                            $resultx = mysql_query($selectx);
                                                                            $rowcountx=  mysql_num_rows($resultx);
                                                                            if($rowcountx == 0){
                                                                                echo '<option class="bg-danger text-danger" value="" >No records found</option>';
                                                                            }else{
                                                                                while($row = mysql_fetch_array($resultx)) { 
                                                                        ?>
                                                                            <option value="<?php echo $row['leaveID'];?>" <?php if($row['leaveID']==$pass){echo 'selected="selected"';}?> > <?php echo $row['name'];?></option>
                                                                        <?php }} ?>
                                                                    </select>
                                                                </div>
                                                            </div>
                                                        </div>    
                                                    </div>
                                                    <div class="row" id="other_reasons">
                                                        <div class="col-md-12">
                                                            <div class="col-md-12 col-sm-12">
                                                                <div class="form-group">
                                                                    <label class="control-label">Explanation (optional)</label>
                                                                    <textarea class="form-control" placeholder="NB:// Be brief in your explanation" name="explanation" autocomplete="off"><?php echo $explanation;?></textarea>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-lg-12 col-md-12 text-center">
                                                            <button name="submit" type="submit" style="padding:5px 20px;color:rgb(1,1,1);margin-top:20px;">Submit Application</button>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </form>
                                    
                                    </div>
                                </div>
                            </div>
                        
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="../../../assets/js/jquery.min.js"></script>
    <script src="../../../assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="../../../assets/js/ebs-simple-login-form.js"></script>
    <script src="../../../assets/js/Profile-Edit.js"></script>
    <script src="../../../assets/js/Sidebar-Menu.js"></script>
    <script src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/1.10.15/js/dataTables.bootstrap.min.js"></script>
    <script src="ajax.js"></script>
    <script type="text/javascript" src="../../../assets/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>   
    <script type="text/javascript" src="../../../assets/js/locales/bootstrap-datetimepicker.fr.js" charset="UTF-8"></script>
    
    <script type="text/javascript">
        $('.form_datetime').datetimepicker({
            //language:  'fr',
            weekStart: 1,
            todayBtn:  1,
                    autoclose: 1,
                    todayHighlight: 1,
                    startView: 2,
                    forceParse: 0,
            showMeridian: 1
        });
            $('.form_date').datetimepicker({
            language:  'fr',
            weekStart: 1,
            todayBtn:  1,
                    autoclose: 1,
                    todayHighlight: 1,
                    startView: 2,
                    minView: 2,
                    forceParse: 0
        });
            $('.form_time').datetimepicker({
            language:  'fr',
            weekStart: 1,
            todayBtn:  1,
                    autoclose: 1,
                    todayHighlight: 1,
                    startView: 1,
                    minView: 0,
                    maxView: 1,
                    forceParse: 0
        });
    </script>
</body>
</html>