140 lines
6.7 KiB
PHP
140 lines
6.7 KiB
PHP
<?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">Vorbestellung</li>
|
|
</ol>
|
|
</div>
|
|
<h4 class="page-title">Vorbestellkampagnen</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("Preordercampaign")?>">
|
|
<div class="row">
|
|
|
|
<div class="col-2">
|
|
<label class="form-label" for="filter_network_id">Netzgebiet</label>
|
|
<select name="filter[network_id]" id="filter_network_id" class="form-control">
|
|
<option></option>
|
|
<?php foreach($mynetworks as $fnet): ?>
|
|
<option value="<?=$fnet->id?>" <?=($filter['network_id'] == $fnet->id) ? "selected='selected'" : ""?>><?=$fnet->name?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
|
|
<?php if($me->is("Admin")): ?>
|
|
<div class="col-2">
|
|
<label class="form-label" for="filter_netowner">Netzbesitzer</label>
|
|
<select name="filter[netowner]" id="filter_netowner" class="form-control">
|
|
<option></option>
|
|
<?php foreach($netowners as $owner): ?>
|
|
<option value="<?=$owner->id?>" <?=($filter['netowner'] == $owner->id) ? "selected='selected'" : ""?>><?=$owner->getCompanyOrName()?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<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 class="col-1">
|
|
<label class="form-label" for="filter_area">Gebiet</label>
|
|
<input type="text" class="form-control" name="filter[area]" id="filter_area" value="<?=$filter['area']?>" />
|
|
</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("Preordercampaign")?>">Filter zurücksetzen</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="card">
|
|
<div class="card-body mb-3">
|
|
<div class="float-left">
|
|
<h4 class="header-title">Liste aller Vorbestellkampagnen</h4>
|
|
</div>
|
|
<div class="float-right">
|
|
<?php if($me->is("Admin")): ?>
|
|
<a class="btn btn-primary mb-2" href="<?=self::getUrl("Preordercampaign", "add")?>"><i class="fas fa-plus"></i> Neue Vorbestellkampagne anlegen</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<table class="table table-striped table-hover">
|
|
<tr>
|
|
<th></th>
|
|
<th></th>
|
|
<th>Netzgebiete</th>
|
|
<th>Name</th>
|
|
<th>Gebiet</th>
|
|
<th>Vorbestellungen</th>
|
|
<th>Start</th>
|
|
<th>Ende</th>
|
|
<th></th>
|
|
</tr>
|
|
<?php foreach($campaigns as $camp): ?>
|
|
<tr style="<?=(date('U') >= $camp->from && date('U') <= $camp->to) ? "background-color: #f0fff0" : ""?>">
|
|
<td class="text-right">
|
|
<?php if(date('U') >= $camp->from && date('U') <= $camp->to): ?>
|
|
<span class="fa-stack" title="Vorbestellkampagne aktiv">
|
|
<i class="fas fa-alarm-clock fa-stack-1x text-success" style="z-index: 20;"></i>
|
|
<i class="fas fa-circle-check" style="color: Tomato; vertical-align: top; font-size: 0.7em; padding-right:4px; padding-top:4px; z-index: 10;"></i>
|
|
</span>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td class="text-right">
|
|
<a class="btn btn-sm btn-outline-primary" href="<?=self::getUrl("Preorder", "add", ["preordercampaign_id" => $camp->id])?>"><i class="fas fa-plus" title="Vorbestellung hinzufügen"></i></a>
|
|
</td>
|
|
<td><?=$camp->network->name?></td>
|
|
<td><?=$camp->name?></td>
|
|
<td><?=$camp->area?></td>
|
|
<td>
|
|
<a href="<?=self::getUrl("Preorder", "Index", ["filter" => ["preordercampaign_id" => $camp->id]])?>">
|
|
<?=$camp->active_preorder_count?>
|
|
<?php if($camp->homes_total): ?>
|
|
/ <?=$camp->homes_total?> (<?=(round(($camp->active_preorder_count / $camp->homes_total) * 100, 2))?> %)
|
|
<?php endif; ?>
|
|
</a>
|
|
</td>
|
|
<td><?=date('d.m.Y',$camp->from)?></td>
|
|
<td><?=date('d.m.Y',$camp->to)?></td>
|
|
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
|
<a href="<?=self::getUrl("Preordercampaign", "downloadAddonServices", ["preordercampaign_id" => $camp->id])?>" title="Bestellte Zusatzdienste exportieren"><i class="far fa-sunset"></i></a>
|
|
<?php if($me->is("Admin")): ?>
|
|
<a href="<?=self::getUrl("Preordercampaign", "edit", ["id" => $camp->id])?>"><i class="far fa-edit" title="Vorbestellkampagne Bearbeiten"></i></a>
|
|
<a href="<?=self::getUrl("Preordercampaign", "delete", ["id" => $camp->id])?>" class="text-danger" onclick="if(!confirm('Vorbestellkampagne wirklich löschen?')) return false;" title="Vorbestellkampagne Löschen"><i class="fas fa-trash"></i></a>
|
|
<?php endif; ?>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|