Merge branch 'fronkdev' into 'master'

Added gemeinde filter to Dashboard

See merge request fronk/thetool!267
This commit is contained in:
Frank Schubert
2024-02-26 12:33:55 +00:00
6 changed files with 335 additions and 87 deletions
+27 -5
View File
@@ -75,7 +75,7 @@ $chartColors = [
<div class="col">
<div class="card">
<div class="card-body">
<h4>Filter</h4>
<?php if($me->is("Admin")): ?>
<h5 class="mt-3">Netzinhaber:</h5>
<div class="row mb-2">
@@ -95,12 +95,20 @@ $chartColors = [
<?php endif; ?>
<label for="campaign_id">Kampagne:</label>
<select name="campaign_id" id="campaign_id" class="form-control">
<select name="campaign_id" id="campaign_id" class="form-control mb-2">
<option value="0">Alle</option>
<?php foreach($campaigns as $c): ?>
<option value="<?=$c->id?>" <?=($c->id == $campaign_id) ? 'selected="selected"' : ""?>><?=$c->name?></option>
<?php endforeach; ?>
</select>
<label for="gemeinde_id" class="mt-2">Gemeinde:</label>
<select name="gemeinde_id" id="gemeinde_id" class="form-control">
<option value="0">Alle</option>
<?php foreach($gemeinden as $g): ?>
<option value="<?=$g->id?>" <?=($g->id == $gemeinde_id) ? 'selected="selected"' : ""?>><?=$g->name?></option>
<?php endforeach; ?>
</select>
</div>
</div>
@@ -268,9 +276,8 @@ $chartColors = [
<script type="text/javascript">
$(document).ready(function() {
$("#campaign_id").select2({
});
$("#campaign_id").select2();
$("#gemeinde_id").select2();
$("#campaign_id").change(function() {
var cid = parseInt($(this).val());
@@ -287,6 +294,21 @@ $chartColors = [
}
});
$("#gemeinde_id").change(function() {
var gid = parseInt($(this).val());
<?php if($gemeinde_id): ?>
if(gid == <?=$gemeinde_id?>) {
return;
}
<?php endif; ?>
if(gid > 0) {
location.href="<?=self::getUrl("Dashboard")?>?gemeinde_id=" + gid;
} else {
location.href="<?=self::getUrl("Dashboard")?>";
}
});
<?php if(count($partner_orders)): ?>
var providerChart = new Chart(document.getElementById('partner-chart').getContext('2d'), {