<?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 Gate Pass | Student | 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 href="../../../assets/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
</head>

<body style="background-color:rgba(42,63,84,0);">
    <nav class="navbar navbar-default" style="background-color:rgb(52,73,94);">
        <div class="container-fluid">
            <div class="navbar-header"><a class="navbar-brand navbar-link" href="#" style="font-weight:bold;background-color:rgb(52,73,94);">Student | Waka CMEC Training Institute</a>
                <button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navcol-2" style="background-color:rgb(52,73,94);color:rgb(255,255,255);"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
            </div>
            <div class="collapse navbar-collapse" id="navcol-2">
                <ul class="nav navbar-nav hidden-xs hidden-sm navbar-right" id="desktop-toolbar">
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#"> <i class="fa fa-user"></i> &nbsp; <?php echo $pro;?>  <i class="fa fa-chevron-down fa-fw"></i></a>
                        <ul class="dropdown-menu" role="menu" style="background-color:rgb(249,249,249);">
                            <li role="presentation"><a href="settings.php"><i class="fa fa-user fa-fw"></i> Profile </a></li>
                            <li role="presentation"><a href="password.php"><i class="fa fa-lock fa-w"></i> Password</a></li>
                            <li role="presentation"><a href="../validate/logout.php"><i class="fa fa-power-off fa-fw"></i> Logout </a></li>
                        </ul>
                    </li>
                </ul>
                <ul class="nav navbar-nav visible-xs-block visible-sm-block" id="mobile-nav">
                    
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#"> <i class="fa fa-user"></i> &nbsp; <?php echo $pro;?> </i> <i class="fa fa-chevron-down fa-fw"></i></a>
                        <ul class="dropdown-menu" role="menu" style="background-color:rgb(249,249,249);">
                            <li role="presentation"><a href="settings.php"><i class="fa fa-user fa-fw"></i> Profile </a></li>
                            <li role="presentation"><a href="password.php"><i class="fa fa-lock fa-fw"></i> Password</a></li>
                            <li role="presentation"><a href="../validate/logout.php"><i class="fa fa-power-off fa-fw"></i> Logout </a></li>
                        </ul>
                    </li>
                    <li role="presentation"><a>&nbsp;</a></li>
                    <li role="presentation"><a>&nbsp;</a></li>
                    
                </ul>
            </div>
        </div>
    </nav>
    <div class="top">
        <nav class="navbar navbar-default" id="navbar-main">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand hidden navbar-link" href="#" style="padding:0px;"> </a>
                    <button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navcol-1"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
                </div>
                <div class="collapse navbar-collapse" id="navcol-1">
                    <ul class="nav navbar-nav">
                        <li role="presentation">
                            <a href="index.php">
                                <i class="fa fa-table" style="margin-right:5px;"></i>
                                Dashboard
                            </a>
                        </li>
                        <li role="presentation">
                            <a href="assignments.php">
                                <i class="fa fa-bookmark" style="margin-right:5px;"></i>
                                Assignments
                            </a>
                        </li>
                        <li role="presentation">
                            <a href="unit.php">Units</a>
                        </li>
                        <li role="presentation">
                            <a href="coursework.php">Course Work</a>
                        </li>
                        <li role="presentation">
                            <a href="pass.php">
                                <i class="fa fa-shield" style="margin-right:5px;"></i>
                                Gate Pass
                            </a>
                        </li>
                        <li class="dropdown">
                            <a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#">
                                Time Table 
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu" role="menu">
                                <li role="presentation"><a href="exam-time-table.php">Exam Time Table</a></li>
                                <li role="presentation"><a href="lectures.php">Lectures Time Table</a></li>
                            </ul>
                        </li>
                        <li role="presentation">
                            <a href="#myModal" data-toggle="modal" class="text-info" role="button">
                                Fee Structure
                            </a>
                        </li>
                    </ul>
                    <?php include 'myModal.php'; ?>
                </div>
            </div>
        </nav>
    </div>   
    <div class="row" style="width:80%;margin-right:auto;margin-left:auto;-webkit-box-shadow:0px 4px 4px 0px rgba(0,0,0,1);-moz-box-shadow:0px 4px 4px 0px rgba(0,0,0,1);box-shadow:0px 4px 4px 0px rgba(0,0,0,1);margin-bottom:5%;overflow:hidden;max-width:960px;">
        
        <form method="POST">
            <div style="padding-top:2px;padding-bottom:2px;background-color:rgb(239,239,239);">
                <h2 style="margin-left:1%;margin-bottom:1%;font-size:16px;color:rgb(1,1,1);font-weight:bold;"><i class="fa fa-map-signs"></i> &nbsp;Apply for Gate Pass</h2>
            </div>
            <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/pass.php';?>
                    
                    <div class="row">
                        <div class="col-md-6 bg-purple">
                            <div class="col-md-6 col-sm-6">
                                <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 col-sm-6">
                                <div class="form-group">
                                    <label for="dtp_input2" class="control-label">Start Time: <a style="color:red;">*</a></label>
                                    <div class="input-group date form_time" data-date="" data-date-format="HH:mm" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                                        <input class="form-control" type="time" required="" value="<?php echo $startTime; ?>" placeholder="hh:mm" name="startTime" autocomplete="off">
                                        <span class="input-group-addon">
                                            <span class="fa fa-clock-o">
                                        </span>
                                    </div>
                                </div>
                                <input type="hidden" id="dtp_input2" value="" />
                            </div>
                        </div>
                        <div class="col-md-6 bg-green">
                            <div class="col-md-6 col-sm-6">
                                <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 class="col-md-6 col-sm-6">
                                <div class="form-group">
                                    <label for="dtp_input2" class="control-label">Reporting Time: <a style="color:red;">*</a></label>
                                    <div class="input-group date form_time" data-date="" data-date-format="HH:mm" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                                        <input class="form-control" type="time" required="" value="<?php echo $reportTime;?>" placeholder="hh:mm" name="reportTime" autocomplete="off">
                                        <span class="input-group-addon">
                                            <span class="fa fa-clock-o">
                                        </span>
                                    </div>
                                </div>
                                <input type="hidden" id="dtp_input2" value="" />
                            </div>
                        </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">Reason for requesting time out</label>
                                    <select class="form-control" name="reason" required style="cursor:pointer;">
                                        <option value="">-- Select Reason for Time out --</option>
                                        <?php 
                                            $selectx = "SELECT * FROM pass WHERE passID != 1 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['passID'];?>" <?php if($row['passID']==$pass){echo 'selected="selected"';}?> > <?php echo $row['name'];?></option>
                                        <?php }} ?>
                                        <option value="1" id="others">Others</option>
                                    </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>
    <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 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>