���Root Mod By V1rus_Alfa
User / IP
:
216.73.216.158
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
repositories
/
portal-cutunix
/
app
/
Livewire
/
Admin
/
Pages
/
Table
/
User
/
Viewing: Cutunixshot.php
<?php namespace App\Livewire\Admin\Pages\Table\User; use App\Exports\UserExportWithQuery; use Carbon\Carbon; use Livewire\Attributes\Url; use Livewire\Component; use Livewire\WithoutUrlPagination; use Livewire\WithPagination; use Illuminate\Support\Facades\Auth; use Maatwebsite\Excel\Facades\Excel; use Masmerise\Toaster\Toastable; use Masmerise\Toaster\Toaster; use Modules\Identity\Models\User; use Morilog\Jalali\Jalalian; class Cutunixshot extends Component { use WithPagination, Toastable; #[Url(history: true, keep: true)] public $search = ''; #[Url(history: true, keep: true)] public $own_users = false; #[Url(history: true, keep: true)] public $start_date = null; #[Url(history: true, keep: true)] public $end_date; #[Url(history: true, keep: true)] public $has_app = 'all'; #[Url(history: true, keep: true)] public $has_payment = 'all'; public $currentPage = null; public function fixPaginationForSearch() { $this->currentPage = request('page'); $this->resetPage(); } public function updatedSearch() { if ($this->search != '' || !is_null($this->search)) { $this->fixPaginationForSearch(); } } public function updatedOwnUsers() { $this->fixPaginationForSearch(); } public function updatedStartDate() { $this->fixPaginationForSearch(); } public function updatedEndDate() { $this->fixPaginationForSearch(); } public function updatedHasApp() { $this->fixPaginationForSearch(); } public function updatedHasPayment() { $this->fixPaginationForSearch(); } public function deleteItem($id) { User::where('id', $id)->delete(); Toaster::success('عملیات با موفقیت انجام شد'); } public function loginUser($id) { if ($id != auth('admin')->user()->id) { Auth::loginUsingId($id, true); return redirect('https://shot.cutunix.com/'); } else { Toaster::error('شما مجاز به انتخاب حساب خود نمی باشید'); return; } } public function activateDemoAccount($id) { $user = User::find($id); if ($user->isExpired()) { $user->update([ 'expire_date' => Carbon::now()->addDays(2)->format('Y-m-d'), ]); $this->dispatch('success','حساب دمو برای این کاربر با موفقیت فعال شد'); } else { $user->update([ 'expire_date' => Carbon::parse($user->created_at)->format('Y-m-d'), ]); $this->dispatch('success','حساب دمو برای این کاربر با موفقیت غیر فعال شد'); } } public function mount() { if (request('has_app') == null) $this->has_app = 'all'; else $this->has_app = request('has_app'); if (request('has_payment') == null) $this->has_payment = 'all'; else $this->has_payment = request('has_payment'); $this->own_users = request('own_users') == 'true'; $this->search = request('search'); // $this->has_app = request('has_app'); // $this->has_payment = request('has_payment'); $this->start_date = request('start_date'); $this->end_date = request('end_date'); if (is_null($this->end_date)) $this->end_date = Jalalian::forge('now')->format('Y/m/d'); } public function render() { $result = $this->filterQuery()->paginate(10); return view('livewire.admin.pages.table.user.cutunixshot', ['result' => $result]); } public function filterQuery() { $start_date = ''; $end_date = ''; if (isset($this->start_date) && $this->start_date != '') { $timestamp = Jalalian::fromFormat('Y/m/d', $this->start_date)->getTimestamp(); $start_date = Carbon::createFromTimestamp($timestamp, 'Asia/Tehran')->format('Y-m-d'); } if (isset($this->end_date) && $this->end_date != '') { $timestamp = Jalalian::fromFormat('Y/m/d', $this->end_date)->getTimestamp(); $end_date = Carbon::createFromTimestamp($timestamp, 'Asia/Tehran')->format('Y-m-d'); } if (isset($this->search)) { $this->search = str_replace(['\'', '!', '@', '#', '%', '^', '*', '(', ')', '`', '=', '-', '%', '$', '&', '"', ':', '؛', '/', '\\', ',', '.', '<', '>', '[', ']', '~', '+', '?', ], '', $this->search); } return User::where('platform', 'cutunixshot') ->with('trackingLogs') ->with('transactions') ->where('parent', 0) ->when($this->search && is_numeric($this->search), function ($q) { $q->where('mobile', 'like', '%' . $this->search . '%'); })->when($this->search && !is_numeric($this->search), function ($q) { $q->where(function ($q) { $q->where('first_name', 'like', '%' . $this->search . '%') ->orWhere('last_name', 'like', '%' . $this->search . '%') ->orWhereRaw('CONCAT(first_name," ",last_name) LIKE \'' . $this->search . '%\''); }); }) ->when($start_date, function ($q) use ($start_date) { $q->whereDate('created_at', '>=', $start_date); }) ->when($end_date, function ($q) use ($end_date) { $q->whereDate('created_at', '<=', $end_date); }) ->when($this->own_users, function ($q) { $q->where('creator_id', Auth::id()); }) ->when($this->has_app != 'all', function ($q) { $q->where('has_app', $this->has_app); }) ->when($this->has_payment == 'true', function ($q) { $q->whereHas('transactions', function ($q) { $q->where('payment_status', $this->has_payment); })->whereDate('expire_date', '>', Carbon::now()->format('Y-m-d')); }) ->when($this->has_payment == 'false', function ($q) { $q->where(function ($q) { $q->whereHas('transactions', function ($q) { $q->where('payment_status', '!=', 'true'); }); }); }) ->when($this->has_payment == 'null', function ($q) { $q->whereDoesntHave('transactions'); }) ->orderBy('created_at', 'desc'); } public function handelExcel() { return Excel::download(new UserExportWithQuery($this->filterQuery()), 'filtered-users.xlsx'); } public function clearFilters() { $this->start_date = null; $this->end_date = Jalalian::forge('now')->format('Y/m/d'); $this->search = ''; $this->own_users = false; $this->has_app = 'all'; $this->has_payment = 'all'; $this->currentPage = 1; $this->resetPage(); $this->render(); } public function goToThisPage() { $this->gotoPage($this->currentPage); } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa