<div class="content-wrapper" ng-if="gUser.emp_first_name === 'Admin'">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-6 offset-sm-1 offset-md-2 offset-lg-3 mt-5">
                <div class="alert alert-danger alert-dismissible">
                    <h5><i class="icon fas fa-ban"></i> Alert!</h5>
                    Please login as Hero.
                </div>
            </div>
        </div>
    </div>
</div>
<div class="content-wrapper" ng-if="gUser.emp_first_name !== 'Admin'">
    <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> {{createButton.heading}}
                    </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">My Certificate</a></li>
                        <li class="breadcrumb-item active">{{createButton.heading}}</li>
                    </ol>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class="container-fluid">
        <!--<div class="row mb-2">
            <div class="col-sm-12">
                <button type="button" class="btn bg-olive float-right" data-toggle="modal" data-target="#modal-view_diary">View Diary</i></button>
            </div>
        </div>-->
        <div class="row">
            <div class="col-sm-12 text-center" ng-if="isEmployeeCertified==false">
                <h3>You are not certified yet. </h3>
            </div>
            <div class="col-sm-12 text-center" ng-if=" isEmployeeCertified == null || isEmployeeCertified == false ">
                <h3>Do you hold any certification ? </h3>
                <button type="submit" ng-click="yesNoButton(true)" class="btn btn-success">
                     Yes
                </button>
                <button type="submit" ng-click="yesNoButton(false)" class="btn btn-danger">
                     No
                </button>
            </div>
          
            <div class="col-sm-12" ng-if="isEmployeeCertified==true">
                <div class="card card-primary card-outline">
                    <div class="card-header"><strong class="text-blue"> My Certifications</strong></div>
                    <div class="card-body">
                        <div class="row mt-1">
                            <div class="col-sm-3"><label>Certification Name</label><input class="form-control" ng-model="ec.certification_name" type="text" placeholder="Certification Name" maxlength="100"></div>
                            <div class="col-sm-3"><label>Certification Number</label><input class="form-control" ng-model="ec.certification_number" type="text" placeholder="Certification Number" maxlength="100"></div>
                            <!--<div class="col-sm-1"><label>Amount</label><input class="form-control" ng-model="ec.certificate_amount" type="number" placeholder="Certification Name" maxlength="100"></div>-->
                            <div class="col-sm-2">
                                <label>Certification  Date </label>
                                <input type=text date-picker
                                       placeholder='Date (DD-MM-YYYY)'
                                       dateformat='dd-mm-yy'
                                       maxlength="10"
                                       ng-required='true'
                                       default=""
                                       class='form-control'
                                       ng-model='ec.certification_date'/></div>
                            <div class="col-sm-2">
                                <label>Valid Till </label>
                                <input type=text date-picker2
                                       placeholder='Date (DD-MM-YYYY)'
                                       dateformat='dd-mm-yy'
                                       maxlength="10"
                                       default=""
                                       ng-required='true'
                                       min-date="{{today}}"
                                       max-date="{{tenYearFromToday}}"
                                       class='form-control'
                                       ng-model='ec.certification_expiry'/>
                                    </div>
                            <!--<div class="col-sm-2">
                                <label for="domain">Certification Domain </label>
                                <select id="domain" class="form-control custom-select"
                                        ng-model="ec.domain_id" ng-options="cd.certificatedomainsid as cd.domain_name | titlecase for cd in certificateDomains">
                                </select>
                            </div>-->
                            <!--<div class="col-sm-1">
                                <label for="reimbursement">Reimbursement </label>
                                <select id="reimbursement" class="form-control custom-select"
                                        ng-model="ec.reimbursement_claimed">
                                    <option value="true">Yes</option>
                                    <option value="false">No</option>
                                </select>
                            </div>-->
                            <div class="col-sm-2"><label>Attach Certificate PDF/Image</label><input type="file" file-model="ec.myCertificateImage" required="required" class="form-control fileinput"></div>
                            <!--<div class="col-sm-1">
                                <button class="btn btn-success float-right" ng-click="removeSelf($parent.$parent.$index,$index)" ng-if="$index > 0"><i class="fas fa-trash"></i></button>
                            </div>-->
                        </div>
                        <!--<button class="btn btn-success mt-1 float-right" ng-click="addMore($index,diary)"><i class="fas fa-plus"></i></button>-->
                    </div>
                </div>

                <button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#modal-cancel">Cancel</button>
                <button type="submit" ng-click="Save()" class="btn btn-success float-right">
                    <i class="fas {{createButton.icon}}"></i> {{createButton.text}}
                </button>
            </div>
        </div>
    </section>
    <div class="modal fade" id="modal-view_diary">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-body">
                    <p>You are being redirected to View Diary Page!</p>
                </div>
                <div class="modal-footer justify-content-between">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="goToSelf('myDiaryList')">Proceed</button>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="modal-cancel">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-body">
                    <p>Please Note: No data would be saved and you will be redirected to View Diary Page.</p>
                </div>
                <div class="modal-footer justify-content-between">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                    <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="goToSelf('myDiaryList')">Proceed</button>
                </div>
            </div>
        </div>
    </div>
</div>
