/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if ($this->checkauth(9)['err'] == 1) { return $this->checkauth(9)['view']; } Activities::where('id', $id)->delete(); return redirect(url('admin/activities')); }
public function actpost($tgl) { $data = array('act' => Activities::whereRaw('date_format(created_at,"%Y-%m-%d")="' . $tgl . '"')->get(), 'tgl' => $tgl); return view('mine.actpost')->with($data); }
public function editActivity(Request $request) { $session = $request->get('session'); $id = $request->get('id'); $staffId = $request->get('activitystaffId'); $cusId = $request->get('cusId'); $date = $request->get("activitydate"); $type = $request->get("activitytype"); $outcome = $request->get("activityoutcome"); $activity = Activities::find($id); $activity->cusId = $cusId; $activity->staffId = $staffId; $activity->date = $date; $activity->type = $type; $activity->outcome = $outcome; $activity->save(); return json_encode(DB::table('activities as a')->select('a.id as activityId', 'a.cusId', 'a.date', 'a.outcome', 'a.staffId', 'a.type', 'u.id as staffId', 'u.fullname as staffName')->leftJoin('user as u', 'a.staffId', '=', 'u.id')->get()); }