Added Voicenumberblock name

This commit is contained in:
Frank Schubert
2021-12-21 20:48:14 +01:00
parent 6aa10f0d29
commit 038c8d5c47
4 changed files with 27 additions and 4 deletions

View File

@@ -29,6 +29,13 @@
<input type="hidden" name="id" value="<?=$block->id?>" />
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="name">Name</label>
<div class="col-lg-10">
<input type="name" class="form-control" name="name" id="name" value="<?=$block->name?>" />
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="countrycode">Country Code *</label>
<div class="col-lg-10">

View File

@@ -25,6 +25,11 @@
<form method="get" action="<?=self::getUrl("Voicenumberblock")?>">
<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 class="col-1">
<label class="form-label" for="filter_countrycode">Countrycode</label>
<input type="text" class="form-control" name="filter[countrycode]" id="filter_countrycode" value="<?=$filter['countrycode']?>" />
@@ -109,6 +114,7 @@
<table class="table table-striped table-hover">
<tr>
<th>ID</th>
<th>Name</th>
<th>Country Code</th>
<th>Area Code</th>
<th>Anfang</th>
@@ -119,6 +125,7 @@
<?php foreach($blocks as $block): ?>
<tr>
<td><?=$block->id?></td>
<td><?=$block->name?></td>
<td><?=$block->countrycode?></td>
<td><?=$block->areacode?></td>
<td><?=$block->first?></td>

View File

@@ -94,6 +94,7 @@ class VoicenumberblockController extends mfBaseController {
}
$data = [];
$data['name'] = $r->name;
$data['countrycode'] = $r->countrycode;
$data['areacode'] = $r->areacode;
$data['first'] = $r->first;

View File

@@ -1,6 +1,7 @@
<?php
class VoicenumberblockModel {
public $name;
public $countrycode;
public $areacode;
public $first;
@@ -110,28 +111,28 @@ class VoicenumberblockModel {
if(array_key_exists("countrycode", $filter)) {
$countrycode = $filter['countrycode'];
if(is_numeric($countrycode)) {
$where .= " AND countrycode=$countrycode";
$where .= " AND countrycode like '%$countrycode%'";
}
}
if(array_key_exists("areacode", $filter)) {
$areacode = $filter['areacode'];
if(is_numeric($areacode)) {
$where .= " AND areacode=$areacode";
$where .= " AND areacode like '%$areacode%'";
}
}
if(array_key_exists("first", $filter)) {
$first = $filter['first'];
if(is_numeric($first)) {
$where .= " AND first=$first";
$where .= " AND first like '%$first%'";
}
}
if(array_key_exists("last", $filter)) {
$last = $filter['last'];
if(is_numeric($last)) {
$where .= " AND last=$last";
$where .= " AND last= like '%$last%'";
}
}
@@ -142,6 +143,13 @@ class VoicenumberblockModel {
}
}
if(array_key_exists("name", $filter)) {
$name = $db->escape($filter['name']);
if($name) {
$where .= " AND name like '%$name%'";
}
}
if(array_key_exists("comment", $filter)) {
$comment = $db->escape($filter['comment']);
if($comment) {