<div class="page-content-wrapper">
                <div class="page-content">
                    <div class="page-bar">
                        <div class="page-title-breadcrumb">
                            <div class=" pull-left">
                                <div class="page-title"><?php echo 'Add Leave'; ?></div>
                            </div>
                            <ol class="breadcrumb page-breadcrumb pull-right">
                                <li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.php?page=home">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
                                </li>
                                <li><a class="parent-item" href="index.php?page=view_staff&id=<?php echo $staffId; ?>">Staff</a>&nbsp;<i class="fa fa-angle-right"></i></li><li class="active">Add Leave</li>
                            </ol>
                        </div>
                    </div>
<div class="row">
                        <div class="col-md-12 col-sm-12">
                            <div class="card card-box">
                                <div class="card-head">
                                    <header><?php echo 'Add Leave'; ?></header>                                    
                                </div>
                                <div class="card-body" id="bar-parent1">
                                	<?php if(isset($error) && $error!='') { ?> 
                                	<div class="alert alert-danger"><?php echo $error; ?></div>
                                	<?php } else if(isset($success) && $success!=''){ ?>                                		
                                		<div class="alert alert-success"><?php echo $success; ?></div>
                                	<?php } else if(isset($_REQUEST['success'])){ ?>                                		
                                		<div class="alert alert-success"><?php echo urldecode($_REQUEST['success']); ?></div>
                                	<?php } ?>
                                    <form action="" id="form_staff_add" class="form-horizontal" method="post">
                                        <div class="form-body">
                                        	<div class="form-group row">
                                                <label class="control-label col-md-3">Select Staff</label>
                                                <div class="col-md-4">                                                    
                                                    <select class="form-control" name="staff">
                                                        <option value="">Select Staff</option>
                                                        <?php if(mysqli_num_rows($staffRs)>0){
                                                        	while($staffRec = mysqli_fetch_array($staffRs)){ ?>   
                                                        	<option value="<?php echo $staffRec['id']; ?>" <?php if(isset($_POST['staff']) && $_POST['staff']==$staffRec['id']){ echo 'selected';} else if(isset($staffId) && $staffId==$staffRec['id']){ echo 'selected';} ?> ><?php echo getStaffName($staffRec['id']); ?></option>
                                                        <?php } } ?>                                                     
                                                    </select>
                                                </div>                                                  
                                            </div>     
                                            <div class="form-group row">
	                                            <label class="col-md-3 control-label">Select Date</label>
	                                            <div class="input-group date form_date col-md-4" data-date="<?php if(isset($_POST['date'])){ echo $_POST['date']; } else if(isset($editRec['date'])){ echo getFormattedDate($editRec['date']); }?>" data-date-format="dd-mm-yyyy" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
	                                                <input class="form-control" size="16" value="<?php if(isset($_POST['date'])){ echo $_POST['date']; } else if(isset($editRec['date'])){ echo getFormattedDate($editRec['date']); }?>" type="text">
	                                                <span class="input-group-addon"><span class="fa fa-remove"></span></span>
	                                                <span class="input-group-addon"><span class="fa fa-calendar"></span></span>
	                                            </div>
	                                            <input name="date" id="dtp_input2" value="<?php if(isset($_POST['date'])){ echo $_POST['date']; } else if(isset($editRec['date'])){ echo getFormattedDate($editRec['date']); }?>" type="hidden">
	                                            <br>
	                                        </div>                                        
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Select Status</label>
                                                <div class="col-md-4">                                                    
                                                    <select class="form-control" name="status">
                                                        <option value="">Select</option>                                                        
                                                        <option value="full_day" <?php if(isset($_POST['status']) && $_POST['status']=='full_day'){ echo 'selected';} else if(isset($editRec['status']) && $editRec['status']=='full_day'){ echo 'selected'; }?> >Full Day</option>
                                                        <option value="half_day" <?php if(isset($_POST['status']) && $_POST['status']=='half_day'){ echo 'selected';} else if(isset($editRec['status']) && $editRec['status']=='half_day'){ echo 'selected'; }?> >Half Day</option>
                                                    </select>
                                                </div>                                                  
                                            </div> 
                                            <div class="form-group row">
                                                <label class="control-label col-md-3">Leave Type</label>
                                                <div class="col-md-4">                                                    
                                                    <select class="form-control" name="leave_type">
                                                        <option value="">Select</option>
                                                        <option value="casual" <?php if(isset($_POST['leave_type']) && $_POST['leave_type']=='casual'){ echo 'selected';} else if(isset($editRec['leave_type']) && $editRec['leave_type']=='casual'){ echo 'selected'; }?> >Casual Leave</option>
                                                        <option value="sick" <?php if(isset($_POST['leave_type']) && $_POST['leave_type']=='sick'){ echo 'selected';} else if(isset($editRec['leave_type']) && $editRec['leave_type']=='sick'){ echo 'selected'; }?> >Sick Leave</option>
                                                    </select>
                                                </div>                                                  
                                            </div>                                         
                                                                                     
                                            
                                        </div>
                                      <div class="form-group">
                                            <div class="offset-md-3 col-md-9">
                                            	<?php if(isset($editId)){ ?>
                                            		<button type="submit" name="update" class="btn btn-info">Update</button>
                                            	<?php } else { ?>
                                            		<button type="submit" name="add" class="btn btn-info">Add</button>
                                            	<?php } ?>                                                
                                                <!--<button type="button" class="btn btn-default">Cancel</button>-->
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
	</div>
</div>
