resq/templates/warranty-search/form.html.twig

139 lines
7.3 KiB
Twig

{% extends 'base.html.twig' %}
{% block body %}
<!-- BEGIN: Subheader -->
<div class="m-subheader">
<div class="d-flex align-items-center">
<div class="mr-auto">
<h3 class="m-subheader__title">
{% if mode == 'form' %}
Search
{% else %}
Search results</span>"
{% endif %}
</h3>
</div>
</div>
</div>
<!-- END: Subheader -->
<div class="m-content">
<!--Begin::Section-->
<div class="row">
<div class="col-xl-6">
<div class="m-portlet m-portlet--mobile">
<div class="m-portlet__head">
<div class="m-portlet__head-caption">
<div class="m-portlet__head-title">
<span class="m-portlet__head-icon">
<i class="fa fa-search"></i>
</span>
<h3 class="m-portlet__head-text">
Customer Battery Status Search
</h3>
</div>
</div>
</div>
<form id="warranty-search-form" autocomplete="off" class="m-form m-form--fit m-form--label-align-right m-form--group-seperator-dashed" method="get" action="{{ url('search_warranty') }}">
<div class="m-portlet__body">
<div class="form-group m-form__group row">
<label data-field="battery_serial">Battery Serial Number</label>
<input name="battery_serial" type="search"class="form-control" placeholder="xxxxxxxxxxxx" value="{{ battery_serial|default("") }}">
</div>
<div class="form-group m-form__group row">
<label data-field="plate_num">Vehicle Plate Number</label>
<input name="plate_num" type="search" class="form-control" placeholder="i.e. ABC 123" value="{{ plate_num|default("") }}">
</div>
</div>
<div class="m-portlet__foot m-portlet__foot--fit">
<div class="m-form__actions m-form__actions--solid m-form__actions--right">
<div class="row">
<div class="col-lg-12">
<button type="submit" class="btn btn-success">Search</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
{% if mode == 'results' %}
<div class="row">
<div class="col-12">
<div class="m-portlet m-portlet--mobile">
<div class="m-portlet__head">
<div class="m-portlet__head-caption">
<div class="m-portlet__head-title">
<h3 class="m-portlet__head-text">
Warranty Information
</h3>
</div>
</div>
</div>
<div class="m-portlet__body">
{% if data is empty %}
<div class="m-alert m-alert--icon m-alert--icon-solid m-alert--outline alert alert-brand" role="alert">
<div class="m-alert__icon">
<i class="flaticon-exclamation-2"></i>
<span></span>
</div>
<div class="m-alert__text">
No warranty found.
</div>
</div>
{% else %}
<table class="table table-striped m-table">
<thead>
<tr class="m-table__row--brand">
<th> </th>
<th> </th>
</tr>
</thead>
<tbody>
{% for key, result in data %}
<tr>
<td>Battery Serial Number</td>
<td>{{ result.getSerial|default("") }}</td>
</tr>
<tr>
<td>Owner Name</td>
<td>{{ result.getFirstName|default("") ~ ' ' ~ result.getLastName|default("") }}</td>
</tr>
<tr>
<td>Vehicle Plate Number</td>
<td>{{ result.getPlateNumber|default("") }}</td>
</tr>
<tr>
<td>Purchase Date</td>
<td>{{ result.getDatePurchase|date("d M Y") }}</td>
</tr>
<tr>
<td>Battery</td>
<td>{{ result.getBatteryModel.getName|default("") ~ ' - ' ~ result.getBatterySize.getName|default("") }}</td>
</tr>
<tr>
<td>End of Warranty</td>
<td>{{ result.getDateExpire|date("d M Y") }}</td>
</tr>
<tr>
<td>Status</td>
<td>
{% if result.isActivated == true %}
Activated
{% else %}
Not Activated
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}