<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-olive">
                        <go-back/>
                        <i class="fas fa-book"></i> My Certificates
                    </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"><a href="{{baseurl}}mycertificates/list">MyCertificate</a></li>
                    </ol>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>
    <section class="content">
        <div class="container-fluid">
            <div class="row">
                <!--  -->
                <div class="col-md-12" ng-if=" myCertificate == null ">
                <div class="col-sm-12 text-center" >
                    <h3>You are not certified yet. </h3>
                </div>
                <div class="col-sm-12 text-center" >
                    <h3>Do you hold any certification ? </h3>
                    <button type="submit" ng-click="goTo($event,'myCertificateAdd')" class="btn btn-success">
                         Yes
                    </button>
                    <button ng-click="goTo($event,'dashboard')" class="btn btn-danger">
                         No
                    </button>
                </div>
            </div>
                <!--  -->
                <div class="col-md-12" ng-if=" myCertificate != null">
                    <div class="card card-primary card-outline">
                        <div class="card-header border-transparent  mb-1">
                            <h3 class="card-title">Data</h3>
                            <div class="card-tools">
                                <div class="btn-group">
                                    <a href="/my/certificate/add" class="btn btn-success"><i class="fas fa-pen"></i> Add Certificate</a>
                                    <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="myDiaryList" class="table table-bordered table-striped myCertificateList">
                                    <thead>
                                    <tr>
                                        <th>Certification Name</th>
                                        <!--<th>Amount</th>-->
                                        <th>Certification Date</th>
                                        <th>Valid till</th>
                                        <th>Certification Number</th>
                                        <!--<th>Reimbursement Claimed</th>-->
                                        <th>View/Download</th>
                                        <!--<th>Comments</th>-->
                                        <th>Action</th>
                                        <!--<th data-toggle="tooltip" title="Hours Per/day" ><small>Billable / Non Billable</small> <i class="fas fa-question-circle"></i></th>-->
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="d in myCertificate | orderBy:'-certificateion_date'">
                                        <!--<td><span>{"mydiaryid":"3","proj_id":"91","emp_id":"22","date":"2006-02-22 00:00:00+05:30","reference":"Dolor illum quos ea","description":"Eu quia dicta fugiat","logtype":"1","hours":82,"comments":"Accusamus non placea","status":"active"}	</span></td>-->
                                        <td>
                                            <div class="" ng-bind-html="d.certification_name"></div>
                                        </td>
                                        <!--<td>
                                            <div class="" ng-bind-html="d.certificate_amount"></div>
                                        </td>-->
                                        <td>
                                            <div ng-bind="formatDate(d.certification_date) | date:'dd MMM yyyy'"></div>
                                        </td>
                                        <td>
                                            <div ng-if="d.certification_expiry !=null" ng-bind="formatDate(d.certification_expiry) | date:'dd MMM yyyy'"></div>
                                        </td>
                                        <td>
                                            <div>{{d.certification_number}}</div>
                                        </td>
                                        <!--<td>
                                            <div class="" ng-bind-html="d.reimbursement_claimed"></div>
                                        </td>-->
                                        <td>
                                            <div><a target="_blank" href="{{baseurl}}/app/uploads/{{d.certificate_image}}">Download Attachment</a></div>
                                        </td>
                                        <!--<td>
                                            <div class="">{{d.comments}}</div>
                                        </td>-->
                                        <td>
                                            <button class="btn btn-danger" ng-click="openMyCertificateDeleteModal(d)" class="dropdown-item"><i class="fas fa-trash"></i></button>
                                            <!-- <button  class="btn btn-success" ng-click="openEditMyDiaryEntry(d)"><i class="fas fa-pen"></i>Edit</button> -->
                                           <!--&lt;!&ndash; <button ng-if="myAccess.repeatDiary" class="btn btn-warning" ng-click="repeatDiaryCurrentWeek(d)" class="dropdown-item"><i class="fas fa-redo"></i> Repeat For Current Week</button>&ndash;&gt;-->
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <script type="text/ng-template" id="MyCertificateDelete.html">
        <div class="">
            <div class="modal-header bg-gradient-gray-dark">
                <h4 class="modal-title" id="modal-titlee">Are you sure you want to to delete this row/entry?</strong></h4>
            </div>
            <div class="modal-footer bg-gradient-gray-dark">
                <button class="btn btn-default" type="button" ng-click="deleteMyCertificate(data)">Proceed to Delete</button>
                <button class="btn btn-primary" type="button" ng-click="cancel()">Cancel</button>
            </div>
        </div>
    </script>
</div>
<script type="text/ng-template" id="EditMyDiaryEntry.html">
    <div class="">
        <div class="modal-header bg-olive">
            <h4 class="modal-title" id="modal-title">Edit</h4>
        </div>
        <div class="modal-body" id="modal-body">
            <div class="form-group"><label>Project Name: </label> <strong class="text-olive">{{data.diary.proj_name}}</strong></div>

            <div class="form-group">
                <label>Date*</label>
                <input type=text date-picker
                       placeholder='Date (DD-MM-YYYY)'
                       dateformat='dd-mm-yy'
                       maxlength="10"
                       ng-required='true'
                       class='form-control'
                       ng-model='data.diary.date'/>
            </div>
            <div class="form-group">
                <label for="logtype">Category</label>
                <select id="logtype" class="form-control custom-select"
                        ng-model="data.diary.logtype" ng-options="lt.mydiarylogtypeid as lt.lt_name | titlecase for lt in logTypes">
                </select>
            </div>
            <div class="form-group">
                <label for="description">Work Area/Description*</label>
                <textarea id="description" class="form-control" required ng-model="data.diary.description" placeholder="Description" rows="2" maxlength="1000"></textarea>
            </div>
            <div class="form-group">
                <label for="reference">Reference</label>
                <input id="reference" class="form-control" ng-model="data.diary.reference" type="text" placeholder="Reference(Jira Issue) in 100 char" maxlength="100">
            </div>
            <div class="form-group">
                <label for="hours">Hours*</label>
                <input id="hours" class="form-control" required ng-model="data.diary.hours" type="number" placeholder="Hours" step="0.25" max="24" min="0.5">
            </div>
            <!--<div class="form-group">
                <label for="comments">Comments</label>
                <textarea id="comments" class="form-control" ng-model="data.diary.comments" placeholder="Comment/Notes" rows="2" maxlength="500"></textarea>
            </div>-->
        </div>
        <div class="modal-footer bg-olive">
            <button class="btn btn-default" type="button" ng-click="change(data)">Save Changes</button>
            <button class="btn btn-primary" type="button" ng-click="cancel()">Cancel</button>
        </div>
    </div>
</script>
