/** * Show the application dashboard to the user. * * @return Response */ public function getAllMembers() { $members = Member::all(); $data = array(); foreach ($members as $member) { # code... $member_data = array(); array_push($member_data, $member->member_id); array_push($member_data, $member->first_name); array_push($member_data, $member->last_name); array_push($member_data, $member->gender); array_push($member_data, $member->birthday); array_push($member_data, $member->address); array_push($member_data, $member->start_date); array_push($member_data, $member->end_date); array_push($member_data, $member->phone); array_push($member_data, $member->balance); array_push($member_data, $member->level); array_push($member_data, $member->email); array_push($member_data, "/member/" . $member->member_id); $data[] = $member_data; } $returner = array('data' => $data); echo json_encode($returner); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $members = Member::all(); foreach ($members as $member) { $member->load('devices', 'subgroups'); } return response()->json($members, 200); }
private function numMembers() { $numActive = Member::all()->where('is_active', 1)->count(); $numInactive = Member::all()->where('is_active', 0)->count(); $numDischarged = Member::onlyTrashed()->count(); $numTotal = Member::withTrashed()->count(); return ['numActive' => $numActive, 'numInactive' => $numInactive, 'numDischarged' => $numDischarged, 'numTotal' => $numTotal]; }
public function export() { $data = Member::all(); Excel::create('Filename', function ($excel) use($data) { $excel->sheet('Sheetname', function ($sheet) use($data) { $sheet->fromArray($data); }); })->download('xls'); }
public static function getMembersForMultiselect() { $members = Member::all(array('id', 'name'))->toArray(); $multiselectMembers = array(); foreach ($members as $member) { $multiselectMembers[$member['id']] = $member['name']; } return $multiselectMembers; }
/** * Display a listing of the resource. * * @return Response */ public function index() { $data = Employee::all(); $name = Auth::user()->name; $pos = ProjectOfficer::all(); $adms = Admin::all(); $tls = Teamleader::all(); $mems = Member::all(); return view('dropmin.dashboard.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('data', $data); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $members = Member::all(); foreach ($members as &$member) { $member->setPriority($member->getPriority()); $member->setLowerPriority($member->getLowerPriority()); } $members = $members->sortByDesc('priority'); return view('members.index', compact('members')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $data = Employee::all(); $name = Auth::user()->name; $pos = ProjectOfficer::all(); $adms = Admin::all(); $tls = Teamleader::all(); $mems = Member::all(); $proj = Project::all(); $ac = Auth::user()->id; $acc = AccessClient::where('id_users', $ac)->get(); return view('dropmin.dashboard.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('projs', $proj)->with('accss', $acc)->with('datas', $data); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $members = []; foreach (Member::all() as $member) { $members += [$member->id => $member->name()]; } $loans = Loan::all(); $ltypes = []; foreach ($loans as $loan) { $ltypes += [$loan->id => $loan->name]; } return view('admin.account.create', compact('ltypes', 'members', 'loans')); }
public function index(Request $request) { if (!Auth::check()) { return response()->json($this->notLoginJson, 401); } else { $user = Auth::user(); if (!$user->hasRole('user')) { return response()->json($this->needPermissionsJson, 401); } } $members = Member::all(); return response()->json($members); }
public function index() { foreach (Member::all() as $item) { sleep(2); // ip-api.com ban any IP addresses doing over 150 requests per minute $json = json_decode(file_get_contents("http://ip-api.com/json/{$item->ip}")); $item->city = $json->city; $item->country = $json->country; $member = Member::find($item->id); $member->city = $item->city; $member->country = $item->country; $member->save(); } return "Ready"; }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // Start Check Authorization $invalid_auth = 1; $authRole = Auth::user()->UserRoles->role; if ($authRole == 1 or $authRole == 3 or $authRole == 5 or $authRole == 7 or $authRole == 9) { $invalid_auth = 0; } if ($invalid_auth == 1) { Alert::error('Anda tidak memilik akses ini')->persistent('close'); return redirect('dashboard'); } // End Check Authorization $data = Employee::all(); $name = Auth::user()->name; $pos = ProjectOfficer::all(); $adms = Admin::all(); $tls = Teamleader::all(); $mems = Member::all(); return view('dropmin.record.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('datas', $data); }
/** * List of all member devices and their pertinent information * * @return \Illuminate\Http\Response */ public function globalView(Request $request) { $validator = Validator::make($request->all(), ['type' => array('regex:/^[\\d]$/i')]); if ($validator->fails()) { return response()->json(["error" => "validator failed", "cause" => $validator->failed()], 400); } else { $ret = array(); $members = Member::all(); foreach ($members as $member) { $devices; if ($request->has('type')) { $devices = $member->devices->where('type', $request->type); } else { $devices = $member->devices; } foreach ($devices as $device) { $entry = ['mid' => $member->id, 'did' => $device->id, 'deviceID' => $device->deviceID, 'deviceName' => $device->name, 'memberName' => $member->name, 'deviceType' => $device->type]; array_push($ret, $entry); } } return response()->json($ret, 200); } }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function sendRead() { $members = Member::all(); //all data of member collection $inbox_id = HelperController::getPage(); $id = Auth::id(); $author = User::find($id); $inbox = Inbox::find($inbox_id); //find data in Inbox collection $unread = Inbox::where('mail_read', '=', '0')->where('member_id', '=', $id)->get()->count(); //mailbox view return view('vendor/flatAdmin/mailRead', compact(array('members', 'author', 'inbox', 'unread', 'id'))); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $membersObj = Member::all(); return view('members.index', compact('membersObj')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $members = Member::all(); $events = Event::all(); return view('points.index', compact('members', 'events')); }
public function getDeleteEquipe($id) { $membro = Member::findOrFail($id); $membro->delete(); $equipe = Member::all()->sortBy("name"); return redirect('/editar_equipe')->with('equipe', $equipe); }
/** * Returns json with every member's id and name * * @return string */ public function exportMembers() { $reply = []; $members = Member::all(); foreach ($members as $member) { $m = []; $m['id'] = $member->id; $m['first_name'] = $member->first_name; $m['last_name'] = $member->last_name; $reply[] = $m; } return response()->json($reply); }
public function index() { return view('member.index')->with('members', Member::all()); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // $member = Member::find($id); $member->delete(); // redirect $members = Member::all(); session()->flash('flash_message', 'Member deleted successfully!'); return redirect()->back(); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $members = Member::all(); return response()->json($members); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $members = Member::all(); return view('tambay_points.index', compact('members')); }