44 lines
2.2 KiB
PHP
44 lines
2.2 KiB
PHP
@props(['invoice'])
|
|
|
|
<flux:modal name="renewal-modal" class="md:w-[28rem]">
|
|
<div class="space-y-6" x-data="{ submitting: false, plan: '12', months: 12 }">
|
|
<div>
|
|
<flux:heading size="lg">{{ __('Gia hạn dịch vụ') }}</flux:heading>
|
|
<flux:text class="mt-2">{{ __('Chọn thời hạn gia hạn hoặc nhập số tháng mong muốn.') }}</flux:text>
|
|
</div>
|
|
|
|
<form x-on:submit.prevent="if (submitting) return; submitting = true; $el.submit()" method="POST" action="{{ route('service.renew') }}">
|
|
@csrf
|
|
<input type="hidden" name="product_id" value="{{ $invoice->vm_id }}">
|
|
|
|
<flux:field>
|
|
<flux:label>{{ __('Chọn thời hạn') }}</flux:label>
|
|
<flux:select x-model="plan" name="plan">
|
|
<flux:select.option value="3">{{ __('3 tháng') }}</flux:select.option>
|
|
<flux:select.option value="6">{{ __('6 tháng') }}</flux:select.option>
|
|
<flux:select.option value="12">{{ __('12 tháng') }}</flux:select.option>
|
|
<flux:select.option value="24">{{ __('24 tháng') }}</flux:select.option>
|
|
<flux:select.option value="other">{{ __('Khác...') }}</flux:select.option>
|
|
</flux:select>
|
|
</flux:field>
|
|
|
|
<div x-show="plan === 'other'" class="mt-2">
|
|
<flux:field>
|
|
<flux:label>{{ __('Số tháng') }}</flux:label>
|
|
<flux:input x-model.number="months" name="months" type="number" min="1" max="60" placeholder="{{ __('Nhập số tháng') }}" />
|
|
<flux:description>{{ __('Nhập số tháng muốn gia hạn (tối đa 60).') }}</flux:description>
|
|
</flux:field>
|
|
</div>
|
|
|
|
<div class="flex gap-2 justify-end mt-6">
|
|
<flux:modal.close>
|
|
<flux:button variant="ghost">{{ __('Hủy') }}</flux:button>
|
|
</flux:modal.close>
|
|
<flux:button type="submit" variant="primary" color="orange" x-bind:disabled="submitting">{{ __('Đồng ý') }}</flux:button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</flux:modal>
|
|
|
|
|