-- Pool CMMS Database Backup
-- Generated: 2026-01-09 21:55:41
-- User: admin

CREATE TABLE `establishment` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(50) NOT NULL,
  `name` text,
  `address` text,
  `city_id` int DEFAULT NULL,
  `zone_id` int DEFAULT NULL,
  `image_path` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

INSERT INTO establishment VALUES("1","01032386416334554","Sample Mall","Sample Address","3","1","uploads/1614299580_47446233-clean-noir-et-gradient-sombre-image-de-fond-abstrait-.jpg");
INSERT INTO establishment VALUES("5","01012315209970957","Γενικά","Bacolod","1","1","uploads/1701168060_1614322380_avatar2.png");


CREATE TABLE `machine` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `email` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `model` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `manufact` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `brand` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `image_path` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `volt` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `kw` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `hp` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `hz` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `rpm` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `WattMax` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `μf` int DEFAULT NULL,
  `Amber` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;



CREATE TABLE `messages` (
  `id` int NOT NULL AUTO_INCREMENT,
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO messages VALUES("1","Καλώς ήρθατε στο Σύστημα Διαχείρισης Βλαβών");
INSERT INTO messages VALUES("2","Ο καθαρισμός του συστήματος κλιματισμού (Climaveneton) ολοκληρώθηκε επιτυχώς στις 25/9.");


CREATE TABLE `repairs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `afm` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `store_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `pnc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `serial_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `date` date NOT NULL,
  `technician` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `arrival_time` time NOT NULL,
  `departure_time` time NOT NULL,
  `purpose` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `diagnosis` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `signature` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `person_id` int NOT NULL,
  `machine_id` int NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;



CREATE TABLE `stores` (
  `id` int NOT NULL AUTO_INCREMENT,
  `afm` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `store_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;



CREATE TABLE `system_info` (
  `id` int NOT NULL AUTO_INCREMENT,
  `meta_field` text NOT NULL,
  `meta_value` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

INSERT INTO system_info VALUES("1","name","CMMS");
INSERT INTO system_info VALUES("2","address","Rodos");
INSERT INTO system_info VALUES("3","contact","+1234567890");
INSERT INTO system_info VALUES("4","email","info@sample.com");
INSERT INTO system_info VALUES("5","fb_page",NULL);
INSERT INTO system_info VALUES("6","short_name","Fanis");
INSERT INTO system_info VALUES("9","logo","uploads/1614224160_47446233-clean-noir-et-gradient-sombre-image-de-fond-abstrait-.jpg");


CREATE TABLE `tbl_note` (
  `tbl_note_id` int NOT NULL AUTO_INCREMENT,
  `note_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `note_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `date_posted` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`tbl_note_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;



CREATE TABLE `tbl_tasks` (
  `task_id` int NOT NULL AUTO_INCREMENT,
  `task_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `maintenance` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `list_id` int DEFAULT NULL,
  `priority` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `category` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  PRIMARY KEY (`task_id`)
) ENGINE=InnoDB AUTO_INCREMENT=249 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;



CREATE TABLE `tblcustomer_payments` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `CustomerID` int NOT NULL,
  `PaymentAmount` decimal(10,2) NOT NULL,
  `PaymentDate` date NOT NULL,
  `PaymentMethod` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Notes` text COLLATE utf8mb4_general_ci,
  `CreatedBy` int DEFAULT NULL,
  `CreatedDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`),
  KEY `CustomerID` (`CustomerID`),
  CONSTRAINT `tblcustomer_payments_ibfk_1` FOREIGN KEY (`CustomerID`) REFERENCES `tblcustomers` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tblcustomer_payments VALUES("1","6","1.00","2026-01-07","Μετρητά",NULL,"1","2026-01-07 10:06:30");
INSERT INTO tblcustomer_payments VALUES("2","6","1.00","2026-01-07","Μετρητά",NULL,"1","2026-01-07 10:06:32");
INSERT INTO tblcustomer_payments VALUES("3","6","1.00","2026-01-07","Μετρητά",NULL,"1","2026-01-07 10:06:33");
INSERT INTO tblcustomer_payments VALUES("4","6","1.00","2026-01-07","Μετρητά",NULL,"1","2026-01-07 10:06:34");
INSERT INTO tblcustomer_payments VALUES("5","6","1.00","2026-01-07","Μετρητά",NULL,"1","2026-01-07 10:10:04");


CREATE TABLE `tbldamages` (
  `id` int NOT NULL AUTO_INCREMENT,
  `damagesNo` bigint DEFAULT NULL,
  `fullName` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `damagesDate` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `damagesTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `roomId` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `Message` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `damagesStatus` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `postingDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updationDate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `maintenance` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `tableid` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `adminremark` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `Specialty` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `UserId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `SpecialtyType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `prediction` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2140 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;



CREATE TABLE `tblemergency_materials` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `EmergencyID` int NOT NULL,
  `MaterialID` int NOT NULL,
  `Quantity` decimal(10,2) NOT NULL,
  `AddedDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`),
  KEY `EmergencyID` (`EmergencyID`),
  KEY `MaterialID` (`MaterialID`),
  CONSTRAINT `tblemergency_materials_ibfk_1` FOREIGN KEY (`EmergencyID`) REFERENCES `tblemergency_requests` (`ID`) ON DELETE CASCADE,
  CONSTRAINT `tblemergency_materials_ibfk_2` FOREIGN KEY (`MaterialID`) REFERENCES `tblmaterials` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tblemergency_materials VALUES("8","9","4","0.20","2026-01-09 18:26:15");
INSERT INTO tblemergency_materials VALUES("9","9","13","1.00","2026-01-09 19:04:50");


CREATE TABLE `tblemergency_photos` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `EmergencyID` int NOT NULL,
  `PhotoPath` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `UploadedDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`),
  KEY `EmergencyID` (`EmergencyID`),
  CONSTRAINT `tblemergency_photos_ibfk_1` FOREIGN KEY (`EmergencyID`) REFERENCES `tblemergency_requests` (`ID`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tblemergency_photos VALUES("12","9","69612c3dd9203_20250810_180153.jpg","2026-01-09 18:26:37");


CREATE TABLE `tblemergency_requests` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `PoolID` int NOT NULL,
  `ProblemType` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `Description` text COLLATE utf8mb4_general_ci,
  `ContactPhone` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `RequestDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `Status` enum('Εκκρεμείς','Αποδεκτό','Ολοκληρωμένο','Απορριφθέν') COLLATE utf8mb4_general_ci DEFAULT 'Εκκρεμείς',
  `AdminCost` decimal(10,2) DEFAULT NULL,
  `ActualCost` decimal(10,2) DEFAULT NULL,
  `AdminNotes` text COLLATE utf8mb4_general_ci,
  `TechnicianNotes` text COLLATE utf8mb4_general_ci,
  `CompletedDate` timestamp NULL DEFAULT NULL,
  `CreatedBy` int DEFAULT NULL,
  `UpdatedDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`),
  KEY `PoolID` (`PoolID`),
  CONSTRAINT `tblemergency_requests_ibfk_1` FOREIGN KEY (`PoolID`) REFERENCES `tblpools` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tblemergency_requests VALUES("9","4","❌ Δεν λειτουργεί φίλτρο","δεν δείχνει ο δείκτης bar καθόλου.","3243324243","2026-01-09 17:45:20","Ολοκληρωμένο","10.00",NULL,"Αλλαγή μανόμετρο φίλτρου.",NULL,NULL,"6","2026-01-09 19:12:11");


CREATE TABLE `tblmaintenance_tasks` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `PoolID` int NOT NULL,
  `TaskName` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `TaskDescription` text COLLATE utf8mb4_unicode_ci,
  `TaskType` enum('Καθαρισμός','Έλεγχος χημικών','Αποκατάσταση εξοπλισμού','Αλγοειδής αποτροπή','Συντήρηση','Άλλο') COLLATE utf8mb4_unicode_ci DEFAULT 'Καθαρισμός',
  `Frequency` enum('Καθημερινό','Εβδομαδιαίο','Μηνιαίο','Τριμηνιαίο','Εξαμηνιαίο','Ετήσιο') COLLATE utf8mb4_unicode_ci DEFAULT 'Καθημερινό',
  `IsTemplate` tinyint(1) DEFAULT '0',
  `Status` enum('Εκκρεμείς','Σε εξέλιξη','Ολοκληρωμένο') COLLATE utf8mb4_unicode_ci DEFAULT 'Εκκρεμείς',
  `DueDate` datetime DEFAULT NULL,
  `VisitDate` date DEFAULT NULL,
  `StartedAt` datetime DEFAULT NULL,
  `pH` decimal(4,2) DEFAULT NULL,
  `Chlorine` decimal(6,2) DEFAULT NULL,
  `Temperature` decimal(5,2) DEFAULT NULL,
  `Activities` longtext COLLATE utf8mb4_unicode_ci,
  `TaskTime` time DEFAULT '09:00:00',
  `ActualHours` decimal(5,2) DEFAULT '0.00',
  `CustomerNotes` longtext COLLATE utf8mb4_unicode_ci,
  `InternalNotes` longtext COLLATE utf8mb4_unicode_ci,
  `CompletedDate` datetime DEFAULT NULL,
  `HoursWorked` decimal(10,2) DEFAULT '0.00',
  `AssignedTo` int DEFAULT NULL,
  `Priority` enum('Χαμηλή','Μεσαία','Υψηλή') COLLATE utf8mb4_unicode_ci DEFAULT 'Μεσαία',
  `TaskCost` decimal(10,2) DEFAULT '0.00',
  `TotalAmount` decimal(10,2) DEFAULT '0.00',
  `RegistrationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `UpdatedDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `Notes` text COLLATE utf8mb4_unicode_ci,
  `CreatedBy` int DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `PoolID` (`PoolID`),
  KEY `AssignedTo` (`AssignedTo`),
  KEY `CreatedBy` (`CreatedBy`),
  CONSTRAINT `tblmaintenance_tasks_ibfk_1` FOREIGN KEY (`PoolID`) REFERENCES `tblpools` (`ID`),
  CONSTRAINT `tblmaintenance_tasks_ibfk_2` FOREIGN KEY (`AssignedTo`) REFERENCES `tbladmin` (`ID`),
  CONSTRAINT `tblmaintenance_tasks_ibfk_3` FOREIGN KEY (`CreatedBy`) REFERENCES `tbladmin` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO tblmaintenance_tasks VALUES("8","4","Αίτημα επίσκεψης - 08/01/2026 16:57","Jdhd","Καθαρισμός","Καθημερινό","0","Ολοκληρωμένο","2026-01-08 00:00:00","2026-01-08","2026-01-08 18:58:48","7.02","1.50","19.00","backwash,surface_cleaning,vacuum,measurements","09:00:00","0.06","Jdhdh","Jdhdh","2026-01-08 19:02:37","0.00","7","Μεσαία","8.00","0.48","2026-01-08 18:57:39","2026-01-08 19:02:37","fdgdfgdf","6");
INSERT INTO tblmaintenance_tasks VALUES("9","4","Συντηρηση",NULL,"Συντήρηση","Εβδομαδιαίο","0","Εκκρεμείς","2026-01-12 09:00:00",NULL,NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","0.00","0.00","2026-01-08 20:07:24","2026-01-08 20:07:24",NULL,"1");
INSERT INTO tblmaintenance_tasks VALUES("10","4","Συντηρηση",NULL,"Συντήρηση","Εβδομαδιαίο","0","Εκκρεμείς","2026-01-14 09:00:00",NULL,NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","0.00","0.00","2026-01-08 20:07:24","2026-01-08 20:07:24",NULL,"1");
INSERT INTO tblmaintenance_tasks VALUES("11","4","Συντηρηση",NULL,"Συντήρηση","Εβδομαδιαίο","0","Εκκρεμείς","2026-01-16 09:00:00",NULL,NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","0.00","0.00","2026-01-08 20:07:24","2026-01-08 20:07:24",NULL,"1");
INSERT INTO tblmaintenance_tasks VALUES("12","4","Συντηρηση",NULL,"Συντήρηση","Εβδομαδιαίο","0","Εκκρεμείς","2026-01-19 09:00:00",NULL,NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","0.00","0.00","2026-01-08 20:07:24","2026-01-08 20:07:24",NULL,"1");
INSERT INTO tblmaintenance_tasks VALUES("13","4","Συντηρηση",NULL,"Συντήρηση","Εβδομαδιαίο","0","Εκκρεμείς","2026-01-21 09:00:00",NULL,NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","0.00","0.00","2026-01-08 20:07:24","2026-01-08 20:07:24",NULL,"1");
INSERT INTO tblmaintenance_tasks VALUES("14","4","Συντηρηση",NULL,"Συντήρηση","Εβδομαδιαίο","0","Εκκρεμείς","2026-01-23 09:00:00",NULL,NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","0.00","0.00","2026-01-08 20:07:24","2026-01-08 20:07:24",NULL,"1");
INSERT INTO tblmaintenance_tasks VALUES("15","4","Συντηρηση",NULL,"Συντήρηση","Εβδομαδιαίο","0","Εκκρεμείς","2026-01-26 09:00:00",NULL,NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","0.00","0.00","2026-01-08 20:07:24","2026-01-08 20:07:24",NULL,"1");
INSERT INTO tblmaintenance_tasks VALUES("16","4","Συντηρηση",NULL,"Συντήρηση","Εβδομαδιαίο","0","Εκκρεμείς","2026-01-28 09:00:00",NULL,NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","0.00","0.00","2026-01-08 20:07:24","2026-01-08 20:07:24",NULL,"1");
INSERT INTO tblmaintenance_tasks VALUES("17","4","Συντηρηση",NULL,"Συντήρηση","Εβδομαδιαίο","0","Εκκρεμείς","2026-01-30 09:00:00",NULL,NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","0.00","0.00","2026-01-08 20:07:24","2026-01-08 20:07:24",NULL,"1");
INSERT INTO tblmaintenance_tasks VALUES("18","4","Συντηρηση",NULL,"Συντήρηση","Εβδομαδιαίο","0","Εκκρεμείς","2026-02-02 09:00:00",NULL,NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","0.00","0.00","2026-01-08 20:07:24","2026-01-08 20:07:24",NULL,"1");
INSERT INTO tblmaintenance_tasks VALUES("19","4","Συντηρηση",NULL,"Συντήρηση","Εβδομαδιαίο","0","Εκκρεμείς","2026-02-04 09:00:00",NULL,NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","0.00","0.00","2026-01-08 20:07:24","2026-01-08 20:07:24",NULL,"1");
INSERT INTO tblmaintenance_tasks VALUES("20","4","Συντηρηση",NULL,"Συντήρηση","Εβδομαδιαίο","0","Εκκρεμείς","2026-02-06 09:00:00",NULL,NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","0.00","0.00","2026-01-08 20:07:24","2026-01-08 20:07:24",NULL,"1");
INSERT INTO tblmaintenance_tasks VALUES("22","1","Αίτημα επίσκεψης - 09/01/2026 09:59",NULL,"Καθαρισμός","Καθημερινό","0","Ολοκληρωμένο","2026-01-09 00:00:00","2026-01-09","2026-01-09 12:05:31","7.20","1.50","20.00","backwash,surface_cleaning,multitab,acid","09:00:00","0.15",NULL,NULL,"2026-01-09 12:14:48","0.00","7","Μεσαία","8.00","1.20","2026-01-09 11:59:17","2026-01-09 12:14:48","gdgf","1");
INSERT INTO tblmaintenance_tasks VALUES("23","8","Αίτημα επίσκεψης - 09/01/2026 09:59","Qqqq","Καθαρισμός","Καθημερινό","0","Ολοκληρωμένο","2026-01-09 00:00:00","2026-01-09","2026-01-09 12:05:35","7.20","1.50","20.00","backwash,surface_cleaning,measurements","09:00:00","0.18","Efty","Ssss","2026-01-09 12:16:19","0.00","7","Μεσαία","25.00","4.50","2026-01-09 11:59:29","2026-01-09 12:16:19","jhhhj","1");
INSERT INTO tblmaintenance_tasks VALUES("24","4","Αίτημα επίσκεψης - 09/01/2026 17:18",NULL,"Καθαρισμός","Καθημερινό","0","Εκκρεμείς","2026-02-04 10:15:00","2026-02-04",NULL,NULL,NULL,NULL,NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00",NULL,"Μεσαία","0.00","0.00","2026-01-09 19:18:40","2026-01-09 19:18:40","Ίσως χρειάζεται συντήρηση λογο ότι θα εχει πολλά άτομα.  ","6");
INSERT INTO tblmaintenance_tasks VALUES("25","4","Αίτημα επίσκεψης - 09/01/2026 18:26",NULL,"Καθαρισμός","Καθημερινό","0","Σε εξέλιξη","2026-01-09 00:00:00","2026-01-09","2026-01-09 20:46:58","0.00","0.00","0.00",NULL,"09:00:00","0.00",NULL,NULL,NULL,"0.00","7","Μεσαία","8.00","0.00","2026-01-09 20:26:43","2026-01-09 20:46:58","Εχει θολώσει λίγο το νερό ","6");


CREATE TABLE `tblmaterial_usage` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `TaskID` int NOT NULL,
  `MaterialID` int NOT NULL,
  `QuantityUsed` decimal(10,2) NOT NULL,
  `Source` enum('Company','Customer') COLLATE utf8mb4_unicode_ci DEFAULT 'Company',
  `Cost` decimal(10,2) DEFAULT '0.00',
  `Notes` longtext COLLATE utf8mb4_unicode_ci,
  `CreatedDate` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`),
  KEY `TaskID` (`TaskID`),
  KEY `MaterialID` (`MaterialID`),
  CONSTRAINT `tblmaterial_usage_ibfk_1` FOREIGN KEY (`TaskID`) REFERENCES `tblmaintenance_tasks` (`ID`) ON DELETE CASCADE,
  CONSTRAINT `tblmaterial_usage_ibfk_2` FOREIGN KEY (`MaterialID`) REFERENCES `tblmaterials` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=131 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO tblmaterial_usage VALUES("125","8","7","1.00","Company","9.00",NULL,"2026-01-08 19:02:37");
INSERT INTO tblmaterial_usage VALUES("126","8","9","1.00","Customer","0.00",NULL,"2026-01-08 19:02:37");
INSERT INTO tblmaterial_usage VALUES("127","22","5","0.20","Company","4.00",NULL,"2026-01-09 12:14:48");
INSERT INTO tblmaterial_usage VALUES("128","22","3","0.10","Customer","0.00",NULL,"2026-01-09 12:14:48");
INSERT INTO tblmaterial_usage VALUES("129","23","7","1.00","Company","9.00",NULL,"2026-01-09 12:16:19");
INSERT INTO tblmaterial_usage VALUES("130","23","6","1.00","Company","10.00",NULL,"2026-01-09 12:16:19");


CREATE TABLE `tblmaterials` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `MaterialName` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `MaterialType` enum('Chemical','Supply','Equipment') COLLATE utf8mb4_unicode_ci DEFAULT 'Chemical',
  `Unit` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'kg',
  `UnitPrice` decimal(10,2) DEFAULT '0.00',
  `CurrentStock` decimal(10,2) DEFAULT '0.00',
  `MinStock` decimal(10,2) DEFAULT '0.00',
  `Supplier` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `CreatedDate` datetime DEFAULT CURRENT_TIMESTAMP,
  `UpdatedDate` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO tblmaterials VALUES("1","Χλώριο 90%","Chemical","kg","15.00","50.00","0.00",NULL,"2026-01-05 11:19:51","2026-01-05 11:19:51");
INSERT INTO tblmaterials VALUES("2","Χλώριο 55%","Chemical","kg","12.00","39.60","0.00",NULL,"2026-01-05 11:19:51","2026-01-05 22:02:45");
INSERT INTO tblmaterials VALUES("3","Αλγοκτόνο","Chemical","L","18.00","28.80","0.00",NULL,"2026-01-05 11:19:51","2026-01-07 23:05:43");
INSERT INTO tblmaterials VALUES("4","Υδροχλωρικό Οξύ","Chemical","L","8.00","23.80","0.00",NULL,"2026-01-05 11:19:51","2026-01-09 18:26:15");
INSERT INTO tblmaterials VALUES("5","Κροκιδωτικό","Chemical","kg","20.00","14.80","0.00",NULL,"2026-01-05 11:19:51","2026-01-09 12:14:48");
INSERT INTO tblmaterials VALUES("6","pH+ (Αλκαλικό)","Chemical","kg","10.00","19.00","0.00",NULL,"2026-01-05 11:19:51","2026-01-09 12:16:19");
INSERT INTO tblmaterials VALUES("7","pH- (Όξινο)","Chemical","kg","9.00","17.00","0.00",NULL,"2026-01-05 11:19:51","2026-01-09 12:16:19");
INSERT INTO tblmaterials VALUES("8","Σταθεροποιητής","Chemical","kg","25.00","9.00","0.00",NULL,"2026-01-05 11:19:51","2026-01-07 22:40:53");
INSERT INTO tblmaterials VALUES("9","Φίλτρο Άμμος","Supply","kg","5.00","100.00","0.00",NULL,"2026-01-05 11:19:51","2026-01-05 11:19:51");
INSERT INTO tblmaterials VALUES("10","Φίλτρο Διατόμων","Supply","kg","8.00","49.00","0.00",NULL,"2026-01-05 11:19:51","2026-01-07 22:40:53");
INSERT INTO tblmaterials VALUES("11","Πολυταμπλέτες Χλωρίου","Chemical","kg","1.00","49.40","10.00","Aqua Master","2026-01-05 13:56:09","2026-01-05 14:28:14");
INSERT INTO tblmaterials VALUES("12","Σωλήνας PVC Φ63 16ATM","Supply","τεμ","1.00","17.00","10.00","Aqua Master","2026-01-08 14:53:52","2026-01-08 17:53:35");
INSERT INTO tblmaterials VALUES("13","Μανόμετρο Πισίνας","Supply","τεμ","19.00","9.00","4.00","Aqua Master","2026-01-09 18:29:01","2026-01-09 19:04:50");



CREATE TABLE `tblpool_filters` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `PoolID` int NOT NULL,
  `FilterNumber` int NOT NULL DEFAULT '1',
  `FilterDetails` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `FilterPhotos` longtext COLLATE utf8mb4_general_ci,
  `CreatedDate` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`),
  KEY `idx_pool` (`PoolID`),
  CONSTRAINT `tblpool_filters_ibfk_1` FOREIGN KEY (`PoolID`) REFERENCES `tblpools` (`ID`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tblpool_filters VALUES("1","1","1","φαφαφ","../uploads/pool-filters/695ccaf41aaa7_20250815_070549.jpg","2026-01-06 10:42:28");
INSERT INTO tblpool_filters VALUES("2","1","2","αφαφ","../uploads/pool-filters/695ccaf41c481_20250815_070612.jpg","2026-01-06 10:42:28");
INSERT INTO tblpool_filters VALUES("3","4","1","Γυαλί ",NULL,"2026-01-06 18:59:23");
INSERT INTO tblpool_filters VALUES("4","5","1","Άμμο",NULL,"2026-01-06 19:02:55");
INSERT INTO tblpool_filters VALUES("5","6","1","Άμμο",NULL,"2026-01-06 19:07:26");
INSERT INTO tblpool_filters VALUES("6","7","1","Γυαλί ",NULL,"2026-01-06 19:12:32");


CREATE TABLE `tblpool_pumps` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `PoolID` int NOT NULL,
  `PumpNumber` int NOT NULL DEFAULT '1',
  `PumpDetails` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `PumpPhotos` longtext COLLATE utf8mb4_general_ci,
  `CreatedDate` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`),
  KEY `idx_pool` (`PoolID`),
  CONSTRAINT `tblpool_pumps_ibfk_1` FOREIGN KEY (`PoolID`) REFERENCES `tblpools` (`ID`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tblpool_pumps VALUES("1","1","1","αφαφ","../uploads/pool-pumps/695ccaf41e6a9_20250824_185044.jpg","2026-01-06 10:42:28");
INSERT INTO tblpool_pumps VALUES("2","1","2","σαφ","../uploads/pool-pumps/695ccaf4200f3_20250824_200354.jpg","2026-01-06 10:42:28");


CREATE TABLE `tblpools` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `CustomerID` int NOT NULL,
  `PoolName` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `PoolType` enum('Δημόσια','Ιδιωτική') COLLATE utf8mb4_unicode_ci DEFAULT 'Ιδιωτική',
  `PoolSize` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ChemicalType` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Status` enum('Ενεργό','Ανενεργό') COLLATE utf8mb4_unicode_ci DEFAULT 'Ενεργό',
  `RegistrationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `UpdatedDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `Notes` text COLLATE utf8mb4_unicode_ci,
  `ChargingMethod` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'Per Hour',
  `ChargingAmount` decimal(10,2) DEFAULT '0.00',
  `CreatedBy` int DEFAULT NULL,
  `FilterDetails` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `FilterPhotos` longtext COLLATE utf8mb4_unicode_ci,
  `PumpDetails` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `PumpPhotos` longtext COLLATE utf8mb4_unicode_ci,
  `PoolVolume` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `SkimmerType` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `OverflowType` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `CustomerID` (`CustomerID`),
  KEY `CreatedBy` (`CreatedBy`),
  CONSTRAINT `tblpools_ibfk_1` FOREIGN KEY (`CustomerID`) REFERENCES `tblcustomers` (`ID`),
  CONSTRAINT `tblpools_ibfk_2` FOREIGN KEY (`CreatedBy`) REFERENCES `tbladmin` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO tblpools VALUES("1","1","Test","Ιδιωτική","7x3","Σορωνη","Χλωριο","Ενεργό","2026-01-05 00:52:53","2026-01-07 00:35:34",NULL,"Per Hour","8.00","1",NULL,"../uploads/pool-filters/695cc932ec3c5_20250824_182758.jpg",NULL,"../uploads/pool-pumps/695cc932ec9cf_20250815_070549.jpg,../uploads/pool-pumps/695cc932ecdef_20250815_070612.jpg","35",NULL,"Υπερχείλιση άκρης");
INSERT INTO tblpools VALUES("2","2","τεστ2","Ιδιωτική","35κιβικα","Σορωνη","Χλωριο","Ενεργό","2026-01-05 22:07:24","2026-01-07 00:57:27",NULL,"Per Hour","8.00","1",NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO tblpools VALUES("3","2","τεστ3","Ιδιωτική","35 Κυβικά","Βίλα Παν","Χλωριο","Ενεργό","2026-01-05 22:08:03","2026-01-07 00:25:59",NULL,"Per Hour","8.00","1",NULL,NULL,NULL,NULL,"34.125 ",NULL,NULL);
INSERT INTO tblpools VALUES("4","6","THE MASSERIA","Ιδιωτική","86,6 τ.μ","Κάμειρος","Χλωριο","Ενεργό","2026-01-06 18:59:23","2026-01-06 21:40:01",NULL,"Per Hour","8.00","1",NULL,NULL,NULL,NULL,"130 Κυβ.",NULL,"Υπερχείλιση άκρης");
INSERT INTO tblpools VALUES("5","3","House","Ιδιωτική","35 τ.μ","Σορωνη","Χλωριο","Ενεργό","2026-01-06 19:02:55","2026-01-07 00:57:27",NULL,"Per Hour","8.00","1",NULL,NULL,NULL,NULL,"34.125 ",NULL,"Υπερχείλιση άκρης");
INSERT INTO tblpools VALUES("6","4","Villa Pandesia","Ιδιωτική","35 Κυβικά","Κρεμαστή","Χλωριο","Ενεργό","2026-01-06 19:07:26","2026-01-07 00:12:57",NULL,"Per Visit","25.00","1",NULL,NULL,NULL,NULL,"34.125 ","Επιφανειακός",NULL);
INSERT INTO tblpools VALUES("7","5","Viva Tourismo Resort naturist club","Ιδιωτική","100","Παραδείσι","Χλωριο","Ενεργό","2026-01-06 19:12:32","2026-01-06 21:39:40",NULL,"Per Visit","25.00","1",NULL,NULL,NULL,NULL,"98000",NULL,"Υπερχείλιση άκρης");
INSERT INTO tblpools VALUES("8","1","τεστ4","Ιδιωτική","86,6 τ.μ","Κοσκινού","Χλωριο","Ενεργό","2026-01-09 11:58:15","2026-01-09 12:33:58",NULL,"Per Hour","25.00","1",NULL,NULL,NULL,NULL,"34.125 ","Επιφανειακός",NULL);


CREATE TABLE `tblquesthistory` (
  `id` int NOT NULL AUTO_INCREMENT,
  `requestId` int DEFAULT NULL,
  `status` varchar(120) DEFAULT NULL,
  `remark` mediumtext,
  `postingDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;



CREATE TABLE `tblquotes` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `QuoteID` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `CustomerID` int NOT NULL,
  `PoolID` int NOT NULL,
  `PoolDescription` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `VisitFrequencyMode` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `VisitsPerWeek` int DEFAULT NULL,
  `BillingCycle` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `TimePerVisit` int DEFAULT NULL,
  `HourlyRate` decimal(10,2) DEFAULT NULL,
  `ChemicalsCost` decimal(10,2) DEFAULT NULL,
  `MaterialsCost` decimal(10,2) DEFAULT NULL,
  `OtherCost` decimal(10,2) DEFAULT NULL,
  `OverheadPercent` decimal(5,2) DEFAULT NULL,
  `ProfitPercent` decimal(5,2) DEFAULT NULL,
  `CostPerVisit` decimal(10,2) DEFAULT NULL,
  `VisitsPerMonth` decimal(10,2) DEFAULT NULL,
  `TotalCostMonthly` decimal(10,2) DEFAULT NULL,
  `SuggestedPrice` decimal(10,2) DEFAULT NULL,
  `SuggestedPricePerVisit` decimal(10,2) DEFAULT NULL,
  `Notes` longtext COLLATE utf8mb4_unicode_ci,
  `CreatedDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `CreatedBy` int DEFAULT NULL,
  `Status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'Ενεργό',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `QuoteID` (`QuoteID`),
  KEY `CustomerID` (`CustomerID`),
  KEY `PoolID` (`PoolID`),
  KEY `CreatedBy` (`CreatedBy`),
  CONSTRAINT `tblquotes_ibfk_1` FOREIGN KEY (`CustomerID`) REFERENCES `tblcustomers` (`ID`),
  CONSTRAINT `tblquotes_ibfk_2` FOREIGN KEY (`PoolID`) REFERENCES `tblpools` (`ID`),
  CONSTRAINT `tblquotes_ibfk_3` FOREIGN KEY (`CreatedBy`) REFERENCES `tbladmin` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



CREATE TABLE `tblroom` (
  `id` int NOT NULL AUTO_INCREMENT,
  `RoomNumber` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `AddedBy` int DEFAULT NULL,
  `Model` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `S/N` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Color` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Color1` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Color2` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Color3` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Color4` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Phone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `S/N Phone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Tv` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `S/N TV` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Fridge` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `S/N Fridge` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `WiFi` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `S/N WiFi` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;



CREATE TABLE `tbltask_photos` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `TaskID` int NOT NULL,
  `PhotoFilename` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `PhotoPath` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `UploadDate` datetime DEFAULT CURRENT_TIMESTAMP,
  `Description` longtext COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`ID`),
  KEY `TaskID` (`TaskID`),
  CONSTRAINT `tbltask_photos_ibfk_1` FOREIGN KEY (`TaskID`) REFERENCES `tblmaintenance_tasks` (`ID`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO tbltask_photos VALUES("27","22","22_1767953688_6960d5183e537_IMG_20260107_162613.jpg","uploads/task_photos/22_1767953688_6960d5183e537_IMG_20260107_162613.jpg","2026-01-09 12:14:48",NULL);
INSERT INTO tbltask_photos VALUES("28","23","23_1767953779_6960d573a0431_IMG_20260107_222814.jpg","uploads/task_photos/23_1767953779_6960d573a0431_IMG_20260107_222814.jpg","2026-01-09 12:16:19",NULL);


CREATE TABLE `tracks` (
  `id` int NOT NULL AUTO_INCREMENT,
  `person_id` int NOT NULL,
  `establishment_id` int NOT NULL,
  `date_added` datetime DEFAULT CURRENT_TIMESTAMP,
  `description` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `technical` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `repairs_id` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;



