-1
My need is to group the concepts according to the discipline, follows the model:
How to do: (I’m not able to group in a "title", only.
Follow a code of the party in question. (If necessary, I make available).
<?php
$curType = '';
if(strpos($class->name, '1º Ano') !== false)
$curType = '1º Ano';
if(strpos($class->name, '2º Ano') !== false)
$curType = '2º Ano';
$conceitos = [];
foreach($subjects as $subject) {
array_push($conceitos, $this->db->get_where('learning_goals', array(
'type' => $curType,
'eixos' => $i.'º Bimestre',
'subject_id' => $subject['subject_id'],
))->result_array());
}
$eixos = [];
$_subjects = [];
foreach($conceitos as $conceito) {
if(in_array($conceito['eixos'], $eixos))
continue;
array_push($eixos, $conceito['eixos']);
$_descs = [];
$descs = [];
foreach($subjects as $subject) {
array_push($_descs, $this->db->get_where('learning_goals', array(
'type' => $curType,
'eixos' => $i.'º Bimestre',
'subject_id' => $subject['subject_id'],
))->result_array());
}
foreach($_descs as $_desc) {
foreach($_desc as $_des) {
array_push($descs, $_des);
}
}
foreach($descs as $key => $desc) {
$descStatus = $this->db->get_where('learning_goals_status', array(
'exam_id' => $i,
'conceito_id' => $conceito[0]['id'],
'student_id' => $stu->student_id,
))->row();
$subject = $this->db->get_where('subject', array('subject_id' => $desc['subject_id'],
))->row();
$key++;
?>
<div class="col-xs-11 text-center">HABILIDADES QUE A CRIANÇA DEMONSTRA EM <?= $subject->name?></div>
<div class="col-xs-11 <?php if($key == sizeof($descs)) { echo 'border-bottom'; } ?> border-top border-bottom border-left border-right"><?= $desc['sys_id'] ?>. <?= $desc['description'] ?></div>
<div class="col-xs-1 <?php if($key == sizeof($descs)) { echo 'border-bottom'; } ?> border-bottom border-top border-right"> <?= $descStatus->status ?></div>
<?php
}
?>
<?php
}
?>
You could send full code. That would help a lot.
– Maury Developer
Sure. I’ll edit and make available.
– Pedro Paulo