From 112df1a9588aff3e3b5ae9d63e0639fb9ca888bb Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Thu, 29 Jul 2021 17:07:35 +0200 Subject: [PATCH] Finished Building -> termination --- Layout/default/Building/Index.php | 33 +- application/Building/Building.php | 2 +- application/Building/BuildingController.php | 4 +- application/Dashboard/DashboardController.php | 15 +- application/Termination/Termination.php | 42 ++ .../Termination/TerminationController.php | 82 +++ thetool.sql | 671 ------------------ 7 files changed, 162 insertions(+), 687 deletions(-) delete mode 100644 thetool.sql diff --git a/Layout/default/Building/Index.php b/Layout/default/Building/Index.php index 9e6075c75..a020e1a82 100644 --- a/Layout/default/Building/Index.php +++ b/Layout/default/Building/Index.php @@ -143,17 +143,34 @@
- + - $term->id])?>" class="text-danger" onclick="if(!confirm('Objekt wirklich löschen?')) return false;" title="Objekt Löschen"> + $term->id])?>" class="text-danger" onclick="if(!confirm('Objekt wirklich löschen?')) return false;" title="Objekt Löschen"> + +

Neuer Anschluss

+
"> + + + + + + + + + + +
+
+ + @@ -221,6 +238,18 @@ } + + var building; + var hash = window.location.hash.substr(1); + var match = hash.match(/building=(\d+)/); + if(match && match[1]) { + building = match[1] + toggleBuilding(building); + + //$('body').scrollTop($('#building-' + building).offset() - 50); + } + + diff --git a/application/Building/Building.php b/application/Building/Building.php index 1f17275e7..935fcd0df 100644 --- a/application/Building/Building.php +++ b/application/Building/Building.php @@ -26,7 +26,7 @@ class Building extends mfBaseModel { $code = "$cc-$zip-"; foreach($rnd as $r) { - $code .= dechex($r); + $code .= str_pad(dechex($r), 2, "0", STR_PAD_LEFT); } if(BuildingModel::search(['code' => $code])) { diff --git a/application/Building/BuildingController.php b/application/Building/BuildingController.php index 7a120eca8..027d34f08 100644 --- a/application/Building/BuildingController.php +++ b/application/Building/BuildingController.php @@ -188,11 +188,11 @@ class BuildingController extends mfBaseController { $this->layout()->setFlash("Objekt nicht gefunden", "error"); $this->redirect("Building"); } - /* + if(TerminationModel::search(["building_id" => $id])) { $this->layout()->setFlash("Das Objekt kann nicht gelöscht werden, da noch Anschlüsse zugeordnet sind.", "error"); $this->redirect("Building"); - }*/ + } $building->delete(); diff --git a/application/Dashboard/DashboardController.php b/application/Dashboard/DashboardController.php index 8fcc559ac..72d65511e 100644 --- a/application/Dashboard/DashboardController.php +++ b/application/Dashboard/DashboardController.php @@ -15,17 +15,10 @@ class DashboardController extends mfBaseController { } - /* + protected function testAction() { - $search = [ - 'street' => "Kastellfeldgasse 20", - 'zip' => "8010", - 'city' => "Graz", - 'country' => "AT" - ]; + $b = new Building(7); + var_dump($b->getNewObjectCode());exit; - $coords = Gmaps_Geocoding::getCoords($search); - var_dump($coords); - exit; - }*/ + } } \ No newline at end of file diff --git a/application/Termination/Termination.php b/application/Termination/Termination.php index fcf094e79..71713f34d 100644 --- a/application/Termination/Termination.php +++ b/application/Termination/Termination.php @@ -9,6 +9,48 @@ class Termination extends mfBaseModel { private $creator; private $editor; + + public function getNewObjectCode() { + if(!$this->building_id) { + return false; + } + + $bcode = $this->getProperty("building")->code; + if(!$bcode) { + return false; + } + + $codes = []; + + // get existing codes + $res = $this->db->select("Termination", "code", "code like '$bcode.%'"); + if($this->db->num_rows($res)) { + while($data = $this->db->fetch_object($res)) { + $codes[] = $data->code; + } + } + + if(count($codes)) { + sort($codes); + } + + $last_code = end($codes); + + $m = []; + if(preg_match('/\.(\d+)$/', $last_code, $m)) { + if($m[1]) { + $last_num = $m[1]; + } + } else { + return false; + } + + $new_num = ++$last_num; + $code = $bcode.".".sprintf("%03d", $new_num); + + return $code; + } + public function getProperty($name) { if($this->$name == null) { diff --git a/application/Termination/TerminationController.php b/application/Termination/TerminationController.php index d4331f35c..e02b5294e 100644 --- a/application/Termination/TerminationController.php +++ b/application/Termination/TerminationController.php @@ -14,6 +14,88 @@ class TerminationController extends mfBaseController { } } + protected function saveAction() { + $r = $this->request; + + $id = $r->id; + if(is_numeric($id) && $id > 0) { + $mode = "edit"; + $term = new Termination($id); + if(!$term->id) { + $this->layout()->setFlash("Anschluss nicht gefunden", "error"); + $this->redirect("Building"); + } + } else { + $id = false; + $mode = "add"; + } + + $building = new Building($r->building_id); + if(!$building->id) { + $this->layout()->setFlash("Anschluss nicht gefunden", "error"); + $this->redirect("Building"); + } + + $data = []; + $data['building_id'] = $r->building_id; + $data['name'] = $r->name; + $data['contact'] = $r->contact; + $data['phone'] = $r->phone; + $data['email'] = $r->email; + $data['lineworker_id'] = $building->lineworker_id; + + $data['edit_by'] = $this->me->id; + + if($mode == "add") { + $data['create_by'] = $this->me->id; + $term = TerminationModel::create($data); + } else { + $term->update($data); + } + + $new_id = $term->save(); + if(!$new_id) { + $this->layout()->setFlash("Fehler beim Speichern", "error"); + $this->redirect("Building", "Index", [], "building=".$term->building_id); + } + + if(!$term->code) { + $term->code = $term->getNewObjectCode(); + $term->save(); + } + + $this->layout()->setFlash("Anschluss gespeichert.", "success"); + $this->redirect("Building", "Index", [], "building=".$term->building_id); + + } + + + protected function delete() { + if(!$this->me->is("Admin")) { + $this->layout()->setFlash("Keine Berechtigung", "error"); + $this->redirect("Building"); + } + + $id = $this->request->id; + + if(!is_numeric($id) || !$id) { + $this->layout()->setFlash("Objekt nicht gefunden", "error"); + $this->redirect("Building"); + } + + $term = new Termination($id); + if(!$term->id) { + $this->layout()->setFlash("Anschluss nicht gefunden", "error"); + $this->redirect("Building"); + } + + $building_id = $term->building_id; + + $term->delete(); + + $this->layout()->setFlash("Anschluss gelöscht", "success"); + $this->redirect("Building", "Index", [], "building=".$building_id); + } protected function apiAction() { $do = $this->request->do; diff --git a/thetool.sql b/thetool.sql deleted file mode 100644 index 7aca43acd..000000000 --- a/thetool.sql +++ /dev/null @@ -1,671 +0,0 @@ --- MySQL dump 10.13 Distrib 8.0.25, for Linux (x86_64) --- --- Host: localhost Database: thetool --- ------------------------------------------------------ --- Server version 8.0.25-0ubuntu0.21.04.1 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!50503 SET NAMES utf8mb4 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `Address` --- - -DROP TABLE IF EXISTS `Address`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Address` ( - `id` int NOT NULL AUTO_INCREMENT, - `parent_id` int DEFAULT NULL, - `company` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `firstname` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `lastname` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `street` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `zip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `city` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `country` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `phone` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `fax` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `mobile` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `email` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Address` --- - -LOCK TABLES `Address` WRITE; -/*!40000 ALTER TABLE `Address` DISABLE KEYS */; -INSERT INTO `Address` VALUES (1,NULL,'SKnetworX\r\nFrank Schubert','Frank','Schubert','Kastellfeldgasse 20','8010','Graz','Österreich','+436642174148','','+436642174148','schubert@sknetworx.net','',1,1,1623777569,1625171912),(2,NULL,'Xinon GmbH','Martin','Jantscher','Xinonplatz','8tausend irgendwas','Pampa','Österreich','+43123456','+43123456789','+431234567','office@xinon.at','xinon',1,1,1623785707,1625165662),(5,1,'','Frank','Schubert','Kastellfeldgasse 20','8010','Graz','Österreich','+436642174148','','','fronk@fronk.at','',1,1,1623958288,1623958288),(6,NULL,'Stadt Graz','','','Hauptplatz 1','8010','Graz','Österreich','','','','','',1,1,1625167937,1625477718); -/*!40000 ALTER TABLE `Address` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Addressattribute` --- - -DROP TABLE IF EXISTS `Addressattribute`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Addressattribute` ( - `id` int NOT NULL AUTO_INCREMENT, - `address_id` int NOT NULL, - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `value` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Addressattribute` --- - -LOCK TABLES `Addressattribute` WRITE; -/*!40000 ALTER TABLE `Addressattribute` DISABLE KEYS */; -INSERT INTO `Addressattribute` VALUES (3,1,'rtrcode','12345',1,1,1624567571,1625171912),(4,2,'rtrcode','',1,1,1625165662,1625165662),(5,6,'rtrcode','',1,1,1625167937,1625477718); -/*!40000 ALTER TABLE `Addressattribute` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Addresstype` --- - -DROP TABLE IF EXISTS `Addresstype`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Addresstype` ( - `id` int NOT NULL AUTO_INCREMENT, - `address_id` int NOT NULL, - `type` enum('systemowner','netowner','salespartner','pipeworker','lineworker','pipeplanner','lineplanner','netoperator','support','billing','employee','customer','supplier','contact') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `primary` tinyint(1) NOT NULL DEFAULT '0', - `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Addresstype` --- - -LOCK TABLES `Addresstype` WRITE; -/*!40000 ALTER TABLE `Addresstype` DISABLE KEYS */; -INSERT INTO `Addresstype` VALUES (24,1,'systemowner',0,NULL,1,1,1623955126,1623955126),(26,4,'employee',0,NULL,1,1,1623958215,1623958215),(27,5,'employee',0,NULL,1,1,1623958288,1623958288),(28,2,'netowner',0,NULL,1,1,1624566105,1624566105),(29,1,'netowner',0,NULL,1,1,1624567676,1624567676),(30,2,'pipeplanner',0,NULL,1,1,1624995668,1624995668),(31,1,'lineplanner',0,NULL,1,1,1624995668,1624995668),(33,2,'salespartner',0,NULL,1,1,1625165662,1625165662),(34,2,'lineworker',0,NULL,1,1,1625165662,1625165662),(35,6,'netowner',0,NULL,1,1,1625167937,1625167937),(36,1,'pipeworker',0,NULL,1,1,1625171912,1625171912),(37,1,'lineworker',0,NULL,1,1,1625171912,1625171912),(38,1,'pipeplanner',0,NULL,1,1,1625171912,1625171912),(39,1,'netoperator',0,NULL,1,1,1625171912,1625171912),(40,6,'salespartner',0,NULL,1,1,1625477718,1625477718); -/*!40000 ALTER TABLE `Addresstype` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Building` --- - -DROP TABLE IF EXISTS `Building`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Building` ( - `id` int NOT NULL AUTO_INCREMENT, - `network_id` int NOT NULL, - `pop_id` int NOT NULL, - `buildingtype_id` int NOT NULL, - `status_id` int NOT NULL, - `object_id` varchar(16) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `oan_id` varchar(8) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `street` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `zip` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `city` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `gps_lat` decimal(15,10) NOT NULL, - `gps_long` decimal(15,10) NOT NULL, - `contact` int NOT NULL, - `phone` int NOT NULL, - `email` int NOT NULL, - `units` int NOT NULL, - `description` int NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Building` --- - -LOCK TABLES `Building` WRITE; -/*!40000 ALTER TABLE `Building` DISABLE KEYS */; -/*!40000 ALTER TABLE `Building` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Buildingtype` --- - -DROP TABLE IF EXISTS `Buildingtype`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Buildingtype` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Buildingtype` --- - -LOCK TABLES `Buildingtype` WRITE; -/*!40000 ALTER TABLE `Buildingtype` DISABLE KEYS */; -/*!40000 ALTER TABLE `Buildingtype` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Network` --- - -DROP TABLE IF EXISTS `Network`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Network` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `owner_id` int NOT NULL, - `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Network` --- - -LOCK TABLES `Network` WRITE; -/*!40000 ALTER TABLE `Network` DISABLE KEYS */; -INSERT INTO `Network` VALUES (1,'Großraum Graz',1,'Das beste Netz.\r\n\r\nImmer Priorisieren!',1,1,1624566166,1624989364),(2,'Oststeiermark',2,'',1,1,1624986989,1624988527); -/*!40000 ALTER TABLE `Network` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `NetworkAddress` --- - -DROP TABLE IF EXISTS `NetworkAddress`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `NetworkAddress` ( - `id` int NOT NULL AUTO_INCREMENT, - `network_id` int NOT NULL, - `address_id` int NOT NULL, - `type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `NetworkAddress` --- - -LOCK TABLES `NetworkAddress` WRITE; -/*!40000 ALTER TABLE `NetworkAddress` DISABLE KEYS */; -INSERT INTO `NetworkAddress` VALUES (39,1,1,'netowner',1,1,1625171786,1625171786),(40,1,1,'pipeworker',1,1,1625171922,1625171922),(41,1,1,'lineworker',1,1,1625171922,1625171922),(42,1,1,'pipeplanner',1,1,1625171922,1625171922),(43,1,1,'lineplanner',1,1,1625171922,1625171922),(44,1,1,'netoperator',1,1,1625171922,1625171922),(46,2,2,'salespartner',1,1,1625478095,1625478095),(48,2,2,'lineworker',1,1,1625478095,1625478095),(49,2,2,'pipeplanner',1,1,1625478095,1625478095); -/*!40000 ALTER TABLE `NetworkAddress` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Objectstatus` --- - -DROP TABLE IF EXISTS `Objectstatus`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Objectstatus` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Objectstatus` --- - -LOCK TABLES `Objectstatus` WRITE; -/*!40000 ALTER TABLE `Objectstatus` DISABLE KEYS */; -/*!40000 ALTER TABLE `Objectstatus` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Pop` --- - -DROP TABLE IF EXISTS `Pop`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Pop` ( - `id` int NOT NULL AUTO_INCREMENT, - `network_id` int NOT NULL, - `name` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `gps_lat` decimal(15,10) DEFAULT NULL, - `gps_long` decimal(15,10) DEFAULT NULL, - `location` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, - `vlan_public` int DEFAULT NULL, - `vlan_nat` int DEFAULT NULL, - `vlan_ipv6` int DEFAULT NULL, - `note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Pop` --- - -LOCK TABLES `Pop` WRITE; -/*!40000 ALTER TABLE `Pop` DISABLE KEYS */; -INSERT INTO `Pop` VALUES (1,1,'Kastellfeldgasse 20',47.0635101000,15.4487916000,'Dritter Stock links\r\nLäuten, sonst anrufen1',1025,1026,NULL,'test',1,1,1624992618,1625000246),(2,1,'Hauptbahnhof',47.0725240000,15.4163090000,'',NULL,NULL,NULL,'',1,1,1625178572,1625178572); -/*!40000 ALTER TABLE `Pop` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Product` --- - -DROP TABLE IF EXISTS `Product`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Product` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, - `sla_id` int NOT NULL, - `external` tinyint(1) NOT NULL DEFAULT '0', - `producttech_id` int DEFAULT NULL, - `productgroup_id` int DEFAULT NULL, - `price_nne` decimal(14,4) DEFAULT NULL, - `price_nbe` decimal(14,4) DEFAULT NULL, - `price` decimal(14,4) NOT NULL, - `price_setup` decimal(14,4) NOT NULL DEFAULT '0.0000', - `billing_delay` int NOT NULL DEFAULT '0' COMMENT 'in months', - `billing_period` int NOT NULL COMMENT 'in months', - `ivt_id` int DEFAULT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Product` --- - -LOCK TABLES `Product` WRITE; -/*!40000 ALTER TABLE `Product` DISABLE KEYS */; -INSERT INTO `Product` VALUES (1,'Produkt 1','Erstes Produkt',3,1,3,1,25.0000,5.0000,100.0000,0.0000,0,12,123456,'test',1,1,1625491911,1625577668),(4,'Galactic Fiber Core 1000/1000','',4,0,3,3,0.0000,35.0000,82.5000,129.0000,2,1,1337,'',1,1,1625571659,1625579815); -/*!40000 ALTER TABLE `Product` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `ProductAttribute` --- - -DROP TABLE IF EXISTS `ProductAttribute`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `ProductAttribute` ( - `id` int NOT NULL AUTO_INCREMENT, - `product_id` int NOT NULL, - `producttechattribute_id` int NOT NULL, - `value` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `ProductAttribute` --- - -LOCK TABLES `ProductAttribute` WRITE; -/*!40000 ALTER TABLE `ProductAttribute` DISABLE KEYS */; -INSERT INTO `ProductAttribute` VALUES (1,4,7,'1234567',1,1,1625574175,1625579815),(2,4,8,'1000',1,1,1625576147,1625579815),(3,4,9,'1000',1,1,1625576147,1625579815),(4,1,8,'',1,1,1625577668,1625577668),(5,1,9,'',1,1,1625577668,1625577668),(6,1,7,'111212',1,1,1625577668,1625577668); -/*!40000 ALTER TABLE `ProductAttribute` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `ProductNetwork` --- - -DROP TABLE IF EXISTS `ProductNetwork`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `ProductNetwork` ( - `id` int NOT NULL AUTO_INCREMENT, - `product_id` int NOT NULL, - `network_id` int NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `ProductNetwork` --- - -LOCK TABLES `ProductNetwork` WRITE; -/*!40000 ALTER TABLE `ProductNetwork` DISABLE KEYS */; -INSERT INTO `ProductNetwork` VALUES (20,1,1,1,1,1625577668,1625577668),(21,1,2,1,1,1625577668,1625577668),(23,4,1,1,1,1625579815,1625579815); -/*!40000 ALTER TABLE `ProductNetwork` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Productgroup` --- - -DROP TABLE IF EXISTS `Productgroup`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Productgroup` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `description` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Productgroup` --- - -LOCK TABLES `Productgroup` WRITE; -/*!40000 ALTER TABLE `Productgroup` DISABLE KEYS */; -INSERT INTO `Productgroup` VALUES (1,'Testprodukte','Produkte zum Testn','testn',1,1,1625491911,1625491911),(2,'Group 2','Gruppe 2','Zweite Gruppe',1,1,1625493528,1625493528),(3,'Internet Residential','','',1,1,1625571659,1625571659); -/*!40000 ALTER TABLE `Productgroup` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Producttech` --- - -DROP TABLE IF EXISTS `Producttech`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Producttech` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `customer_type` enum('residential','business') COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'residential', - `description` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Producttech` --- - -LOCK TABLES `Producttech` WRITE; -/*!40000 ALTER TABLE `Producttech` DISABLE KEYS */; -INSERT INTO `Producttech` VALUES (3,'FTTH Residential','residential','Fiber to the Home','',1,1,1625502636,1625576188),(4,'FTTH Business','business','Fiber to the Home Business','',1,1,1625569878,1625576179); -/*!40000 ALTER TABLE `Producttech` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `ProducttechAttribute` --- - -DROP TABLE IF EXISTS `ProducttechAttribute`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `ProducttechAttribute` ( - `id` int NOT NULL AUTO_INCREMENT, - `producttech_id` int NOT NULL, - `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `displayname` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `value` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `description` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `ProducttechAttribute` --- - -LOCK TABLES `ProducttechAttribute` WRITE; -/*!40000 ALTER TABLE `ProducttechAttribute` DISABLE KEYS */; -INSERT INTO `ProducttechAttribute` VALUES (1,4,'rtrcode','RTR Code (Mbit)','','Technologiecode von RTR','testnotiz',1,1,1625570581,1625576179),(2,4,'bwdown','Bandbreite Down (Mbit)','','Download-Bandbreite aus Kundensicht','',1,1,1625571044,1625576179),(3,4,'bwup','Bandbreite Up','','Upload-Bandbreite aus Kundensicht','',1,1,1625571062,1625576179),(7,3,'rtrcode','RTR Code','','Technologiecode von RTR','testnotiz',1,1,1625570581,1625576188),(8,3,'bwdown','Bandbreite Down (Mbit)','','Download-Bandbreite aus Kundensicht','',1,1,1625571044,1625576188),(9,3,'bwup','Bandbreite Up (Mbit)','','Upload-Bandbreite aus Kundensicht','',1,1,1625571062,1625576188); -/*!40000 ALTER TABLE `ProducttechAttribute` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Sla` --- - -DROP TABLE IF EXISTS `Sla`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Sla` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `description` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `note` text COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Sla` --- - -LOCK TABLES `Sla` WRITE; -/*!40000 ALTER TABLE `Sla` DISABLE KEYS */; -INSERT INTO `Sla` VALUES (1,'12h/6T - Working Hours','','',1,1,1625495944,1625495944),(2,'24h/7T - 2h/6h Emergency','','',1,1,1625495944,1625495944),(3,'8h/5T - Next Business Day','','',1,1,1625495985,1625495985),(4,'8h/5T - Residential','','',1,1,1625495985,1625495985); -/*!40000 ALTER TABLE `Sla` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Termination` --- - -DROP TABLE IF EXISTS `Termination`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Termination` ( - `id` int NOT NULL AUTO_INCREMENT, - `building_id` int NOT NULL, - `status_id` int NOT NULL, - `object_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `contact` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `street` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `zip` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `city` varchar(1024) COLLATE utf8mb4_unicode_520_ci NOT NULL, - `phone` varchar(1024) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, - `email` varchar(1024) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Termination` --- - -LOCK TABLES `Termination` WRITE; -/*!40000 ALTER TABLE `Termination` DISABLE KEYS */; -/*!40000 ALTER TABLE `Termination` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `Worker` --- - -DROP TABLE IF EXISTS `Worker`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `Worker` ( - `id` int NOT NULL AUTO_INCREMENT, - `address_id` int NOT NULL, - `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `password` varchar(56) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `ip` varchar(39) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, - `sessionid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `Worker` --- - -LOCK TABLES `Worker` WRITE; -/*!40000 ALTER TABLE `Worker` DISABLE KEYS */; -INSERT INTO `Worker` VALUES (1,1,'admin','e3823cb9c12137166c9e71978e8383b96300d0e6f46d1c902b794d95','Admin I. Strator','root@localhost','127.0.0.1','6j33fpddna6e8hgnp6ue6f6mvp',1,1,1520600652,1604674421),(3,1,'fronk','7d50790c55c5c9957d6fc72f8657ebcdf92105f70a280f1e592387ab','fronk','fronk@fronk.at','::1','osb50h9bmdcqaps13vbnmq819i',1,1,1600857318,1614625922),(5,1,'test1','35da2d46e5907f01d5d68e6ec797ff498c71d4f7234ae090e58d5835','test2','test@test.com','','',1,1,1602715807,1615490909),(7,2,'test3','a431dfd6b4218e922cf83b842a49d0f052f95ba19052b6af80d9fb9c','Tester 3','test@localhost',NULL,NULL,1,1,1624388563,1624388563); -/*!40000 ALTER TABLE `Worker` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `WorkerFlag` --- - -DROP TABLE IF EXISTS `WorkerFlag`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `WorkerFlag` ( - `id` int NOT NULL AUTO_INCREMENT, - `worker_id` int NOT NULL, - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, - `create_by` int NOT NULL, - `edit_by` int NOT NULL, - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `WorkerFlag` --- - -LOCK TABLES `WorkerFlag` WRITE; -/*!40000 ALTER TABLE `WorkerFlag` DISABLE KEYS */; -INSERT INTO `WorkerFlag` VALUES (1,1,'ticket_all_transactions','1',1,1,1615927037,1616871381); -/*!40000 ALTER TABLE `WorkerFlag` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `WorkerPermission` --- - -DROP TABLE IF EXISTS `WorkerPermission`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `WorkerPermission` ( - `id` int NOT NULL AUTO_INCREMENT, - `worker_id` int NOT NULL, - `admin` enum('false','true') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'false', - `ticketadmin` enum('false','true') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'false', - `create` int NOT NULL, - `edit` int NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `WorkerPermission` --- - -LOCK TABLES `WorkerPermission` WRITE; -/*!40000 ALTER TABLE `WorkerPermission` DISABLE KEYS */; -INSERT INTO `WorkerPermission` VALUES (1,1,'true','true',1549970701,1604674421),(3,3,'false','false',1600857318,1614625922),(5,5,'true','false',1602715807,1615490909),(7,7,'false','false',1624388563,1624388563); -/*!40000 ALTER TABLE `WorkerPermission` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2021-07-13 19:26:27