<?php 
$this->load->helper('text');
$view_person_id = $this->session->userdata('view_person_id');
$person_id = $this->session->userdata('person_id');
$person_role = $this->session->userdata('person_role');
$this->load->library('cf');

?>

<div class="col-sm-12 white" style="padding: 0">
    <div class="col-sm-12 text-left" style="padding: 5px 0 0 20px">
        <span><i class="fa fa-tachometer fa-2x">&nbsp;&nbsp;&nbsp;</i>Express your talent and ability to success!</span>
    </div>

    <div class="col-sm-12 gray">
    <?php
    if (isset($all_quiz)) {
        $count = 0;
        foreach ($all_quiz as $v_quiz) {
            $quiz_id = $v_quiz->quiz_id;
            $quiz_result_permission = $quiz_result[$v_quiz->quiz_id]->quiz_result_permission;
            $quiz_result_status = $quiz_result[$v_quiz->quiz_id]->quiz_result_status;
            $quiz_result_percentage = $quiz_result[$v_quiz->quiz_id]->quiz_receive_marks_percentage;
            if (($quiz_result_permission == 1) || ($person_id && $quiz_result_permission == 2) || (in_array($person_id, $final_array) && $quiz_result_permission == 3 ) || ($quiz_result[$v_quiz->quiz_id]->person_id == $person_id && $quiz_result_permission == 4)) {
                if (($quiz_result_status == 0 && $person_id == $quiz_result[$v_quiz->quiz_id]->person_id) || $quiz_result_status == 1) {
                    ?>

                    <div class="col-sm-4">
                        <div class="col-sm-12">
                            <span class="text-center h3 quiz_name_skill_meter"><?php echo $v_quiz->quiz_name ?></span>
                        </div>                                                                
                        <div class="col-sm-12">
                            <div id="quiz_result_meter<?php echo $quiz_id ?>" 
                                 class="meterCircle" 
                                 data-dimension="200" 
                                 data-text="<?php echo $quiz_result_percentage . '%' ?>" 
                                 data-width="30" 
                                 data-fontsize="38" 
                                 data-fgcolor="" 
                                 data-percent="<?php echo $quiz_result_percentage ?>"  
                                 data-bgcolor="#eee" 
                                 data-fill="#ddd">                                                                     
                            </div>
                        </div>                                                                
                    </div>

                    <?php
                    $count++;
                }
            } 
        }
    }
    ?>
    </div>
    <?php if($all_row_quiz > $count){
        echo "<div class='col-sm-12 gray' id = 'view_more'><span style='color: green'>View more...</span></div>";
    } ?>
</div>
<script src="<?php echo base_url() ?>front_end_resource/quiz/skill_meter.js" type="text/javascript"></script>

