Hi,
I have the following crud. Can I remove 'function_time_selector' field on the READ state ? It is because I get this error message if I leave the function_time_selector on the READ page.
Error Massage
A PHP Error was encountered
Severity: Warning
Message: in_array() expects parameter 2 to be array, null given
Filename: libraries/Grocery_CRUD.php
Line Number: 161
CRUD code:
$crud->fields('function_address','contact_person','function_time', 'function_time_selector', 'function_purpose'); $crud->callback_field('function_time_selector',array($this,'functime_callback')); function functime_callback($value = '', $primary_key = null) { $time_value = substr($value, 0, -2); $time_ampm = substr($value, -3); $functime = ""; /*get the time value*/ $functime = '<select id="field-function_time_1" name="function_time_1">'; for($i = 1.00; $i <= 12.00; $i++){ $functime .= '<option value="'.$i.'" '.($time_value == $i ? "selected" : "").'>'.number_format($i, 2, '.', '').'</option>'; } $functime .= '</select>'; /*get the time AM/PM*/ $functime .= '<select id="field-function_time_2" name="function_time_2">'; $functime .= '<option value=" AM" '.($time_ampm == ' AM' ? "selected" : "").'>AM</option>'; $functime .= '<option value=" PM" '.($time_ampm == ' PM' ? "selected" : "").'>PM</option>'; $functime .= '</select>'; return $functime; }