Linux localhost 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
Apache/2.4.41 (Ubuntu)
: 23.92.16.63 | : 162.158.155.29
Cant Read [ /etc/named.conf ]
8.1.5
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
realestate /
source /
app /
Http /
Controllers /
[ HOME SHELL ]
Name
Size
Permission
Action
Admin
[ DIR ]
drwxr-xr-x
ApplicantController.php
32.25
KB
-rwxr-xr-x
Controller.php
299
B
-rwxr-xr-x
DirectoryController.php
10.75
KB
-rwxr-xr-x
LandlordController.php
15.28
KB
-rwxr-xr-x
MainDashboardController.php
251
B
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : LandlordController.php
<?php namespace App\Http\Controllers; use App\Models\Applicant; use App\Models\Branch; use App\Models\Category; use App\Models\Country; use App\Models\Label; use App\Models\Landlord; use App\Models\Landlordfile; use App\Models\LandlordUserDetail; use App\Models\User; use Illuminate\Http\Request; class LandlordController extends Controller { public function __construct() { $this->middleware('permission:view_landlord', ['only' => ['index']]); $this->middleware('permission:create_landlord', ['only' => ['create', 'store']]); $this->middleware('permission:edit_landlord', ['only' => ['edit', 'update']]); $this->middleware('permission:delete_landlord', ['only' => ['destroy']]); } public function index() { $country = Country::orderBy('country_name', 'asc')->get(); // Fetch all applicant details grouped by applicant_id $landlords = Landlord::with('firstlandlordUserDetail')->get(); $title='Landlord'; return view('front.landlords.list',compact('country','landlords','title')); } public function create(){ $branch=Branch::all(); $user=User::all();; $category = Category::where('type','2')->orderBy('name', 'asc')->get(); $country = Country::orderBy('country_name', 'asc')->get(); $label=Label::where('status','1')->get(); $title='Landlord'; return view('front.landlords.create',compact('label','branch','user','country','category','title')); } public function store(Request $request) { try { // Validate the incoming request data $validated = $request->validate([ 'landlord' => 'nullable|string|max:10', 'type' => 'nullable|string|max:10', 'feedback_notification' => 'nullable|string|max:10', 'vendor' => 'nullable|string|max:10', 'dob' => 'nullable|date', 'website' => 'nullable|string|max:255', 'birth_place' => 'nullable|string|max:255', 'pager' => 'nullable|string|max:255', 'nationality' => 'nullable|string|max:255', 'passport_no' => 'nullable|string|max:255', 'lha_dwp' => 'nullable|string|max:255', 'solicitor' => 'nullable|string|max:255', 'status' => 'nullable|string|max:255', 'negotiator_id' => 'nullable|string|max:255', 'assigned_to' => 'nullable|string|max:255', 'lead_source' => 'nullable|string|max:255', 'repairs' => 'nullable|string|max:255', 'is_buy' => 'nullable|string|max:255', 'sole_sale_fee' => 'nullable|string|max:255', 'sole_sale_fee_unit' => 'nullable|string|max:255', 'sole_finder_fee' => 'nullable|string|max:255', 'sole_finder_fee_unit' => 'nullable|string|max:255', 'management_finder_fee' => 'nullable|string|max:255', 'management_finder_fee_unit' => 'nullable|string|max:255', 'multi_sale_fee' => 'nullable|string|max:255', 'multi_sale_fee_unit' => 'nullable|string|max:255', 'multi_finder_fee' => 'nullable|string|max:255', 'multi_finder_fee_unit' => 'nullable|string|max:255', 'multi_management_finder_fee' => 'nullable|string|max:255', 'multi_management_finder_fee_unit' => 'nullable|string|max:255', 'olt' => 'nullable|string|max:255', 'nrl_rate' => 'nullable|string|max:255', 'nrl_ref' => 'nullable|string|max:255', 'vat_number' => 'nullable|string|max:255', 'supplier_1' => 'nullable|string|max:255', 'supplier_2' => 'nullable|string|max:255', 'supplier_3' => 'nullable|string|max:255', 'comments' => 'nullable|string', 'other_info' => 'nullable|string', 'bym_status' => 'nullable|string|max:255', 'notify_property_alerts' => 'nullable|string|max:255', 'notify_general_news' => 'nullable|string|max:255', 'notify_special_offers' => 'nullable|string|max:255', 'notify_phone' => 'nullable|string|max:255', 'notify_email' => 'nullable|string|max:255', 'notify_sms' => 'nullable|string|max:255', 'notify_post' => 'nullable|string|max:255', 'bank_body' => 'nullable|string|max:255', 'bank_account_no' => 'nullable|string|max:255', 'bank_sort_code' => 'nullable|string|max:255', 'bank_account_name' => 'nullable|string|max:255', 'bank_beneficiary_reference' => 'nullable|string|max:255', 'bank_address_line_1' => 'nullable|string|max:255', 'bank_address_line_2' => 'nullable|string|max:255', 'bank_town' => 'nullable|string|max:255', 'bank_county' => 'nullable|string|max:255', 'bank_postcode' => 'nullable|string|max:255', 'bank_country' => 'nullable|string|max:255', 'iban' => 'nullable|string|max:255', 'bic' => 'nullable|string|max:255', 'nib' => 'nullable|string|max:255', 'username' => 'nullable|string|max:255', 'password' => 'nullable|string|max:255', ]); // Create landlord entry using validated data $landlord = Landlord::create($validated); // Loop through each landlord user detail and store it foreach ($request->last_name as $i => $detail) { $LandlordUserDetail = LandlordUserDetail::create([ 'landlord_id' => $landlord->id, 'last_name' => $detail ?? null, 'first_name' => $request['first_name'][$i] ?? null, 'title' => $request['title'][$i] ?? null, 'salutation' => $request['salutation'][$i] ?? null, 'postcode' => $request['postcode'][$i] ?? null, 'addresslineone' => $request['addresslineone'][$i] ?? null, 'addresslinetwo' => $request['addresslinetwo'][$i] ?? null, 'town' => $request['town'][$i] ?? null, 'county' => $request['county'][$i] ?? null, 'country' => $request['country'][$i] ?? null, 'phonehome' => $request['phonehome'][$i] ?? null, 'phonework' => $request['phonework'][$i] ?? null, 'phonemobile' => $request['phonemobile'][$i] ?? null, 'fax' => $request['fax'][$i] ?? null, 'email' => $request['email'][$i] ?? null, 'company' => $request['company'] ?? null, ]); } // If files are uploaded, handle and save them if ($request->hasFile('files_list')) { foreach ($request->file('files_list') as $file) { $fileName = time() . '_' . $file->getClientOriginalName(); $filePath = 'assets/landlord/'; // Move file to desired directory $file->move($filePath, $fileName); // Save file details to database Landlordfile::create([ 'landlord_id' => $landlord->id, 'file_name' => $fileName, ]); } } // Redirect back with success message return redirect()->route('landlords.index')->with('success', 'Landlord created successfully!'); } catch (\Exception $e) { // Catch and handle any exception, then redirect back with error message return redirect()->back()->with('error', 'Error saving landlord data: ' . $e->getMessage()); } } public function deleteFile(Request $request) { $request->validate([ 'file' => 'required|string' ]); $filePath = "assets/landlord/" . $request->file; if (file_exists($filePath)) { unlink($filePath); // Delete the file } // Delete associated addresses Landlord::where('id', $request->id)->delete(); return response()->json(['success' => true, 'message' => 'File deleted successfully']); } public function edit($id) { $branch=Branch::all(); $user=User::all();; $category = Category::where('type','2')->orderBy('name', 'asc')->get(); $country = Country::orderBy('country_name', 'asc')->get(); $label=Label::where('status','1')->get(); $landlord = Landlord::with('landlordUserDetails','landlordFiles')->where('id',$id)->first(); $title='Landlord'; return view('front.landlords.edit',compact('label','landlord','branch','user','country','category','title')); } public function update(Request $request, $id) { try { // Find the landlord record or fail $landlord = Landlord::findOrFail($id); // Validate incoming request $validated = $request->validate([ 'landlord' => 'nullable|string|max:10', 'type' => 'nullable|string|max:10', 'vendor' => 'nullable|string|max:10', 'feedback_notification' => 'nullable|string|max:10', 'dob' => 'nullable|date', 'website' => 'nullable|string|max:255', 'birth_place' => 'nullable|string|max:255', 'pager' => 'nullable|string|max:255', 'nationality' => 'nullable|string|max:255', 'passport_no' => 'nullable|string|max:255', 'lha_dwp' => 'nullable|string|max:255', 'solicitor' => 'nullable|string|max:255', 'status' => 'nullable|string|max:255', 'negotiator_id' => 'nullable|string|max:255', 'assigned_to' => 'nullable|string|max:255', 'lead_source' => 'nullable|string|max:255', 'repairs' => 'nullable|string|max:255', 'is_buy' => 'nullable|string|max:255', 'sole_sale_fee' => 'nullable|string|max:255', 'sole_sale_fee_unit' => 'nullable|string|max:255', 'sole_finder_fee' => 'nullable|string|max:255', 'sole_finder_fee_unit' => 'nullable|string|max:255', 'management_finder_fee' => 'nullable|string|max:255', 'management_finder_fee_unit' => 'nullable|string|max:255', 'multi_sale_fee' => 'nullable|string|max:255', 'multi_sale_fee_unit' => 'nullable|string|max:255', 'multi_finder_fee' => 'nullable|string|max:255', 'multi_finder_fee_unit' => 'nullable|string|max:255', 'multi_management_finder_fee' => 'nullable|string|max:255', 'multi_management_finder_fee_unit' => 'nullable|string|max:255', 'olt' => 'nullable|string|max:255', 'nrl_rate' => 'nullable|string|max:255', 'nrl_ref' => 'nullable|string|max:255', 'vat_number' => 'nullable|string|max:255', 'supplier_1' => 'nullable|string|max:255', 'supplier_2' => 'nullable|string|max:255', 'supplier_3' => 'nullable|string|max:255', 'comments' => 'nullable|string', 'other_info' => 'nullable|string', 'bym_status' => 'nullable|string|max:255', 'notify_property_alerts' => 'nullable|string|max:255', 'notify_general_news' => 'nullable|string|max:255', 'notify_special_offers' => 'nullable|string|max:255', 'notify_phone' => 'nullable|string|max:255', 'notify_email' => 'nullable|string|max:255', 'notify_sms' => 'nullable|string|max:255', 'notify_post' => 'nullable|string|max:255', 'bank_body' => 'nullable|string|max:255', 'bank_account_no' => 'nullable|string|max:255', 'bank_sort_code' => 'nullable|string|max:255', 'bank_account_name' => 'nullable|string|max:255', 'bank_beneficiary_reference' => 'nullable|string|max:255', 'bank_address_line_1' => 'nullable|string|max:255', 'bank_address_line_2' => 'nullable|string|max:255', 'bank_town' => 'nullable|string|max:255', 'bank_county' => 'nullable|string|max:255', 'bank_postcode' => 'nullable|string|max:255', 'bank_country' => 'nullable|string|max:255', 'iban' => 'nullable|string|max:255', 'bic' => 'nullable|string|max:255', 'nib' => 'nullable|string|max:255', 'username' => 'nullable|string|max:255', 'password' => 'nullable|string|max:255', ]); // Update landlord data $landlord->update($validated); // Delete old user details if needed LandlordUserDetail::where('landlord_id', $landlord->id)->delete(); // Re-insert user details foreach ($request->last_name as $i => $detail) { LandlordUserDetail::create([ 'landlord_id' => $landlord->id, 'last_name' => $detail ?? null, 'first_name' => $request['first_name'][$i] ?? null, 'title' => $request['title'][$i] ?? null, 'salutation' => $request['salutation'][$i] ?? null, 'postcode' => $request['postcode'][$i] ?? null, 'addresslineone' => $request['addresslineone'][$i] ?? null, 'addresslinetwo' => $request['addresslinetwo'][$i] ?? null, 'town' => $request['town'][$i] ?? null, 'county' => $request['county'][$i] ?? null, 'country' => $request['country'][$i] ?? null, 'phonehome' => $request['phonehome'][$i] ?? null, 'phonework' => $request['phonework'][$i] ?? null, 'phonemobile' => $request['phonemobile'][$i] ?? null, 'fax' => $request['fax'][$i] ?? null, 'email' => $request['email'][$i] ?? null, 'company' => $request['company'] ?? null, ]); } // Handle new uploaded files if ($request->hasFile('files_list')) { foreach ($request->file('files_list') as $file) { $fileName = time() . '_' . $file->getClientOriginalName(); $filePath = 'assets/landlord/'; // Move file to desired directory $file->move($filePath, $fileName); // Save file record Landlordfile::create([ 'landlord_id' => $landlord->id, 'file_name' => $fileName, ]); } } return redirect()->route('landlords.index')->with('success', 'Landlord updated successfully!'); } catch (\Exception $e) { return redirect()->back()->with('error', 'Error updating landlord: ' . $e->getMessage()); } } }
Close