first commit
This commit is contained in:
@@ -0,0 +1,269 @@
|
||||
<!-- <link href="/assets/css/transport_providers/form.css" rel="stylesheet" type="text/css" /> -->
|
||||
|
||||
<div class="row mt-3 automation-job-form">
|
||||
<?php if ($this->session->flashdata('error')) { ?>
|
||||
<div class="col-12">
|
||||
<div class="alert alert-danger alert-dismissible bg-danger text-white" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close" style="margin-right: 15px;">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<strong>Error - </strong> <?php echo $this->session->flashdata('error') ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('name') ? 'has-error' : ''; ?>">
|
||||
<label for="location-start">Location start</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="location-start"
|
||||
name="location_start"
|
||||
value="<?php echo set_value('location_start', (isset($job) && isset($job['location_start']) ? $job['location_start'] : null)); ?>"
|
||||
placeholder="Enter location start"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('location_start') ? form_error('location_start') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('name') ? 'has-error' : ''; ?>">
|
||||
<label for="location-end">Location end</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="location-end"
|
||||
name="location_end"
|
||||
value="<?php echo set_value('location_end', (isset($job) && isset($job['location_end']) ? $job['location_end'] : null)); ?>"
|
||||
placeholder="Enter location end"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('location_end') ? form_error('location_end') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('location_start_lat') ? 'has-error' : ''; ?>">
|
||||
<label for="location-start-lat">Location start lat</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="location-start-lat"
|
||||
name="location_start_lat"
|
||||
value="<?php echo set_value('location_start_lat', (isset($job) && isset($job['location_start_lat']) ? $job['location_start_lat'] : null)); ?>"
|
||||
placeholder="Enter location start latitude"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('location_start_lat') ? form_error('location_start_lat') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('location_start_lng') ? 'has-error' : ''; ?>">
|
||||
<label for="location-start-lng">Location start lng</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="location-start-lng"
|
||||
name="location_start_lng"
|
||||
value="<?php echo set_value('location_start_lng', (isset($job) && isset($job['location_start_lng']) ? $job['location_start_lng'] : null)); ?>"
|
||||
placeholder="Enter location start longitude"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('location_start_lng') ? form_error('location_start_lng') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('location_end_lat') ? 'has-error' : ''; ?>">
|
||||
<label for="location-end-lat">Location end lat</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="location-end-lat"
|
||||
name="location_end_lat"
|
||||
value="<?php echo set_value('location_end_lat', (isset($job) && isset($job['location_end_lat']) ? $job['location_end_lat'] : null)); ?>"
|
||||
placeholder="Enter location end lat"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('location_end_lat') ? form_error('location_end_lat') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('location_end_lng') ? 'has-error' : ''; ?>">
|
||||
<label for="location-end-lng">Location end lng</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="location-end-lng"
|
||||
name="location_end_lng"
|
||||
value="<?php echo set_value('location_end_lng', (isset($job) && isset($job['location_end_lng']) ? $job['location_end_lng'] : null)); ?>"
|
||||
placeholder="Enter location start longitude"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('location_end_lng') ? form_error('location_end_lng') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('trackedemail_item_id') ? 'has-error' : ''; ?>">
|
||||
<label for="trackedemail-item-id">Trackedemail item</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="trackedemail-item-id"
|
||||
name="trackedemail_item_id"
|
||||
value="<?php echo set_value('trackedemail_item_id', (isset($job) && isset($job['trackedemail_item_id']) ? $job['trackedemail_item_id'] : null)); ?>"
|
||||
placeholder="Enter trackedemail item"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('trackedemail_item_id') ? form_error('trackedemail_item_id') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('transport_provider_id') ? 'has-error' : ''; ?>">
|
||||
<label for="transport-provider">Transport provider</label>
|
||||
<select
|
||||
class="form-control"
|
||||
id="transport-provider"
|
||||
name="transport_provider_id"
|
||||
placeholder="Enter transport provider"
|
||||
>
|
||||
<?php
|
||||
if (isset($job) && isset($job['transport_provider_id'])) {
|
||||
echo '<option value="' . $job['transport_provider_id'] . '" selected >' . $job['transport_provider_name'] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('transport_provider_id') ? form_error('transport_provider_id') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('cost_raw') ? 'has-error' : ''; ?>">
|
||||
<label for="cost-raw">Cost raw</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="cost-raw"
|
||||
name="cost_raw"
|
||||
value="<?php echo set_value('cost_raw', (isset($job) && isset($job['cost_raw']) ? $job['cost_raw'] : null)); ?>"
|
||||
placeholder="Enter cost raw"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('cost_raw') ? form_error('cost_raw') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('cost') ? 'has-error' : ''; ?>">
|
||||
<label for="cost">Cost</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="cost"
|
||||
name="cost"
|
||||
value="<?php echo set_value('cost', (isset($job) && isset($job['cost']) ? $job['cost'] : null)); ?>"
|
||||
placeholder="Enter cost"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('cost') ? form_error('cost') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('started') ? 'has-error' : ''; ?>">
|
||||
<label for="started">Started</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="started"
|
||||
name="started"
|
||||
datepicker
|
||||
autocomplete="off"
|
||||
value="<?php echo set_value('started', (isset($job) && isset($job['started']) ? date('Y-m-d', strtotime($job['started'])) : null)); ?>"
|
||||
placeholder="Enter started date"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('started') ? form_error('started') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('complete') ? 'has-error' : ''; ?>">
|
||||
<label for="complete">Complete</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="complete"
|
||||
name="complete"
|
||||
datepicker
|
||||
autocomplete="off"
|
||||
value="<?php echo set_value('complete', (isset($job) && isset($job['complete']) ? date('Y-m-d', strtotime($job['complete'])) : null)); ?>"
|
||||
placeholder="Enter complete date"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('complete') ? form_error('complete') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('status') ? 'has-error' : ''; ?>">
|
||||
<label for="status">Status</label>
|
||||
<input type="text"
|
||||
type="number"
|
||||
class="form-control"
|
||||
id="status"
|
||||
name="status"
|
||||
value="<?php echo set_value('status', (isset($job) && isset($job['status']) ? $job['status'] : null)); ?>"
|
||||
placeholder="Enter status"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('status') ? form_error('status') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('attempts') ? 'has-error' : ''; ?>">
|
||||
<label for="attemps">Attemps</label>
|
||||
<input type="text"
|
||||
type="number"
|
||||
class="form-control"
|
||||
id="attemps"
|
||||
name="attempts"
|
||||
value="<?php echo set_value('attempts', (isset($job) && isset($job['attempts']) ? $job['attempts'] : null)); ?>"
|
||||
placeholder="Enter attemps"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('attempts') ? form_error('attempts') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-12">
|
||||
<div class="form-group mb-3 <?php echo form_error('message') ? 'has-error' : ''; ?>">
|
||||
<label for="message">Message</label>
|
||||
<textarea type="text"
|
||||
class="form-control"
|
||||
id="message"
|
||||
name="message"
|
||||
placeholder="Enter message"
|
||||
><?php echo set_value('message', (isset($job) && isset($job['message']) ? $job['message'] : null)); ?></textarea>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('message') ? form_error('message') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/assets/js/plugins/pickers/datepicker.js"></script>
|
||||
<script src="/assets/js/plugins/forms/selects/select2.min.js"></script>
|
||||
<script src="/assets/js/pages/automation_jobs/form.js" type="text/javascript"></script>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row align-items-center">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<h4 class="page-title">Automation Jobs</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title">Create New Automation Job</h4>
|
||||
|
||||
<form action="/automation_jobs/store" method="post" id="automation-job-form">
|
||||
<?php include '_form.php'; ?>
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12 text-right mt-3">
|
||||
<div class="btn-group" role="group">
|
||||
<button type="submit" class="btn btn-primary mr-2">Create</button>
|
||||
<a href="/automation_jobs" class="btn btn-danger">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- end card-body -->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
<!-- end row-->
|
||||
</div> <!-- container -->
|
||||
@@ -0,0 +1,36 @@
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row align-items-center">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<h4 class="page-title">Automation Jobs</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title">Edit Automation Job</h4>
|
||||
|
||||
<form action="/automation_jobs/update/<?php echo $jobId ?>" method="post" id="automation-job-form">
|
||||
<?php include '_form.php'; ?>
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12 text-right mt-3">
|
||||
<div class="btn-group" role="group">
|
||||
<button type="submit" class="btn btn-primary mr-2">Edit</button>
|
||||
<a href="/automation_jobs" class="btn btn-danger">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- end card-body -->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
<!-- end row-->
|
||||
</div> <!-- container -->
|
||||
@@ -0,0 +1,185 @@
|
||||
<link href="/assets/css/transport_provider/list.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row align-items-center">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right text-right action">
|
||||
<a href="/automation_jobs/create" class="btn btn-success">New automation job</a>
|
||||
</div>
|
||||
<h4 class="page-title">Automation Jobs</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<!-- start alert -->
|
||||
<?php if ($this->session->flashdata('success')) { ?>
|
||||
<div class="col-12">
|
||||
<div class="alert alert-success alert-dismissible bg-success text-white border-0" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<?php echo $this->session->flashdata('success') ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<!-- end alert -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<form class="search-block form-inline" id="searchForm" action="/automation_jobs" method="get">
|
||||
<div class="form-group mr-sm-3">
|
||||
<label style="width: 110px" for="transport-provider">Transport Provider</label>
|
||||
<select
|
||||
class="form-control"
|
||||
id="transport-provider"
|
||||
name="transport_provider_id"
|
||||
placeholder="Enter transport provider"
|
||||
>
|
||||
<?php
|
||||
if (isset($transport_provider_id) && isset($transport_provider_name)) {
|
||||
echo '<option value="' . $transport_provider_id . '" selected >' . $transport_provider_name . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group mr-sm-3" style="margin-top: 1rem">
|
||||
<label style="width: 95px" for="location_start">Location</label>
|
||||
<input class="form-control"
|
||||
id="location_start"
|
||||
name="location_start"
|
||||
placeholder="Location"
|
||||
value="<?= isset($location_start) ? $location_start : '' ?>"
|
||||
/>
|
||||
<input class="form-control"
|
||||
id="location_end"
|
||||
name="location_end"
|
||||
placeholder="Location"
|
||||
value="<?= isset($location_end) ? $location_end : '' ?>"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group mr-sm-3" style="margin-top: 1rem">
|
||||
<label style="width: 95px" for="from_complete">Complete Date</label>
|
||||
<input class="form-control"
|
||||
id="from_complete"
|
||||
name="from_complete"
|
||||
placeholder="Complete"
|
||||
value="<?= isset($from_complete) ? $from_complete : '' ?>"
|
||||
/>
|
||||
<input class="form-control"
|
||||
id="to_complete"
|
||||
name="to_complete"
|
||||
placeholder="Complete"
|
||||
value="<?= isset($to_complete) ? $to_complete : '' ?>"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary btn-search" id="btnSearch" type="submit">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive-sm">
|
||||
<table id="trips-datatable" class="table table-sm table-centered mb-0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Id</td>
|
||||
<td>Location Start</td>
|
||||
<td>Location End</td>
|
||||
<td>Cost Raw</td>
|
||||
<td>Trackedemail Item</td>
|
||||
<td>Cost</td>
|
||||
<td>Transport Provider</td>
|
||||
<td>Request Date</td>
|
||||
<td>Started</td>
|
||||
<td>Complete</td>
|
||||
<td>Status</td>
|
||||
<td>Action</td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="table-striped">
|
||||
<?php foreach($list as $item): ?>
|
||||
<tr>
|
||||
<td><?php echo $item['id'] ?></td>
|
||||
<td><?php echo $item['location_start'] ?></td>
|
||||
<td><?php echo $item['location_end'] ?></td>
|
||||
<td><?php echo $item['cost_raw'] ?></td>
|
||||
<td><?php echo $item['trackedemail_item_id'] ?></td>
|
||||
<td><?php echo $item['cost'] ?></td>
|
||||
<td><?php echo isSet($item['transport_provider_name']) ? $item['transport_provider_name'] : '' ?></td>
|
||||
<td><?php echo $item['request_date'] ?></td>
|
||||
<td><?php echo date('Y-m-d', strtotime($item['started'])) ?></td>
|
||||
<td><?php echo date('Y-m-d', strtotime($item['complete'])) ?></td>
|
||||
<td><?php echo $item['status'] ?></td>
|
||||
<td class="actions">
|
||||
<a href="/automation_jobs/edit/<?php echo $item['id']; ?>" class="btn btn-primary">View</a>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-danger btn-remove"
|
||||
data-id="<?php echo $item['id'] ?>"
|
||||
data-job="<?php echo $item['id'] ?>"
|
||||
data-toggle="modal"
|
||||
data-target="#remove-job-warning-modal"
|
||||
>Remove</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php echo $pagination ?>
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
<!-- end row-->
|
||||
</div> <!-- container -->
|
||||
|
||||
<div id="remove-job-warning-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="warning-header-modalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header modal-colored-header bg-warning">
|
||||
<h4 class="modal-title" id="warning-header-modalLabel"></h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h5 class="mt-0">Remove warning</h5>
|
||||
<p>This can not be undone. Do you want to conitnue?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-warning" id="removeBtn" data-id="">Continue</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<script src="/assets/js/plugins/pickers/datepicker.js"></script>
|
||||
<script src="/assets/js/app.js" type="text/javascript"></script>
|
||||
<script src="/assets/js/plugins/forms/selects/select2.min.js"></script>
|
||||
<script src="/assets/js/pages/automation_jobs/list.js" type="text/javascript"></script>
|
||||
|
||||
<style>
|
||||
#searchForm {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
span.select2-container {
|
||||
width: 37%;
|
||||
}
|
||||
#btnSearch {
|
||||
width: 100px;
|
||||
margin-top: 1rem;
|
||||
margin-left: 12rem;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user