• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with calling a method in a method.

#1
[eluser]soyut[/eluser]
Hello,

I was calling a method/function in a another method.
But when it runs the function it doesn't continue the code. it just stops there.

How can I sort this out.

Code:
public function rep(){
    if ($this->input->post('submit'))
          {
            if($this->input->post('date1')){
                if($this->input->post('date2')){
          
      $data['reports'] = $this->blog_model2->reporting();
          $reports =array();    
    
        
    
        
        $this->topdf();
//topdf function is printing out the search results in pdf format.

        $this->load->view('header_view');
        $this->load->view('nav_view');
        $this->load->view('nav2_view');
        $this->load->view('report_view', $data);
        
        $this->load->view('footer_view');
        
        }
        else{
            
            
            echo "Please enter a valid end date!";
        }
            
       }
       else{
            echo "Please enter a valid start date!";
        }
        
        
        } //submit
        else {
        
        $this->load->view('header_view');
        $this->load->view('nav_view');
        $this->load->view('nav2_view');
        $this->load->view('report_view');
        $this->load->view('footer_view');
        
        }
    }

#2
[eluser]jprateragg[/eluser]
What function is causing the problem, and what is the error message? Is this function in a library, helper, MY_Controller, or MY_Model?

#3
[eluser]bigbusty[/eluser]
I really don't want to mess with your habits and whats good for you but for the sake of readability and coding standards, read the CodeIgniter Style Guide found here http://ellislab.com/codeigniter/user-gui...guide.html and tell us where the problem is. Posting some code doesn't do the magic.

reformatted
Code:
public function rep()
{
    if ($this->input->post('submit'))
    {
        if($this->input->post('date1'))
        {
            if($this->input->post('date2'))
            {
                $data['reports'] = $this->blog_model2->reporting();
                $reports =array();

                $this->topdf();
                //topdf function is printing out the search results in pdf format.

                $this->load->view('header_view');
                $this->load->view('nav_view');
                $this->load->view('nav2_view');
                $this->load->view('report_view', $data);

                $this->load->view('footer_view');

            }
            else
            {
                echo "Please enter a valid end date!";
            }

        }
        else
        {
            echo "Please enter a valid start date!";
        }
    } //submit
    else
    {
        $this->load->view('header_view');
        $this->load->view('nav_view');
        $this->load->view('nav2_view');
        $this->load->view('report_view');
        $this->load->view('footer_view');
    }
}



Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.