/** * POST /warehouse * */ public function s003() { $req = App::request(); if ($req->isPost()) { $post = $req->post(); $attributes = array("warehouse_nama" => $post["warehouse_nama"], "keterangan" => $post["keterangan"], "company" => "RSMM"); $table = Warehouse::table(); if (is_null($post["gen_id"]) || $post["gen_id"] == "") { $attributes["id"] = ZiUtil::GetNowID(); $table->insert($attributes); } else { $where = "id = '" . $post["gen_id"] . "'"; $table->update($attributes, $where); } } App::redirect('warehouse.index'); }