Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into ramadhan
Browse files Browse the repository at this point in the history
  • Loading branch information
dikisiswanto committed May 18, 2020
2 parents d301bf1 + d3df494 commit 8f175e7
Show file tree
Hide file tree
Showing 8 changed files with 15,941 additions and 138 deletions.
399 changes: 336 additions & 63 deletions assets/css/vendor.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/vendor.min.css

Large diffs are not rendered by default.

15,540 changes: 15,540 additions & 0 deletions assets/js/vendor.js

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions assets/js/vendor.min.js

Large diffs are not rendered by default.

41 changes: 9 additions & 32 deletions commons/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,13 @@
<div class="container">
<div class="social-link justify-content-start">
<ul>
<?php if($sosmed[nested_array_search('Facebook',$sosmed)]['enabled'] == 1 && $sosmed[nested_array_search('Facebook', $sosmed)]['link']) : ?>
<li>
<a href="<?= $sosmed[nested_array_search('Facebook',$sosmed)]['link'] ?>" target="_blank"><i class="fab fa-facebook"></i></a>
</li>
<?php endif ?>
<?php if($sosmed[nested_array_search('Twitter', $sosmed)]['enabled'] == 1 && $sosmed[nested_array_search('Twitter', $sosmed)]['link']) : ?>
<li>
<a href="<?= $sosmed[nested_array_search('Twitter', $sosmed)]['link'] ?>" target="_blank"><i class="fab fa-twitter"></i></a>
</li>
<?php endif ?>
<?php if($sosmed[nested_array_search('Google Plus', $sosmed)]['enabled'] == 1 && $sosmed[nested_array_search('Google Plus', $sosmed)]['link']) : ?>
<li>
<a href="<?= $sosmed[nested_array_search('Google Plus', $sosmed)]['link'] ?>" target="_blank"><i class="fab fa-google-plus-g"></i></a>
</li>
<?php endif ?>
<?php if($sosmed[nested_array_search('Instagram', $sosmed)]['enabled'] == 1 && $sosmed[nested_array_search('Instagram', $sosmed)]['link']) : ?>
<li>
<a href="<?= $sosmed[nested_array_search('Instagram', $sosmed)]['link'] ?>" target="_blank"><i class="fab fa-instagram"></i></a>
</li>
<?php endif ?>
<?php if($sosmed[nested_array_search('YouTube', $sosmed)]['enabled'] == 1 && $sosmed[nested_array_search('YouTube', $sosmed)]['link']) : ?>
<li>
<a href="<?= $sosmed[nested_array_search('YouTube', $sosmed)]['link'] ?>" target="_blank"><i class="fab fa-youtube"></i></a>
</li>
<?php endif ?>
<?php if($sosmed[nested_array_search('WhatsApp', $sosmed)]['enabled'] == 1 && $sosmed[nested_array_search('WhatsApp', $sosmed)]['link']) : ?>
<li>
<a href="<?= $sosmed[nested_array_search('WhatsApp', $sosmed)]['link'] ?>" target="_blank"><i class="fab fa-whatsapp"></i></a>
</li>
<?php endif ?>
<?php foreach ($sosmed as $data): ?>
<?php if (!empty($data["link"])): ?>
<li>
<a href="<?= $data['link']?>" target="_blank"><i class="fab fa-<?= strtolower(str_replace(' ', '-', $data['nama']))?>"></i></a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
<div class="meta-desa justify-content-end">
Expand Down Expand Up @@ -75,7 +52,7 @@
</h1>
<div class="ket">
<span>
<?= ucfirst($this->setting->sebutan_kecamatan_singkat) ?>
<?= ucfirst($this->setting->sebutan_kecamatan_singkat) ?>
<?= ucwords($desa['nama_kecamatan']) ?>
<?= ucfirst($this->setting->sebutan_kabupaten_singkat) ?>
<?= ucwords($desa['nama_kabupaten']) ?>
Expand All @@ -86,4 +63,4 @@
</a>
</div>
</div>
</header>
</header>
1 change: 0 additions & 1 deletion commons/source_css.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed'); ?>

<link href="https://fonts.googleapis.com/css?family=Montserrat:300,600,700" rel="stylesheet">
<link href="<?= base_url("$this->theme_folder/$this->theme/vendor/datatable/datatables.min.css") ?>" rel="stylesheet">
<link rel="stylesheet" href="<?= base_url("$this->theme_folder/$this->theme/assets/css/vendor.min.css") ?>">
<link rel="stylesheet" href="<?= base_url("$this->theme_folder/$this->theme/vendor/font-awesome/css/all.min.css") ?>">
<link rel="stylesheet" href="<?= base_url("$this->theme_folder/$this->theme/vendor/font-awesome/css/fontawesome.min.css")?>">
Expand Down
1 change: 0 additions & 1 deletion commons/source_js.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed'); ?>

<script src="<?= base_url("$this->theme_folder/$this->theme/assets/js/vendor.min.js") ?>"></script>
<script src="<?= base_url("$this->theme_folder/$this->theme/vendor/datatable/datatables.min.js") ?>"></script>
<script src="<?= base_url('assets/js/highcharts/highcharts.js')?>"></script>
<script src="<?= base_url("assets/front/js/jquery.cycle2.min.js")?>"></script>
<script src="<?= base_url("assets/front/js/jquery.cycle2.carousel.js")?>"></script>
Expand Down
73 changes: 43 additions & 30 deletions partials/statistik/statistik.php
Original file line number Diff line number Diff line change
@@ -1,61 +1,67 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed'); ?>

