Jump to content


Undefined variable

css_file output js_files

  • Please log in to reply
No replies to this topic

#1 indra

indra

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 03 September 2019 - 08:04 AM

i have problem for load my table

 

error.png

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

 







Also tagged with one or more of these keywords: css_file, output, js_files

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users