{% extends 'base.html.twig' %}

{% block body %}
	{{ block('nav', 'internal/libs/nav.html.twig') }}

	<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
		{{ block('topnav', 'internal/libs/top-nav.html.twig') }}

		<section>
			<div class="card card-plain">
				<div class="card-header">
					<h4 class="font-weight-bolder">Add Referral</h4>
					<p class="mb-0">{{ case.caseName }}</p>
				</div>
				<div class="card-body">
					<div class="container">
						{{ form_errors(form) }}
						{{ form_start(form) }}

						<div class='input-group input-group-outline mb-3'>
							<label for='referral_form_referralId' class='form-label'>Referral ID</label>
							<input type='text' name='{{ field_name(form.referralId) }}' id='referral_form_referralId' class='form-control'/>
						</div>

						<div class='input-group input-group-outline mb-3'>
							<select name='{{ field_name(form.serviceCode) }}' id='referral_form_serviceCode' class='form-control'>
								<option value=''>-- Select Service Code --</option>

								{% for sc in enum('App\\Enums\\ReferralServiceType').cases() %}
									<option value='{{ sc.value }}'>{{ sc.name }}</option>
								{% endfor %}
							</select>
						</div>

						<div class='input-group input-group-outline mb-3'>
							<label for='referral_form_hours' class='form-label'>Hours</label>
							<input type='number' name='{{ field_name(form.hours) }}' id='referral_form_hours' class='form-control'/>
						</div>

						<div class='input-group input-group-outline mb-3'>
							<label for='referral_form_endDate' class='form-label'></label>
							<input type='date' name='{{ field_name(form.endDate) }}' id='referral_form_endDate' class='form-control'/>
						</div>

						<div class='input-group input-group-outline mb-3'>
							<select name='{{ field_name(form.dischargeReason) }}' id='referral_form_dischargeReason' class='form-control'>
								<option value=''>-- Select Discharge Reason --</option>

								{% for dr in enum('App\\Enums\\DischargeReason').cases() %}
									<option value='{{ dr.value }}'>{{ dr.name }}</option>
								{% endfor %}
							</select>
						</div>

						<div class='input-group input-group-outline mb-3'>
							<label for='referral_form_dischargeDate' class='form-label'></label>
							<input type='date' name='{{ field_name(form.dischargeDate) }}' id='referral_form_dischargeDate' class='form-control'/>
						</div>

						<div class='row'>
							<div class="text-center">
								<button type="submit" class="btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0">Save Referral</button>
							</div>
						</div>
						{{ form_end(form) }}
					</div>
				</div>
			</div>
		</section>
	</main>
{% endblock %}
