���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
/
MakeSlice
/
Viewing: Edit.php
<?php namespace App\Livewire\Site\Pages\Analyze\MakeSlice; use Livewire\Component; use Modules\Central\Models\UnitList; use Modules\Central\Models\AnalyzeMaterial; use Masmerise\Toaster\Toastable; use App\Helpers\HelperClass\GeneralUseV2; class Edit extends Component { use Toastable; public $list; public $project_id; public $form=[]; public function mount($id,$project_id=null) { if($project_id){ $this->project_id=$project_id; } $this->list = UnitList::where(['id' => $id, 'user_id' => auth()->user()->id])->first(); if(!$this->list){ return abort(404); } $this->form['rotatable']=false; $this->form['panel_description']=''; $this->form['material_id']=''; $this->form['num_slice']=1; $this->form['slice']=[]; if(0 < count($this->list->attach)){ $this->form['num_slice']=count($this->list->attach); $this->form['material_id']=$this->list->attach[0]->material_id; foreach ($this->list->attach as $row) { array_push($this->form['slice'],[ 'length'=>$row->length, 'width'=>$row->width, 'count'=>$row->count, 'length_one'=>$row->length_one, 'length_two'=>$row->length_two, 'width_one'=>$row->width_one, 'width_two'=>$row->width_two, 'rotatable'=>$row->rotatable, 'description'=>$row->label, ]); } } } public function handleIncrementingOrDecrementingRow($type) { if($type == 'increment'){ $this->form['num_slice']=$this->form['num_slice']+1; array_push($this->form['slice'],[ 'length'=>'', 'width'=>'', 'count'=>'1', 'length_one'=>0, 'length_two'=>0, 'width_one'=>0, 'width_two'=>0, 'rotatable'=>false, 'description'=>'', ]); }elseif(1 < $this->form['num_slice']){ $this->form['num_slice']=$this->form['num_slice']-1; array_splice($this->form['slice'], $this->form['num_slice'], 1); } } public function removeSliceRow($s=null ) { array_splice($this->form['slice'], $s, 1); $this->form['num_slice']=$this->form['num_slice']-1; } public function handelSubmit() { //VALIDATION $validateUnit=validateSliceData($this->form ); if($validateUnit){ $this->error($validateUnit); return; } if($this->form['rotatable'] != false){ foreach ($this->form['slice'] as $key=>$row) { $this->form['slice'][$key]['rotatable']=true; } } $material = AnalyzeMaterial::where('id', $this->form['material_id'])->first(); $result = GeneralUseV2::CustomList( $this->form, $material,$this->list->id,$this->project_id); $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() { $materials = AnalyzeMaterial::get(); return view('livewire.site.pages.analyze.make-slice.edit',['materials'=>$materials]) ->layout('components.layouts.site.app', ['page_name' => 'analyze']); } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa