<?php

include('../include/header.php');
	
?>
<div class="page-wrapper">
            <!-- Bread crumb -->
            <div class="row page-titles">
                <div class="col-md-5 align-self-center">
                    <h3 class="text-primary"></h3> </div>
                <div class="col-md-7 align-self-center">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="javascript:void(0)">Home</a></li>
                        <li class="breadcrumb-item active">Leave Requests</li>
                    </ol>
                </div>
            </div>
            <!-- End Bread crumb -->
            <!-- Container fluid  -->
            <div class="container-fluid">
                <!-- Start Page Content -->
                <div class="row">
                    <div class="col-12">
                        <div class="card">
                            <div class="card-body">
                                <div class="card-content">
                                    <!-- Left sidebar -->
                                    <div class="inbox-leftbar">
                                        <a class="btn btn-danger btn-block waves-effect waves-light" href="">Compose</a>

                                        <div class="mail-list mt-4">
                                            <a class="list-group-item border-0 text-danger" href="#"><i class="mdi mdi-inbox font-18 align-middle mr-2"></i><b>Inbox</b></a>
                                            <a class="list-group-item border-0" href="#"><i class="mdi mdi-star font-18 align-middle mr-2"></i>Starred</a>
                                            <a class="list-group-item border-0" href="#"><i class="mdi mdi-file-document-box font-18 align-middle mr-2"></i>Draft</a>
                                            <a class="list-group-item border-0" href="#"><i class="mdi mdi-send font-18 align-middle mr-2"></i>Sent Mail</a>
                                            <a class="list-group-item border-0" href="#"><i class="mdi mdi-delete font-18 align-middle mr-2"></i>Trash</a>
                                        </div>

                                        <h6 class="mt-5 m-b-15">Labels</h6>

                                        <div class="list-group b-0 mail-list">
                                            <a class="list-group-item border-0" href="#"><span class="fa fa-circle text-info mr-2"></span>Web App</a>
                                            <a class="list-group-item border-0" href="#"><span class="fa fa-circle text-warning mr-2"></span>Project 1</a>
                                            <a class="list-group-item border-0" href="#"><span class="fa fa-circle text-purple mr-2"></span>Project 2</a>
                                            <a class="list-group-item border-0" href="#"><span class="fa fa-circle text-pink mr-2"></span>Friends</a>
                                            <a class="list-group-item border-0" href="#"><span class="fa fa-circle text-success mr-2"></span>Family</a>
                                        </div>

                                    </div>
                                    <!-- End Left sidebar -->

                                    <div class="inbox-rightbar">

                                        <div role="toolbar" class="">
                                            <div class="btn-group">
                                                <button class="btn btn-light waves-effect" type="button"><i class="mdi mdi-archive font-18 vertical-middle"></i></button>
                                                <button class="btn btn-light waves-effect" type="button"><i class="mdi mdi-alert-octagon font-18 vertical-middle"></i></button>
                                                <button class="btn btn-light waves-effect" type="button"><i class="mdi mdi-delete-variant font-18 vertical-middle"></i></button>
                                            </div>
                                            <div class="btn-group">
                                                <button aria-expanded="false" data-toggle="dropdown" class="btn btn-light dropdown-toggle waves-effect" type="button">
                                                                                    <i class="mdi mdi-folder font-18 vertical-middle"></i>
                                                                                    <b class="caret m-l-5"></b>
                                                                                </button>
                                                <div class="dropdown-menu">
                                                    <span class="dropdown-header">Move to</span>
                                                    <a href="javascript: void(0);" class="dropdown-item">Social</a>
                                                    <a href="javascript: void(0);" class="dropdown-item">Promotions</a>
                                                    <a href="javascript: void(0);" class="dropdown-item">Updates</a>
                                                    <a href="javascript: void(0);" class="dropdown-item">Forums</a>
                                                </div>
                                            </div>
                                            <div class="btn-group">
                                                <button aria-expanded="false" data-toggle="dropdown" class="btn btn-light dropdown-toggle waves-effect" type="button">
                                                                                    <i class="mdi mdi-label font-18 vertical-middle"></i>
                                                                                    <b class="caret m-l-5"></b>
                                                                                </button>
                                                <div class="dropdown-menu">
                                                    <span class="dropdown-header">Label as:</span>
                                                    <a href="javascript: void(0);" class="dropdown-item">Updates</a>
                                                    <a href="javascript: void(0);" class="dropdown-item">Social</a>
                                                    <a href="javascript: void(0);" class="dropdown-item">Promotions</a>
                                                    <a href="javascript: void(0);" class="dropdown-item">Forums</a>
                                                </div>
                                            </div>

                                            <div class="btn-group">
                                                <button aria-expanded="false" data-toggle="dropdown" class="btn btn-light dropdown-toggle waves-effect" type="button">
                                                                                    More
                                                                                    <span class="caret m-l-5"></span>
                                                                                </button>
                                                <div class="dropdown-menu">
                                                    <span class="dropdown-header">More Option :</span>
                                                    <a href="javascript: void(0);" class="dropdown-item">Mark as Unread</a>
                                                    <a href="javascript: void(0);" class="dropdown-item">Add to Tasks</a>
                                                    <a href="javascript: void(0);" class="dropdown-item">Add Star</a>
                                                    <a href="javascript: void(0);" class="dropdown-item">Mute</a>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="">
                                            <div class="mt-4">
                                                <div class="">
                                                    <ul class="message-list">
													<option value="">Select</option>
												<?php
												 $sql2 = "select *from tbl_leave_request where request_to = '".$row_emp['emp_id']."' order by id desc ";
						$result2 = $objhr->viewdata($sql2);
							
							while($rows2 = $result2->fetch_assoc()){
												?>
                                                        <li class="unread">
                                                            <a href="leave_request_detail.php?leave_id=<?php echo md5($rows2['id']);?>">
                                                                <div class="col-mail col-mail-1">
                                                                    
                                                                    <p class="title"><?php
												 $sql1 = "select *from tbl_emp_master where id = '".$rows2['emp_id']."' ";
						$result1 = $objhr->viewdata($sql1);
							
						$rows1 = $result1->fetch_assoc(); echo strtoupper($rows1['emp_name']);?> (<?php echo strtoupper($rows1['emp_code']);?>)</p><span class="star-toggle fa fa-star-o"></span>
                                                                </div>
                                                                <div class="col-mail col-mail-2">
                                                                    <div class="subject">Requested Leave &nbsp;&ndash;&nbsp;
                                                                      <?php
																	if($rows2['leave_status']=='0'){
																	?>
                                                                      <button type="button" class="btn btn-warning btn-xs">Pending</button><?php }?>
																	  <?php
																	if($rows2['leave_status']=='2'){
																	?>
																	  <button type="button" style="background:#FF0000; color:#FFFFFF" class="btn  btn-xs">Rejected</button>   <?php }?>
																	  <?php
																	if($rows2['leave_status']=='1'){
																	?>
																	  <button type="button" style="background:#009900; color:#FFFFFF" class="btn  btn-xs">Approved</button> <?php }?>
                                                                    </div>
                                                                    <div class="date"><?php $date_time = $rows2['requested_time'];
																	echo date('d-m-Y', strtotime($date_time));
																	?></div>
                                                                </div>
                                                            </a>
                                                        </li>
<?php } ?>
                                                        
                                                    </ul>
                                                </div>

                                            </div>
                                            <!-- panel body -->
                                        </div>
                                        <!-- panel -->

                                        <div class="row">
                                            <div class="col-7">
                                                
                                            </div>
                                            <!--<div class="col-5">
                                                <div class="btn-group float-right">
                                                    <button class="btn btn-gradient waves-effect" type="button"><i class="fa fa-chevron-left"></i></button>
                                                    <button class="btn btn-gradient waves-effect" type="button"><i class="fa fa-chevron-right"></i></button>
                                                </div>
                                            </div>-->
                                        </div>
                                    </div>

                                    <div class="clearfix"></div>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- End PAge Content -->
            </div>
            <!-- End Container fluid  -->
        <?php

include('../include/footer.php');
	
?>