if ($i++ > 5) { echo 'style="display: none;"'; } ?> /> </li> <?php } ?> </ul> <div class="clear"></div> </div><!--Grid 1--> <div class="grid_3" style="border:1px solid #BBC3B8;"> <?php if ($stat = progress_stat($assessment->all_scores, count($assessment->rubrics))) { ?> <div class="progressbar_wrap"> <div class="progressbar"> <div class="progress-bar-wrapper"> <div class="red-bar" style="margin-left: <?php echo $stat[10]; ?> %; width: <?php echo $stat[90] - $stat[10]; ?> %"> <img src="<?php echo base_url('themes/parent/images/pointer.png'); ?> " class="pointer-show" style="left: <?php
public function GetChildProgressReport() { $params = $this->_check_parameter(array('progressReportID', 'assessmentCategoryID')); $this->load->model('progress_report/progress_report_model'); $this->load->model('parent_account/parent_account_model'); $this->load->model('sow/sow_model'); $progress_report_details = $this->progress_report_model->getFromId($params->progressReportID); $progress_assessments = $this->progress_report_model->getProgressAssessments($params->progressReportID, $params->assessmentCategoryID); // debug($this->db->last_query()); // debug_continue(count($progress_assessments)); // debug($progress_assessments); $assessments = array(); foreach ($progress_assessments as $progress_assessment) { $assessments[$progress_assessment->assessment_id] = $progress_assessment; $assessments[$progress_assessment->assessment_id]->rubrics = array(); $assessments[$progress_assessment->assessment_id]->all_scores = array(); } // debug_continue(count($assessments)); // debug($assessments); $assessment_ids = array_unique(pluck($progress_assessments, 'assessment_id')); $sow_ids = pluck($progress_assessments, 'sow_id'); // debug($sow_ids, 'sow_ids'); if (count($assessment_ids) > 0) { $rubrics = $this->parent_account_model->getRubricByAssessment($assessment_ids); foreach ($rubrics as $rubric) { if (isset($assessments[$rubric->assessment_id]->rubrics)) { $assessments[$rubric->assessment_id]->rubrics[] = $rubric; } } $all_progress_assessments = $this->parent_account_model->getAllProgressAssessments($assessment_ids); foreach ($all_progress_assessments as $all_progress_assessment) { if (isset($assessments[$all_progress_assessment->assessment_id]->all_scores)) { $assessments[$all_progress_assessment->assessment_id]->all_scores[] = $all_progress_assessment->rubric_passed; } } foreach ($assessments as &$assessment) { $assessment->stat = progress_stat($assessment->all_scores, count($assessment->rubrics)); unset($assessment->all_scores); } } $this->_response['assessments'] = array(); foreach ($assessments as $assessment) { $this->_response['assessments'][] = $assessment; } if (!empty($sow_ids)) { $sow_album = $this->sow_model->getAllSowAlbum($sow_ids, $progress_report_details->student_id); // debug($sow_album, 'sow_album'); // debug($this->_response['sow_album_items']); $this->_response['sow_album_items'] = array(); $i = 0; if (!empty($sow_album)) { foreach ($sow_album as $row) { if (isset($this->_response['sow_album_items'][$row->assessment_category_id])) { if (count($this->_response['sow_album_items'][$row->assessment_category_id]) < 6 and !isset($this->_response['sow_album_items'][$row->assessment_category_id][$row->id])) { $this->_response['sow_album_items'][$row->assessment_category_id][$row->id] = $row; } } else { $this->_response['sow_album_items'][$row->assessment_category_id][$row->id] = $row; } } } } echo json_encode($this->_response); }