@use(Carbon\Carbon)

@extends('adminlte::layouts.app')

@section('htmlheader_title')
	{{ $so->sid }}
@endsection
@section('page_title')
	{{ $so->sid }}
@endsection

@section('contentheader_title')
	Service: {{ $so->sid }} <strong>{{ $so->product->name }}</strong>
@endsection
@section('contentheader_description')
	{{ $so->name }}
@endsection

@section('main-content')
	<div class="row">
		<div class="col-12 col-md-6">
			<form method="POST">
				@csrf

				<div class="card card-dark">
					<div class="card-header p-2">
						<div class="card-title">Change Service</div>
					</div>

					<div class="card-body">
						<div class="row">
							<div class="col-8 col-sm-5 col-md-12 col-lg-6">
								<x-leenooks::form.date name="change_date" icon="fa-calendar" label="Request Change Date" :value="Carbon::now()->addDays(7)->format('Y-m-d')"/>
							</div>
							@if($so->is_contracted)
							<div class="col-12 col-sm-7 col-md-12 col-lg-6">
								<strong>NOTE</strong>: This service is in a contract until <strong>{{ $so->contract_end->format('Y-m-d') }}</strong>, thus it may not be able to change plans.
							</div>
							@endif
						</div>

						<div class="row">
							<div class="col">
								@includeIf('theme.backend.adminlte.service.widget.'.$so->product->category_lc.'.change',['o'=>$so->type])
							</div>
						</div>

						<div class="row">
							<div class="col">
								<x-leenooks::form.textarea name="notes" label="Notes" placeholder="Please let us know what you would like to change your service to" :value="$so->order_info_notes ?? ''"/>
							</div>
						</div>
					</div>

					<div class="card-footer">
						<x-leenooks::button.cancel/>
						<x-leenooks::button.submit class="float-right">Save</x-leenooks::button.submit>
					</div>
				</div>
			</form>
		</div>

		<div class="col-6">
			<div id="product_info"></div>
		</div>
	</div>
@endsection