CodeIgniter Forums
HELP! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: HELP! (/showthread.php?tid=28783)



HELP! - El Forum - 03-21-2010

[eluser]husni[/eluser]
Code:
$data['msg'] = "";
                $data['availability'] = TRUE;
                $data['allModul'] = $this->helpdesk_model->getAllModul();
                print_r($data['allModul']);
                $this->load->library('calendar');
                $data['querys'] = $this->helpdesk_model->display_menu();
                $this->load->view('statusAll',$data);
hey guys..this is my code..
and in the view file it will display all of the module in the database..
there's a lot of thing that i need to calculate for each module..
i dont know how to do that..i need to carry the module id to the model to make the calculation but my module id display in the view file.. so how??


HELP! - El Forum - 03-21-2010

[eluser]husni[/eluser]
[quote author="tokyo" date="1269249621"]hi,
if ur model is giving all the data u want then u can calculate it in th view part.
BTW what kind of calculation u want to do?[/quote]

but can i use model in the view part??
i want to calculate a lot of things..
for example..the total report logged to each module..
total closed..the response time..the solution time..


HELP! - El Forum - 03-22-2010

[eluser]InsiteFX[/eluser]
Input -> Controller | Processing -> Model | Output -> View

You should not load your model into the view...

Enjoy
InsiteFX


HELP! - El Forum - 03-22-2010

[eluser]husni[/eluser]
this is a part of my controller..
Code:
$data['msg'] = "";
                $data['availability'] = TRUE;
                $data['allModul'] = $this->helpdesk_model->getAllModul();
                print_r($data['allModul']);
                $this->load->library('calendar');
                $data['querys'] = $this->helpdesk_model->display_menu();
                $this->load->view('statusAll',$data);

and this is a part of my view..
Code:
foreach($allModul as $modul):
                        echo "<tr><td width='15%'><b>".$modul['moduleID']."</b></td><td>".$this->helpdesk_model->countTotalLog($modul['moduleID'])."</td><td>".$this->helpdesk_model->countTotalClose($modul['moduleID'])."</td><td>".$this->helpdesk_model->countPercentage($modul['moduleID'])."</td><td>".$this->helpdesk_model->responseIn2Hours($modul['moduleID'])."</td><td>".$this->helpdesk_model->responseMore2Hours($modul['moduleID'])."</td><td>".$this->helpdesk_model->responseMore3Days($modul['moduleID'])."</td><td></td><td>".$this->helpdesk_model->TMresponseIn2Hours($modul['moduleID'])."</td><td>".$this->helpdesk_model->TMresponseMore2Hours($modul['moduleID'])."</td><td>".$this->helpdesk_model->TMresponseMore3Days($modul['moduleID'])."</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>";
                    endforeach;

can anyone tell me how to do this one instead of this way??