public function user_remove(Request $request, $user_id) { Patients::where('id', $user_id)->delete(); $patients = Patients::orderBy('first_name', 'desc')->get(); $patients1 = Patients::orderBy('reg_date', 'desc')->get(); $HTMLView = (string) view('admin_patients_views.home_1')->with(['comment' => $patients, 'comment1' => $patients1]); $res['page'] = $HTMLView; return response()->json($res); }
public function get_doctor_comments(Request $request, $doc_id) { try { $comments = Comments::where('doctor_id', $doc_id)->orderBy('id', 'DESC')->get(); $count = 1; foreach ($comments as $com) { $user = Patients::where('user_id', $com->user_id)->first(); $img = Images::where('user_id', $com->user_id)->first(); $temp['comment'] = $com; $temp['user'] = $user; $temp['user_img'] = $img; $comment_ob['comment_' . $count] = $temp; $count++; } } catch (Exception $e) { $this->LogError('AjaxController Get_Doctor_Comments Function', $e); } if ($count > 1) { $res['COMMENT'] = "YES"; $res['DATA'] = $comment_ob; return response()->json($res); } else { $res['COMMENT'] = "NO"; return response()->json($res); } }
public function blockUser(Request $request, $user_id) { $reason = Input::get('reason'); try { //block the user User::where('id', $user_id)->update(['mode' => 0]); Patients::where('user_id', $user_id)->update(['comments' => $reason]); $user = Patients::whereUser_id($user_id)->first(); /* Send an Email */ self::sendBolckedEmail($user->first_name, $user->last_name, $user->email); $HTMLView = (string) view('admin_patients_views.home_1'); $res['error'] = false; $res['page'] = $HTMLView; return response()->json($res); } catch (Exception $e) { $res['error'] = true; $HTMLView = (string) view('errors.adminError'); $res['page'] = $HTMLView; return response()->json($res); } }