function _save($id = null) { $criteria_options = array(); $criteria_options[0]['id'] = 5; $criteria_options[0]['name'] = 'Luar Biasa'; $criteria_options[1]['id'] = 4; $criteria_options[1]['name'] = 'Melampaui Kebutuhan'; $criteria_options[2]['id'] = 3; $criteria_options[2]['name'] = 'Memenuhi Kebutuhan'; $criteria_options[3]['id'] = 2; $criteria_options[3]['name'] = 'Cukup'; $criteria_options[4]['id'] = 1; $criteria_options[4]['name'] = 'Kurang'; $this->_data['criteria_options'] = $criteria_options; if ($_POST) { if ($this->_validate()) { $CI =& get_instance(); $user = $CI->_get_user(); unset($_POST['user']); unset($_POST['manager']); if (empty($id)) { $_POST['score_taker_id'] = $user['id']; } $id = $this->_model()->save($_POST, $id); // redirect(site_url("cust_service/print_receipt/".$id)); } } else { if ($id !== null) { $this->_data['id'] = $id; // $_POST = $this->_model()->getDetail($id); } } return parent::_save($id); }
function _save($id = null) { parent::_save($id); $provinces = $this->_model()->query('SELECT * FROM province')->result_array(); $this->_data['province_options'] = array('' => l('(Please select)')); foreach ($provinces as $pro) { $this->_data['province_options'][$pro['id']] = $pro['name']; } }
function _save($id = null) { parent::_save($id); if (!empty($id)) { $this->_data['privileges'] = $this->_model()->get_privileges($id); $config = array('fields' => array('uri'), 'actions' => array('delete' => 'role/delete_privilege/' . $id)); $this->load->library('xgrid', $config, 'grid_privilege'); } }
function _save($id = null) { parent::_save($id); $citys = $this->_model()->query('SELECT * FROM city')->result_array(); $this->_data['city_options'] = array('' => l('(Please select)')); foreach ($citys as $ci) { $this->_data['city_options'][$ci['id']] = $ci['name']; } }
function _save($id = null) { if ($_POST) { if (is_array($_POST['address'])) { $_POST['address'] = trim(implode("\n", $_POST['address'])); } } parent::_save($id); if (isset($_POST['address']) && !is_array($_POST['address'])) { $_POST['address'] = explode("\n", $_POST['address']); } }
function _save($id = null) { if ($_POST) { if ($this->_validate()) { $CI =& get_instance(); $user = $CI->_get_user(); $_POST['user_id'] = $user['id']; $id = $this->_model()->save($_POST, $id); // redirect(site_url("cust_service/print_receipt/".$id)); } } else { if ($id !== null) { $this->_data['id'] = $id; // $_POST = $this->_model()->getDetail($id); } } return parent::_save($id); }
function _save($id = null) { parent::_save($id); $menus = $this->_model()->query('SELECT * FROM menu')->result_array(); $this->_data['parent_options'][0] = 'Top'; foreach ($menus as $menu) { $this->_data['parent_options'][$menu['id']] = $menu['title'] . ' (' . $menu['uri'] . ')'; } }
function _save($id = null) { parent::_save($id); $this->_manage_privileges($id); }