Files
thetool/Layout/default/Voiceplan/View.php
2023-12-05 22:09:00 +01:00

151 lines
6.6 KiB
PHP

<?php
$pagination_baseurl = $this->getUrl($Mod,"View");
$pagination_baseurl_params = ["filter" => $filter, "id" => $plan->id];
$pagination_entity_name = "Destinations";
?>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="<?=self::getUrl("Dashboard")?>"><?=MFAPPNAME_SLUG?></a></li>
<li class="breadcrumb-item"><a href="<?=self::getUrl("Voiceplan")?>">Sprachtarife</a></li>
<li class="breadcrumb-item active"><?=$plan->name?></li>
</ol>
</div>
<h4 class="page-title">Tarifzonen</h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body mb-3">
<h4 class="header-title mb-3">Filter</h4>
<form method="get" action="<?=self::getUrl("Voiceplan", "view")?>">
<input type="hidden" name="id" value="<?=$plan->id?>" />
<div class="row">
<div class="col-2">
<label class="form-label" for="filter_name">Zone</label>
<input type="text" class="form-control" name="filter[name]" id="filter_name" value="<?=$filter['name']?>" />
</div>
<div class="col-2">
<label class="form-label" for="filter_prefix">Destination Prefix</label>
<input type="text" class="form-control" name="filter[prefix]" id="filter_prefix" value="<?=$filter['prefix']?>" />
</div>
<div class="col-2">
<label class="form-label" for="filter_destination">Verkaufspreis</label>
<select name="filter[price_difference]" class="form-control">
<option></option>
<option value="same">Stimmt mit Multiplikator überein</option>
<option value="diff">Weicht von Multiplikator ab</option>
</select>
</div>
</div>
<div class="row mt-2">
<div class="col">
<button type="submit" class="btn btn-primary">Filter anwenden</button>
<a class="btn btn-secondary" href="<?=self::getUrl("Voiceplan", "view", ["id" => $plan->id, "resetFilter" => 1])?>">Filter zurücksetzen</a>
</div>
<!--<div class="col">
<button class="btn btn-info" type="button" onclick="refreshMap()"><i class="far fa-map"></i> Auf Karte anzeigen</button>
</div>-->
</div>
</form>
</div>
</div>
<div class="card">
<div class="card-body mb-3">
<div class="row">
<div class="col-12">
<div class="float-left">
<h4 class="header-title">Tarifzonen für Sprachtarifpaket <?=$plan->name?></h4>
</div>
<div class="float-right">
<a class="btn btn-primary mb-2" href="<?=self::getUrl("Voiceplanzone", "add", ["voiceplan_id" => $plan->id])?>"><i class="fas fa-plus"></i> Neue Tarifzone anlegen</a>
</div>
</div>
</div>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
<table class="table table-striped table-hover">
<tr>
<th>Zone</th>
<th>Destination(s)</th>
<th>Taktung</th>
<th>Einkaufspreis</th>
<th>Verkaufspreis</th>
<th>Erstellt</th>
<th>Bearbeitet</th>
<th></th>
</tr>
<?php foreach($zones as $zone): ?>
<tr>
<td><a href="<?=self::getUrl("Voiceplanzone", "view", ["id" => $zone->id])?>"><?=$zone->name?></a></td>
<?php if(count($zone->destinations) > 1): ?>
<td title="<?php foreach($zone->destinations as $d): ?>+<?=$d->prefix."\n"?><?php endforeach; ?>"><?=count($zone->destinations)?> Destinations</td>
<?php else: ?>
<td><spam class='text-monospace'>+<?=$zone->destinations[0]->prefix?></span></td>
<?php endif; ?>
<td><?=($zone->increment_first && $zone->increment) ? $zone->increment_first."/".$zone->increment : ""?></td>
<td><?=$zone->purchase_price?></td>
<td><?=$zone->price?></td>
<td><?=date("d.m.Y H:i", $plan->create)?> (<?=$plan->creator->name?>)</td>
<td><?=date("d.m.Y H:i", $plan->edit)?> (<?=$plan->editor->name?>)</td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?=self::getUrl("Voiceplanzone", "view", ["id" => $zone->id])?>"><i class="far fa-eyes" title="Prefixes anzeigen"></i></a>
<a href="<?=self::getUrl("Voiceplanzone", "edit", ["id" => $zone->id])?>"><i class="far fa-edit" title="Zone bearbeiten"></i></a>
<a href="<?=self::getUrl("Voiceplanzone", "delete", ["id" => $zone->id])?>" onclick="if(!confirm('Tarifzone wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function toggleBlock(id) {
$('#block-detail-' + id).toggle();
if($('#block-detail-' + id).is(":hidden")) {
$('#block-' + id).removeClass("table-info");
$('#block-' + id).removeClass("text-info");
} else {
$('#block-' + id).addClass("text-info");
$('#block-' + id).addClass("table-info");
}
}
var block;
var hash = window.location.hash.substr(1);
var match = hash.match(/block=(\d+)/);
if(match && match[1]) {
block = match[1]
toggleBlock(block);
}
</script>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>