hi, i'm new here.. this is my first issue using GC.
below are the code in controller.
public function trxgroup() { $crud = $this->generate_crud('ref_genlookups'); $crud -> where('lookup_group_code','TRXGRP'); $crud -> columns('code', 'description'); $crud->set_relation('data_owner','users','username'); $crud->field_type('active', 'hidden', 1); $crud->field_type('lookup_group_code', 'hidden', 'TRXGRP'); $crud->field_type('deleted', 'hidden'); $crud->field_type('deletedby', 'hidden'); $date = date('Y-m-d H:i:s'); $state = $crud->getState(); if ($state==='add') { $crud->field_type('created', 'hidden', $date); $crud->field_type('createdby', 'hidden', $this->mUser->id); $crud->field_type('updated', 'hidden'); $crud->field_type('updatedby', 'hidden'); }else{ $crud->field_type('created', 'readonly'); $crud->field_type('createdby', 'readonly'); $crud->field_type('updated', 'hidden', $date); $crud->field_type('updatedby', 'hidden', $this->mUser->id); } $this->mTitle.= 'Transaction Group'; $this->render_crud(); }
the problem is on created field. I didn't save the $date value.
datatype for the field id DATETIME.
Appreciate your help guys.
Thanks.