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\Interventions; use App\Models\User; use App\Models\Clients; use App\Models\Teams; use App\Models\InterventionAddresses; use App\Models\InterventionContacts; use App\Models\InterventionBuildings; use Illuminate\Support\Facades\DB; use App\Http\Requests\StoreInterventionsRequest; use App\Http\Requests\UpdateInterventionsRequest; use Illuminate\Http\Request; class InterventionsController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $users = $this->getAdmins(); $interventions = Interventions::select(['id', 'ref', 'start_date', 'end_date', 'place', 'team_id'])->orderBy('created_at', 'desc')->paginate(25); $clients = Clients::select(['id', 'address_id', 'client_name'])->get(); $teams = Teams::select(['id', 'team_name'])->get(); return view('interventions.index', ['interventions' => $interventions, 'users' => $users, 'clients' => $clients, 'teams' => $teams]); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function search(Request $request) { $clients = Clients::select(['id', 'address_id', 'client_name'])->get(); $teams = Teams::select(['id', 'team_name'])->get(); $users = $this->getAdmins(); $interventions = Interventions::select(['id', 'ref', 'start_date', 'end_date', 'place', 'team_id'])->orderBy('created_at', 'desc')->paginate(25); if (!empty($request->ref) && (($request->ref) != 1)){ $interventions = Interventions::where('ref', 'like', '%'.$request->ref.'%')->orderBy('created_at', 'desc')->paginate(25); return view('interventions.index', ['interventions' => $interventions, 'users' => $users, 'clients' => $clients, 'teams' => $teams]); } if (!empty($request->start_date) && (($request->start_date) != 1)){ $interventions = Interventions::where('start_date', '=', $request->start_date)->orderBy('created_at', 'desc')->paginate(25); return view('interventions.index', ['interventions' => $interventions, 'users' => $users, 'clients' => $clients, 'teams' => $teams]); } if (!empty($request->end_date) && (($request->end_date) != 1)){ $interventions = Interventions::where('end_date', '=', $request->end_date)->orderBy('created_at', 'desc')->paginate(25); return view('interventions.index', ['interventions' => $interventions, 'users' => $users, 'clients' => $clients, 'teams' => $teams]); } if (!empty($request->place) && (($request->place) != "1")){ $interventions = Interventions::where('place', 'like', '%'.$request->place.'%')->orderBy('created_at', 'desc')->paginate(25); return view('interventions.index', ['interventions' => $interventions, 'users' => $users, 'clients' => $clients, 'teams' => $teams]); } if (!empty($request->team_id) && (($request->team_id) != 0)){ $interventions = Interventions::where('team_id', '=', $request->team_id)->orderBy('created_at', 'desc')->paginate(25); return view('interventions.index', ['interventions' => $interventions, 'users' => $users, 'clients' => $clients, 'teams' => $teams]); } return view('interventions.index', ['interventions' => $interventions, 'users' => $users, 'clients' => $clients, 'teams' => $teams]); } /** * Store a newly created resource in storage. * * @param \App\Http\Requests\StoreInterventionsRequest $request * @return \Illuminate\Http\Response */ public function store(Request $request) { if ($request->start_date && $request->end_date && $request->hour && $request->nb_techniciens && $request->user_id && $request->first_contact_name && $request->first_contact_phone && $request->place && $request->definition_chantier && $request->desc_installation && $request->observations && $request->client_id && $request->team_id && $request->nb_passages && $request->type_intervention && $request->address_id){ $last_in_ref = Interventions::where('ref', 'LIKE', 'IN00%')->orderBy('created_at', 'desc')->first(); $next_ref_nb = 1; if ($last_in_ref) { $next_ref_nb = (intval(substr($last_in_ref->ref, 4)) + 1); } $new_intervention = Interventions::create([ "start_date" => $request->start_date, "end_date" => $request->end_date, "hour" => $request->hour, "nb_techniciens" => $request->nb_techniciens, "user_id" => $request->user_id, "ref" => $last_in_ref ? "IN00".$next_ref_nb : "IN001", "place" => $request->place, "def_chantier" => $request->definition_chantier, "desc_installation" => $request->desc_installation, "observations" => $request->observations, "client_id" => $request->client_id, "team_id" => $request->team_id, "nb_passages" => $request->nb_passages, "type_intervention" => $request->type_intervention, ]); InterventionAddresses::create([ "intervention_id" => $new_intervention->id, "address_id" => $request->address_id ]); InterventionContacts::create([ "intervention_id" => $new_intervention->id, "contact_name" => $request->first_contact_name, "contact_phone" => $request->first_contact_phone ]); if ($request->second_contact_name && $request->second_contact_phone) { interventionContacts::create([ "intervention_id" => $new_intervention->id, "contact_name" => $request->second_contact_name, "contact_phone" => $request->second_contact_phone ]); } $selected_lodgments = $request->lodgment; if (isset($selected_lodgments[0])) { foreach ($selected_lodgments as $selected_lodgment){ InterventionBuildings::create([ 'intervention_id' => $new_intervention->id, 'floor_id' => $selected_lodgment ]); } } return redirect('/interventions'); }else{ return redirect('/interventions?message=emptyField'); } } /** * Display the specified resource. * * @param \App\Models\Interventions $interventions * @return \Illuminate\Http\Response */ public function show($id) { $users = $this->getAdmins(); $intervention = Interventions::where('id', $id)->first(); $clients = Clients::select(['id', 'address_id', 'client_name'])->get(); $teams = Teams::select(['id', 'team_name'])->get(); $interventionBuildings = InterventionBuildings::where('intervention_id', $id)->get(); $interventionAddresses = InterventionAddresses::where('intervention_id', $intervention->id)->first(); return view('interventions.intervention', [ 'intervention' => $intervention, 'users' => $users, 'clients' => $clients, 'teams' => $teams, 'interventionAddresses' => $interventionAddresses, 'interventionBuildings' => $interventionBuildings, ]); } /** * Show the form for editing the specified resource. * * @param \App\Models\Interventions $interventions * @return \Illuminate\Http\Response */ public function edit(Interventions $interventions) { // } /** * Update the specified resource in storage. * * @param \App\Http\Requests\UpdateInterventionsRequest $request * @param \App\Models\Interventions $interventions * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { if ($request->start_date && $request->end_date && $request->hour && $request->nb_techniciens && $request->user_id && $request->first_contact_name && $request->first_contact_phone && $request->place && $request->definition_chantier && $request->desc_installation && $request->observations && $request->client_id && $request->team_id && $request->nb_passages && $request->type_intervention && $request->address_id){ Interventions::where('id', $id)->first()->update([ "start_date" => $request->start_date, "end_date" => $request->end_date, "hour" => $request->hour, "nb_techniciens" => $request->nb_techniciens, "user_id" => $request->user_id, "place" => $request->place, "def_chantier" => $request->definition_chantier, "desc_installation" => $request->desc_installation, "observations" => $request->observations, "client_id" => $request->client_id, "team_id" => $request->team_id, "nb_passages" => $request->nb_passages, "type_intervention" => $request->type_intervention, ]); $intervention = Interventions::where('id', $id)->first(); $interventionAddresses = InterventionAddresses::where('intervention_id', $intervention->id)->first(); if (!$interventionAddresses) { InterventionAddresses::create([ "intervention_id" => $intervention->id, "address_id" => $request->address_id ]); }else{ $interventionAddresses->update([ "intervention_id" => $intervention->id, "address_id" => $request->address_id ]); } $interventionContacts = InterventionContacts::where('intervention_id', $intervention->id)->get(); if (count($interventionContacts) == 0) { InterventionContacts::create([ "intervention_id" => $intervention->id, "contact_name" => $request->first_contact_name, "contact_phone" => $request->first_contact_phone ]); }else{ $interventionContacts[0]->update([ "intervention_id" => $intervention->id, "contact_name" => $request->first_contact_name, "contact_phone" => $request->first_contact_phone ]); } if (!isset($interventionContacts[1]) && $request->second_contact_name && $request->second_contact_phone) { interventionContacts::create([ "intervention_id" => $intervention->id, "contact_name" => $request->second_contact_name, "contact_phone" => $request->second_contact_phone ]); }else if(isset($interventionContacts[1]) && $request->second_contact_name && $request->second_contact_phone) { $interventionContacts[1]->update([ "intervention_id" => $intervention->id, "contact_name" => $request->second_contact_name, "contact_phone" => $request->second_contact_phone ]); }else if(isset($interventionContacts[1]) && !$request->second_contact_name && !$request->second_contact_phone) { $interventionContacts[1]->delete(); } $selected_lodgments = $request->lodgment; $lodgments = InterventionBuildings::where('intervention_id', $intervention->id)->get(); if (isset($selected_lodgments[0])) { if ($lodgments) { foreach ($lodgments as $lodgment){ $lodgment->delete(); } foreach ($selected_lodgments as $selected_lodgment){ InterventionBuildings::create([ 'intervention_id' => $intervention->id, 'floor_id' => $selected_lodgment ]); } }else{ foreach ($selected_lodgments as $selected_lodgment){ InterventionBuildings::create([ 'intervention_id' => $intervention->id, 'floor_id' => $selected_lodgment ]); } } }else { foreach ($lodgments as $lodgment){ $lodgment->delete(); } } return redirect('/interventions/'. $id); }else { return redirect('/interventions/'. $id . '/message=emptyFields'); } } /** * Remove the specified resource from storage. * * @param \App\Models\Interventions $interventions * @return \Illuminate\Http\Response */ public function delete($id) { Interventions::where('id', $id)->delete(); return redirect('/interventions'); } public function getAdmins() { $user = User::whereHas('rules', function ($query) { return $query->where('role', '=', "admin"); })->get(); return $user; } public function getClients() { $user = User::whereHas('rules', function ($query) { return $query->where('role', '=', "client"); })->get(); return $user; } public function progress(){ $interventions = DB::table('interventions') ->where("status_id", "=", "1") //TODO: edit the good value id ->get(); $n = 0; foreach ($interventions as $inter) { $address = DB::table("addresses") ->join('intervention_addresses', 'intervention_addresses.address_id', "=", "addresses.id") ->where('intervention_id', '=', $inter->id) ->get('address'); $interventions[$n]->address = $address[0]->address; $n++; } return view('interventions.progress', ['interventions' => $interventions]); } public function finish(){ $interventions = DB::table('interventions') ->where("status_id", "=", 2) //TODO: edit the good value ->get(); $n = 0; foreach ($interventions as $inter) { $address = DB::table("addresses") ->join('intervention_addresses', 'intervention_addresses.address_id', "=", "addresses.id") ->where('intervention_id', '=', $inter->id) ->get('address'); $interventions[$n]->address = $address[0]->address; $n++; } return view('interventions.finish', ["interventions" => $interventions]); } public function toInvoice(){ $interventions = DB::table("interventions") ->where("status_id", "=", 1) //TODO: edit the good value ->get(); return view('interventions.toInvoice', ["interventions" => $interventions]); } }