public function action_index() { $record = new MODEL(); SAVE_FIELDS; $record->save(); $array = array('success' => 'true', 'msg' => 'Record added successfully'); $json = json_encode($array); return $json; }
function update($id, $data = array()) { if ($data['password']) { $data['password'] = end_encode($data['password']); } else { unset($data['password']); } return parent::update($id, $data); }
public function put_index() { $data = file_get_contents('php://input'); $temp = json_decode($data); $new = MODEL::find($temp->id); SAVE_FIELDS; $new->save(); $array = array('success' => 'true'); $json = json_encode($array); return $json; }
public function put_index() { $data = file_get_contents('php://input'); $temp = json_decode($data); $new = MODEL::find($temp->id); $new->DEFAULT_FIELD = $temp->text; $new->PARENT_ID = $temp->parentId; $new->save(); $array = array('success' => 'true'); $json = json_encode($array); return $json; }
function get_list($data = array()) { !$data['order'] && ($data['order'] = "order_id DESC,{$this->id} ASC"); return parent::get_list($data); }
function add($data = array()) { $data['create_time'] = time(); return parent::add($data); }
function update($id, $data = array()) { $data['update_time'] = time(); return parent::update($id, $data); }
function check_password($name, $password) { return parent::get_one(array('name' => $name, 'password' => $password)); }
function get_list($data = array()) { if (END_MODULE == 'admin' && $_SESSION['login_user']['rights']['limit_category_id'] && $_SESSION['login_user']['allowed_categories']) { $data['where'] && ($data['where'] .= ' AND '); $data['where'] .= 'category_id IN (' . $_SESSION['login_user']['allowed_categories'] . ')'; } if (!isset($data['order'])) { $data['order'] = 'order_id DESC,category_id ASC'; } return parent::get_list($data); }