Date fields problem with callback_before_insert & update
- Single Page
Posted 13 August 2013 - 23:10 PM
everything works fine except date values. Please anyone have an idea bout the problem let me know .<br />
here is my views.<br />
</p>
<pre class="_prettyXprint">
function new_acty()
{
$crud = new grocery_CRUD();
$user = $this-&gt;ion_auth-&gt;user()-&gt;row();
$crud-&gt;where('Orgnization', $user-&gt;Orgniz_Id);
$crud-&gt;set_theme('datatables');
$crud-&gt;set_table('activities');
$crud-&gt;set_subject('Activity');
$crud-&gt;display_as('Activity_name','Activity Name')
-&gt;display_as('Activity_des','Description')
-&gt;display_as('CreatedOn','Created On')
-&gt;display_as('CreatedBy','Created By')
-&gt;display_as('LastModifiedBy','Last ModifiedBy')
-&gt;display_as('LastModified','Last ModifiedOn') ;
$crud-&gt;required_fields('Activity_name','Activity_des');
$crud-&gt;fields('Activity_name','Activity_des','Orgnization','CreatedOn','CreatedBy','LastModifiedBy','LastModified');
$crud-&gt;columns('Activity_name','Activity_des','CreatedBy','LastModifiedBy');
$crud-&gt;field_type('CreatedBy','invisible');
$crud-&gt;field_type('CreatedOn','invisible');
$crud-&gt;field_type('LastModifiedBy','invisible');
$crud-&gt;field_type('LastModified','invisible');
$crud-&gt;field_type('Orgnization','invisible');
$crud-&gt;callback_before_insert(array($this, '_created_callback'));
$crud-&gt;callback_before_update(array($this, '_modified_callback'));
$crud-&gt;set_crud_url_path(site_url(strtolower(__CLASS__.&quot;/&quot;.__FUNCTION__)),site_url(strtolower(__CLASS__.&quot;/cfsSetup&quot;)));
$output = $crud-&gt;render();
if($crud-&gt;getState() != 'list') {
$this-&gt;_example_output($output);
}
else {
return $output;
}
}
</pre>
</pre>
<p> </p>
<p><br />
the second view is :<br />
</p>
<pre class="_prettyXprint">
function new_cfs()
{
$crud = new grocery_CRUD();
$user = $this-&gt;ion_auth-&gt;user()-&gt;row();
$crud-&gt;where('Orgnization', $user-&gt;Orgniz_Id);
$crud-&gt;set_table('basic_info_cfs');
$crud-&gt;set_subject('CFS');
//$crud-&gt;set_theme('datatables');
$crud-&gt;display_as('cfs_name','CFS Name ')
-&gt;display_as('Governorate','Governorate')
-&gt;display_as('district','District')
-&gt;display_as('Area','Area')
-&gt;display_as('location_type','Location Type ')
-&gt;display_as('cfs_type','CFS Type');
$crud-&gt;set_relation('location_type','cfs_location','location_type_name');
$crud-&gt;set_relation('cfs_type','cfs_types','type_name');
$crud-&gt;set_relation('Governorate', 'governorates', 'Gov_name');
$crud-&gt;set_relation('district', 'districts', 'Dist_name');
$crud-&gt;fields('cfs_name','Governorate','district','Area','location_type','cfs_type','shift','Orgnization','CreatedOn','CreatedBy','LastModifiedBy','LastModified');
$crud-&gt;columns('cfs_name','Governorate','district','Area','location_type','cfs_type','shift','CreatedBy','LastModifiedBy');
$crud-&gt;field_type('shift','dropdown', array('1' =&gt; 'Morning', '0' =&gt; 'afternoon'));
$crud-&gt;field_type('CreatedBy','invisible');
$crud-&gt;field_type('CreatedOn','invisible');
$crud-&gt;field_type('LastModifiedBy','invisible');
$crud-&gt;field_type('LastModified','invisible');
$crud-&gt;field_type('Orgnization','invisible');
$crud-&gt;callback_before_insert(array($this, '_created_callback'));
$crud-&gt;callback_before_update(array($this, '_modified_callback'));
$crud-&gt;set_crud_url_path(site_url(strtolower(__CLASS__.&quot;/&quot;.__FUNCTION__)),site_url(strtolower(__CLASS__.&quot;/cfsSetup&quot;)));
$output = $crud-&gt;render();
if($crud-&gt;getState() != 'list') {
$this-&gt;_example_output($output);
} else {
return $output;
}
}
</pre>
<p>the third is :</p>
<pre class="_prettyXprint">
function New_child()
{
$crud = new grocery_CRUD();
$user = $this-&gt;ion_auth-&gt;user()-&gt;row();
$crud-&gt;where('Orgnization', $user-&gt;Orgniz_Id);
$crud-&gt;set_subject('Child');
$crud-&gt;set_table('child_prof_cfs');
//$crud-&gt;set_theme('datatables');
$crud-&gt;display_as('Child_Name','Child Name ')
-&gt;display_as('Child_Age','Child Age ')
-&gt;display_as('child_address','Child Address ')
-&gt;display_as('child_phone','Contact')
-&gt;display_as('child_des','description')
-&gt;display_as('child_fur_des',' further description');
$crud-&gt;set_relation_n_n('ChildNeed', 'cfs_child_suppot', 'cfs_support_type', 'Child_No', 'support_type_no', 'support_type_name');
$crud-&gt;set_relation_n_n('ChildStatus', 'cfs_child_status', 'cfs_status_type', 'Child_No', 'status_id', 'status_title');
$crud-&gt;fields('Child_Name','Child_Age','Gender','child_address','child_phone','child_des','child_fur_des','ChildNeed','ChildStatus','Orgnization','CreatedOn','CreatedBy','LastModifiedBy','LastModified');
$crud-&gt;columns('Child_Name','Child_Age','Gender','child_address','child_phone','child_des','child_fur_des','ChildNeed','ChildStatus','CreatedBy','LastModifiedBy');
$crud-&gt;field_type('Gender','dropdown', array('1' =&gt; 'Boy', '0' =&gt; 'Girl'));
$crud-&gt;field_type('CreatedBy','invisible');
$crud-&gt;field_type('CreatedOn','invisible');
$crud-&gt;field_type('LastModifiedBy','invisible');
$crud-&gt;field_type('LastModified','invisible');
$crud-&gt;field_type('Orgnization', 'invisible');
$crud-&gt;callback_before_insert(array($this, '_created_callback'));
$crud-&gt;callback_before_update(array($this, '_modified_callback'));
$crud-&gt;set_crud_url_path(site_url(strtolower(__CLASS__.&quot;/&quot;.__FUNCTION__)),site_url(strtolower(__CLASS__.&quot;/cfsSetup&quot;)));
$output = $crud-&gt;render();
if($crud-&gt;getState() != 'list') {
$this-&gt;_example_output($output);
} else {
return $output;
}
}
</pre>
<p> </p>
<p><br />
<br />
Finally my callback functions are :</p>
<pre class="_prettyXprint">
function _created_callback($post_array) {
$user = $this-&gt;ion_auth-&gt;user()-&gt;row();
$post_array['CreatedBy'] = $user-&gt;username;
$post_array['CreatedOn'] = date('Y-d-m');
$post_array['LastModified'] = date('Y-d-m');
$post_array['Orgnization']= $user-&gt;Orgniz_Id;
return $post_array;
}
function _modified_callback($post_array) {
$user = $this-&gt;ion_auth-&gt;user()-&gt;row();
$post_array['LastModifiedBy'] = $user-&gt;username;
$post_array['LastModified'] = date('Y-d-m');
return $post_array;
}
</pre>
<p>my problem only with<br />
<br />
CreatedOn and LastModified fields. I see their values&nbsp; in my tables like 00-00-0000.<br />
<br />
thanks in Advance<br />
</p>
Posted 14 August 2013 - 12:16 PM
I have 3 identical grads in one page all of them use same callback_before_insert and callback_before_update functions
everything works fine except date values. Please anyone have an idea bout the problem let me know .
here is my views
function new_acty() { $crud = new grocery_CRUD(); $user = $this->ion_auth->user()->row(); $crud->where('Orgnization', $user->Orgniz_Id); $crud->set_theme('datatables'); $crud->set_table('activities'); $crud->set_subject('Activity'); $crud->display_as('Activity_name','Activity Name') ->display_as('Activity_des','Description') ->display_as('CreatedOn','Created On') ->display_as('CreatedBy','Created By') ->display_as('LastModifiedBy','Last ModifiedBy') ->display_as('LastModified','Last ModifiedOn') ; $crud->required_fields('Activity_name','Activity_des'); $crud->fields('Activity_name','Activity_des','Orgnization','CreatedOn','CreatedBy','LastModifiedBy','LastModified'); $crud->columns('Activity_name','Activity_des','CreatedBy','LastModifiedBy'); $crud->field_type('CreatedBy','invisible'); $crud->field_type('CreatedOn','invisible'); $crud->field_type('LastModifiedBy','invisible'); $crud->field_type('LastModified','invisible'); $crud->field_type('Orgnization','invisible'); $crud->callback_before_insert(array($this, '_created_callback')); $crud->callback_before_update(array($this, '_modified_callback')); $crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/cfsSetup"))); $output = $crud->render(); if($crud->getState() != 'list') { $this->_example_output($output); } else { return $output; } }
and this my second grad
function new_cfs() { $crud = new grocery_CRUD(); $user = $this->ion_auth->user()->row(); $crud->where('Orgnization', $user->Orgniz_Id); $crud->set_table('basic_info_cfs'); $crud->set_subject('CFS'); //$crud->set_theme('datatables'); $crud->display_as('cfs_name','CFS Name ') ->display_as('Governorate','Governorate') ->display_as('district','District') ->display_as('Area','Area') ->display_as('location_type','Location Type ') ->display_as('cfs_type','CFS Type'); $crud->set_relation('location_type','cfs_location','location_type_name'); $crud->set_relation('cfs_type','cfs_types','type_name'); $crud->set_relation('Governorate', 'governorates', 'Gov_name'); $crud->set_relation('district', 'districts', 'Dist_name'); $crud->fields('cfs_name','Governorate','district','Area','location_type','cfs_type','shift','Orgnization','CreatedOn','CreatedBy','LastModifiedBy','LastModified'); $crud->columns('cfs_name','Governorate','district','Area','location_type','cfs_type','shift','CreatedBy','LastModifiedBy'); $crud->field_type('shift','dropdown', array('1' => 'Morning', '0' => 'afternoon')); $crud->field_type('CreatedBy','invisible'); $crud->field_type('CreatedOn','invisible'); $crud->field_type('LastModifiedBy','invisible'); $crud->field_type('LastModified','invisible'); $crud->field_type('Orgnization','invisible'); $crud->callback_before_insert(array($this, '_created_callback')); $crud->callback_before_update(array($this, '_modified_callback')); $crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/cfsSetup"))); $output = $crud->render(); if($crud->getState() != 'list') { $this->_example_output($output); } else { return $output; } }
and here the third
function New_child() { $crud = new grocery_CRUD(); $user = $this->ion_auth->user()->row(); $crud->where('Orgnization', $user->Orgniz_Id); $crud->set_subject('Child'); $crud->set_table('child_prof_cfs'); //$crud->set_theme('datatables'); $crud->display_as('Child_Name','Child Name ') ->display_as('Child_Age','Child Age ') ->display_as('child_address','Child Address ') ->display_as('child_phone','Contact') ->display_as('child_des','description') ->display_as('child_fur_des',' further description'); $crud->set_relation_n_n('ChildNeed', 'cfs_child_suppot', 'cfs_support_type', 'Child_No', 'support_type_no', 'support_type_name'); $crud->set_relation_n_n('ChildStatus', 'cfs_child_status', 'cfs_status_type', 'Child_No', 'status_id', 'status_title'); $crud->fields('Child_Name','Child_Age','Gender','child_address','child_phone','child_des','child_fur_des','ChildNeed','ChildStatus','Orgnization','CreatedOn','CreatedBy','LastModifiedBy','LastModified'); $crud->columns('Child_Name','Child_Age','Gender','child_address','child_phone','child_des','child_fur_des','ChildNeed','ChildStatus','CreatedBy','LastModifiedBy'); $crud->field_type('Gender','dropdown', array('1' => 'Boy', '0' => 'Girl')); $crud->field_type('CreatedBy','invisible'); $crud->field_type('CreatedOn','invisible'); $crud->field_type('LastModifiedBy','invisible'); $crud->field_type('LastModified','invisible'); $crud->field_type('Orgnization', 'invisible'); $crud->callback_before_insert(array($this, '_created_callback')); $crud->callback_before_update(array($this, '_modified_callback')); $crud->set_crud_url_path(site_url(strtolower(__CLASS__."/".__FUNCTION__)),site_url(strtolower(__CLASS__."/cfsSetup"))); $output = $crud->render(); if($crud->getState() != 'list') { $this->_example_output($output); } else { return $output; } }
finally my callback functions
function _created_callback($post_array) { $user = $this->ion_auth->user()->row(); $post_array['CreatedBy'] = $user->username; $post_array['CreatedOn'] = date('Y-d-m'); $post_array['LastModified'] = date('Y-d-m'); $post_array['Orgnization']= $user->Orgniz_Id; return $post_array; } function _modified_callback($post_array) { $user = $this->ion_auth->user()->row(); $post_array['LastModifiedBy'] = $user->username; $post_array['LastModified'] = date('Y-d-m'); return $post_array; }
my problem only with
CreatedOn and LastModified fields. I see their values&nbsp; in my tables like 00-00-0000.
thanks in Advance
Posted 17 August 2013 - 06:45 AM
Hi there,
Don't change the field type of the CreatedOn / LastModified .. and whatever you want to populate it back in the callbacks to any type (invisible / readonly, etc). Rather change it to type hidden. I have not experienced it as what is the effect of invisible .. but hidden is the best way to ensure that the field will be passed and is set to be part of the parameters the GC engine will parse / populate while setting it in the tables.
Change it to hidden and see .. it should surely work.
Posted 17 August 2013 - 12:01 PM
thank you so much Amit for your reply.
I change it to hidden as recommended but still same problem, i get 0000-00-00 inside my database table :( :(
you know , before I add the third grid it was working fine and I got the date, but with adding last one I lost it
I remove it after that but the problem still.
until now i have no idea how can I solve this problem.
Posted 17 August 2013 - 12:15 PM
Well technically that should not be a problem as such. You can add as many grids and let it call the same callback function but it really should not have any issue on the same. Can you share the snapshot of the table structure, which environment you testing and also the post parameters when u add / update so based on the same we can come to some analysis as to what is the actual problem and where. Also do 1 more thing, print out the elements of post_array and lets see if it dose have the parameters in within the same. If yes, it should be inserted. If not, it might just ignore it. A complete collection of snapshots as described may be helpful to diagnose and come to the proper solution
Posted 17 August 2013 - 13:48 PM
1- for table structure ( please see the attachment)
2- for the environment I am working on PhpMyadmin as database with CodeIgniter_2.1.3 and grocery-crud-1.4
3- my add/update parameters are
3.1 :
$crud->fields('Activity_name','Activity_des','Orgnization','CreatedOn','CreatedBy','LastModifiedBy','LastModified');
3.2:
$crud->fields('cfs_name','Governorate','district','Area','location_type','cfs_type','shift','Orgnization','CreatedOn','CreatedBy','LastModifiedBy','LastModified');
3.3
$crud->fields('Child_Name','Child_Age','Gender','child_address','child_phone','child_des','child_fur_des','ChildNeed','ChildStatus','Orgnization','CreatedOn','CreatedBy','LastModifiedBy','LastModified');
4- I have no idea how to print out the elements of post_array using GC structure. please tell me how and i will print it to you
thanks in advance for your help Amit
Posted 17 August 2013 - 13:55 PM
Well use firefox with firebug installed, post that when you go to the add section of any grid, press F12 and click on save. There you will see the method being called with /add as post. There when u click on that url .. it will expand up with details. That is where you will find in all the fields that gets posted.
Secondly, what i will like you to do (as mentioned above /earlier) is that you do a print_r($post_array) as you enter into the callback function .. before you alter the same.
Also in thefirebug (in the links, detail section) you can get the output of the same in response tab. Copy the output and paste it .. so it will be good for debuging
Posted 17 August 2013 - 20:12 PM
Well, find the attached picture to see add form as requested , you will see only CreatedOn and LastModified fields from call back that appear there as hidden but other fields like username and organization set as invisible so we can't see them
secondly , please correct me if I am doing wrong , my callback should be like
function _created_callback($post_array) { $user = $this->ion_auth->user()->row(); $post_array['CreatedBy'] = $user->username; $post_array['CreatedOn'] = date('Y-d-m'); $post_array['LastModified'] = date('Y-d-m'); $post_array['Orgnization']= $user->Orgniz_Id; return $post_array; print_r($post_array); } function _modified_callback($post_array) { $user = $this->ion_auth->user()->row(); $post_array['LastModifiedBy'] = $user->username; $post_array['LastModified'] = date('Y-d-m'); return $post_array; print_r($post_array); }
then from HTML tab - detail section (links ) i should get the link of my posted data as it is in my list view as following :
<tr> <td class="" width="7%"> <div class="text-left">test3</div> </td> <td class="" width="7%"> <div class="text-left">Abyan</div> </td> <td class="" width="7%"> <div class="text-left">Ahwer</div> </td> <td class="" width="7%"> <div class="text-left">testarea</div> </td> <td class="" width="7%"> <div class="text-left">Community</div> </td> <td class="" width="7%"> <div class="text-left">Fixed</div> </td> <td class="" width="7%"> <div class="text-left">Morning</div> </td> <td class="" width="7%"> <div class="text-left">Assem Riadh</div> </td> <td class="" width="7%"> <div class="text-left"> </div> </td> <td class="" width="7%"> <div class="text-left">0000-00-00</div> </td>
let me know if this the way of debugging or i missed something this the first time i used firebug .
Posted 18 August 2013 - 09:04 AM
Naa .. sorry brother.. this is not what i asked you to get ..
In firefox .. press F12 .. go to Net tab ..
Click on the add button or update button .. there u will find the url being called. Click on the final url with /add on the same .. there click on that.. then it will expand with details .. and tabs like above..
in those tabs click on the post .. that is where u will get the actual post...
and as requested you to do a print_r for the $post_array .. for the same url .. go to the response tab.. that is where u will get the response back from the call..
that is where u will find the dump or the post_array ..
copy / paste that dump .. and also the post params to the url
Posted 18 August 2013 - 10:22 AM
thank you so much Amit for your patience.
I did as you told me now.
see the attachment to find the parameters
and here is my response tab
{"output":"<script type=\"text\/javascript\">\nvar ajax_relation_url = 'http:\/\/localhost\/cpuwebsite\/cfs\/new_cfs\/ajax_relation';\n\n<\/script>\n<script type=\"text\/javascript\">\nvar ajax_relation_url = 'http:\/\/localhost\/cpuwebsite\/cfs\/new_cfs\/ajax_relation';\n\n<\/script>\n<script type=\"text\/javascript\">\nvar ajax_relation_url = 'http:\/\/localhost\/cpuwebsite\/cfs\/new_cfs\/ajax_relation';\n\n<\/script>\n<script type=\"text\/javascript\">\nvar ajax_relation_url = 'http:\/\/localhost\/cpuwebsite\/cfs\/new_cfs\/ajax_relation';\n\n<\/script>\n<div class=\"flexigrid crud-form\" style='width: 100%;' data-unique-hash=\"1bd21009c2e60c9d903dd62325e930d2\">\n\t<div class=\"mDiv\">\n\t\t<div class=\"ftitle\">\n\t\t\t<div class='ftitle-left'>\n\t\t\t\tAdd CFS\t\t\t<\/div>\n\t\t\t<div class='clear'><\/div>\n\t\t<\/div>\n\t\t<div title=\"Minimize\/Maximize\" class=\"ptogtitle\">\n\t\t\t<span><\/span>\n\t\t<\/div>\n\t<\/div>\n<div id='main-table-box'>\n\t<form action=\"http:\/\/localhost\/cpuwebsite\/cfs\/new_cfs\/insert\" method=\"post\" id=\"crudForm\" autocomplete=\"off\" enctype=\"multipart\/form-data\" accept-charset=\"utf-8\">\t\t<div class='form-div'>\n\t\t\t\t\t\t<div class='form-field-box odd' id=\"cfs_name_field_box\">\n\t\t\t\t<div class='form-display-as-box' id=\"cfs_name_display_as_box\">\n\t\t\t\t\tCFS Name :\n\t\t\t\t<\/div>\n\t\t\t\t<div class='form-input-box' id=\"cfs_name_input_box\">\n\t\t\t\t\t<input id='field-cfs_name' name='cfs_name' type='text' value=\"\" maxlength='30' \/>\t\t\t\t<\/div>\n\t\t\t\t<div class='clear'><\/div>\n\t\t\t<\/div>\n\t\t\t\t\t\t<div class='form-field-box even' id=\"Governorate_field_box\">\n\t\t\t\t<div class='form-display-as-box' id=\"Governorate_display_as_box\">\n\t\t\t\t\tGovernorate :\n\t\t\t\t<\/div>\n\t\t\t\t<div class='form-input-box' id=\"Governorate_input_box\">\n\t\t\t\t\t<select id='field-Governorate' name='Governorate' class='chosen-select' data-placeholder='Select Governorate' style='width:300px'><option value=''><\/option><option value='1' >Abyan<\/option><option value='3' >Al Dhale\u2019e<\/option><option value='2' >Shabwa<\/option><\/select>\t\t\t\t<\/div>\n\t\t\t\t<div class='clear'><\/div>\n\t\t\t<\/div>\n\t\t\t\t\t\t<div class='form-field-box odd' id=\"district_field_box\">\n\t\t\t\t<div class='form-display-as-box' id=\"district_display_as_box\">\n\t\t\t\t\tDistrict :\n\t\t\t\t<\/div>\n\t\t\t\t<div class='form-input-box' id=\"district_input_box\">\n\t\t\t\t\t<select id='field-district' name='district' class='chosen-select' data-placeholder='Select District' style='width:300px'><option value=''><\/option><option value='4' >Ahwer<\/option><option value='3' >Al Wade\u2019a<\/option><option value='1' >Khanfar<\/option><option value='7' >Mefa'a<\/option><option value='6' >Mudiyah<\/option><option value='2' >Zinjibar<\/option><\/select>\t\t\t\t<\/div>\n\t\t\t\t<div class='clear'><\/div>\n\t\t\t<\/div>\n\t\t\t\t\t\t<div class='form-field-box even' id=\"Area_field_box\">\n\t\t\t\t<div class='form-display-as-box' id=\"Area_display_as_box\">\n\t\t\t\t\tArea :\n\t\t\t\t<\/div>\n\t\t\t\t<div class='form-input-box' id=\"Area_input_box\">\n\t\t\t\t\t<input id='field-Area' name='Area' type='text' value=\"\" maxlength='20' \/>\t\t\t\t<\/div>\n\t\t\t\t<div class='clear'><\/div>\n\t\t\t<\/div>\n\t\t\t\t\t\t<div class='form-field-box odd' id=\"location_type_field_box\">\n\t\t\t\t<div class='form-display-as-box' id=\"location_type_display_as_box\">\n\t\t\t\t\tLocation Type :\n\t\t\t\t<\/div>\n\t\t\t\t<div class='form-input-box' id=\"location_type_input_box\">\n\t\t\t\t\t<select id='field-location_type' name='location_type' class='chosen-select' data-placeholder='Select Location Type ' style='width:300px'><option value=''><\/option><option value='2' >Community<\/option><option value='1' >School<\/option><\/select>\t\t\t\t<\/div>\n\t\t\t\t<div class='clear'><\/div>\n\t\t\t<\/div>\n\t\t\t\t\t\t<div class='form-field-box even' id=\"cfs_type_field_box\">\n\t\t\t\t<div class='form-display-as-box' id=\"cfs_type_display_as_box\">\n\t\t\t\t\tCFS Type :\n\t\t\t\t<\/div>\n\t\t\t\t<div class='form-input-box' id=\"cfs_type_input_box\">\n\t\t\t\t\t<select id='field-cfs_type' name='cfs_type' class='chosen-select' data-placeholder='Select CFS Type' style='width:300px'><option value=''><\/option><option value='2' >Fixed<\/option><option value='1' >Mobile<\/option><\/select>\t\t\t\t<\/div>\n\t\t\t\t<div class='clear'><\/div>\n\t\t\t<\/div>\n\t\t\t\t\t\t<div class='form-field-box odd' id=\"shift_field_box\">\n\t\t\t\t<div class='form-display-as-box' id=\"shift_display_as_box\">\n\t\t\t\t\tShift :\n\t\t\t\t<\/div>\n\t\t\t\t<div class='form-input-box' id=\"shift_input_box\">\n\t\t\t\t\t<select id='field-shift' name='shift' class='chosen-select' data-placeholder='Select Shift'><option value='' ><\/option><option value='1' >Morning<\/option><option value='0' >afternoon<\/option><\/select>\t\t\t\t<\/div>\n\t\t\t\t<div class='clear'><\/div>\n\t\t\t<\/div>\n\t\t\t\t\t\t<!-- Start of hidden inputs -->\n\t\t\t\t<input id='field-CreatedOn' type='hidden' name='CreatedOn' value='' \/><input id='field-LastModified' type='hidden' name='LastModified' value='' \/>\t\t\t<!-- End of hidden inputs -->\n\t\t\t<input type=\"hidden\" name=\"is_ajax\" value=\"true\" \/>\n\t\t\t<div id='report-error' class='report-div error'><\/div>\n\t\t\t<div id='report-success' class='report-div success'><\/div>\n\t\t<\/div>\n\t\t<div class=\"pDiv\">\n\t\t\t<div class='form-button-box'>\n\t\t\t\t<input id=\"form-button-save\" type='submit' value='Save' class=\"btn btn-large\"\/>\n\t\t\t<\/div>\n\t\t\t<div class='form-button-box'>\n\t\t\t\t<input type='button' value='Save and go back to list' id=\"save-and-go-back-button\" class=\"btn btn-large\"\/>\n\t\t\t<\/div>\n\t\t\t<div class='form-button-box'>\n\t\t\t\t<input type='button' value='Cancel' class=\"btn btn-large\" id=\"cancel-button\" \/>\n\t\t\t<\/div>\n\t\t\t<div class='form-button-box'>\n\t\t\t\t<div class='small-loading' id='FormLoading'>Loading, saving data...<\/div>\n\t\t\t<\/div>\n\t\t\t<div class='clear'><\/div>\n\t\t<\/div>\n\t<\/form><\/div>\n<\/div>\n<script>\n\tvar validation_url = 'http:\/\/localhost\/cpuwebsite\/cfs\/new_cfs\/insert_validation';\n\tvar list_url = 'http:\/\/localhost\/cpuwebsite\/cfs\/cfssetup';\n\n\tvar message_alert_add_form = \"The data you had insert may not be saved.\\nAre you sure you want to go back to list?\";\n\tvar message_insert_error = \"An error has occurred on insert.\";\n<\/script><script type=\"text\/javascript\">\nvar js_date_format = 'dd\/mm\/yy';\n<\/script>\n","js_files":["http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/js\/jquery-1.10.2.min.js","http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/js\/jquery_plugins\/jquery.chosen.min.js","http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/js\/jquery_plugins\/config\/jquery.chosen.config.js","http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/themes\/flexigrid\/js\/jquery.form.js","http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/themes\/flexigrid\/js\/flexigrid-add.js","http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/js\/jquery_plugins\/jquery.noty.js","http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/js\/jquery_plugins\/config\/jquery.noty.config.js"],"js_lib_files":["http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/js\/jquery-1.10.2.min.js","http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/js\/jquery_plugins\/jquery.chosen.min.js","http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/themes\/flexigrid\/js\/jquery.form.js","http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/js\/jquery_plugins\/jquery.noty.js","http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/js\/jquery_plugins\/config\/jquery.noty.config.js"],"js_config_files":["http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/js\/jquery_plugins\/config\/jquery.chosen.config.js","http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/themes\/flexigrid\/js\/flexigrid-add.js"],"css_files":["http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/css\/jquery_plugins\/chosen\/chosen.css","http:\/\/localhost\/cpuwebsite\/assets\/grocery_crud\/themes\/flexigrid\/css\/flexigrid.css"]}
I also tried to get Post Insert parameters,
Partsmultipart/form-data cfs_name TestDate Governorate 1 district 4 Area Ja'ar location_type 1 cfs_type 2 shift 1 CreatedOn LastModified is_ajax true