mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Added resultview and more logic
This commit is contained in:
@@ -319,9 +319,23 @@ class Statistics extends CI_Controller {
|
||||
// Set Page Title
|
||||
$data['page_title'] = __("EME Initials");
|
||||
|
||||
$footerData = [];
|
||||
$footerData['scripts'] = [
|
||||
'assets/js/sections/initials.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/initials.js")),
|
||||
];
|
||||
|
||||
// Load Views
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('statistics/initials');
|
||||
$this->load->view('interface_assets/footer');
|
||||
$this->load->view('interface_assets/footer', $footerData);
|
||||
}
|
||||
|
||||
public function getInitials() {
|
||||
$band = xss_clean($this->input->post('band'));
|
||||
$mode = xss_clean($this->input->post('mode'));
|
||||
|
||||
$this->load->model('stats');
|
||||
$data['intials_array'] = $this->stats->getInitialsFromDb($band, $mode);
|
||||
$this->load->view('statistics/initialresult', $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -918,6 +918,10 @@
|
||||
|
||||
return $this->db->get($this->config->item('table_name'));
|
||||
}
|
||||
|
||||
public function getInitialsFromDb($band, $mode) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
32
application/views/statistics/initialresult.php
Normal file
32
application/views/statistics/initialresult.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
if ($intials_array) {
|
||||
echo '<br />
|
||||
<table style="width:100%" class="qsotable table-sm table table-bordered table-hover table-striped table-condensed text-center">
|
||||
<thead>';
|
||||
echo '<tr><th></th>';
|
||||
foreach($bands as $band) {
|
||||
echo '<th>' . $band . '</th>';
|
||||
}
|
||||
echo '<th>'.__("Total").'</th>';
|
||||
echo '</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
foreach ($qsoarray as $mode => $value) {
|
||||
echo '<tr>
|
||||
<th>'. $mode .'</th>';
|
||||
foreach ($value as $key => $val) {
|
||||
echo '<td>' . $val . '</td>';
|
||||
}
|
||||
echo '<th>' . $modetotal[$mode] . '</th>';
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</tbody><tfoot><tr><th>'.__("Total").'</th>';
|
||||
|
||||
$grandtotal = 0;
|
||||
foreach ($bandtotal as $band => $value) {
|
||||
echo '<th>' . $value . '</th>';
|
||||
$grandtotal += $value;
|
||||
}
|
||||
echo '<th>' . $grandtotal . '</th>';
|
||||
echo '</tr></tfoot></table>';
|
||||
}
|
||||
@@ -39,8 +39,9 @@
|
||||
<div class="mb-3 row">
|
||||
<label class="col-md-1 control-label" for="button1id"></label>
|
||||
<div class="col-md-10">
|
||||
<button id="showinitials();" type="button" name="button1id" class="btn btn-primary"><?= __("Show") ?></button>
|
||||
<button onclick="showinitials();" type="button" name="button1id" class="btn btn-primary"><?= __("Show") ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="resulttable"></div>
|
||||
</div>
|
||||
|
||||
32
assets/js/sections/initials.js
Normal file
32
assets/js/sections/initials.js
Normal file
@@ -0,0 +1,32 @@
|
||||
$(".activatorstable").DataTable({
|
||||
pageLength: 25,
|
||||
responsive: false,
|
||||
ordering: false,
|
||||
scrollY: "500px",
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
scrollX: true,
|
||||
language: {
|
||||
url: getDataTablesLanguageUrl(),
|
||||
},
|
||||
dom: "Bfrtip",
|
||||
buttons: ["csv"],
|
||||
});
|
||||
|
||||
function showinitials() {
|
||||
var data = {
|
||||
mode: $('#band').val(),
|
||||
band: $('#mode').val()
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: base_url + "index.php/statistics/getInitials",
|
||||
type: "post",
|
||||
data: data,
|
||||
success: function (html) {
|
||||
$(".resulttable").empty();
|
||||
$(".resulttable").html(html);
|
||||
$(".qsotable").DataTable();
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user