<div class="content-wrapper">
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="text-indigo">
                        <go-back />
                        <i class="fas fa-envelope"></i> Skills Updated Report
                    </h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a ng-href="{{baseurl}}/dashboard">Home</a></li>
                        <li class="breadcrumb-item active">Skills Updated Report</li>
                    </ol>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>
    <section class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <div class="card card-indigo card-outline">
                        <div class="card-header border-transparent">
                            <h3 class="card-title">Skills Last Updated Report</h3>
                            <div class="card-tools">
                                <div class="btn-group">
                                    <!--<button ng-click="goTo($event,'ClientAppreciationsAdd')" type="button" class="btn bg-indigo"><i class="fas fa-plus"></i> <span class="d-none d-lg-inline-block">Create Appreciation</span></button>-->
                                    <button type="button" title="Fullscreen Toggle"
                                        class="btn btn-dark toggle-fullscreen"><i class="fas fa-expand"></i></button>
                                    <button type="button" class="btn btn-dark" data-widget="collapse"><i
                                            class="fas fa-minus"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="card-body p-0">
                            <div class="table table-responsive">
                                <table id="skillReport" class="table table-bordered table-striped">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>Hero Name</th>
                                            <th>Emp Code</th>
                                            <th>Date of Joining</th>
                                            <th>Department</th>
                                            <th>Designation</th>
                                            <th>No. of Days</th>
                                            <th>Last Updated Date</th>
                                            <th>Reminder</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr ng-repeat="skl in skills | orderBy : '-updatedAt'">
                                            <td>{{$index+1}}</td>
                                            <td><span class="nowrap"><a href="/heroes/view/{{skl.emp_id}}"><i
                                                            class="fas fa-external-link-alt"></i> {{skl.emp_first_name |
                                                        capitalize }} {{skl.emp_middle_name | capitalize }}
                                                        {{skl.emp_last_name | capitalize}}</a></span></td>
                                            <td><span class="nowrap">{{skl.emp_code}}</span></td>
                                            <td><span class="nowrap">{{skl.emp_doj2 | datetz:'YYYY-MMM-DD'}}</span></td>
                                            <td><span class="nowrap">{{skl.dept_name}}</span></td>
                                            <td><span class="nowrap">{{skl.desg_name}}</span></td>
                                            <td><span class="nowrap">{{skl.noOfdays}}</span></td>
                                            <td><span class="nowrap">{{skl.updatedAt | datetz:'DD-MMM-YYYY'}}</span>
                                            </td>
                                            <!-- <td><button class="btn btn-success" ng-click="sendReminder({{skl.emp_id}})"><i class="fas fa-envelope"></i> Send</button></td> -->
                                            <!-- Created By Yasin on 28 Feb 2023 -->
                                            <!-- Purpose: Modal open for meail sending, start -->
                                            <td><button ng-click="openEmailPopup(skl,skl.emp_id)" class="btn btn-warning btn-xs float-right"><i
                                                class="fas fa-envelope"></i> Send Email</button></td>
                                            <!-- Purpose: Modal open for meail sending, end -->
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-md-12">
                    <div class="card card-indigo card-outline">
                        <div class="card-header border-transparent">
                            <h3 class="card-title">Skills Unfilled Report</h3>
                            <div class="card-tools">
                                <div class="btn-group">
                                    <!--<button ng-click="goTo($event,'ClientAppreciationsAdd')" type="button" class="btn bg-indigo"><i class="fas fa-plus"></i> <span class="d-none d-lg-inline-block">Create Appreciation</span></button>-->
                                    <button type="button" title="Fullscreen Toggle"
                                        class="btn btn-dark toggle-fullscreen"><i class="fas fa-expand"></i></button>
                                    <button type="button" class="btn btn-dark" data-widget="collapse"><i
                                            class="fas fa-minus"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="card-body p-0">
                            <div class="table table-responsive">
                                <table id="skillUnfilledReport" class="table table-bordered table-striped">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>Hero Name</th>
                                            <th>Emp Code</th>
                                            <th>Date of Joining</th>
                                            <th>Department</th>
                                            <th>Designation</th>
                                            <th>Reminder</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr ng-repeat="skl in unfilledSkills">
                                            <td>{{$index+1}}</td>
                                            <td><span class="nowrap"><a href="/heroes/view/{{skl.id}}"><i
                                                            class="fas fa-external-link-alt"></i> {{skl.emp_first_name |
                                                        capitalize }} {{skl.emp_middle_name | capitalize }}
                                                        {{skl.emp_last_name | capitalize}}</a></span></td>
                                            <td><span class="nowrap">{{skl.emp_code}}</span></td>
                                            <td><span class="nowrap">{{skl.emp_doj2 | datetz:'YYYY-MMM-DD'}}</span></td>
                                            <td><span class="nowrap">{{skl.dept_name}}</span></td>
                                            <td><span class="nowrap">{{skl.desg_name}}</span></td>
                                            <td><button class="btn btn-success" ng-click="sendReminder({{skl.id}})"><i
                                                        class="fas fa-bell"></i> Send</button></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<!-- Created by Yasin on 01 March 2023 -->
<!-- For email template choose start here -->
<script type="text/ng-template" id="sendEmailTemp.html">
    <div class="modal-header bg-dark"><strong><i class="{{mInfo.head_icon}}"></i> {{ mInfo.head_title }}  </strong></div>
    <div class="modal-body" id="modal-body">

         <div class="row">
            <div class="form-group col-sm-12">
                <label for="emailtemp">Choose Email Template</label>
            <select id="emailtemp" class="form-control" ng-model="emailTempId" ng-change="selectTemplate(emailTempId)">
                <option value="">Select</option>
                <option ng-repeat="x in allMailTemplates" value="{{x.id}}">{{x.key}}</option>
            </select>
            </div>
            <div class="form-group col-sm-3"></div>
           <div class="form-group col-sm-12">
                 <!-- Get content of Email template start -->
                 <section class="content">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="card card-indigo card-outline">
                                <div class="card-body">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <!-- <div class="form-group">
                                <label for="key">Key</label>
                                <input type="text" id="key" class="form-control" required="required" ng-model="emailtemplates.key" placeholder="Subject">
                            </div> -->
                                            <div class="form-group">
                                                <label for="subject">Subject</label>
                                                <input type="text" id="subject" class="form-control"
                                                    required="required" readonly
                                                    ng-model="emailtemplateSingle.subject"
                                                    placeholder="Subject">
                                            </div>
                                            <div class="form-group">
                                                <label for="email">Email Body</label>
                                                <textarea id="email" class="form-control" ck-editor
                                                    ng-model="emailtemplateSingle.message"></textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
                <!-- Get content of Email template end -->
            </div>
        </div> 
        <div class="modal-footer p-2">
            <button class="btn btn-danger btn-xs" type="button" ng-click="cancel()"><i class="fas fa-times"></i> Cancel</button>
            <button class="btn btn-success btn-xs" type="button" ng-click="send(emailtemplateSingle)"><i class="{{mInfo.btn_icon}}"></i> {{mInfo.btn_title}}</button>
        </div>
    </div>
</script>
<!-- For email template choose start here -->