<span *ngIf="show" class="backToList">

    <a (click)="show = !show;" tooltip="Go to listing">Back to List</a>
    
    </span>
<div class="col-lg-12" *ngIf="!show">
    <tabset>
        <tab>
            <ng-template tabHeading> Employee List</ng-template>
            <div class="card">
                <div class="card-header">
                    <i class="fa fa-align-justify"></i> Employee List
                </div>
                <div class="card-body">
                     <div class="row">
                        <div class="col-md-4">
                            <div class="input-prepend input-group">
                                <span class="input-group-addon">
                                    <i class="fa fa-search"></i>
                                    </span>
                                <input id="search" class="form-control" type="text" placeholder="search">
                            </div>
                        </div>
                    </div>
                    <br>
                    <table class="table table-bordered table-responsive">
                        <thead>
                            <tr>
                                <th>EmployeeID</th>
                                <th>Name</th>
                                <th>Mobile Number</th>
                                <th>Role</th>
                                <th>Status</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr *ngFor="let emp of employees">
                                <td>{{emp.empId}}</td>
                                <td>{{emp.name}}</td>
                                <td>{{emp.mobile}}</td>
                                <td>{{emp.role}}</td>
                                <td>
                                    <span *ngIf="emp.status == 1" class="badge badge-success">Active</span>
                                    <span *ngIf="emp.status == 0" class="badge badge-danger">In-Active</span>
                                </td>
                                <td>
                                    <i class="fa fa-edit" tooltip="Edit" (click)="editEmployee()"></i> |
                                    <i class="fa fa-eye" tooltip="View More" data-toggle="modal" (click)="myModal.show(); getModelWindowDetails(emp)"></i>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <ul class="pagination">
                        <li class="page-item"><a class="page-link" href="#">Prev</a></li>
                        <li class="page-item active">
                            <a class="page-link" href="#">1</a>
                        </li>
                        <li class="page-item"><a class="page-link" href="#">2</a></li>
                        <li class="page-item"><a class="page-link" href="#">3</a></li>
                        <li class="page-item"><a class="page-link" href="#">4</a></li>
                        <li class="page-item"><a class="page-link" href="#">Next</a></li>
                    </ul>
                </div>
            </div>
        </tab>
        <tab>
            <ng-template tabHeading> Add Employee</ng-template>
            <div class="animated fadeIn">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                             <i class="fa fa-align-justify"></i> Personal Details
                            </div>
                            <form>
                                <fieldset>
                                    <!--<legend>Personal Details</legend>-->
                                    <div class="container">
                                        <div class="row">
                                            <div class="form-group col-md-4">
                                                <label for="fname">First Name <span class="danger">*</span></label>
                                                <input type="text" class="form-control" id="fname" placeholder="Enter First name">
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="lname">Last Name <span class="danger">*</span></label>
                                                <input type="text" class="form-control" id="lname" placeholder="Enter Last name">
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="form-group col-md-4">
                                                <label for="pmobile">Primary Mobile Number <span class="danger">*</span></label>
                                                <input type="text" class="form-control" id="pmobile" placeholder="Enter Primary Mobile Number">
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="smobile">Secondary Mobile Number</label>
                                                <input type="text" class="form-control" id="smobile" placeholder="Enter Secondary Mobile Number">
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="email">Email <span class="danger">*</span></label>
                                                <input type="text" class="form-control" id="email" placeholder="Enter Email">
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="form-group col-md-4">
                                                <label for="fatherName">Father Name <span class="danger">*</span></label>
                                                <input type="text" class="form-control" id="fatherName" placeholder="Enter Father Name">
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="motherName">Mother Name <span class="danger">*</span></label>
                                                <input type="text" class="form-control" id="motherName" placeholder="Enter Mother Name">
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="dob">Date Of Birth <span class="danger">*</span></label>
                                                <input type="text" class="form-control" id="dob" placeholder="Enter DOB">
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="form-group col-md-4">
                                                <label for="gender">Gender <span class="danger">*</span></label>
                                                <!--<input type="text" class="form-control" id="gender" placeholder="Enter Gender">-->
                                                    <label class="radio" for="gender">
                                                        <input type="radio" id="gender-male" name="inline-radios" value="Male"> Male
                                                    </label>
                                                    <label class="radio" for="inline-radio2">
                                                        <input type="radio" id="gender-female" name="inline-radios" value="Female"> Female
                                                    </label>
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="adhar">Aadhar Number <span class="danger">*</span></label>
                                                <input type="text" class="form-control" id="adhar" placeholder="Enter Aadhar Number">
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="qualification">Qualification</label>
                                                <input type="text" class="form-control" id="qualification" placeholder="Enter Qualification">
                                            </div>
                                        </div>
                                        <!--/.row-->
                                        <div class="row">
                                            <div class="form-group col-md-4">
                                                <label for="premanentAddress">Premanent Address <span class="danger">*</span></label>
                                                <textarea class="form-control" id="premanentAddress" placeholder="Enter Permanent Address"></textarea>
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="currentAddress">Current Address <span class="danger">*</span></label>
                                                <textarea class="form-control" id="currentAddress" placeholder="Enter Current Address"></textarea>
                                            </div>
                                        </div>
                                    </div>
                                </fieldset>
                                <div class="card-header">
                                 <i class="fa fa-align-justify"></i>   Role Details
                                </div>
                                <fieldset>
                                    <!--<legend>Role Details</legend>-->
                                    <div class="container">
                                        <div class="row">
                                            <div class="form-group col-md-4">
                                                <label for="doj">Date Of Joining<span class="danger">*</span></label>
                                                <input type="text" class="form-control" id="doj" placeholder="Enter DOJ">
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="role">Role <span class="danger">*</span></label>
                                                <!--<input type="text" class="form-control" id="role" placeholder="Enter Role">-->
                                                <select class="form-control" id="role" placeholder="Select Role">
                                                    <option disabled>Select Role</option>
                                                    <option>Admin</option>
                                                </select>
                                            </div>
                                            <div class="form-group col-md-4">
                                                <label for="jobResponsibilities">Job Responsibilities</label>
                                                <textarea class="form-control" id="jobResponsibilities" placeholder="Enter Job Responsibilities"></textarea>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="form-group col-md-4">
                                                Active/De-Active : <label class="switch switch-default switch-pill switch-primary">
                                        <input type="checkbox" class="switch-input" checked>
                                        <span class="switch-label"></span>
                                        <span class="switch-handle"></span>
                                    </label>
                                            </div>
                                        </div>
                                    </div>
                                </fieldset>
                                <div class="card-footer" align="right">
                                    <button type="submit" class="btn btn-sm btn-success"><i class="fa fa-dot-circle-o"></i> Submit</button>
                                    <button type="reset" class="btn btn-sm btn-danger"><i class="fa fa-ban"></i> Reset</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </tab>
    </tabset>
</div>

<app-edit-employee *ngIf="show"></app-edit-employee>

<div bsModal #myModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document" *ngIf="myModalData">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">{{ myModalData.empId }}</h4>
                <button type="button" class="close" (click)="myModal.hide()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
            </div>
            <div class="modal-body">
                <div class="container">
                    <div class="row">
                        <div class="col-md-4">
                            <label><b>Name : </b> </label> {{myModalData.name}}
                        </div>
                        <div class="col-md-4">
                            <label><b>Mobile : </b> </label> {{myModalData.mobile}}
                        </div>
                        <div class="col-md-4">
                            <label><b>Role : </b> </label> {{myModalData.role}}
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" (click)="myModal.hide()">Close</button>
                <!--<button type="button" class="btn btn-primary">Save changes</button>-->
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->