public function pilih_tugas($f3) { $post = $f3->get('POST'); $data = $f3->scrub($post); $header = $f3->get("HEADERS"); $dataHeader = $f3->scrub($header); $notes = "takenby:" . $dataHeader['Token']; $id_tugas = $data['id_tugas']; $tugas = new \models\OrdersM(); $tugas->load(array('id=?', $id_tugas)); $tugas->status++; $tugas->notes = $notes; $tugas->save(); $notif = new Notifikasi(); $beritahu = $notif->kirim_notif($f3, $tugas->id_user); $this->set_code("01"); $this->set_msg("Tugas dipilih"); $this->set_data("tugas", ["id_tugas" => $id_tugas, "status" => $tugas->status, "notif" => $beritahu]); $this->return_json(); }
public function set_delete($f3) { $post = $f3->get('POST'); $post = $f3->scrub($post); $id = (int) $post['id']; $order = new \models\OrdersM(); $hapus = $order->set_delete($id); if ($hapus === 1) { $this->set_code("01"); $this->set_msg("Data telah di hapus"); $this->set_data("delete", []); } else { $this->set_code("00"); $this->set_msg("Terdapat kesalahan proses"); $this->set_data("tracking", []); } $this->return_json(); }
function hapusorder() { $order = new \models\OrdersM(); $a = $order->set_delete(5); var_dump($a); }