2016-09-18 2 views
0

に私はCodeIgniterのプロジェクトに取り組んでいるとIと呼ばれるビューにデータを送信するとき()メンバ関数行にコール - merchant_registrationアレイエラー:非オブジェクト

コントローラ

として
function Merchant_Registration($para1 = '', $para2 = '') { 

     if (!$this->crud_model->admin_permission('report')) { 
      redirect(base_url() . 'index.php/admin'); 
     } 
     if ($para1 == 'edit') { 

      $page_data['vendor_data'] = $this->db->get_where('vendor', array(
         'vendor_id' => $para2 
        ))->result_array(); 
      $this->load->view('back/admin/merchant_edit', $page_data); 
     } elseif ($para1 == 'update') { 
      $page_data['status'] = $this->input->post('status'); 
      $this->db->where('vendor_id', $para2); 
      $this->db->update('vendor', $page_data); 
      redirect(base_url() . 'index.php/admin/Merchant_Registration/', 'refresh'); 
      recache(); 
     } else { 
      $this->db->order_by('vendor_id', 'ased'); 
      $create_timestamp = $this->input->post("create_timestamp"); 
      $status = $this->input->post("status"); 
//search query 
//change the dates to the proper column 
//and find the package column and 
      //$date = DateTime::createFromFormat('Y-m-d"', $create_timestamp); 
      $page_data['query'] = $this->db->query("select * from vendor where create_timestamp >= UNIX_TIMESTAMP($create_timestamp) and create_timestamp <= UNIX_TIMESTAMP($create_timestamp) or status like '%$status%'")->result_array(); 
      $page_data['page_name'] = "Merchant_Registration"; 
      $this->load->view('back/index', $page_data); 
     } 
    } 

なお、このエラーを示す:

重大度:エラー

メッセージ:メンバ関数行にコール()非対象に

ファイル名:バック/ index.phpを

行番号:5

バックトレース:

私は、クエリビルダとアクティブなレコードを使用していたそれを考え出し

<?php 
    $system_name  = $this->db->get_where('general_settings',array('type' => 'system_name'))->row()->value; 
    $system_title = $this->db->get_where('general_settings',array('type' => 'system_title'))->row()->value; 
?> 
<?php include 'includes_top.php'; ?> 
<body onbeforeunload="HandleBackFunctionality()"> 
    <div id="container" class="effect mainnav-lg"> 
     <!--NAVBAR--> 
     <?php include 'header.php'; ?> 
     <!--END NAVBAR--> 
     <div class="boxed" id="fol"> 
      <!--CONTENT CONTAINER--> 
      <div> 
      <?php 
      include $this->session->userdata('title').'/'.$page_name.'.php' ?> 
      </div> 
      <!--END CONTENT CONTAINER--> 

      <!--MAIN NAVIGATION--> 
      <?php include $this->session->userdata('title').'/navigation.php' ?> 
      <!--END MAIN NAVIGATION--> 

     </div> 
     <!-- FOOTER --> 
     <?php include 'footer.php'; ?> 
     <?php include 'script_texts.php'; ?> 
     <!-- END FOOTER --> 
     <!-- SCROLL TOP BUTTON --> 
     <button id="scroll-top" class="btn"><i class="fa fa-chevron-up"> 
     </i></button> 
    </div> 
    <!-- END OF CONTAINER --> 

    <!-- SETTINGS - DEMO PURPOSE ONLY --> 
<?php include 'includes_bottom.php'; ?> 
+0

ちょうど注意:ビューをロードするときには、codeigniter load view http://www.codeigniter.com/usを使用することができますer_guide/general/views.htmlまた、データベースから取得する必要のあるものやモデルを使用してください。http://www.codeigniter.com/user_guide/general/models.html – user4419336

+1

MVCフレームワークを使用している場合は、それに従います。あなたの質問に関しては、あなたの質問に結果がないので。 '$ system_title = $ this-> db-> get_where( 'general_settings'、array( 'type' => 'system_title')) - > row() - > value;'。その値を使用する前に結果を得ていることを確認してください – Zeeshan

答えて

0

インデックスファイル同時に、

関連する問題