Welcome Guest, Not a member yet? Register   Sign In
HELP!
#1

[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??
#2

[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..
#3

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

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

Enjoy
InsiteFX
#4

[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??




Theme © iAndrew 2016 - Forum software by © MyBB