���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
/
Site
/
Pages
/
Analyze
/
Unit
/
Viewing: Edit.php
<?php namespace App\Livewire\Site\Pages\Analyze\Unit; use Modules\Central\Models\Unit; use Modules\Central\Models\AnalyzeDimension; use Modules\Central\Models\UnitList; use Livewire\Attributes\Url; use Livewire\Component; use Masmerise\Toaster\Toastable; use function App\Helpers\toEnDigit; use App\Helpers\HelperClass\GeneralUseV2; class Edit extends Component { use Toastable; public $list; public $project_id; public $unit; public $dimension = []; public $computing = []; #[Url(history: true, keep: true)] public $form = [ 'count' => 1, ]; protected $listeners = ['SetRow' => 'handelSetRow']; public function mount($id, $project_id = null) { $this->project_id = $project_id; $this->list = UnitList::where('id', $id)->where('user_id', auth()->user()->id)->first(); $this->dimension = AnalyzeDimension::where('user_id', auth()->user()->id)->get(); $this->unit = $this->list->unit; if (!$this->unit) { return abort(404); } if (0 < count($this->unit->variables)) { foreach ($this->unit->variables as $variable) { $set = false; foreach ($this->list->input as $input) { if ($input->key == $variable->key) { $set = true; $this->form[$variable->key] = $input->value; } } if (!$set) { $this->form[$variable->key] = ''; } } } $this->computing = $this->list->attach->toArray(); } public function handelDelete($i) { array_splice($this->computing, $i, 1); } public function handelSetRow($data) { $this->computing[$data['key']] = $data['row']; $this->dispatch('success', trans('container.operation successful')); } public function handleSelectedMaterial($variable) { $this->selectedMaterial = $variable; } public function handelComputing($type) { $this->form['type'] = $type; $this->form['unit_title'] = $this->unit->title; $this->form['unit_id'] = $this->unit->id; //VALIDATION $validateUnit = validateUnitData($this->form, $this->unit, $this->computing); if ($validateUnit) { $this->error($validateUnit); return; } $property = []; foreach ($this->unit->variables as $value) { array_push($property, ['key' => $value->key, 'value' => toEnDigit($this->form[$value->key])]); } if ($this->form['type'] == 'set') { GeneralUseV2::computing_unit($this->form, $property, $this->list, $this->computing); } else { $this->computing = GeneralUseV2::computing_unit($this->form, $property, $this->list); } $hasError = false; // check any dimension of slices shouldn't lte zero foreach($this->computing as $key => $item) { $title = "تکه ی " . $key + 1; if ($item['width'] <= 0) { $error = "مقدار عرض غیر قابل پردازش دارد؛ ابعاد را اصلاح کنید"; $hasError = true; $this->error($title . $error); } if ($item['length'] <= 0) { $error = "مقدار طول غیر قابل پردازش دارد؛ ابعاد را اصلاح کنید"; $hasError = true; $this->error($title . $error); } if ($item['count'] <= 0) { $error = "مقدار تعداد غیر قابل پردازش دارد؛ ابعاد را اصلاح کنید"; $hasError = true; $this->error($title . $error); } } if($hasError) return redirect()->back(); if ($this->form['type'] == 'set') { $this->dispatch('success', trans('container.operation successful')); if ($this->project_id) { return redirect()->to('/' . app()->getLocale() . '/analyze/projects/units/' . $this->project_id); } else { return redirect()->to('/' . app()->getLocale() . '/analyze/list'); } } } public function render() { return view('livewire.site.pages.analyze.unit.edit') ->layout('components.layouts.site.app', ['page_name' => 'analyze']); } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa