first commit
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
<link href="/assets/css/phone_farm_phones/form.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<div class="row mt-3 quote-estimate-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 mr-sm-3 <?php echo form_error('mkey') ? 'has-error' : ''; ?>">
|
||||
<label for="mkey">Mkey</label>
|
||||
<select class="form-control select2 w-100" data-toggle="select2" id="mkey" name="mkey" allow-search="false">
|
||||
<option value="">--Select Mkey</option>
|
||||
<?php
|
||||
if (isset($mkeyOptions) && !empty($mkeyOptions)) {
|
||||
foreach($mkeyOptions as $key => $value) {
|
||||
$selected = set_value('mkey', $details['mkey']) == $value ? 'selected' : '';
|
||||
echo '<option value="' . $value . '"' . $selected . '>' . $value . '</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('mkey') ? form_error('mkey') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('gramskm_perc') ? 'has-error' : ''; ?>">
|
||||
<label for="gramskm_perc">Gramskm_perc</label>
|
||||
<input type="number"
|
||||
min="0"
|
||||
step="any"
|
||||
class="form-control"
|
||||
id="gramskm_perc"
|
||||
name="gramskm_perc"
|
||||
value="<?php echo isset($details['gramskm_perc']) ? $details['gramskm_perc'] : null; ?>"
|
||||
placeholder="Enter emission gramskm_perc"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('gramskm_perc') ? form_error('gramskm_perc') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mr-sm-3 <?php echo form_error('country') ? 'has-error' : ''; ?>">
|
||||
<label for="country">Country</label>
|
||||
<select class="form-control select2 w-100" data-toggle="select2" id="country" name="country" allow-search="false">
|
||||
<option value="">--Select Country</option>
|
||||
<?php
|
||||
if (isset($country) && !empty($country)) {
|
||||
foreach($country as $key => $value) {
|
||||
$selected = set_value('country', $details['country']) == $value ? 'selected' : '';
|
||||
echo '<option value="' . $value . '"' . $selected . '>' . $value . '</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('country') ? form_error('country') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('state') ? 'has-error' : ''; ?>">
|
||||
<label for="state">State</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="state"
|
||||
name="state"
|
||||
value="<?php echo isset($details['state']) ? $details['state'] : null; ?>"
|
||||
placeholder="Enter emission state"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('state') ? form_error('state') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('city') ? 'has-error' : ''; ?>">
|
||||
<label for="city">City</label>
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="city"
|
||||
name="city"
|
||||
value="<?php echo isset($details['city']) ? $details['city'] : null; ?>"
|
||||
placeholder="Enter emission city"
|
||||
>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('city') ? form_error('city') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6">
|
||||
<div class="form-group mr-sm-3 <?php echo form_error('status') ? 'has-error' : ''; ?>">
|
||||
<label for="status">Status</label>
|
||||
<select class="form-control select2 w-100" data-toggle="select2" id="status" name="status" allow-search="false">
|
||||
<?php
|
||||
foreach($statusOptions as $key => $value) {
|
||||
$selected = set_value('status', $details['status']) == $value ? 'selected' : '';
|
||||
echo '<option value="' . $value . '"' . $selected . '>' . $key . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/assets/js/pages/quote_estimates/form.js"></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">Emission Average Commuting</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 emission average</h4>
|
||||
|
||||
<form action="/emission/store" method="post">
|
||||
<?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="/emission" 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">Emission Average Commuting</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 Emission Avrg <?php echo $details['id']; ?></h4>
|
||||
|
||||
<form action="/emission/update/<?php echo $details['id']; ?>" method="post">
|
||||
<?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="/emission" 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,172 @@
|
||||
<!-- Dashboard content -->
|
||||
<div class="row">
|
||||
<div class="col-lg-5">
|
||||
<!-- Recent Members -->
|
||||
|
||||
<div class="panel panel-flat" style="background-color: #ffffff; height: 380px;">
|
||||
<div class="panel-heading">
|
||||
<h6 class="panel-title">Emission Model</h6>
|
||||
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<?= $emission_model??'' ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Recent Members -->
|
||||
</div>
|
||||
<div class="col-lg-7">
|
||||
<div class="panel panel-flat" style="background-color: #ffffff;">
|
||||
<div class="panel-heading" style="display: flex; justify-content: space-between;">
|
||||
<h6 class="panel-title">AVERAGE COMMUTING DISTANCE (KM)</h6>
|
||||
<div class="page-title-right text-right action">
|
||||
<a href="/emission/create" class="btn btn-success">New emission avrg</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (isset($emission_model_item['results'])): ?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover table-bordered table-condensed"
|
||||
style="padding:0px; background-color:lightgreen;">
|
||||
<thead class="bg-indigo">
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>transport_mode</th>
|
||||
<th>country</th>
|
||||
<th>state</th>
|
||||
<th>city</th>
|
||||
<th>gramskm_perc</th>
|
||||
<th>a</th>
|
||||
<th>b</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($emission_model_item['results']->result_array() as $key => $value): ?>
|
||||
<tr>
|
||||
<td><?php echo $value['id']; ?></td>
|
||||
<td><?php echo $value['transport_mode']; ?></td>
|
||||
<td><?php echo $value['country']; ?></td>
|
||||
<td><?php echo $value['state']; ?></td>
|
||||
<td><?php echo $value['city']; ?></td>
|
||||
<td><?php echo $value['gramskm_perc']; ?></td>
|
||||
<td><?php echo $value['a']; ?></td>
|
||||
<td><?php echo $value['b']; ?></td>
|
||||
<td class="input-group-btn">
|
||||
<a href="/emission/edit/<?php echo $value['id']; ?>" type="button"
|
||||
class="btn btn-info btn-sm btn-update legitRipple">Update
|
||||
<div class="legitRipple-ripple"></div>
|
||||
</a>
|
||||
<button type="button" class="btn btn-secondary btn-sm btn-cancel hidden legitRipple">
|
||||
Cancel
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger btn-sm btn-delete legitRipple"
|
||||
data-id="<?php echo $value['id']; ?>">Delete
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<!--CHART-->
|
||||
|
||||
<div class="row" style="padding: 20px 0;">
|
||||
<div class="col-md-6">
|
||||
<canvas id="SG"></canvas>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<canvas id="US"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="pagi" style="margin-top: 30px;">
|
||||
<?php if (isset($emission_model_item['pagination'])): ?>
|
||||
<?php echo $emission_model_item['pagination']; ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<!-- /Recent Members -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /dashboard content -->
|
||||
|
||||
<script src="/assets/js/app.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
var emissionCRUD = {
|
||||
init: function () {
|
||||
this.deleteEmissionManagement();
|
||||
},
|
||||
deleteEmissionManagement: function () {
|
||||
$('.btn-delete').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (!confirm('Are you sure want to delete?')) {
|
||||
return;
|
||||
}
|
||||
var $this = $(this),
|
||||
id = $this.data('id');
|
||||
$.ajax({
|
||||
url: origin + '/emission/deleteEmissionAvrg/' + id,
|
||||
type: 'POST'
|
||||
})
|
||||
.done(function (res) {
|
||||
if (res) {
|
||||
$this.closest('tr').remove();
|
||||
} else {
|
||||
alert('Delete emission average distance get errors!');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
emissionCRUD.init();
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
var radar_data = <?php echo json_encode($emission_model_item['charts']) ?>;
|
||||
for (let country in radar_data) {
|
||||
let marksCanvas = document.getElementById(country);
|
||||
let chart = radar_data[country];
|
||||
let marksData = {
|
||||
labels: chart.label,
|
||||
datasets: [{
|
||||
label: "AVG person in your city (" + country + ")",
|
||||
backgroundColor: "rgba(0,0,200,0.2)",
|
||||
data: chart.data
|
||||
}]
|
||||
};
|
||||
new Chart(marksCanvas, {
|
||||
type: 'radar',
|
||||
data: marksData,
|
||||
options: {
|
||||
backgroundColor: 'red',
|
||||
scale: {
|
||||
gridLines: {
|
||||
circular: true
|
||||
},
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
},
|
||||
pointLabels: {
|
||||
fontSize: 14,
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
labels: {
|
||||
render: 'percentage',
|
||||
fontColor: function (data) {
|
||||
var rgb = chartHexToRgb(data.dataset.backgroundColor[data.index]);
|
||||
var threshold = 140;
|
||||
var luminance = 0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.b;
|
||||
return luminance > threshold ? 'black' : 'white';
|
||||
},
|
||||
precision: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user