I want to create leveling system with Codeigniter. I retrieve all criteria from the table, then User fill the quistionare and finally system make a decission, level 1, level 2, or level 3.
Here is my controller:
if ($this->input->post('submit_asesmen')) {
$hitung_asesmen=count($_POST['id_komponen']);
$level='';
for ($i=0; $i < $hitung_asesmen; $i++) {
$id_asesmen=$_POST['id_komponen'][$i];
$yes=$_POST['yesorno'][$i];
$bukti=$_POST['cek'][$i];
$lihat_level=$this->m_asesmen->select_level($id_asesmen);
$data_asesmen = array(
'id_komponen_asesmen' => $id_asesmen,
'yes_or_no' => $yes,
'level' => $lihat_level,
);
$hitung_level_1=$this->m_asesmen->jml_level_1();
$macam_level_1=$this->m_asesmen->macam_level_1();
if ($lihat_level=='1' && $yes=='1') {
echo "Level 1 <br>";
}
else{
echo "Level 0 <br>";
}
}
}
My temporary output is like
Level 1
Level 0
Level 0
Level 0
Level 1
Level 1
Level 1
Level 1
Level 0
Level 0
Level 0
How to create output like : ?
Level 0 : 6 values
Level 1 : 5 values