Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.112
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
html_old /
iNetty /
app /
Http /
Controllers /
Delete
Unzip
Name
Size
Permission
Date
Action
Api
[ DIR ]
drwxrwxrwx
2022-04-21 13:43
Auth
[ DIR ]
drwxrwxrwx
2022-04-21 13:43
ripcord
[ DIR ]
drwxrwxrwx
2022-04-21 13:43
AddressController.php
4.36
KB
-rwxrwxrwx
2022-04-21 13:43
BuildingFloorsController.php
1.9
KB
-rwxrwxrwx
2022-04-21 13:43
BuildingTypesController.php
1.88
KB
-rwxrwxrwx
2022-04-21 13:43
BuildingsController.php
4.48
KB
-rwxrwxrwx
2022-04-21 13:43
CalendarController.php
467
B
-rwxrwxrwx
2022-04-21 13:43
CarHistoryController.php
3.01
KB
-rwxrwxrwx
2022-04-21 13:43
CarsController.php
2.78
KB
-rwxrwxrwx
2022-04-21 13:43
CheckInController.php
1.74
KB
-rwxrwxrwx
2022-04-21 13:43
Controller.php
361
B
-rwxrwxrwx
2022-04-21 13:43
CustomersController.php
4.75
KB
-rwxrwxrwx
2022-04-21 13:43
DevisController.php
4.99
KB
-rwxrwxrwx
2022-04-21 13:43
DevisLinesController.php
2
KB
-rwxrwxrwx
2022-04-21 13:43
DocumentsController.php
2.14
KB
-rwxrwxrwx
2022-04-21 13:43
HomeController.php
2.54
KB
-rwxrwxrwx
2022-04-21 13:43
InterventionAddressesController.php
2.07
KB
-rwxrwxrwx
2022-04-21 13:43
InterventionBuildingsController.php
2.07
KB
-rwxrwxrwx
2022-04-21 13:43
InterventionContactsController.php
2.04
KB
-rwxrwxrwx
2022-04-21 13:43
InterventionStatusController.php
2
KB
-rwxrwxrwx
2022-04-21 13:43
InterventionsController.php
15.03
KB
-rwxrwxrwx
2022-04-21 13:43
OddoController.php
6.5
KB
-rwxrwxrwx
2022-06-02 16:29
PassesController.php
1.72
KB
-rwxrwxrwx
2022-04-21 13:43
ProfileController.php
1.1
KB
-rwxrwxrwx
2022-04-21 13:43
RulesController.php
1.69
KB
-rwxrwxrwx
2022-04-21 13:43
StatusController.php
1.72
KB
-rwxrwxrwx
2022-04-21 13:43
TeamHistoryController.php
3.09
KB
-rwxrwxrwx
2022-04-21 13:43
TeamLogsController.php
1.76
KB
-rwxrwxrwx
2022-04-21 13:43
TeamMembersController.php
1.83
KB
-rwxrwxrwx
2022-04-21 13:43
TeamsController.php
6.69
KB
-rwxrwxrwx
2022-04-21 13:43
UserController.php
4.55
KB
-rwxrwxrwx
2022-04-21 13:43
Save
Rename
<?php namespace App\Http\Controllers; use App\Models\User; use App\Models\Teams; use App\Models\CheckIn; use App\Models\CarHistory; use App\Models\Cars; use Illuminate\Http\Request; use App\Http\Requests\StoreTeamsRequest; use App\Http\Requests\UpdateTeamsRequest; use Illuminate\Support\Facades\DB; class TeamsController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $teams = Teams::all(); $users = $this->getAdmins(); $cars = Cars::all(); $members = $this->getMembers(); return view('teams.index', ['teams' => $teams, 'users' => $users, "members" => $members, "cars" => $cars]); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \App\Http\Requests\StoreTeamsRequest $request * @return \Illuminate\Http\Response */ public function store(Request $request) { if ($request->team_name && $request->color && $request->user_id && $request->password) { $team_name = Teams::where('team_name', $request->team_name)->first(); if (!$team_name) { $team = new Teams(); $team->team_name = $request->team_name; $team->team_color = $request->color; $team->user_id = $request->user_id; $team->password = $request->password; $team->save(); return redirect('/teams'); }else { return redirect('/teams?message=teamAlreadyExist'); } }else { return redirect('/teams?message=emptyField'); } } /** * Display the specified resource. * * @param \App\Models\Teams $teams * @return \Illuminate\Http\Response */ public function show($id) { $team = Teams::find($id); $members = $this->getMembers(); $cars = Cars::all(); $check_in_list = CheckIn::where('team_id', $id)->orderBy('created_at', 'desc')->get(); $team_history_list = $team->teamHistory()->orderBy('created_at', 'desc')->get(); $active_members = []; $current_date = date_create(); foreach ($team_history_list as $team_history) { $team_history["member_name"] = $this->getMemberNameById($team_history->team_member_id); if (($current_date >= date_create($team_history->start_date)) && ($current_date <= date_create($team_history->end_date))){ array_push($active_members, [ "member_name" => $this->getMemberNameById($team_history->team_member_id), "member_email" => $this->getMemberEmailById($team_history->team_member_id), ]); } } $distinct_team_history_list = $team_history_list->unique('history_number'); $cars_history_list = CarHistory::where('team_id', $id)->orderBy('created_at', 'desc')->get(); foreach ($cars_history_list as $cars_history) { $cars_history["car_name"] = $this->getCarNameById($cars_history->car_id); $cars_history["car_matricule"] = $this->getCarMatriculeById($cars_history->car_id); } $distinct_cars_history_list = $cars_history_list->unique('history_number'); foreach ($check_in_list as $check_in) { $check_in["duration"] = $check_in->end_date ? date_diff(date_create($check_in->start_date), date_create($check_in->end_date)) : date_diff(date_create($check_in->start_date), date_create()); } return view('teams.team', ['team' => $team, 'members' => $members, 'team_history_list' => $team_history_list, 'distinct_team_history_list' => $distinct_team_history_list, 'cars' => $cars, 'cars_history_list' => $cars_history_list, 'distinct_cars_history_list' => $distinct_cars_history_list, 'check_in_list' => $check_in_list, 'active_members' => $active_members ]); } /** * Update the specified resource in storage. * * @param \App\Http\Requests\UpdateTeamsRequest $request * @param \App\Models\Teams $teams * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { if ($id && $request->team_name && $request->color && $request->user_id && $request->password) { $team = Teams::where('id', $id)->first(); if ($team) { $team->team_name = $request->team_name; $team->team_color = $request->color; $team->user_id = $request->user_id; $team->password = $request->password; $team->save(); return redirect('/teams'); }else { return redirect('/teams?message=teamNotFound'); } }else{ return redirect('/teams?message=emptyField'); } } /** * Remove the specified resource from storage. * * @param \App\Models\Teams $teams * @return \Illuminate\Http\Response */ public function delete($id) { Teams::where('id', $id)->delete(); return redirect('/teams'); } public function getAdmins() { $user = User::whereHas('rules', function ($query) { return $query->where('role', '=', "admin"); })->get(); return $user; } public function getMembers() { $user = User::whereHas('rules', function ($query) { return $query->where('role', '=', "team"); })->get(); return $user; } public function getMemberNameById($id) { $member = User::where('id', $id)->first(); return $member->name; } public function getMemberEmailById($id) { $member = User::where('id', $id)->first(); return $member->email; } public function getCarNameById($id) { $car = Cars::where('id', $id)->first(); return $car->car_name; } public function getCarMatriculeById($id) { $car = Cars::where('id', $id)->first(); return $car->car_matricule; } public function showActives() { $actualDay = date("Y-m-d"); $teamsActives = DB::table('teams') ->join('team_histories', 'team_histories.team_id', '=', 'teams.id') ->where('team_histories.start_date', '<', $actualDay) ->where('team_histories.end_date', '>', $actualDay) ->distinct('teams.team_name') ->get("team_name"); return view('teams.actives', ['teamsActives' => $teamsActives ]); } }