Files
thetool/Layout/default/Voiceplan/Index.php
2024-08-30 13:17:22 +02:00

129 lines
5.1 KiB
PHP

<?php
$pagination_baseurl = $this->getUrl($Mod,"Index");
$pagination_baseurl_params = ["filter" => $filter];
$pagination_entity_name = "Sprachtarife";
?>
<?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 active">Sprachtarife</li>
</ol>
</div>
<h4 class="page-title">Sprachtarife</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")?>">
<div class="row">
<div class="col-1">
<label class="form-label" for="filter_name">Name</label>
<input type="text" class="form-control" name="filter[name]" id="filter_name" value="<?=$filter['name']?>" />
</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")?>">Filter zurücksetzen</a>
</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">Sprachtarifpakete</h4>
</div>
<div class="float-right">
<a class="btn btn-primary mb-2" href="<?=self::getUrl("Voiceplan", "add")?>"><i class="fas fa-plus"></i> Neues Sprachtarifpaket 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>Name</th>
<th>Beschreibung</th>
<th>Anzahl Tarifzonen</th>
<th>Anzahl Destinations</th>
<th>Standardtaktung</th>
<th>Verkaufspreis Multiplikator</th>
<th>Erstellt</th>
<th></th>
</tr>
<?php foreach($voiceplans as $plan): ?>
<tr>
<td><a href="<?=self::getUrl("Voiceplan", "view", ['id' => $plan->id])?>"><?=$plan->name?></a></td>
<td><?=$plan->description?></td>
<td><?=count($plan->zones)?></td>
<td><?=count($plan->destinations)?></td>
<td><?=($plan->increment_first && $plan->increment) ? $plan->increment_first."/".$plan->increment : ""?></td>
<td><?=str_replace(".",",",(float)$plan->price_multiplicator)?>x</td>
<td><?=date("d.m.Y H:i", $plan->create)?> (<?=$plan->creator->name?>)</td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?=self::getUrl("Voiceplan", "downloadPdf", ["id" => $plan->id])?>"><i class="far fa-file-pdf" title="Anzeigen"></i></a>
<a href="<?=self::getUrl("Voiceplan", "view", ["id" => $plan->id])?>"><i class="far fa-eyes" title="Anzeigen"></i></a>
<a href="<?=self::getUrl("Voiceplan", "edit", ["id" => $plan->id])?>"><i class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?=self::getUrl("Voiceplan", "delete", ["id" => $plan->id])?>" onclick="if(!confirm('Sprachtarifpaket 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"); ?>