Added filter and pagination to Product
This commit is contained in:
@@ -24,6 +24,81 @@
|
||||
<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("Product")?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_network_id">Produktgruppen</label>
|
||||
<select name="filter[productgroup_id][]" id="filter_productgroup_id" class="form-control select2" multiple="multiple">
|
||||
<option></option>
|
||||
<?php foreach(ProductgroupModel::getAll() as $group): ?>
|
||||
<option value="<?=$group->id?>" <?=(is_array($filter) && array_key_exists('productgroup_id', $filter) && in_array($group->id, $filter['productgroup_id'])) ? "selected='selected'" : ""?>><?=$group->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_producttech_id">Technologien</label>
|
||||
<select name="filter[producttech_id][]" id="filter_producttech_id" class="form-control select2" multiple="multiple">
|
||||
<option></option>
|
||||
<?php foreach(ProducttechModel::getAll() as $tech): ?>
|
||||
<option value="<?=$tech->id?>" <?=(is_array($filter) && array_key_exists('producttech_id', $filter) && in_array($tech->id, $filter['producttech_id'])) ? "selected='selected'" : ""?>><?=$tech->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_sla_id">SLA</label>
|
||||
<select name="filter[sla_id]" id="filter_sla_id" class="form-control">
|
||||
<option></option>
|
||||
<?php foreach(SlaModel::getAll() as $sla): ?>
|
||||
<option value="<?=$sla->id?>" <?=(is_array($filter) && array_key_exists('sla_id', $filter) && $filter['sla_id'] == $sla->id) ? "selected='selected'" : ""?>><?=$sla->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<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-2">
|
||||
<label class="form-label" for="filter_customer_type">Kundentyp</label>
|
||||
<select name="filter[customer_type]" id="filter_customer_type" class="form-control">
|
||||
<option></option>
|
||||
<option value="business" <?=(is_array($filter) && array_key_exists('customer_type', $filter) && $filter['customer_type'] == "business") ? "selected='selected'" : ""?>>Business</option>
|
||||
<option value="residential" <?=(is_array($filter) && array_key_exists('customer_type', $filter) && $filter['customer_type'] == "residential") ? "selected='selected'" : ""?>>Residential</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_external">Externe Produkte</label>
|
||||
<select name="filter[external]" id="filter_external" class="form-control">
|
||||
<option></option>
|
||||
<option value="1" <?=(is_array($filter) && array_key_exists('external', $filter) && $filter['external']) ? "selected='selected'" : ""?>>Anzeigen</option>
|
||||
<option value="0" <?=(is_array($filter) && array_key_exists('external', $filter) && !$filter['external']) ? "selected='selected'" : ""?>>Ausblenden</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("Product")?>">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="float-left">
|
||||
@@ -34,8 +109,8 @@
|
||||
</div>
|
||||
|
||||
|
||||
<?php //include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
|
||||
<?php //include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
|
||||
<?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>
|
||||
@@ -69,12 +144,17 @@
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
<?php //include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
|
||||
<?php //include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
|
||||
<?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">
|
||||
$("#filter_productgroup_id").select2({closeOnSelect: false});
|
||||
$("#filter_producttech_id").select2({closeOnSelect: false});
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
|
||||
Reference in New Issue
Block a user