@extends('admin.lyoute.masterpage2') @php $isEdit = isset($productModel); $currentPrices = []; if ($isEdit) { $stagePrices = $productModel->stagePrices; foreach ($stagePrices as $sp) { if ($sp->stage_id === 'kabooi' && $sp->noedarz) { $currentPrices[$sp->stage_id][$sp->noedarz] = $sp->price; } else { $currentPrices[$sp->stage_id] = $sp->price; } } } @endphp @section('page_title', $isEdit ? 'ویرایش مدل' : 'افزودن مدل جدید') @section('main_section') {{-- ✅ CSS مستقیم اینجا --}}
@if($errors->any())
@endif

{{ $isEdit ? 'ویرایش مدل: ' . $productModel->name : 'تعریف مدل جدید' }}

@csrf @if($isEdit) @method('PUT') @endif
@php $isActive = old('is_active', $productModel->is_active ?? true); @endphp

@if(isset($stages))
تعرفه مراحل دوخت قیمت هر مرحله برای این مدل خاص (به تومان)
@foreach($stages as $stage)
{{ $stage->name }}
@if($stage->default_price) قیمت پایه: {{ number_format($stage->default_price) }} تومان @endif
@if($stage->code === 'kabooi')
@foreach(['جلو', 'بغل', 'پشت'] as $noedarz)
تومان
@endforeach
@else
code", $currentPrices[$stage->code] ?? '') }}" placeholder="0" autocomplete="off"> تومان
@endif
@endforeach
@endif
{{-- ✅ JS مستقیم اینجا — بدون @section --}} @endsection