138 lines
3.9 KiB
Twig
138 lines
3.9 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">
|
|
Job Orders (Rider Assignment)
|
|
</h3>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- END: Subheader -->
|
|
<div class="m-content">
|
|
<!--Begin::Section-->
|
|
<div class="row">
|
|
<div class="col-xl-12">
|
|
<div class="m-portlet m-portlet--mobile">
|
|
<div class="m-portlet__body">
|
|
<div class="m-form m-form--label-align-right m--margin-top-20 m--margin-bottom-30">
|
|
<div class="row align-items-center">
|
|
<div class="col-xl-12">
|
|
<div class="form-group m-form__group row align-items-center">
|
|
<div class="col-md-4">
|
|
<div class="m-input-icon m-input-icon--left">
|
|
<input type="text" class="form-control m-input m-input--solid" placeholder="Search..." id="data-rows-search">
|
|
<span class="m-input-icon__icon m-input-icon__icon--left">
|
|
<span><i class="la la-search"></i></span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!--begin: Datatable -->
|
|
<div id="data-rows"></div>
|
|
<!--end: Datatable -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
$(function() {
|
|
var options = {
|
|
data: {
|
|
type: 'remote',
|
|
source: {
|
|
read: {
|
|
url: '{{ url('jo_assign_rows') }}',
|
|
method: 'POST'
|
|
}
|
|
},
|
|
saveState: {
|
|
cookie: false,
|
|
webstorage: false
|
|
},
|
|
pageSize: 10,
|
|
serverPaging: true,
|
|
serverFiltering: true,
|
|
serverSorting: true
|
|
},
|
|
rows: {
|
|
beforeTemplate: function (row, data, index) {
|
|
if (data.flag_advance) {
|
|
$(row).addClass('m-table__row--danger');
|
|
}
|
|
}
|
|
},
|
|
columns: [
|
|
{
|
|
field: 'id',
|
|
title: 'JO Number'
|
|
},
|
|
{
|
|
field: 'delivery_address',
|
|
title: 'Customer Area'
|
|
},
|
|
{
|
|
field: 'service_type',
|
|
title: 'Type of Transaction'
|
|
},
|
|
{
|
|
field: 'date_schedule',
|
|
title: 'Scheduled Date'
|
|
},
|
|
{
|
|
field: 'status',
|
|
title: 'Status'
|
|
},
|
|
{
|
|
field: 'processor',
|
|
title: 'Dispatcher'
|
|
},
|
|
{
|
|
field: 'assignor',
|
|
title: 'Assignor'
|
|
},
|
|
{
|
|
field: 'Actions',
|
|
width: 110,
|
|
title: 'Actions',
|
|
sortable: false,
|
|
overflow: 'visible',
|
|
template: function (row, index, datatable) {
|
|
var actions = '<a href="' + row.meta.update_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="View / Edit"><i class="la la-edit"></i></a>';
|
|
|
|
{% if is_granted('jo_assign.unlock') %}
|
|
if (row.meta.unlock_url != '') {
|
|
actions += '<a href="' + row.meta.unlock_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="Unlock"><i class="fa fa-unlock"></i></a>';
|
|
}
|
|
{% endif %}
|
|
|
|
return actions;
|
|
},
|
|
}
|
|
],
|
|
search: {
|
|
onEnter: false,
|
|
input: $('#data-rows-search'),
|
|
delay: 400
|
|
}
|
|
};
|
|
|
|
var table = $("#data-rows").mDatatable(options);
|
|
|
|
// auto refresh table
|
|
setInterval(function() {
|
|
table.reload();
|
|
}, {{ table_refresh_rate }});
|
|
});
|
|
</script>
|
|
{% endblock %}
|