<link href="<?php echo base_url('application/modules/employee/assets/css/appraisal_print.css'); ?>" rel="stylesheet"
    type="text/css" />

<div class="container" id="print-table" style="width:100%">

    <div class="panel panel-default thumbnail add_emp_appraisal">

        <div class="panel-body">

            <div class="text-right" id="print">
                <button type="button" class="btn btn-warning" id="btnPrint" onclick="printDiv();"><i
                        class="fa fa-print"></i></button>

            </div>

            <br>

            <div id="printArea">

                <div style="padding: 20px;">
<?php echo form_open('employee/Employees_performance/save_employees_comments/'.$id) ?>
                    <div class="row">
                        <div class="col-xs-3">
                            <img class="" style="margin-top: -10px;" src="<?php echo base_url('/').$setting->logo;?>"
                                alt="">
                        </div>
                        <div class="col-xs-5">
                            <h3 style="text-align:center;"><?php echo $performance_year?$performance_year:'';?>
                                PERFOMANCE APPRAISAL</h3>
                        </div>
                        <div class="col-xs-4" style="text-align:right;">
                            <span>Serial No: <?php echo $perform_sl?$perform_sl:'';?></span>
                        </div>
                    </div>

                    <div class="row mt-20">
                        <div class="col-xs-6 mb-20">
                            <div class="row">
                                <div class="col-xs-5">
                                    <span class="fs-16 fw-700"> Name of Employee:</span>
                                </div>
                                <div class="col-xs-7 d-flex justify-content-center"
                                    style="border-bottom: 1px solid #000;">
                                    <span class="fs-16"><?php echo $empplyee_name?$empplyee_name:'';?></span>
                                </div>
                            </div>
                             <input type="hidden" name="employee_name" value="<?php echo $empplyee_name?$empplyee_name:''; ?>">
                             
                        </div>
                        <div class="col-xs-6 mb-20">
                            <div class="row">
                                <div class="col-xs-4">
                                    <span class="fs-16 fw-700">Department:</span>
                                </div>
                                <div class="col-xs-8 d-flex justify-content-center"
                                    style="border-bottom: 1px solid #000;">
                                    <span class="fs-16"><?php echo $department_name?$department_name:'';?></span>
                                </div>
                            </div>

                        </div>
                        <div class="col-xs-6 mb-20">
                            <div class="row">
                                <div class="col-xs-4">
                                    <span class="fs-16 fw-700">Job Title:</span>
                                </div>
                                <div class="col-xs-8 d-flex justify-content-center"
                                    style="border-bottom: 1px solid #000;">
                                    <span class="fs-16"><?php echo $job_title?$job_title:'';?></span>
                                </div>
                            </div>

                        </div>
                        <div class="col-xs-12 mb-20">
                            <div class="row">
                                <div class="col-xs-6 mb-20">
                                    <div class="row">
                                        <div class="col-xs-4">
                                            <span class="fs-16 fw-700">Review Period:</span>
                                        </div>
                                        <div class="col-xs-8 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span class="fs-16"><?php echo $review_period?$review_period:'';?></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-xs-6 mb-20">
                                    <div class="col-xs-5">
                                        <span class="fs-16 fw-700">Staff Status:</span>
                                    </div>
                                    <div class="col-xs-7 d-flex justify-content-center"
                                        style="border-bottom: 1px solid #000;">
                                        <span class="fs-14" id="staff_status"><?php if($status == "Annual Performance"){
                                            echo "Junior staff";
                                        } else echo $status?$status:'';?></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-12 mb-20">
                            <div class="row">
                                <div class="col-xs-5">
                                    <span class="fs-16 fw-700">Name and Position of Supervisor/Head of Department
                                        :</span>
                                </div>
                                <div class="col-xs-7 d-flex justify-content-center"
                                    style="border-bottom: 1px solid #000;">
                                    <span
                                        class="fs-16"><?php echo $position_of_supervisor?$position_of_supervisor:'';?></span>
                                </div>
                            </div>

                        </div>

                    </div>

                    <br>
                    <div class="row" id="preliminary">
                        <table class="table table-bordered" id="request_table_dev_plan">
                            <thead>
                                <tr>
                                    <th width="25%"><span id="junior1">DUTIES AND RESPONSIBILITES</span><span
                                            id="junior_1">SPECIAL CONTRIBUTIONS MADE TO ACTIVITIES</span></th>
                                    <th width="25%"><span id="junior2">SPECIAL CONTRIBUTIONS MADE TO
                                            ACTIVITIES</span><span id="junior_2">IMPROVEMENT TO BE ON UNFAVOURABLE
                                            REPORT</span></th>
                                    <th width="25%">CONDITION THAT FACILITATED YOUR PERFORMANCE</th>
                                    <th width="25%">CONDITIONS THAT HINDERED ACHIEVING BETTER PERFORMANCE</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach ($data_key_goals as $key => $row) { 
                                     $key_goals_data_array = json_decode($row->key_duties_res, true);
        
                                     // Check if the decoded data is an array
                                        if (is_array($key_goals_data_array)) {
                                            foreach ($key_goals_data_array as $key_goals_data) { ?>
                                <tr>
                                    <td>
                                        <?php echo htmlspecialchars($key_goals_data['duties_responsibilites']); ?>
                                    </td>
                                    <td>
                                        <?php echo htmlspecialchars($key_goals_data['special_contributions']); ?>
                                    </td>
                                    <td>
                                        <?php echo htmlspecialchars($key_goals_data['duties_perf_circumstances']); ?>
                                    </td>
                                    <td>
                                        <?php echo htmlspecialchars($key_goals_data['duties_perf_circumstances_bad']); ?>
                                    </td>
                                </tr>
                                <?php } 
                                        }
                                    } ?>
                            </tbody>

                        </table>
                    </div>

                    <div class="row" id="academic">
                        <h3 class="mb-20">A: ASSESSMENT OF JOB PERFORMANCE</h3>
                        <h4>3.1 EXPERIENCE</h4>
                        <h4>(a) Teaching experience. (Please indicate institution, your designation, area of
                            specification,
                            subject(s) taught and dates)</h4>
                        <table class="table table-bordered" id="request_table">
                            <thead>
                                <tr>
                                <tr>
                                    <th>INSTITUTION</th>
                                    <th>DESIGNATION</th>
                                    <th>AREA OF SPECIALIZATIONS</th>
                                    <th>SUBJECTS TAUGHT</th>
                                    <th>DATE</th>
                                </tr>
                                <tr>

                                    <!-- <th class="text-center"><?//php echo display('action') ?> <i class="text-danger"></i></th> -->
                                </tr>
                                </tr>
                            </thead>
                            <tbody id="add_exp_teaching">
                                <?php 
                            
                            foreach ($emp_exp as $key => $row) { 
                                $exp_teaching_data_array = json_decode($row->exp_teaching, true);
                                
                                // Check if the decoded data is an array
                                if (is_array($exp_teaching_data_array)) {
                                    foreach ($exp_teaching_data_array as $teachingExperience) { ?>
                                <tr>
                                    <td><?php echo $teachingExperience['institution']; ?>
                                    </td>
                                    <td><?php echo $teachingExperience['designation']; ?>
                                    </td>
                                    <td>
                                        <?php echo $teachingExperience['specialization']; ?></td>
                                    <td><?php echo $teachingExperience['subject']; ?></td>
                                    <td><?php echo $teachingExperience['date']; ?></td>
                                    <td>

                                    </td>
                                </tr>
                                <?php } }}?>
                            </tbody>
                        </table>
                        <h4>(b) Professional Experience</h4>
                        <table class="table table-bordered" id="request_table">
                            <thead>
                                <tr>
                                <tr>
                                    <th>EMPLOYER'S NAME</th>
                                    <th>DESIGNATION</th>
                                    <th>NUTURE OF DUTY</th>

                                    <th>FROM</th>
                                    <th>TO</th>
                                </tr>
                                <tr>

                                    <!-- <th class="text-center"><?//php echo display('action') ?> <i class="text-danger"></i></th> -->
                                </tr>
                                </tr>
                            </thead>
                            <tbody id="exp_professional">
                                <?php    foreach ($emp_exp as $key => $row) { 
                                $exp_professional_data_array = json_decode($row->exp_professional, true);
                                
                                // Check if the decoded data is an array
                                if (is_array($exp_professional_data_array)) {
                                    foreach ($exp_professional_data_array as $professionalExperience) { ?>
                                <tr>
                                    <td><?php echo $professionalExperience['institution']; ?>
                                    </td>
                                    <td><?php echo $professionalExperience['designation']; ?></td>
                                    <td><?php echo $professionalExperience['duty']; ?></td>
                                    <td><?php echo $professionalExperience['date_start']; ?></td>
                                    <td><?php echo $professionalExperience['date_end']; ?></td>
                                    <td>

                                    </td>
                                </tr>
                                <?php }}} ?>
                            </tbody>
                        </table>

                        <h4>3.2 RESEARCH/PROJECT/INVENTION/INNOVATION/DESIGNATION</h4>
                        <h4>(a) Brief Description (if any)</h4>
                        <table class="table table-bordered">
                            <tbody>
                                <?php    foreach ($emp_exp as $key => $row) { 
                                $exp_description_data = $row->exp_description ?>


                                <tr>
                                    <td><textarea name="brief_descriptions[]" class="form-control" rows="3"
                                            placeholder="" readonly><?php echo $exp_description_data; ?></textarea>
                                    </td>
                                </tr>
                                <?php } ?>
                            </tbody>
                        </table>

                        <h4>(b) Research/Project/Innovation/Design completed but not yet published or patented</h4>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                <tr>
                                    <th style="text-align:center">TOPIC</th>
                                    <th style="text-align:center">DATE</th>
                                </tr>

                                </tr>
                            </thead>
                            <tbody id="exp_research">
                                <?php    foreach ($emp_exp as $key => $row) { 
                                $exp_research_data_array = json_decode($row->exp_research, true);
                                
                                // Check if the decoded data is an array
                                if (is_array($exp_research_data_array)) {
                                    foreach ($exp_research_data_array as $researchProject) { ?>
                                <tr>
                                    <td><textarea name="research_titles[]" class="form-control" rows="1" placeholder=""
                                            readonly><?php echo $researchProject['topic']; ?></textarea></td>
                                    <td><?php echo $researchProject['date']; ?></td>

                                    <td>

                                    </td>
                                </tr>
                                <?php }}} ?>
                            </tbody>
                        </table>

                        <h4>(c) RECOOGNISED PUBLICATIONS/EXHIBITIONS/DESIGNS (Give details of books and articles,
                            stating
                            reference). List your publications under the following broad headings. State dates of
                            publications
                            very clearly. <br /><br />

                            (i) Dissertation or Thesis <br />

                            (ii) Books and Monographs <br />

                            (iii) Articles that have already appeared in learned journals<br />

                            (iv) Papers already accepted for publication<br />

                            (v) Exhibitions/Designed/Project</h4>
                        <table class="table table-bordered">
                            <tbody>
                                <?php    foreach ($emp_exp as $key => $row) { 
                                $recognized_publications_data = $row->recognized_publications ?>
                                <tr>
                                    <td><textarea name="recognised_publication" class="form-control" rows="3"
                                            placeholder=""
                                            readonly><?php echo $recognized_publications_data ?></textarea>
                                    </td>
                                </tr>
                                <?php } ?>
                            </tbody>
                        </table>

                        <h4>3.3 Unplublished papers read at Conference (with names of conferences and date(s))</h4>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                <tr>
                                    <th style="text-align:center">TITLE</th>
                                    <th style="text-align:center">WHERE READ</th>
                                    <th style="text-align:center">DATE</th>
                                </tr>

                                </tr>
                            </thead>
                            <tbody id="exp_research_unpublish">
                                <?php    foreach ($emp_exp as $key => $row) { 
                                $exp_research_unpublish_data_array = json_decode($row->exp_research_unpublish, true);
                                
                                // Check if the decoded data is an array
                                if (is_array($exp_research_unpublish_data_array)) {
                                    foreach ($exp_research_unpublish_data_array as $paper) { ?>
                                <tr>
                                    <td><textarea name="unpublished_titles[]" class="form-control" rows="1"
                                            placeholder="" readonly><?php echo $paper['topic']; ?></textarea></td>
                                    <td><textarea name="unpublished_details[]" class="form-control" rows="1"
                                            placeholder="" readonly><?php echo $paper['read']; ?></textarea></td>
                                    <td><input type="text" name="unpublished_date[]" class="form-control datepicker"
                                            value="<?php echo $paper['date']; ?>" readonly></td>
                                    <td>
                                        <!-- <button type="button" class="btn btn-info btn-sm"
                                            onclick="addRow('exp_research_unpublish')"><i class="fa fa-plus-square"
                                                aria-hidden="true"></i></button>
                                        <button type="button" class="btn btn-danger btn-sm" onclick="deleteRow(this)"><i
                                                class="fa fa-trash" aria-hidden="true"></i></button> -->
                                    </td>
                                </tr>
                                <?php } }}?>
                            </tbody>
                        </table>

                        <h4>3.4 Other activites within the institute</h4>
                        <table class="table table-bordered">
                            <?php    foreach ($emp_exp as $key => $row) { 
                                $exp_other_activities_data = $row->exp_other_activities ?>
                            <textarea name="exp_other_activities" class="form-control" placeholder="Maximum 500 words"
                                readonly><?php echo $exp_other_activities_data ?></textarea>
                            <?php } ?>
                        </table>
                        <h4>3.5 Other relevant activites outside normal institute work</h4>
                        <table class="table table-bordered">
                            <?php    foreach ($emp_exp as $key => $row) { 
                                $exp_other_activities_out_data = $row->exp_other_activities_out ?>
                            <textarea name="exp_other_activities_out" class="form-control"
                                placeholder="Maximum 500 words"
                                readonly><?php echo $exp_other_activities_out_data ?></textarea>
                            <?php }?>
                        </table>

                        <h4>3.9 (To be completed by the Head of Department)</h4>
                        <table class="table table-bordered">
                            <thead>
                                <colgroup>
                                    <col style="width: 40%;">
                                    <col style="width: 10%;">
                                    <col style="width: 10%;">
                                    <col style="width: 10%;">
                                    <col style="width: 10%;">
                                    <col style="width: 10%;">
                                </colgroup>
                                <tr>
                                    <th></th>
                                    <th colspan="4" style="border: none; text-align: center;">General Evaluation Grade
                                    </th>
                                </tr>
                                <tr class="text-center">
                                    <th></th>
                                    <th>Poor</th>
                                    <th>Fair</th>
                                    <th>Good</th>
                                    <th>Very Good</th>
                                    <th>Excellent</th>
                                    <th>Score</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                // Array of evaluation criteria
                                $criteria = [
                                    ['label' => '(a) Quality of Teaching', 'name' => 'quality_teaching', 'score' => $quality_teaching_score],
                                    ['label' => '(b) Current Research/Exhibition/Innovation/Design', 'name' => 'current_research', 'score' => $current_research_score],
                                    ['label' => '(c) Quality of Research/Exhibition/Innovation/Design', 'name' => 'quality_research', 'score' => $quality_research_score],
                                    ['label' => '(d) Quality of Publication/Exhibition/Innovation/Design', 'name' => 'quality_publication', 'score' => $quality_publication_score],
                                    ['label' => '(e) Other Departmental Responsibilities', 'name' => 'department_responsibilities', 'score' => $department_responsibilities_score],
                                    ['label' => '(f) Contribution to the Institute or the Country', 'name' => 'contribution', 'score' => $contribution_score],
                                    ['label' => '(g) Relationship with Colleagues', 'name' => 'relationship_colleagues', 'score' => $relationship_colleagues_score],
                                    ['label' => '(h) Acceptance of Responsibility', 'name' => 'acceptance_responsibility', 'score' => $acceptance_responsibility_score],
                                    ['label' => '(i) Management of Staff (if applicable)', 'name' => 'management_staff', 'score' => $management_staff_score],
                                    ['label' => '(j) Punctuality', 'name' => 'punctuality', 'score' => $punctuality_score],
                                    ['label' => '(k) Appearance', 'name' => 'appearance', 'score' => $appearance_score],
                                ];

                                // Loop through each criterion and generate the row
                                foreach ($criteria as $criterion) {
                                    echo '<tr>';
                                    echo '<td>' . $criterion['label'] . '</td>';
                                    for ($i = 1; $i <= 5; $i++) {
                                        $readonly = ($criterion['score'] != $i) ? 'readonly' : '';
                                        echo '<td class="text-center"><input type="radio" id="' . $criterion['name'] . '_' . $i . '" name="' . $criterion['name'] . '" class="' . $criterion['name'] . '" value="' . $i . '" ' . ($criterion['score'] == $i ? 'checked' : $readonly) . '></td>';
                                    }
                                    echo '<td><input type="number" id="' . $criterion['name'] . '_score" name="' . $criterion['name'] . '_score" class="form-control review-table assessment_d" aria-describedby="basic-addon1" value="' . $criterion['score'] . '"></td>';
                                    echo '</tr>';
                                }
                                ?>
                                <tr>
                                    <td></td>
                                    <td colspan="5">Total Score</td>
                                    <td><input class="fw-700" style="border:0px; width: 45px;"
                                            id="assesment_d_total_score" name="assesment_d_total_score"
                                            value="<?php echo $assesment_d_total_score;?>" readonly><b>%</b></td>
                                </tr>
                            </tbody>
                        </table>

                        <h4>General Remarks</h4>
                        <table class="table table-bordered">
                            <?php  foreach ($emp_exp as $key => $row) { ?>
                            <textarea name="exp_general_remarks" class="form-control"
                                readonly><?php echo $row->general_remarks ?></textarea>
                            <?php }?>
                        </table>
                        <?php  foreach ($emp_exp as $key => $row) { ?>
                        <h3>The officer has served under me from <input type="text" id="exp_serve_date_start"
                                name="exp_serve_date_start" class="form-control datepicker"
                                style="width:200px; display: inline-block;     height: 20px;"
                                value="<?php echo $row->exp_serve_date_start ?>" readonly> to <input type="text"
                                id="exp_serve_date_end" name="exp_serve_date_end" class="form-control datepicker"
                                style="width:200px; display: inline-block;     height: 20px;"
                                value="<?php echo $row->exp_serve_date_end ?>" readonly></h3>
                        <?php }?>

                        <table class="table ">
                            <?php  foreach ($emp_academic as $key => $row) { 
            ?>

                            <thead>
                                <tr>
                                    <th style="width:50%">Signature:<input type="text" id="exp_signature"
                                            name="exp_signature" class="form-control"
                                            style="width:200px; display: inline-block; height: 30px;"
                                            value="<?php echo $row->exp_signature ?>" readonly></th>
                                    <th>Date:<input type="text" id="exp_signature_start" name="exp_signature_date"
                                            class="form-control pl-5 datepicker"
                                            style="width:200px; display: inline-block; height: 30px; padding-left:20px"
                                            value="<?php echo $row->exp_signature_date ?>" readonly>
                                    </th>
                                </tr>
                            </thead>

                        </table>

                        <?php }?>

                    </div>

                    <div class="row" id="tbl">
                        <div class="col-xs-12">
                            <p class="fs-17 mb-20 fs-i">Please provide a critical assessment of the performance of the
                                employee
                                within the review period using the following rating scale. Provide examples where
                                applicable.
                                Please use a separate sheet if .
                            </p>
                        </div>
                        <table class="table table-bordered w-65">
                            <thead>
                                <tr>
                                    <th>P</th>
                                    <th>FA</th>
                                    <th>G</th>
                                    <th>VG</th>
                                    <th>E</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>Poor</td>
                                    <td>Fair</td>
                                    <td>Good</td>
                                    <td>Very Good</td>
                                    <td>Excellent</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                    <div class="row" id="annual_performance">
                        <h3 class="mb-20">B. JOB PERFORMANCE EVALUATION (To be completed by reporting officer)</h3>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>Criteria</th>
                                    <th>P <br> (1)</th>
                                    <th>FA <br> (2)</th>
                                    <th>G <br> (3)</th>
                                    <th>VG <br> (4)</th>
                                    <th>E <br> (5)</th>
                                    <th>Scores Achieve</th>
                                    <th>Comments </th>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- Row 1.1: Quality -->
                                <tr>
                                    <td><b>QUALITY</b> Degree to which employee meets established standard</td>
                                    <td class="text-center">
                                        <?php if($quality == 1){echo '1';}?>
                                        <p>Poor, generally not acceptable</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($quality == 2){echo '2';}?>
                                        <p>Below standard, frequent errors</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($quality == 3){echo '3';}?>
                                        <p>Only normal amount of errors; Quality acceptable</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($quality == 4){echo '4';}?>
                                        <p>Consistently good - Above average quality</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($quality == 5){echo '5';}?>
                                        <p>High quality. Meets all requirements.</p>
                                    </td>
                                    <td><?php echo $quality_score;?></td>
                                    <td><?php echo $quality_comments;?></td>
                                </tr>

                                <!-- Row 1.2: Work Output -->
                                <tr>
                                    <td><b>WORK OUTPUT</b> Amount of work regularly produced</td>
                                    <td class="text-center">
                                        <?php if($work_output == 1){echo '1';}?>
                                        <p>Very low output</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($work_output == 2){echo '2';}?>
                                        <p>Fair, Below group average</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($work_output == 3){echo '3';}?>
                                        <p>Normal volume, maintains group average</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($work_output == 4){echo '4';}?>
                                        <p>Good volume, above average</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($work_output == 5){echo '5';}?>
                                        <p>Gets a great deal done within a set time frame</p>
                                    </td>
                                    <td><?php echo $work_output_score;?></td>
                                    <td><?php echo $work_output_comments;?></td>
                                </tr>

                                <!-- Row 1.3: Dependability -->
                                <tr>
                                    <td><b>DEPENDABILITY</b> Ability to do job well with minimum supervision</td>
                                    <td class="text-center">
                                        <?php if($dependability == 1){echo '1';}?>
                                        <p>Requires constant supervision</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($dependability == 2){echo '2';}?>
                                        <p>Requires close supervision</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($dependability == 3){echo '3';}?>
                                        <p>Requires some supervision</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($dependability == 4){echo '4';}?>
                                        <p>Requires little supervision</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($dependability == 5){echo '5';}?>
                                        <p>Requires minimum supervision</p>
                                    </td>
                                    <td><?php echo $dependability_score;?></td>
                                    <td><?php echo $dependability_comments;?></td>
                                </tr>

                                <!-- Row 1.4: Job Attitude -->
                                <tr>
                                    <td><b>JOB ATTITUDE</b> The real enthusiasm with which he carries out his job</td>
                                    <td class="text-center">
                                        <?php if($job_attitude == 1){echo '1';}?>
                                        <p>Nonchalant</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($job_attitude == 2){echo '2';}?>
                                        <p>Regularly reminded of his job</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($job_attitude == 3){echo '3';}?>
                                        <p>Shows enthusiasm on his job</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($job_attitude == 4){echo '4';}?>
                                        <p>Dedicated to the job</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($job_attitude == 5){echo '5';}?>
                                        <p>Highly dedicated, committed to his job</p>
                                    </td>
                                    <td><?php echo $job_attitude_score;?></td>
                                    <td><?php echo $job_attitude_comments;?></td>
                                </tr>

                                <!-- Row 1.5: Adaptability -->
                                <tr>
                                    <td><b>ADAPTABILITY</b> Ability to adjust quickly to job change</td>
                                    <td class="text-center">
                                        <?php if($adaptability == 1){echo '1';}?>
                                        <p>Does not adapt easily</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($adaptability == 2){echo '2';}?>
                                        <p>Adjusts to new situations fairly easily</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($adaptability == 3){echo '3';}?>
                                        <p>Can be relied upon to adjust easily to new situations most of the time</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($adaptability == 4){echo '4';}?>
                                        <p>Highly adaptable to all situations</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($adaptability == 5){echo '5';}?>
                                        <p>Highly adaptable to all situations</p>
                                    </td>
                                    <td><?php echo $adaptability_score;?></td>
                                    <td><?php echo $adaptability_comments;?></td>
                                </tr>

                                <!-- Row 1.6: Job Knowledge -->
                                <tr>
                                    <td><b>JOB KNOWLEDGE H</b> Possession of information & understanding of job
                                        requirements
                                    </td>
                                    <td class="text-center">
                                        <?php if($job_knowledge == 1){echo '1';}?>
                                        <p>Has acquired no skills to do selected work</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($job_knowledge == 2){echo '2';}?>
                                        <p>Has acquired enough skill to do selected work</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($job_knowledge == 3){echo '3';}?>
                                        <p>Has acquired enough skill to do just enough work</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($job_knowledge == 4){echo '4';}?>
                                        <p>Has acquired enough skill to do most work</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($job_knowledge == 5){echo '5';}?>
                                        <p>Has acquired all necessary skill to do all work</p>
                                    </td>
                                    <td><?php echo $job_knowledge_score;?></td>
                                    <td><?php echo $job_knowledge_comments;?></td>
                                </tr>
                                <!-- Row 1.7: Attendance -->
                                <tr>
                                    <td><b>ATTENDANCE</b> Faithfulness in coming to work daily and conforming to work
                                    </td>
                                    <td class="text-center">
                                        <?php if($attendance == 1){echo '1';}?>
                                        <p>Often absent without valid excuse and/or frequently late to work</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($attendance == 2){echo '2';}?>
                                        <p>Occasionally lax in attendance and in timekeeping</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($attendance == 3){echo '3';}?>
                                        <p>Usually present and on time</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($attendance == 4){echo '4';}?>
                                        <p>Regular and prompt, willing to work extra hours in the interest of the job
                                        </p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($attendance == 5){echo '5';}?>
                                        <p>Inspiring, ready to help, an excellent team builder</p>
                                    </td>
                                    <td><?php echo $attendance_score;?></td>
                                    <td><?php echo $attendance_comments;?></td>
                                </tr>

                                <!-- Row 1.8: Physical Fitness -->
                                <tr>
                                    <td><b>PHYSICAL FITNESS</b> Endurance, Energy, Strength, Handicap or Disabilities,
                                        Frequency of sick leave</td>
                                    <td class="text-center">
                                        <?php if($physical_fitness == 1){echo '1';}?>
                                        <p>Discourteous, antagonistic</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($physical_fitness == 2){echo '2';}?>
                                        <p>Sometimes tactless</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($physical_fitness == 3){echo '3';}?>
                                        <p>Meets physical and energy job requirements</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($physical_fitness == 4){echo '4';}?>
                                        <p>Energetic; seldom tires</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($physical_fitness == 5){echo '5';}?>
                                        <p>Excellent health; no fatigue</p>
                                    </td>
                                    <td><?php echo $physical_fitness_score;?></td>
                                    <td><?php echo $physical_fitness_comments;?></td>
                                </tr>

                                <!-- Row 1.9: Cooperativeness -->
                                <tr>
                                    <td><b>COOPERATIVENESS</b> Attitude towards Institute's fellow employees and the
                                        public
                                    </td>
                                    <td class="text-center">
                                        <?php if($cooperativeness == 1){echo '1';}?>
                                        <p>Unable to learn and difficult to teach, forgetful</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($cooperativeness == 2){echo '2';}?>
                                        <p>Slow to learn and to use past experience</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($cooperativeness == 3){echo '3';}?>
                                        <p>Agreeable and pleasant</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($cooperativeness == 4){echo '4';}?>
                                        <p>Always polite and willing to help</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($cooperativeness == 5){echo '5';}?>
                                        <p>Inspiring to others, courteous, and very pleasant</p>
                                    </td>
                                    <td><?php echo $cooperativeness_score;?></td>
                                    <td><?php echo $cooperativeness_comments;?></td>
                                </tr>

                                <!-- Row 1.10: Learning Capacity -->
                                <tr>
                                    <td><b>LEARNING CAPACITY</b> Ability to learn new job procedures, instructions,
                                        speed,
                                        retention of learning, profits from past mistakes</td>
                                    <td class="text-center">
                                        <?php if($learning_capacity == 1){echo '1';}?>
                                        <p>Unable to learn and difficult to teach, forgetful</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($learning_capacity == 2){echo '2';}?>
                                        <p>Slow to learn and to use past experience</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($learning_capacity == 3){echo '3';}?>
                                        <p>Willing and able to learn under normal situations</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($learning_capacity == 4){echo '4';}?>
                                        <p>Self-motivated to learn and use past knowledge and experience</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($learning_capacity == 5){echo '5';}?>
                                        <p>Highly intelligent, skilled, fast to learn</p>
                                    </td>
                                    <td><?php echo $learning_capacity_score;?></td>
                                    <td><?php echo $learning_capacity_comments;?></td>
                                </tr>

                            </tbody>
                            <tfoot>
                                <tr>
                                    <td colspan="6" class="text-right"><strong>Total Score:</strong></td>
                                    <td id="assesment_c_total_score">
                                        <b><?php echo $assesment_c_total_score ? $assesment_c_total_score:''?>%</b>
                                    </td>
                                    <td></td>
                                </tr>
                            </tfoot>
                        </table>
                    </div>

                    <div class="row" id="academic_and_non_academic_1">
                        <h3 class="mb-20">A: ASSESSMENT OF JOB PERFORMANCE</h3>
                        <table class="table table-bordered" id="request_table">
                            <thead>
                                <tr>
                                <tr>
                                    <th>RESPONSIBILITIES: TASK AND TARGET</th>
                                    <th>GENERAL ASSESSMENT</th>
                                </tr>
                                <tr>
                                    <td><b>Briefly List the major responsibilities, in order of importance for each
                                            responsibility. Note specific goals set during period under review<b></td>
                                    <td><b>Rating the employee on each task and target by commenting the grade that most
                                            accurately describe your rating.<br><br> Rating Criteria:POOR, FAIR, GOOD,
                                            VERY
                                            GOOD, EXCELLENT</b>
                                    </td>
                                    <!-- <th class="text-center"><?//php echo display('action') ?> <i class="text-danger"></i></th> -->
                                </tr>


                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach ($data_key_goals as $key => $row) { 
                               $key_goal_data_array = json_decode($row->key_goals, true);
                                
                                // Check if the decoded data is an array
                                if (is_array($key_goal_data_array)) {
                                    foreach ($key_goal_data_array as $key_goal_data) { ?>
                                <tr>
                                    <td><textarea class="form-control" rows="3"
                                            readonly><?php echo htmlspecialchars($key_goal_data['key_goals']);?></textarea>
                                    </td>
                                    <td><?php if ($key_goal_data['rating'] == 1){echo "POOR"; } 
                                    elseif ($key_goal_data['rating'] == 2){ echo "FAIR";}
                                    elseif ($key_goal_data['rating'] == 3){ echo "GOOD";} 
                                    elseif ($key_goal_data['rating'] == 4){ echo "VERY GOOD";} 
                                    elseif ($key_goal_data['rating'] == 5){ echo "EXCELLENT";}
                                    else{ echo "";};?></td>
                                    <td><?php echo htmlspecialchars($key_goal_data['key_goals_score']);?></td>

                                </tr>

                                <?php }}}?>

                            </tbody>
                            <tfoot>
                                <tr>
                                    <td colspan="2" class="text-right"><strong>Total Score:</strong></td>
                                    <td><b><?php echo $key_total_goals_score?$key_total_goals_score:0 ?>%</b></td>

                                </tr>
                            </tfoot>
                        </table>



                    </div>

                    <div class="row" id="management_staff">
                        <h3 class="mb-20">PART 4 PERFORMANCE CRITERIA</h3>
                        <h3>(To be completed by the Reporting Officer) Please tick the column that most accurately
                            describe your
                            rating</h3>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>4.1</th>
                                    <th>LEADERSHIP/PERSONNEL BUILDING</th>
                                    <th>P <br> (1)</th>
                                    <th>FA <br> (2)</th>
                                    <th>G <br> (3)</th>
                                    <th>VG <br> (4)</th>
                                    <th>E <br> (5)</th>
                                    <th>Scores Achieve</th>
                                    <th>Comments </th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                
                               
                                
                                // Leadership criteria
                                $leadership_criteria = [
                                    [
                                        'label' => 'Please consider the following factors:<br /><br />Does he develop subordinates, build team morale, communicate, motivate staff, command respect and inspire; has he drive and determination; is he sympathetic yet firm and decisive?',
                                        'name' => 'leadership',
                                        'score' => $leadership_score,
                                        'comments_name' => 'leadership_comments',
                                        'comments_value' => $leadership_comments
                                    ],
                                ];

                                foreach ($leadership_criteria as $criterion) {
                                    echo '<tr>';
                                    echo '<td></td>';
                                    echo '<td>' . $criterion['label'] . '</td>';
                                    for ($i = 1; $i <= 5; $i++) {
                                        echo '<td class="text-center"><input type="radio" id="' . $criterion['name'] . '_' . $i . '" name="' . $criterion['name'] . '" class="' . $criterion['name'] . '" value="' . $i . '" ' . ($criterion['score'] == $i ? 'checked' : '') . ' readonly></td>';
                                    }
                                    echo '<td><input type="number" id="' . $criterion['name'] . '_score" name="' . $criterion['name'] . '_score" class="form-control review-table assessment_b" aria-describedby="basic-addon1" value="' . $criterion['score'] . '"></td>';
                                    echo '<td><input type="text" name="' . $criterion['comments_name'] . '" class="form-control review-table" aria-describedby="basic-addon1" value="' . $criterion['comments_value'] . '" readonly></td>';
                                    echo '</tr>';
                                }
                                ?>
                                <tr>
                                    <td></td>
                                    <td>Examples of "DEMONSTRATED LEADERSHIP/PERSONNEL BUILDING" that describe your
                                        ratings:</td>
                                    <td colspan="7">
                                        <textarea id="leadership_build_p" class="form-control leadership_build"
                                            style="border:1px solid #e4e5e7" name="leadership_build"
                                            readonly><?php echo $leadership1 ?></textarea>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>4.2</th>
                                    <th>DECISION MAKING CAPABILITY</th>
                                    <th>P <br> (1)</th>
                                    <th>FA <br> (2)</th>
                                    <th>G <br> (3)</th>
                                    <th>VG <br> (4)</th>
                                    <th>E <br> (5)</th>
                                    <th>Scores Achieve</th>
                                    <th>Comments </th>
                                </tr>
                            </thead>
                            <tbody>

                                <tr>
                                    <td></td>
                                    <td>Please consider the following factors: <br /><br />
                                        Has the ability to specify aims and objectives correctly, analyse issues,
                                        courageously
                                        make correct decisions and follow through implementation
                                    </td>
                                    <?php for ($i = 1; $i <= 5; $i++) { ?>
                                    <td class="text-center">
                                        <input type="radio" id="decision_making_cap1_<?php echo $i; ?>"
                                            class="decision_making_cap1 mt-5" name="decision_making_cap1"
                                            value="<?php echo $i; ?>"
                                            <?php echo ($decision_making_cap1 == $i) ? 'checked' : 'readonly'; ?>>
                                    </td>
                                    <?php } ?>
                                    <td><input type="number" id="decision_making_cap1_score"
                                            name="decision_making_cap1_score"
                                            class="form-control review-table assessment_b"
                                            aria-describedby="basic-addon1"
                                            value="<?php echo $decision_making_cap1_score; ?>"></td>
                                    <td><input type="text" name="decision_making_cap1_comments"
                                            class="form-control review-table" aria-describedby="basic-addon1"
                                            value="<?php echo $decision_making_cap1_comments; ?>" readonly></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>Does he accept responsibility for his decisions?</td>
                                    <?php for ($i = 1; $i <= 5; $i++) { ?>
                                    <td class="text-center">
                                        <input type="radio" id="decision_making_cap2_<?php echo $i; ?>"
                                            class="decision_making_cap2 mt-5" name="decision_making_cap2"
                                            value="<?php echo $i; ?>"
                                            <?php echo ($decision_making_cap2 == $i) ? 'checked' : 'readonly'; ?>>
                                    </td>
                                    <?php } ?>
                                    <td><input type="number" id="decision_making_cap2_score"
                                            name="decision_making_cap2_score"
                                            class="form-control review-table assessment_b"
                                            aria-describedby="basic-addon1"
                                            value="<?php echo $decision_making_cap2_score; ?>"></td>
                                    <td><input type="text" name="decision_making_cap2_comments"
                                            class="form-control review-table" aria-describedby="basic-addon1"
                                            value="<?php echo $decision_making_cap2_comments; ?> " readonly></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>Does he encourage subordinates to take decisions?</td>
                                    <?php for ($i = 1; $i <= 5; $i++) { ?>
                                    <td class="text-center">
                                        <input type="radio" id="decision_making_cap3_<?php echo $i; ?>"
                                            class="decision_making_cap3 mt-5" name="decision_making_cap3"
                                            value="<?php echo $i; ?>"
                                            <?php echo ($decision_making_cap3 == $i) ? 'checked' : 'readonly'; ?>>
                                    </td>
                                    <?php } ?>
                                    <td><input type="number" id="decision_making_cap3_score"
                                            name="decision_making_cap3_score"
                                            class="form-control review-table assessment_b"
                                            aria-describedby="basic-addon1"
                                            value="<?php echo $decision_making_cap3_score; ?>"></td>
                                    <td><input type="text" name="decision_making_cap3_comments"
                                            class="form-control review-table" aria-describedby="basic-addon1"
                                            value="<?php echo $decision_making_cap3_comments; ?>" readonly></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>Examples of "DECISION MAKING CAPABILITY" that describe your ratings:</td>
                                    <td colspan="7">
                                        <textarea id="decision_making_cap4_p" class="form-control decision_making_cap4"
                                            style="border:1px solid #e4e5e7" name="decision_making_cap4"
                                            readonly><?php echo $decision_making_cap4; ?></textarea>
                                    </td>
                                </tr>
                            </tbody>

                        </table>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>4.3</th>
                                    <th>MANAGEMENT COMPETENCE</th>
                                    <th>P <br> (1)</th>
                                    <th>FA <br> (2)</th>
                                    <th>G <br> (3)</th>
                                    <th>VG <br> (4)</th>
                                    <th>E <br> (5)</th>
                                    <th>Scores Achieve</th>
                                    <th>Comments </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td></td>
                                    <td>Please consider the following factors: <br /><br />
                                        Does he analyse problems competently, set realistic goals, establish priorities
                                        correctly?
                                    </td>
                                    <?php for ($i = 1; $i <= 5; $i++) { ?>
                                    <td class="text-center">
                                        <input type="radio" id="management_com1_<?php echo $i; ?>"
                                            class="management_com1 mt-5" name="management_com1"
                                            value="<?php echo $i; ?>"
                                            <?php echo ($management_com1 == $i) ? 'checked' : 'readonly'; ?>>
                                    </td>
                                    <?php } ?>
                                    <td><input type="number" id="management_com1_score" name="management_com1_score"
                                            class="form-control review-table assessment_b"
                                            aria-describedby="basic-addon1"
                                            value="<?php echo $management_com1_score; ?>"></td>
                                    <td><input type="text" name="management_com1_comments"
                                            class="form-control review-table" aria-describedby="basic-addon1"
                                            value="<?php echo $management_com1_comments; ?>" readonly></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>How does he organise resources, evaluate results?</td>
                                    <?php for ($i = 1; $i <= 5; $i++) { ?>
                                    <td class="text-center">
                                        <input type="radio" id="management_com2_<?php echo $i; ?>"
                                            class="management_com2 mt-5" name="management_com2"
                                            value="<?php echo $i; ?>"
                                            <?php echo ($management_com2 == $i) ? 'checked' : 'readonly'; ?>>
                                    </td>
                                    <?php } ?>
                                    <td><input type="number" id="management_com2_score" name="management_com2_score"
                                            class="form-control review-table assessment_b"
                                            aria-describedby="basic-addon1"
                                            value="<?php echo $management_com2_score; ?>"></td>
                                    <td><input type="text" name="management_com2_comments"
                                            class="form-control review-table" aria-describedby="basic-addon1"
                                            value="<?php echo $management_com2_comments; ?> " readonly></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>Is he innovative and creative?</td>
                                    <?php for ($i = 1; $i <= 5; $i++) { ?>
                                    <td class="text-center">
                                        <input type="radio" id="management_com3_<?php echo $i; ?>"
                                            class="management_com3 mt-5" name="management_com3"
                                            value="<?php echo $i; ?>"
                                            <?php echo ($management_com3 == $i) ? 'checked' : 'readonly'; ?>>
                                    </td>
                                    <?php } ?>
                                    <td><input type="number" id="management_com3_score" name="management_com3_score"
                                            class="form-control review-table assessment_b"
                                            aria-describedby="basic-addon1"
                                            value="<?php echo $management_com3_score; ?>"></td>
                                    <td><input type="text" name="management_com3_comments"
                                            class="form-control review-table" aria-describedby="basic-addon1"
                                            value="<?php echo $management_com3_comments; ?>" readonly></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>Examples of "DEMONSTRATED MANAGEMENT COMPETENCE" that describe your ratings:
                                    </td>
                                    <td colspan="7">
                                        <textarea id="management_com4_p" class="form-control management_com4"
                                            style="border:1px solid #e4e5e7" name="management_com4"
                                            readonly><?php echo $management_com4; ?></textarea>
                                    </td>
                                </tr>
                            </tbody>
                        </table>

                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>4.4</th>
                                    <th>FUNCTIONAL EFFECTIVENESS</th>
                                    <th>P <br> (1)</th>
                                    <th>FA <br> (2)</th>
                                    <th>G <br> (3)</th>
                                    <th>VG <br> (4)</th>
                                    <th>E <br> (5)</th>
                                    <th>Scores Achieve</th>
                                    <th>Comments </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td></td>
                                    <td>Please consider the following factors: <br /><br />
                                        Does he meet deadlines, initiate solutions, achieve customer satisfaction,
                                        generate
                                        profit, effectively manage budget?
                                    </td>
                                    <?php for ($i = 1; $i <= 5; $i++) { ?>
                                    <td class="text-center">
                                        <input type="radio" id="functional1_<?php echo $i; ?>" class="functional1 mt-5"
                                            name="functional1" value="<?php echo $i; ?>"
                                            <?php echo ($functional1 == $i) ? 'checked' : 'readonly'; ?>>
                                    </td>
                                    <?php } ?>
                                    <td><input type="number" id="functional1_score" name="functional1_score"
                                            class="form-control review-table assessment_b"
                                            aria-describedby="basic-addon1" value="<?php echo $functional1_score; ?>">
                                    </td>
                                    <td><input type="text" name="functional1_comments" class="form-control review-table"
                                            aria-describedby="basic-addon1" value="<?php echo $functional1_comments; ?>"
                                            readonly></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>Does he achieve balance between job quality and quantity?</td>
                                    <?php for ($i = 1; $i <= 5; $i++) { ?>
                                    <td class="text-center">
                                        <input type="radio" id="functional2_<?php echo $i; ?>" class="functional2 mt-5"
                                            name="functional2" value="<?php echo $i; ?>"
                                            <?php echo ($functional2 == $i) ? 'checked' : 'readonly'; ?>>
                                    </td>
                                    <?php } ?>
                                    <td><input type="number" id="functional2_score" name="functional2_score"
                                            class="form-control review-table assessment_b"
                                            aria-describedby="basic-addon1" value="<?php echo $functional2_score; ?>">
                                    </td>
                                    <td><input type="text" name="functional2_comments" class="form-control review-table"
                                            aria-describedby="basic-addon1"
                                            value="<?php echo $functional2_comments; ?> " readonly></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>Is he efficient (input/output on time basis)?</td>
                                    <?php for ($i = 1; $i <= 5; $i++) { ?>
                                    <td class="text-center">
                                        <input type="radio" id="functional3_<?php echo $i; ?>" class="functional3 mt-5"
                                            name="functional3" value="<?php echo $i; ?>"
                                            <?php echo ($functional3 == $i) ? 'checked' : 'readonly'; ?>>
                                    </td>
                                    <?php } ?>
                                    <td><input type="number" id="functional3_score" name="functional3_score"
                                            class="form-control review-table assessment_b"
                                            aria-describedby="basic-addon1" value="<?php echo $functional3_score; ?>">
                                    </td>
                                    <td><input type="text" name="functional3_comments" class="form-control review-table"
                                            aria-describedby="basic-addon1" value="<?php echo $functional3_comments; ?>"
                                            readonly></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>Examples of "DEMONSTRATED FUNCTIONAL COMPETENCE" that describe your ratings:
                                    </td>
                                    <td colspan="7">
                                        <textarea id="functional4_p" class="form-control functional4"
                                            style="border:1px solid #e4e5e7" name="functional4"
                                            readonly><?php echo $functional4; ?></textarea>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                    <div class="row" id="tb">
                        <div class="col-xs-12">
                            <p class="fs-17 mb-20 fs-i">Please provide a critical assessment of the performance of the
                                employee
                                within the review period using the following rating scale. Provide examples where
                                applicable.

                            </p>
                        </div>
                        <table class="table table-bordered w-65">
                            <thead>
                                <tr>
                                    <th>P</th>
                                    <th>FA</th>
                                    <th>G</th>
                                    <th>VG</th>
                                    <th>E</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>Poor</td>
                                    <td>Fair</td>
                                    <td>Good</td>
                                    <td>Very Good</td>
                                    <td>Excellent</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                    <div class="row" id="academic_and_non_academic_2">
                        <h3 class="mb-20">PART 4: PERFORMANCE CRITERIA (to be comleted by reporting officer) <br> (Tick
                            the
                            appropriate column that best describes the officers rating)</h3>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>Criteria</th>
                                    <th>P <br> (1)</th>
                                    <th>FA <br> (2)</th>
                                    <th>G <br> (3)</th>
                                    <th>VG <br> (4)</th>
                                    <th>E <br> (5)</th>
                                    <th>Scores Achieve</th>
                                    <th>Comments </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td><b>JOB KNOWLEDGE</b> Posession of information , and understanding of job
                                        requirements
                                    </td>
                                    <td class="text-center"><?php if($demonstrated == 1){echo '1';}?><p>Has acquied no
                                            skill and can do little work</p>
                                    </td>
                                    <td class="text-center"><?php if($demonstrated == 2){echo '2';}?><p>Has acquied
                                            enough skill to do selected work</p>
                                    </td>
                                    <td class="text-center"><?php if($demonstrated == 3){echo '3';}?><p>Has acquied
                                            enough skill to do just enough work</p>
                                    </td>
                                    <td class="text-center"><?php if($demonstrated == 4){echo '4';}?><p>Has acquied
                                            enough skill to do most work required</p>
                                    </td>
                                    <td class="text-center"><?php if($demonstrated == 5){echo '5';}?><p>Has acquied
                                            all necessary skill to do all work required</p>
                                    </td>
                                    <td><?php echo $demonstrated_score;?></td>
                                    <!-- <td><?php echo $demonstrated_comments;?></td> -->
                                </tr>
                                <tr>
                                    <td><b>Oranization </b>Effectiveness in controlling and completing tasks according
                                        to priority</td>
                                    <td class="text-center"><?php if($timeliness == 1){echo '1';}?><p>Unorganized; often
                                            confused and unable to identify priorities</p>
                                    </td>
                                    <td class="text-center"><?php if($timeliness == 2){echo '2';}?><p>Some times shows
                                            evidence of being in control of situations data and resources.</p>
                                    </td>
                                    <td class="text-center"><?php if($timeliness == 3){echo '3';}?><p>Show ability to
                                            plan and control activities according to priority</p>
                                    </td>
                                    <td class="text-center"><?php if($timeliness == 4){echo '4';}?><p>Effective in
                                            identifying most priority areas and information</p>
                                    </td>
                                    <td class="text-center"><?php if($timeliness == 5){echo '5';}?><p>Always very
                                            effective in ordering his priorities and outstanding in ability to use time
                                            and resources</td>
                                    <td><?php echo $timeliness_score;?></td>
                                    <!-- <td><?php echo $timeliness_score_commnets;?></td> -->
                                </tr>
                                <tr>
                                    <td><b>Job Skills</b> Proficiency in major job related skills e.g record-keeping,
                                        typing, short hand, transcription etc</td>
                                    <td class="text-center"><?php if($impact == 1){echo '1';}?><p>Lack the necessary
                                            skills needed for the job</p>
                                    </td>
                                    <td class="text-center"><?php if($impact == 2){echo '2';}?><p>Has some skills needed
                                            for efficient performance of the job</p>
                                    </td>
                                    <td class="text-center"><?php if($impact == 3){echo '3';}?><p>Shows enough
                                            proficiency in the skill needed for the job</p>
                                    </td>
                                    <td class="text-center"><?php if($impact == 4){echo '4';}?><p>Very proficient in he
                                            skills needed for the job</p>
                                    </td>
                                    <td class="text-center"><?php if($impact == 5){echo '5';}?><p>outstandingly
                                            proficient in all the skills needed for the job</p>
                                    </td>
                                    <td><?php echo $impact_score;?></td>
                                    <!-- <td><?php echo $impact_score_commnets;?></td> -->
                                </tr>
                                <tr>
                                    <td><b>Initiative</b> Ability to take independent actions as required by the job,
                                        self-motivating</td>
                                    <td class="text-center"><?php if($overall == 1){echo '1';}?><p>Does not work well
                                            even under guidance</p>
                                    </td>
                                    <td class="text-center"><?php if($overall == 2){echo '2';}?><p>Only works well under
                                            guidance</p>
                                    </td>
                                    <td class="text-center"><?php if($overall == 3){echo '3';}?><p>Shows satisfactory
                                            initiative and acceptance of responsibility</p>
                                    </td>
                                    <td class="text-center"><?php if($overall == 4){echo '4';}?><p>Demostrate high
                                            degree of initiative and acceptance of responsibility</p>
                                    </td>
                                    <td class="text-center"><?php if($overall == 5){echo '5';}?><p>Always shows
                                            outstanding initiative and high degree of acceptance of responsibility
                                            self-motivating</p>
                                    </td>
                                    <td><?php echo $overall_score;?></td>
                                    <!-- <td><?php echo $overall_score_commnets;?></td> -->
                                </tr>
                                <tr>
                                    <td><b>Leadership</b> Skills in supervising, coaching and develop others</td>
                                    <td class="text-center"><?php if($interpersonal == 1){echo '1';}?><p>frustrate
                                            subordinate, lacks drive and initiative</p>
                                    </td>
                                    <td class="text-center"><?php if($interpersonal == 2){echo '2';}?><p>Shows
                                            concessional intiative, control and drive</p>
                                    </td>
                                    <td class="text-center"><?php if($interpersonal == 3){echo '3';}?><p>Demostrate
                                            enough initiative, control and drive</p>
                                    </td>
                                    <td class="text-center"><?php if($interpersonal == 4){echo '4';}?><p>Has a high
                                            degree of initiative, control and drive</p>
                                    </td>
                                    <td class="text-center"><?php if($interpersonal == 5){echo '5';}?><p>Has a high
                                            degree of initiative, control and drive </td>
                                    <td><?php echo $interpersonal_score;?></td>
                                    <td><?php echo $interpersonal_commnets;?></td>
                                </tr>
                                <tr>
                                    <td><b>Work Relationship</b> Effectiveness in working with other employees to
                                        accomplish objectives</td>
                                    <td class="text-center"><?php if($work_relationship == 1){echo '1';}?><p>Very
                                            distant and
                                            aloof usually antagonistic and uncooperative</p>
                                    </td>
                                    <td class="text-center"><?php if($work_relationship == 2){echo '2';}?><p>Shows
                                            concessional
                                            initiative, control and drive</p>
                                    </td>
                                    <td class="text-center"><?php if($work_relationship == 3){echo '3';}?><p>One of the
                                            team
                                            warm, cooperative and sociable</p>
                                    </td>
                                    <td class="text-center"><?php if($work_relationship == 4){echo '4';}?><p>Always
                                            friendly
                                            and cooperative. A team man tactful</p>
                                    </td>
                                    <td class="text-center"><?php if($work_relationship == 5){echo '5';}?><p>Inspiring
                                            reafy
                                            to help an excellent team builder</p>
                                    </td>
                                    <td><?php echo $work_relationship_score;?></td>
                                    <td><?php echo $$work_relationship_commnets;?></td>
                                </tr>
                                <tr>
                                    <td><b>Reliability</b> Flexibility to commit experience and times the job demand
                                        punctually and regularity</td>
                                    <td class="text-center"><?php if($communication == 1){echo '1';}?><p>Can hardly be
                                            depended upon to perform outside routine situation</p>
                                    </td>
                                    <td class="text-center"><?php if($communication == 2){echo '2';}?><p>Just able to
                                            perform under pressure</p>
                                    </td>
                                    <td class="text-center"><?php if($communication == 3){echo '3';}?><p>Does perform
                                            well under pressure and in change circumstances</p>
                                    </td>
                                    <td class="text-center"><?php if($communication == 4){echo '4';}?><p>Perform very
                                            well in all situations, even under pressure</p>
                                    </td>
                                    <td class="text-center"><?php if($communication == 5){echo '5';}?><p>Can be relied
                                            upon for outstanding performance in all situations</p>
                                    </td>
                                    <td><?php echo $communication_score;?></td>
                                    <td><?php echo $communication_commnets;?></td>
                                </tr>
                                <tr>
                                    <td><b>Communication Skills</b> Ability to present ideas and information concisely
                                        and effectively, orally in writing, ability to listen to others and understand
                                        their views</td>
                                    <td class="text-center"><?php if($contributing == 1){echo '1';}?><p>Unable to
                                            express thoughts, lack organization. A poor listener unable to understand
                                            the views of others</p>
                                    </td>
                                    <td class="text-center"><?php if($contributing == 2){echo '2';}?><p>Thoughts express
                                            after guidance, required considerable vetting a fire listener, just able to
                                            understand views of others</p>
                                    </td>
                                    <td class="text-center"><?php if($contributing == 3){echo '3';}?><p>Usually
                                            organizes and expresses thoughts clearly and concisely in speech and
                                            writing. A good listener, recognizes others views</p>
                                    </td>
                                    <td class="text-center"><?php if($contributing == 4){echo '4';}?><p>Consistently
                                            able to express ideas clearly andconcisely in speech and in writing listen
                                            to and appreciate others view point</p>
                                    </td>
                                    <td class="text-center"><?php if($contributing == 5){echo '5';}?><p>Has
                                            outstanding ability to communicate ideas to others in speech and in writing.
                                            Excellent listener, sympathetic to others viw point</p>
                                    </td>
                                    <td><input type="number" id="contributing_score" name="contributing_score"
                                            class="form-control review-table assessment_b"
                                            aria-describedby="basic-addon1" value="0"></td>
                                    <td><input type="text" name="contributing_commnets"
                                            class="form-control review-table" aria-describedby="basic-addon1"></td>
                                </tr>

                                <tr>
                                    <td><b>Problem Solving</b> Possession of Analytical and conceptual skills,
                                        creativity, ability to identify new opportunities</td>
                                    <td class="text-center"><?php if($problem_solving == 1){echo '1';}?><p>Overwhelmed
                                            by every problem unable to see different aspects of an issue</p>
                                    </td>
                                    <td class="text-center"><?php if($problem_solving == 2){echo '2';}?><p>Able to see
                                            through some issues and solve simple problems</p>
                                    </td>
                                    <td class="text-center"><?php if($problem_solving == 3){echo '3';}?><p>Has ability
                                            to analyze problems and solve most of them</p>
                                    </td>
                                    <td class="text-center"><?php if($problem_solving == 4){echo '4';}?><p>Has an
                                            analytical mind and skill to identify and solve all problems</p>
                                    </td>
                                    <td class="text-center"><?php if($problem_solving == 5){echo '5';}?><p>Exceptionally
                                            capable of solving even complex problems and identify new opportunities</p>
                                    </td>
                                    <td><input type="number" id="problem_solving_score" name="problem_solving_score"
                                            class="form-control review-table assessment_a"
                                            aria-describedby="basic-addon1"
                                            value="<?php echo $problem_solving_score; ?>"></td>
                                    <td><input type="text" name="problem_solving_comments"
                                            class="form-control review-table" aria-describedby="basic-addon1"
                                            value="<?php echo $problem_solving_comments; ?>"></td>
                                </tr>


                                <tr>
                                    <td><b>Decision Making</b> Possession of sound judgment as reflected in results</td>
                                    <td class="text-center"><?php if($decision_making == 1){echo '1';}?><p>Decisions and
                                            recommendations are wrong most of the time</p>
                                    </td>
                                    <td class="text-center"><?php if($decision_making == 2){echo '2';}?><p>Judgment is
                                            generally fair and occasional errors are common</p>
                                    </td>
                                    <td class="text-center"><?php if($decision_making == 3){echo '3';}?><p>Judgment and
                                            assessment are regularly sound</p>
                                    </td>
                                    <td class="text-center"><?php if($decision_making == 4){echo '4';}?><p>A sound and
                                            logical thinker who assesses all factors effectively even on complex issues
                                        </p>
                                    </td>
                                    <td class="text-center"><?php if($decision_making == 5){echo '5';}?><p>Consistently
                                            arrives at right decisions</p>
                                    </td>
                                    <td><input type="number" id="decision_making_score" name="decision_making_score"
                                            class="form-control review-table assessment_a"
                                            aria-describedby="basic-addon1"
                                            value="<?php echo $decision_making_score; ?>"></td>
                                    <td><input type="text" name="decision_making_comments"
                                            class="form-control review-table" aria-describedby="basic-addon1"
                                            value="<?php echo $decision_making_comments; ?>"></td>
                                </tr>


                                <tr>
                                    <td><b>Managerial Potentials</b> Ability to organize, delegate, and control; being
                                        aware of the cost, commercial, and political implications of decisions</td>
                                    <td class="text-center">
                                        <?php if($managerial_potentials == 1){echo '1';}?>
                                        <p>Unable to plan, control, or use resources efficiently</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($managerial_potentials == 2){echo '2';}?>
                                        <p>Shows some ability at organization, control, and use of resources</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($managerial_potentials == 3){echo '3';}?>
                                        <p>Able to organize, control, monitor, and use resources efficiently</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($managerial_potentials == 4){echo '4';}?>
                                        <p>Proficient in the arts of planning, organizing, controlling, and monitoring;
                                            uses resources very efficiently</p>
                                    </td>
                                    <td class="text-center">
                                        <?php if($managerial_potentials == 5){echo '5';}?>
                                        <p>Exceptionally competent in organization, planning, and monitoring, and the
                                            maximization of resources</p>
                                    </td>
                                    <td><input type="number" id="managerial_potentials_score"
                                            name="managerial_potentials_score"
                                            class="form-control review-table assessment_a"
                                            aria-describedby="basic-addon1"
                                            value="<?php echo $managerial_potentials_score; ?>"></td>
                                    <td><input type="text" name="managerial_potentials_comments"
                                            class="form-control review-table" aria-describedby="basic-addon1"
                                            value="<?php echo $managerial_potentials_comments; ?>"></td>
                                </tr>




                                <tr>
                                    <td></td>
                                    <td colspan="5">Total Score </td>
                                    <td><span class="pl-15 fw-700"
                                            id="assesment_a_total_score"><?php echo $assesment_a_total_score ?>%</span>
                                    </td>
                                    <td><input type="text"
                                            class="form-control review-table assesment_total_score_commnets"
                                            aria-describedby="basic-addon1"></td>
                                </tr>



                            </tbody>

                        </table>

                    </div>




                    <br>
                    <div class="row" id="general2">
                        <h3 class="mb-20">PART 5: EMPLOYEE'S STRENGHT <br> (To be completed by reporting officer) </h3>
                        <table class="table table-bordered" id="request_table_strenght">
                            <thead>
                                <tr>
                                <tr>
                                    <th>MAJOR STRENGHT</th>
                                    <th>CAN BE USED MORE EFFECTIVELY BY DOING THE FOLLOWING</th>
                                </tr>


                                </tr>
                            </thead>
                            <tbody>


                                <?php foreach ($data_key_goals as $key => $row) { 
                                $strength_data_array = json_decode($row->major_strength, true);
                                
                                // Check if the decoded data is an array
                                if (is_array($strength_data_array)) {
                                    foreach ($strength_data_array as $strength_data) { ?>
                                <tr>
                                    <td><?php echo htmlspecialchars($strength_data['major_strenght']); ?></td>
                                    <td><?php echo htmlspecialchars($strength_data['major_strenght_effect']); ?></td>

                                </tr>

                                <?php } 
                                }
                            } ?>
                            </tbody>

                        </table>



                    </div>

                    <div class="row" id="general3">
                        <h3 class="mb-20">C2: EMPLOYEE'S WEAKNESSES</h3>
                        <table class="table table-bordered" id="request_table">
                            <thead>
                                <tr>
                                <tr>
                                    <th>MAJOR WEAKNESSES</th>
                                    <th>CAN BE CORRECTED BY DOING THE FOLLOWING</th>

                                </tr>
                            <tbody>

                                <?php 
                                
                                foreach ($data_key_goals as $key => $row) { 
                                $weakness_data_array = json_decode($row->major_weakness, true);
                                
                                // Check if the decoded data is an array
                                if (is_array($weakness_data_array)) {
                                    foreach ($weakness_data_array as $weakness_data) { ?>
                                <tr>
                                    <td><?php echo htmlspecialchars($weakness_data['major_weakness']); ?></td>
                                    <td><?php echo htmlspecialchars($weakness_data['major_weakness_correction']); ?>
                                    </td>

                                </tr>
                                <?php }} ?>
                                <?php }?>
                            </tbody>
                            </tr>
                            </thead>
                        </table>
                    </div>


                    <div class="row" id="general4">
                        <h3 class="mb-20">C3:ASSESSMENT OF EMPLOYEE'S POTENTIAL FOR GROWTH</h3>
                        <div id="checkbox-container">
                            <label><input type="checkbox" name="very_high" class="checkbox" value="1"
                                    <?php echo ($employee_growth == 1) ? 'checked' : ''; ?>
                                    <?php echo ($employee_growth != 1) ? 'disabled' : ''; ?>> VERY HIGH</label>
                            <label><input type="checkbox" name="above_average" class="checkbox" value="2"
                                    <?php echo ($employee_growth == 2) ? 'checked' : ''; ?>
                                    <?php echo ($employee_growth != 2) ? 'disabled' : ''; ?>> ABOVE AVERAGE</label>
                            <label><input type="checkbox" name="average" class="checkbox" value="3"
                                    <?php echo ($employee_growth == 3) ? 'checked' : ''; ?>
                                    <?php echo ($employee_growth != 3) ? 'disabled' : ''; ?>> AVERAGE</label>
                            <label><input type="checkbox" name="limited" class="checkbox" value="4"
                                    <?php echo ($employee_growth == 4) ? 'checked' : ''; ?>
                                    <?php echo ($employee_growth != 4) ? 'disabled' : ''; ?>> LIMITED</label>
                        </div>

                        <h4 class="mb-20">Please comment and make recommedations</h4>
                        <textarea class="form-control mb-20" id="exampleFormControlTextarea2"
                            readonly><?php echo $growth_comments;?></textarea>
                    </div>
                    <div class="row" id="general5">
                        <h3 class="mb-20">D: OVERALL EVALUATION</h3>
                        <div id="checkbox-container-2">
                            <div class="checkbox-2">
                                <input type="checkbox" id="checkbox-1-2" name="checkbox-group-2"
                                    class="checkbox-group-2" value="1"
                                    <?php echo ($overall_evaluation == 1) ? 'checked' : ''; ?>
                                    onclick="enableCheckbox('checkbox-1-2', <?php echo $overall_evaluation; ?>)">
                                <label for="checkbox-1-2">Definitely Unsatisfactory</label>
                            </div>
                            <div class="checkbox-2">
                                <input type="checkbox" id="checkbox-2-2" name="checkbox-group-2"
                                    class="checkbox-group-2" value="2"
                                    <?php echo ($overall_evaluation == 2) ? 'checked' : ''; ?>
                                    onclick="enableCheckbox('checkbox-2-2', <?php echo $overall_evaluation; ?>)">
                                <label for="checkbox-2-2">Substandard but making progress</label>
                            </div>
                            <div class="checkbox-2">
                                <input type="checkbox" id="checkbox-3-2" name="checkbox-group-2"
                                    class="checkbox-group-2" value="3"
                                    <?php echo ($overall_evaluation == 3) ? 'checked' : ''; ?>
                                    onclick="enableCheckbox('checkbox-3-2', <?php echo $overall_evaluation; ?>)">
                                <label for="checkbox-3-2">Doing an Average job</label>
                            </div>
                            <div class="checkbox-2">
                                <input type="checkbox" id="checkbox-4-2" name="checkbox-group-2"
                                    class="checkbox-group-2" value="4"
                                    <?php echo ($overall_evaluation == 4) ? 'checked' : ''; ?>
                                    onclick="enableCheckbox('checkbox-4-2', <?php echo $overall_evaluation; ?>)">
                                <label for="checkbox-4-2">Definitely above Average</label>
                            </div>
                            <div class="checkbox-2">
                                <input type="checkbox" id="checkbox-5-2" name="checkbox-group-2"
                                    class="checkbox-group-2" value="5"
                                    <?php echo ($overall_evaluation == 5) ? 'checked' : ''; ?>
                                    onclick="enableCheckbox('checkbox-5-2', <?php echo $overall_evaluation; ?>)">
                                <label for="checkbox-5-2">Outstanding</label>
                            </div>
                        </div>
                    </div>

                    <div class="row" id="general6">
                        <h3 class="mb-20">COMMENTS BY EMPLOYEE</h3>
                        <div class="form-group">
                                <?php if (!empty($is_admin) && $is_admin || $userRole == 1): ?>
                            <textarea name="employee_comments" class="form-control" id="employees-comments" rows="3"
                                ><?php echo $employee_comments;?></textarea>
                        </div>
                          <?php endif; ?>
                    </div>
                    <!-- <div class="row mt-20">
                        <div class="col-xs-4">
                            <p>Name:</p>
                        </div>
                        <div class="col-xs-4">
                            <p>Signature:</p>
                        </div>
                        <div class="col-xs-4">
                            <p>Date:</p>
                        </div>
                    </div> -->

                    <br>
                    <div class="row" id="general7">
                        <h3 class="mb-20">E. TRAINING NEEDS</h3>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th width="20%">TRAINING RECOMMENDATIONS</th>
                                    <th width="20%">OBJECTIVES TO BE ACHIEVED AS A RESULT OF THE TRAINING</th>
                                    <th width="20%"> Responsible Person(s) to assist in the achievement of the Plan</th>
                                    <th width="13%">Start Date</th>
                                    <th width="13%">End Date</th>
                                    <th width="13%">Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach ($development_plans as $key => $row) { ?>

                                <tr>
                                    <td><?php echo $row->recommand_areas;?></td>
                                    <td>
                                        <?php echo $row->expected_outcomes;?>
                                    </td>
                                    <td><?php echo $row->responsible_person;?></td>
                                    <td><?php echo $row->start_date;?></td>
                                    <td><?php echo $row->end_date;?></td>
                                </tr>

                                <?php }?>

                            </tbody>
                        </table>

                    </div>

                    <div class="row" id="general8">
                        <h3>Part 9: REWARD AND MOTIVATION RECOMMENDATION</h3>
                        <h4>(To be completed by reporting officer) Taking Cognisance of the overall performance
                            individual
                            circumstances of the employee and the Corporate Policy on Reward and Motivation (Tick the
                            appropriate box(es))</h4>
                        <table>
                            <div class="row mt-20">
                                <div class="col-xs-6 mb-20">
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Promotion:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span class="fs-16"><?php echo $promotion ; ?></span>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Post:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span
                                                class="fs-16"><?php echo $reward_promotion ? $reward_promotion : ''; ?></span>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Salary Category:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span
                                                class="fs-16"><?php echo $reward_salary ? $reward_salary : ''; ?></span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="row mt-20">
                                <div class="col-xs-6 mb-20">
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Merit Award:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span class="fs-16"><?php echo $merit_award ; ?></span>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Amount:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span
                                                class="fs-16"><?php echo $reward_amount_merit ? $reward_amount_merit : ''; ?></span>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Also attach citation:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span
                                                class="fs-16"><?php echo $reward_citation ? $reward_citation : ''; ?></span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="row mt-20">
                                <div class="col-xs-6 mb-20">
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Annual Increment:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span class="fs-16"><?php echo $annual_increment; ?></span>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">% Amount:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span
                                                class="fs-16"><?php echo $reward_amount_annual ? $reward_amount_annual : ''; ?></span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="row mt-20">
                                <div class="col-xs-6 mb-20">
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Other Increment:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span class="fs-16"><?php echo $other_increment ?></span>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Specify:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span
                                                class="fs-16"><?php echo $reward_sprcify ? $reward_sprcify : ''; ?></span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="row mt-20">
                                <div class="col-xs-6 mb-20">
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Redeployment:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span class="fs-16"><?php echo $redeployment; ?></span>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">To what job:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span class="fs-16"><?php echo $reward_job ? $reward_job : ''; ?></span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="row mt-20">
                                <div class="col-xs-6 mb-20">
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Disciplinary Action:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span class="fs-16"><?php echo $disciplinary_action; ?></span>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Department:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span class="fs-16"><?php echo $reward_dept ? $reward_dept : ''; ?></span>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-5">
                                            <span class="fs-16 fw-700">Specify:</span>
                                        </div>
                                        <div class="col-xs-7 d-flex justify-content-center"
                                            style="border-bottom: 1px solid #000;">
                                            <span
                                                class="fs-16"><?php echo $reward_specify ? $reward_specify : ''; ?></span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </table>
                        <h4 class="mb-20">Please comment and make recommedations</h4>
                        <textarea name="reward_comments" class="form-control mb-20" rows="3"
                            readonly><?php echo $reward_comments ?></textarea>
                    </div>
                    <input type="hidden" name="signname" value="<?php echo $signingOfficerName ?>">
                    <input type="hidden" name="email" value="<?php echo $signingOfficeremail ?>">
                    <input type="hidden" name="empCalculatedscore" value="<?php echo $calculatedScore?$calculatedScore:'' ?>">
                    <div class="row" id="general9">
                        <h3 class="mb-20">F. TOTAL SCORE</h3>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>Total Score: <span class="pl-15 fw-700" name="calculatedScore"
                                            id="calculatedScore"><b><?php echo $calculatedScore?$calculatedScore:'' ?>%</b></span>
                                    </th>
                                    <th>Reporting Officer</th>
                                    <th>Countersigning Officer </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>

                                        <div>
                                            <p class="fw-700">Classification of Employee:</p>
                                        </div>
                                        <div class="d-flex">
                                            <p class="fw-700">EE <br> (80-100)</p>
                                            <p class="pl-15 fw-700">AE <br> (75-85)</p>
                                            <p class="pl-15 fw-700">UE <br> (0-70)</p>
                                        </div>
                                    </td>
                                    <td>
                                        <div>
                                            <p class="fw-700">Name:<?php echo $signingOfficerName ?> </p>
                                        </div>
                                        <div>
                                            <p class="fw-700">Signature:<?php echo $signingOfficerSignature ?></p>
                                        </div>
                                        <div>
                                            <p class="fw-700">Date:<?php echo $signingOfficerDate ?></p>
                                        </div>
                                        <div>
                                            <p class="fw-700">Designation: <?php echo $signingOfficerDesignation ?></p>
                                        </div>
                                        <div>
                                            <p class="fw-700">Next Review Period:<?php echo $signingOfficerNRDate ?></p>
                                        </div>
                                    </td>

                                    <td>
                                        <div>
                                            <p class="fw-700">Name:<?php echo $counterOfficerName ?> </p>
                                        </div>
                                        <div>
                                            <p class="fw-700">Signature:<?php echo $counterOfficerSignature ?></p>
                                        </div>
                                        <div>
                                            <p class="fw-700">Date:<?php echo $counterOfficerDate ?></p>
                                        </div>
                                        <div>
                                            <p class="fw-700">Designation: <?php echo $counterOfficerDesignation ?></p>
                                        </div>
                                        <div>
                                            <p class="fw-700">Next Review Period:<?php echo $counterOfficerNRDate ?></p>
                                        </div>
                                    </td>

                                </tr>

                            </tbody>
                        </table>

                    </div>


                    <!-- <div class="row mt-20">
                        <h3 class="mb-20">G. REVIEW / COMMENTS</h3>
                        <div class="col-xs-4">
                            <p>Name:</p>
                        </div>
                        <div class="col-xs-4">
                            <p>Signature:</p>
                        </div>
                        <div class="col-xs-4">
                            <p>Date:</p>
                        </div>
                    </div> -->
                </div>

            </div>
  <button type="submit" class="btn btn-success w-md m-b-5"><?php echo display('save') ?></button>
            </div>
            <?php echo form_close() ?>
        </div>
    </div>

