/**
  * Load data into DataTable for Admins.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function fillAdminData()
 {
     $admins = Admin::all();
     $thisAdminEmail = Auth::user()->email;
     $thisAdminID = Admin::where('email', $thisAdminEmail)->first()->emp_id;
     return response()->json(['thisAdmin' => $thisAdminID, 'data' => $admins]);
 }
 public function index()
 {
     $usersData = [];
     $usersData['count'] = User::all()->count();
     $usersData['incompleteCount'] = User::where('status', 0)->count();
     $picsData = [];
     $picsData['count'] = Pic::all()->count();
     $clubsData = [];
     $clubsData['count'] = Club::all()->count();
     $badgesData = [];
     $badgesData['count'] = Badge::all()->count();
     $fixtures = Fixture::all();
     $fixturesData = [];
     $fixturesData['count'] = $fixtures->count();
     $fixturesData['overCount'] = $fixtures->filter(function ($fxt) {
         return $fxt->isOver();
     })->count();
     $fixturesData['closedNotOverCount'] = $fixtures->filter(function ($fxt) {
         return $fxt->isClosed() and !$fxt->isOver();
     })->count();
     $gameweeks = Gameweek::all();
     $gameweeksData = [];
     $gameweeksData['count'] = $gameweeks->count();
     $gameweeksData['completeCount'] = Gameweek::complete()->get()->count();
     $gameweeksData['pendingCount'] = Gameweek::incomplete()->get()->filter(function ($gw) {
         return $gw->hasCompletedFixture();
     })->count();
     $adminsData = [];
     $adminsData['count'] = Admin::all()->count();
     return view('admin.dashboard.index', compact('usersData', 'picsData', 'clubsData', 'badgesData', 'fixturesData', 'gameweeksData', 'adminsData'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // $admin = Admin::all();
     // return $admin;
     $admin = Admin::all();
     return view('admin.index', compact('admin'));
 }
Example #4
0
 public function all($type = 'json')
 {
     $admin = Admin::all();
     if ($type == 'json') {
         return response()->json($admin);
     } else {
         return response()->json($admin);
     }
 }
Example #5
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     // Récupération de tous les administrateurs
     $admins = Admin::all()->where('delete', 0);
     // Récupération de tous les utilisateur
     $users = User::all()->where('delete', 0);
     // Récupération de tous les quizz
     $quizzes = Quizz::all()->where('delete', 0);
     return view('admin/gestion', ['admins' => $admins, 'users' => $users, 'quizzes' => $quizzes]);
 }
 /**
  * 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);
 }
 public function postSuperadmin(Request $request)
 {
     $admin = Admin::all();
     $superadmin = $admin[1]->role;
     $password = $request->get('password');
     $login = Admin::where('role', '=', $superadmin)->where('password', '=', $password)->first();
     if ($login) {
         return redirect('/admission/feestructure');
     }
     return redirect('/admin/superadmin')->with('message', 'Incorrect Password');
 }
Example #8
0
 public function indexAdmin()
 {
     $keyword = Input::get('keyword');
     if (isset($keyword)) {
         //check if keyword has value
         $kategori = Input::get('kategori');
         $admin = Admin::where($kategori, 'LIKE', '%' . $keyword . '%')->get();
         return view('auth.lihat-admin')->with('admin', $admin);
     }
     $admin = Admin::all();
     return view('auth.lihat-admin')->with('admin', $admin);
 }
Example #9
0
 public function getEdit($id)
 {
     $user = $this->user->find($id);
     $admins = Admin::all();
     /*pega o id do servidor atual*/
     $servers = Server::all();
     /*pega o ip do servidor */
     $resellers = Reseller::all();
     /*pega o ip do servidor */
     $packages = Package::all();
     return view('admin.users.edit', compact('admins', 'servers', 'resellers', 'user', 'packages'));
 }
 /**
  * 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);
 }
 /**
  * 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);
 }
Example #12
0
 public function administrators()
 {
     $all_admins = Admin::all();
     $all_roles = Role::all();
     $with_add = true;
     $current_form = 'administrators';
     return view('admin.administrators', compact('all_admins', 'with_add', 'all_roles', 'current_form'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data = array('title' => 'Admin', 'admin' => Admin::all());
     return view('backend.pages.backend-show-admin')->with($data);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $profs = Enseignant::all();
     $administrators = Admin::all();
     return View('app/gestion_enseignants', array('profs' => $profs, 'administrators' => $administrators));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $data = Admin::all();
     return view('pages.admin.previlege.index', compact('data'));
 }
Example #16
0
 public function registration()
 {
     $this->_methodName = 'registration';
     $this->resolveParams();
     $arNeed = ['email' => 'required|email|max:200|unique:user', 'firstName' => 'required', 'lastName' => 'required', 'birthday' => 'required|date|date_format:"d.m.Y"'];
     $this->checkAttr($arNeed);
     if (Auth::check() && !Auth::checkAdmin()) {
         throw new \App\Exceptions\ExceptionApiAuthAlready(['email' => $this->_request_params['email'], 'firstName' => $this->_request_params['firstName'], 'lastName' => $this->_request_params['lastName'], 'birthday' => $this->_request_params['birthday']], $this->_typeName, $this->_methodName);
     }
     $reg_user = \App\Users::whereEmail($this->_request_params['email'])->first();
     if (is_null($reg_user)) {
         if (Auth::checkAdmin()) {
             $reg_user = new \App\Users();
             $reg_user->email = $this->_request_params['email'];
             $reg_user->first_name = $this->_request_params['firstName'];
             $reg_user->last_name = $this->_request_params['lastName'];
             $reg_user->bithday = Carbon::createFromFormat('d.m.Y', $this->_request_params['birthday'])->toDateTimeString();
             $password = $this->generateCode(8);
             $this->_user = $reg_user;
             $reg_user->bonusPoint = Auth::user()->point;
             $reg_user->password = Hash::make($password);
             if (isset($this->_request_params['occupation'])) {
                 $arNeed = ['occupation' => 'required|max:64'];
                 $this->checkAttr($arNeed);
                 $reg_user->occupation = $this->_request_params['occupation'];
             }
             if (isset($this->_request_params['city'])) {
                 $arNeed = ['city' => 'required|max:64'];
                 $this->checkAttr($arNeed);
                 $reg_user->city = $this->_request_params['city'];
             }
             if (isset($this->_request_params['street'])) {
                 $arNeed = ['street' => 'required|max:128'];
                 $this->checkAttr($arNeed);
                 $reg_user->street = $this->_request_params['street'];
             }
             $reg_user->save();
             $tasks = \App\Task::where('userAll', 1)->get();
             foreach ($tasks as $task) {
                 $task_user = new \App\UserTask();
                 $task_user->id_task = $task->id;
                 $task_user->id_user = $reg_user->id;
                 $task_user->status = 'available';
                 $task_user->save();
             }
         } else {
             $reg_user = new \App\Users();
             $reg_user->email = $this->_request_params['email'];
             $reg_user->first_name = $this->_request_params['firstName'];
             $reg_user->last_name = $this->_request_params['lastName'];
             $reg_user->bithday = Carbon::createFromFormat('d.m.Y', $this->_request_params['birthday'])->toDateTimeString();
             $password = $this->generateCode(8);
             $reg_user->password = Hash::make($password);
             $this->_user = $reg_user;
             $reg_user->bonusPoint = \App\Admin::all()->first()->point;
             $reg_user->save();
             $tasks = \App\Task::where('userAll', 1)->get();
             foreach ($tasks as $task) {
                 $task_user = new \App\UserTask();
                 $task_user->id_task = $task->id;
                 $task_user->id_user = $reg_user->id;
                 $task_user->status = 'available';
                 $task_user->save();
             }
         }
     } else {
         throw new \App\Exceptions\ExceptionApiUserEmailExist($this->_request_params, $this->_typeName, $this->_methodName);
     }
     Mail::send('mail.welcome', ['data' => ['email' => $reg_user->email, 'password' => $password]], function ($message) {
         $message->to($this->_user->email)->subject('Добро пожаловать!');
     });
     return $this;
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $admins = Admin::all();
     return view('admin.admin.index', compact('admins'));
 }