Added number base
This commit is contained in:
@@ -116,6 +116,7 @@
|
||||
<th>Name</th>
|
||||
<th>Landeskennzahl</th>
|
||||
<th>Ortskennzahl</th>
|
||||
<th>Nummernbasis</th>
|
||||
<th>Anfang</th>
|
||||
<th>Ende</th>
|
||||
<th>Kommentar</th>
|
||||
@@ -126,6 +127,7 @@
|
||||
<td><?=$block->name?></td>
|
||||
<td><?=$block->countrycode?></td>
|
||||
<td><?=$block->areacode?></td>
|
||||
<td><?=$block->base?></td>
|
||||
<td><?=$block->getFirst()?></td>
|
||||
<td><?=$block->getLast()?></td>
|
||||
<td><?=$block->comment?></td>
|
||||
|
||||
5
application/Voicenumber/Voicenumber.php
Normal file
5
application/Voicenumber/Voicenumber.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
class Voicenumber extends mfBaseModel {
|
||||
|
||||
}
|
||||
8
application/Voicenumber/VoicenumberModel.php
Normal file
8
application/Voicenumber/VoicenumberModel.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
@@ -4,6 +4,7 @@ class Voicenumberblock extends mfBaseModel {
|
||||
protected $forcestr = ['comment'];
|
||||
private $number_first;
|
||||
private $number_last;
|
||||
private $base;
|
||||
private $files;
|
||||
private $numbers;
|
||||
|
||||
@@ -31,6 +32,14 @@ class Voicenumberblock extends mfBaseModel {
|
||||
return $this->last;
|
||||
}
|
||||
|
||||
public function getBaseNumber() {
|
||||
$base = floor($this->first / pow(10, ceil(log10($this->last - $this->first))));
|
||||
|
||||
if($this->number_prepend_zero) {
|
||||
return "0".$base;
|
||||
}
|
||||
return $base;
|
||||
}
|
||||
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
@@ -53,6 +62,10 @@ class Voicenumberblock extends mfBaseModel {
|
||||
return $this->getFullNumber(true);
|
||||
}
|
||||
|
||||
if($name == "base") {
|
||||
return $this->getBaseNumber();
|
||||
}
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
|
||||
Reference in New Issue
Block a user