⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Undefined variable



indra
  • profile picture
  • Member

Posted 03 September 2019 - 08:04 AM

i have problem for load my table

 

[attachment=1377:error.png]

[attachment=1378:error2.png]

 

------------------------------------------------------------------------------------

 

this my view:

 
<?php foreach ($css_files as $file) : ?>
<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
<?php endforeach; ?>
 
<?php echo $output; ?>
 
<?php foreach ($js_files as $file) : ?>
<script src="<?php echo $file; ?>"></script>
<?php endforeach; ?>

 

--------------------------------------------------------------------------------------

this my controller:

 

<?php
defined('BASEPATH') or exit('No direct script access allowed');
 
//memanggil libarary grocery
include(APPPATH . 'libraries/GroceryCrudEnterprise/autoload.php');
use GroceryCrud\Core\GroceryCrud;
//memanggil libarary grocery
 
class Operator extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
        help_islogin();
    }
 
    public function index()
    {
        $ardata['title'] = 'Operator';
        $ardata['email'] = $this->session->userdata('email');
        $ardata['compid'] = $this->session->userdata('compid');
 
        $this->load->view('partials/_header');
        $this->load->view('operator/index', $ardata);
        $this->load->view('partials/_footer');
    }
 
        public function _example_output($output = null)
    {
        if (isset($output->isJSONResponse) && $output->isJSONResponse) {
            header('Content-Type: application/json; charset=utf-8');
            echo $output->output;
            exit;
        }
 
        $this->load->view('operator/masmes.php', (array) $output);
    }
 
    public function masmes()
    {
        $ardata['title'] = 'Master Mesin';
 
        $this->load->view('partials/_header');
        $this->load->view('operator/masmes', $ardata);
        $this->load->view('partials/_footer');
 
        $crud = $this->_getGroceryCrudEnterprise();
        $crud->setTable('mastmesin');
        $crud->columns(['CompCode', 'MesinCode', 'MesinName', 'MesinType', 'UserName', 'IPAddress', 'LANPort']);
        $output= $crud->render();
 
        $this->_example_output($output);
    }
 
 
        private function _getDbData()
    {
        $db = [];
        include(APPPATH . 'config/database.php');
        return [
            'adapter' => [
                'driver' => 'Pdo_Mysql',
                'host'     => $db['default']['hostname'],
                'database' => $db['default']['database'],
                'username' => $db['default']['username'],
                'password' => $db['default']['password'],
                'charset' => 'utf8'
            ]
        ];
    }
 
    private function _getGroceryCrudEnterprise($bootstrap = true, $jquery = true)
    {
        $db = $this->_getDbData();
        $config = include(APPPATH . 'config/gcrud-enteprise.php');
        $groceryCrud = new GroceryCrud($config, $db);
        return $groceryCrud;
    }
//load bootstrap, jquery, dan db