I found very nice php api last week, Grocery Crud, from examples available here http://www.grocerycrud.com/examples/the-simplest-example , I could create view and its working fine, my question is there are 2 buttons once you edit Update Changes and Update Back to List, I am interested to print post array whenever I click these two button, so that I can see what is inside array, and my actual plan is whenever I update record ( on click of update changes or update and back to list in edit ), I need to update about 7 tables
Here is what I have tried so far, here function test prints nothing
function test($post_array)
{
echo "<pre>";
print_r($post_array);
echo "</pre>";
}
function myapp(){
$this->db = $this->load->database('Groupdb',true);
$crud = new grocery_CRUD();
$crud->set_table('main_table');
$crud->columns(
"Serial",
"Date",
"Time"
);
$crud->fields(
"Serial",
"Date",
"Time"
);
$crud->callback_after_update(array($this, 'test'));
$crud->set_subject('Update Mains');
$output = $crud->render();
$this->_example_output($output);
}
From my code I think you guys can imagine table name is main_table, whenever I update serial, date and time, of main_table, it has to be reflected on 7 other tables whose fields are date and time, here serial number is unique