<script src="<?= base_url('assets/js/highcharts/highcharts-more.js')?>"></script>
<script src="<?= base_url('assets/js/highcharts/exporting.js')?>"></script>
<script type="text/javascript">
let chart;
const raw = Object.values(<?= json_encode($stat) ?>);
const chartType = '<?= $tipe == 1 ? 'column' : 'pie' ?>';
const legend = Boolean(<?=!($tipe)?>);
let chartType = 'pie';
const legend = Boolean(!<?= ($tipe) ?>);
const categories = [];
const data = [];
let status_tampilkan = true;
let showStatus = true;
for (const stat of raw) {
if (stat.nama !== 'BELUM MENGISI' && stat.nama !== 'TOTAL' && stat.nama !== 'JUMLAH' && stat.nama != 'PENERIMA') {
if (stat.nama !== 'TOTAL' && stat.nama !== 'JUMLAH' && stat.nama != 'PENERIMA') {
let filteredData = [stat.nama, parseInt(stat.jumlah)];
let category = stat.nama;
categories.push(category);
categories.push(stat.nama);
data.push(filteredData);
}
}

function tampilkan_nol(tampilkan = false) {
if (tampilkan) {
function showZeroValue(show = false) {
if (show) {
$(".nol").parent().show();
} else {
$(".nol").parent().hide();
}
}

function toggle_tampilkan() {
function showHideToggle() {
$('#showData').click();
tampilkan_nol(status_tampilkan);
status_tampilkan = !status_tampilkan;
if (status_tampilkan) $('#tampilkan').text('Tampilkan Nol');
showZeroValue(showStatus);
showStatus = !showStatus;
if (showStatus) $('#tampilkan').text('Tampilkan Nol');
else $('#tampilkan').text('Sembunyikan Nol');
}

function switchType(type){
chart.series[0].update({
type: type
});
}

$(document).ready(function () {
tampilkan_nol(false);
const chart = new Highcharts.Chart({
showZeroValue(false);
chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
title: 0,
xAxis: {
categories: categories,
},
yAxis: {
showEmpty: false,
title: {
text: 'Jumlah Populasi'
}
},
xAxis: {
categories: categories,
},
plotOptions: {
series: {
colorByPoint: true
},
column: {
pointPadding: -0.1,
borderWidth: 0
borderWidth: 0,
showInLegend: false
},
pie: {
allowPointSelect: true,
Expand All @@ -78,9 +84,18 @@ function toggle_tampilkan() {
$('#showData').click(function () {
$('tr.lebih').show();
$('#showData').hide();
tampilkan_nol(false);
showZeroValue(false);
});

$('.btn-switch').click(function () {
chartType = $(this).data('type');
$(this).addClass('btn-primary');
$(this).removeClass('btn-default')
$(this).siblings('.btn').removeClass('btn-primary');
$(this).siblings('.btn').addClass('btn-default');
switchType(chartType);
})

});
</script>

Expand All @@ -89,15 +104,13 @@ function toggle_tampilkan() {
<div class="col-12 px-0 mb-4 mt-3">
<div class="row justify-content-between align-content-center">
<div class="col-7">
<h5 class="font-weight-bold">Grafik Data</h5>
<h5 class="font-weight-bold">Grafik <?= $heading ?></h5>
</div>
<div class="col-5">
<div class="box-stats d-flex justify-content-end">
<div class="btn-group btn-group-sm">
<?php $jenis_btn = ($tipe==1) ? "btn-primary":"btn-default"; ?>
<a href="<?= site_url('first/statistik/'.$st.'/1') ?>" class="btn btn-sm <?= $jenis_btn ?>">Bar Graph</a>
<?php $jenis_btn = ($tipe==0) ? "btn-primary":"btn-default"; ?>
<a href="<?= site_url('first/statistik/'.$st.'/0') ?>" class="btn btn-sm <?= $jenis_btn ?>">Pie Chart</a>
<button class="btn-switch btn btn-default btn-xs" data-type="column">Bar Graph</button>
<button class="btn-switch btn btn-primary btn-xs" data-type="pie">Pie Chart</button>
</div>
</div>
</div>
Expand All @@ -111,7 +124,7 @@ function toggle_tampilkan() {
</div>

<h5 class="font-weight-bold mt-4">
Tabel Data
Tabel <?= $heading ?>
</h5>
<div class="table-responsive">
<table class="table table-bordered table-striped">
Expand Down Expand Up @@ -172,13 +185,13 @@ function toggle_tampilkan() {
<?php if($hide == "lebih") : ?>
<button class='btn btn-sm btn-success mr-3' id='showData'>Selengkapnya...</button>
<?php endif ?>
<button id='tampilkan' onclick="toggle_tampilkan();" class="btn btn-sm btn-success">Tampilkan Nol</button>
<button id='tampilkan' onclick="showHideToggle();" class="btn btn-sm btn-success">Tampilkan Nol</button>
</div>
</div>

<?php if (in_array($st, array('bantuan_keluarga', 'bantuan_penduduk'))):?>
<h5 class="font-weight-bold mt-4">
Tabel Data
Daftar <?= $heading ?>
</h5>
<input id="stat" type="hidden" value="<?=$st?>">
<div class="table-responsive">
Expand Down Expand Up @@ -228,4 +241,4 @@ function toggle_tampilkan() {
});
</script>
<?php endif;?>
</div>
</div>

0 comments on commit 8f175e7

Please sign in to comment.