Jump to content


hurtz

Member Since 13 Jan 2017
Offline Last Active Mar 14 2017 05:09 AM
-----

Posts I've Made

In Topic: Timepicker Implementation

05 March 2017 - 11:17 AM

I tried this solution but it gives me this error "Fatal error: Call to undefined method grocery_CRUD::set_js_lib()" referring to this line of code:

 

           $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/ui/'.grocery_CRUD::JQUERY_UI_JS);

 

any help will be much appreciated


In Topic: [ANSWERED] Can I switch databases?

01 March 2017 - 02:34 AM

I tried this solution but it says "Fatal error: Uncaught exception 'Exception' with message 'The table name does not exist. Please check you database and try again.' in D:\wamp\www\ATS\admin\application\libraries\grocery_crud.php on line 4349"

 

here is my config/database

$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'logbook';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
$db['default']['failover'] = array();

$db['db2']['hostname'] = 'localhost';
$db['db2']['username'] = 'root';
$db['db2']['password'] = '';
$db['db2']['database'] = 'calendar';
$db['db2']['dbdriver'] = 'mysql';
$db['db2']['dbprefix'] = '';
$db['db2']['pconnect'] = TRUE;
$db['db2']['db_debug'] = TRUE;
$db['db2']['cache_on'] = FALSE;
$db['db2']['cachedir'] = '';
$db['db2']['char_set'] = 'utf8';
$db['db2']['dbcollat'] = 'utf8_general_ci';
$db['db2']['swap_pre'] = '';
$db['db2']['autoinit'] = TRUE;
$db['db2']['stricton'] = FALSE;
$db['db2']['failover'] = array();

and this is my controller

    function event()
    {
        
        $this->db = $this->load->database('db2',true);
        
        $crud = new grocery_CRUD();
        
        $crud->set_table('tbl_event');
        $crud->set_subject('Calendar')
             ->columns('time_date','event_name','divID','venue')
             ->display_as('event_name','Event Name')
             ->display_as('time_date','Time & Date')
             ->display_as('time_start','Start time')
             ->display_as('time_end','End time')
             ->display_as('date_start','Start date')
             ->display_as('date_end','End date')
             ->display_as('venue','Venue')
             ->display_as('address1','Name of Venue')
             ->display_as('address2','Address 1')
             ->display_as('address3','Address 2')
             ->display_as('divID','Division Concerned');
        $crud->fields('event_name','date_time','time_start','time_end','date_start','date_end','venue','address1','address2','address3','divID');

        $crud->set_relation('divID','division','description');
        
        
        $crud->callback_before_insert(array($this,'set_time_date_value'));
        $crud->callback_before_update(array($this,'set_time_date_value'));
        
        $crud->order_by('date_start','asc');

        $output = $crud->render();
        
        $this->_pg_view($output);
    }

In Topic: like() not working

03 February 2017 - 01:43 AM

i managed to retrieve my data from the session using the code below:

   

instead of

 

    $division = $this->session->userdata('divID');

 

I used this

 

     $division = $this->session->userdata['logged_in']['divID'];

 

Thanks for the views


In Topic: like() not working

27 January 2017 - 03:46 AM

looks like this line of my code is not returning any value

  

     $this->session->userdata('divID');

 

I've checked a lot of posts here and the above code is what I've seen, can anyone please guide me? please bear with my ignorance, I don't have any background in programming or whatever you call it and I just started learning this stuff 2 weeks ago. thanks in advance


In Topic: how to fetch data in db from one table and set as a value of a data field in...

24 January 2017 - 07:11 AM

thanks Amit. I'll try that one and hope it will work :)