Mobile Integration,Pop Multiple Networks,DataTables responsible update,Migrations
Mobile Integration: * in footer.php js eingefügt damit das mobile Menu funktioniert * in menu.php bzw. app.css neue Klasse eingefügt mobile-hide um in der mobilen Version Menupünkte zu verstecken Pop Multiple Networks * Pops können nun mehrere Netzgebiete haben * Netzgebiete und Pop ansicht angepasst * (Script muss ausgeführt werden um die PopNetwork Table vom Bestand zu befüllen) DataTables responsible update * Datatables update und responsible addon * Diverse Anpassungen für Responsible in: - Pops, Geräte Hersteller, Geräte Typen, Devices, Benutzer Migrations * PopNetwork * Poprackmodulepatch
This commit is contained in:
108
application/Poprackmodulepatch/PoprackmodulepatchModel.php
Normal file
108
application/Poprackmodulepatch/PoprackmodulepatchModel.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
class PoprackmodulepatchModel
|
||||
{
|
||||
private $poprackmodule_id;
|
||||
private $port;
|
||||
private $fiberPlanCable_id;
|
||||
private $destination;
|
||||
public $create_by = null;
|
||||
public $edit_by = null;
|
||||
public $create = null;
|
||||
public $edit = null;
|
||||
|
||||
public static function find($data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function create(array $data)
|
||||
{
|
||||
$model = new Poprackmodulepatch();
|
||||
|
||||
foreach ($data as $field => $value) {
|
||||
if (property_exists(get_called_class(), $field)) {
|
||||
if (substr($field, 0, 5) == "vlan_" && !$value) {
|
||||
$model->$field = null;
|
||||
continue;
|
||||
}
|
||||
$model->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$me = mfValuecache::singleton()->get("me");
|
||||
if (!$me) {
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
mfValuecache::singleton()->set("me", $me);
|
||||
}
|
||||
|
||||
if ($model->create_by === null) {
|
||||
$model->create_by = $me->id;
|
||||
}
|
||||
if ($model->edit_by === null) {
|
||||
$model->edit_by = $me->id;
|
||||
}
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public static function getOne($id)
|
||||
{
|
||||
if (!is_numeric($id) || !$id) {
|
||||
throw new Exception("Invalid number", 400);
|
||||
}
|
||||
$item = [];
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$res = $db->select("Poprackmodulepatch", "*", "id=$id LIMIT 1");
|
||||
if ($db->num_rows($res)) {
|
||||
$data = $db->fetch_object($res);
|
||||
$item = new Poprackmodulepatch($data);
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
||||
public static function countAllModule($moduleId)
|
||||
{
|
||||
$items = [];
|
||||
$db = FronkDB::singleton();
|
||||
$sql = "SELECT `id` FROM `Poprackmodulepatch` WHERE `poprackmodule_id`='" . $moduleId . "'";
|
||||
|
||||
$res = $db->query($sql);
|
||||
$countrows = $db->num_rows($res);
|
||||
return $countrows;
|
||||
}
|
||||
|
||||
public static function deletebyPort($moduleId, $port)
|
||||
{
|
||||
$db = FronkDB::singleton();
|
||||
$sql = "DELETE FROM `Poprackmodulepatch` WHERE `port`='" . $port . "' AND `poprackmodule_id`='" . $moduleId . "'";
|
||||
$res = $db->query($sql);
|
||||
}
|
||||
|
||||
public static function updatebyPort($moduleId, $port, $fiberPlanCable_id)
|
||||
{
|
||||
$db = FronkDB::singleton();
|
||||
$sql = "UPDATE `Poprackmodulepatch` SET fiberPlanCable_id='" . $fiberPlanCable_id . "' WHERE `port`='" . $port . "' AND `poprackmodule_id`='" . $moduleId . "'";
|
||||
echo $sql . "\n";
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
public static function updatebyPortRange($moduleId, $startport, $endport, $fiberPlanCable_id)
|
||||
{
|
||||
$db = FronkDB::singleton();
|
||||
$sql = "UPDATE `Poprackmodulepatch` SET fiberPlanCable_id='" . $fiberPlanCable_id . "' WHERE `port`>='" . $startport . "' AND `port`<='" . $endport . "' AND `poprackmodule_id`='" . $moduleId . "'";
|
||||
echo $sql . "\n";
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
public static function clearPort($fiberPlanCable_id)
|
||||
{
|
||||
$db = FronkDB::singleton();
|
||||
$sql = "UPDATE `Poprackmodulepatch` SET fiberPlanCable_id=NULL WHERE `fiberPlanCable_id`='" . $fiberPlanCable_id . "'";
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user