</div>

<script>
document.addEventListener('DOMContentLoaded', function() {
    var checkboxes = document.querySelectorAll('.checkbox-group-2');
    var overallEvaluation = <?php echo $overall_evaluation; ?>;

    function handleCheckboxChange() {
        checkboxes.forEach(function(checkbox) {
            checkbox.disabled = checkbox !== this;
        }, this);
    }

    checkboxes.forEach(function(checkbox) {
        if (checkbox.value != overallEvaluation) {
            checkbox.disabled = true;
        }
        checkbox.addEventListener('change', handleCheckboxChange);
    });
});
</script>
<script src="<?php echo MOD_URL . 'employee/assets/js/view_emp_appraisal.js'; ?>" type="text/javascript">
<!-- function addRow(sectionId) {
// Function to add a new row in the table
var section = document.getElementById(sectionId);
var newRow = section.insertRow();
var cols = section.rows[0].cells.length;

for (var i = 0; i < cols - 1; i++) {
    var newCell = newRow.insertCell(i);
    newCell.innerHTML = section.rows[0].cells[i].innerHTML;
}
var actionCell = newRow.insertCell(cols - 1);
actionCell.innerHTML = '<button type="button" class="btn btn-info btn-sm" onclick="addRow(\'' + sectionId +
    ' \')"><i class="fa fa-plus-square" aria-hidden="true"></i></button> <button type="button"
class = "btn btn-danger btn-sm"
onclick = "deleteRow(this)" > < i class = "fa fa-trash"
aria - hidden = "true" > < /i></button > ';
}

function deleteRow(button) {
    // Function to delete a row in the table
    var row = button.parentNode.parentNode;
    row.parentNode.removeChild(row);
}
-->
</script>