--
-- Host: localhost    Database: catalogonline
-- ------------------------------------------------------


--
-- Table structure for table `access_log`
--

CREATE TABLE `access_log` (
  `access_log_id` int NOT NULL AUTO_INCREMENT,
  `access_log_pk` int NOT NULL,
  `access_log_ip` varchar(255) NOT NULL,
  `access_log_activity` varchar(255) NOT NULL,
  `access_log_loginas` varchar(255) DEFAULT NULL,
  `access_log_time` datetime NOT NULL,
  PRIMARY KEY (`access_log_id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `access_log`
--

INSERT INTO `access_log` VALUES (1,1,'49.229.126.185','Login','','2025-06-11 15:43:30'),(2,1,'49.229.126.185','Login','','2025-06-11 15:50:31'),(3,1,'49.229.126.185','Login','','2025-06-11 17:12:37'),(4,1,'49.229.127.211','Login','','2025-06-12 09:59:54'),(5,1,'49.229.127.211','Login','','2025-06-12 10:24:21'),(6,1,'49.229.127.211','Login','','2025-06-12 10:26:49'),(7,1,'49.229.127.211','Login','','2025-06-12 10:26:55'),(8,1,'49.229.127.211','LoginAsGo','73','2025-06-12 11:04:48'),(9,1,'49.229.127.211','Login','','2025-06-12 13:24:36'),(10,1,'49.229.127.211','Login','','2025-06-12 13:36:17'),(11,1,'49.229.126.5','Login','','2025-06-13 09:59:11'),(12,1,'49.229.126.0','Login','','2025-06-13 17:00:34'),(13,1,'49.229.127.235','Login','','2025-06-16 10:09:40'),(14,1,'49.229.127.235','Login','','2025-06-16 14:07:31'),(15,1,'49.229.126.57','Login','','2025-06-17 10:11:29'),(16,1,'49.229.126.57','Login','','2025-06-17 14:32:52'),(17,1,'49.229.125.12','Login','','2025-06-23 10:05:34'),(18,1,'49.229.124.182','Login','','2025-06-24 09:54:25'),(19,1,'49.229.124.182','Login','','2025-06-24 13:04:07'),(20,1,'49.229.125.234','Login','','2025-06-26 10:02:03'),(21,1,'49.229.125.234','Login','','2025-06-26 10:30:56'),(22,1,'49.229.125.122','Login','','2025-06-26 13:54:58'),(23,1,'192.168.42.124','Login','','2025-06-26 16:09:18'),(24,1,'49.229.124.139','Login','','2025-06-27 10:05:59'),(25,1,'192.168.42.27','Login','','2025-06-27 13:02:58'),(26,1,'49.229.127.193','Login','','2025-06-27 13:19:45'),(27,1,'49.229.125.231','Login','','2025-06-30 09:56:25');

--
-- Table structure for table `backup_log`
--

CREATE TABLE `backup_log` (
  `backup_log_id` int NOT NULL AUTO_INCREMENT,
  `backup_log_date_active` varchar(255) NOT NULL,
  `backup_log_date_inactive` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `backup_log_type` varchar(50) NOT NULL,
  `backup_log_folder` varchar(50) NOT NULL,
  `backup_log_status` varchar(50) NOT NULL,
  PRIMARY KEY (`backup_log_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `backup_log`
--


--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `categories_id` int NOT NULL AUTO_INCREMENT,
  `categories_name` varchar(255) DEFAULT NULL,
  `categories_description` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`categories_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `categories`
--


--
-- Table structure for table `log_activity`
--

CREATE TABLE `log_activity` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `USER_ID` int NOT NULL,
  `TYPE` varchar(100) NOT NULL,
  `KEY_ID` int NOT NULL,
  `MODULE` varchar(100) NOT NULL,
  `SOURCE` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `log_activity`
--

INSERT INTO `log_activity` VALUES (1,1,'INSERT',0,'User List','user_userid=>73///user_title=>///user_username=>Nongtest///user_fullname=>Nongtest Nongtest///user_firstname=>Nongtest///user_lastname=>Nongtest///user_position=>///user_email=>nalinee@siit.tu.ac.th///user_role=>///user_picture=>///','2025-06-12 11:04:27','2025-06-12 11:04:27');

--
-- Table structure for table `model_has_permissions`
--

CREATE TABLE `model_has_permissions` (
  `permission_id` int unsigned NOT NULL,
  `model_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_permissions`
--

INSERT INTO `model_has_permissions` VALUES (7,'App\\User',1),(7,'App\\User',2);

--
-- Table structure for table `model_has_roles`
--

CREATE TABLE `model_has_roles` (
  `role_id` int unsigned NOT NULL,
  `model_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_roles`
--

INSERT INTO `model_has_roles` VALUES (1,'App\\User',1),(1,'App\\User',73);

--
-- Table structure for table `order_items`
--

CREATE TABLE `order_items` (
  `order_item_id` int NOT NULL AUTO_INCREMENT,
  `order_id` int DEFAULT NULL,
  `product_id` int DEFAULT NULL,
  `product_name` varchar(255) DEFAULT NULL,
  `product_price` varchar(255) DEFAULT NULL,
  `quantity` int DEFAULT NULL,
  `total` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`order_item_id`)
) ENGINE=InnoDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `order_items`
--

INSERT INTO `order_items` VALUES (51,33,3,'Fan','500',1,NULL,'2025-06-24 15:37:46','2025-06-24 15:37:46'),(52,33,1,'ขวดน้ำ','359',3,NULL,'2025-06-24 15:37:46','2025-06-24 15:37:46'),(53,34,1,'ขวดน้ำ','359',3,NULL,'2025-06-24 15:56:25','2025-06-24 15:56:25'),(54,35,1,'ขวดน้ำ','359',3,NULL,'2025-06-26 13:55:18','2025-06-26 13:55:18'),(55,36,1,'ขวดน้ำ','359',3,NULL,'2025-06-26 14:02:34','2025-06-26 14:02:34'),(56,37,3,'Fan','500',2,NULL,'2025-06-26 16:10:06','2025-06-26 16:10:06'),(57,38,1,'ขวดน้ำ','359',1,NULL,'2025-06-30 14:48:30','2025-06-30 14:48:30'),(58,39,1,'ขวดน้ำ','359',1,NULL,'2025-06-30 15:00:40','2025-06-30 15:00:40'),(59,40,1,'ขวดน้ำ','359',2,NULL,'2025-06-30 15:06:07','2025-06-30 15:06:07'),(60,40,3,'Fan','500',1,NULL,'2025-06-30 15:06:07','2025-06-30 15:06:07');

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `order_id` int NOT NULL AUTO_INCREMENT,
  `order_user_id` int DEFAULT NULL,
  `order_code` varchar(20) DEFAULT NULL,
  `order_customer_name` varchar(255) DEFAULT NULL,
  `order_division` varchar(255) DEFAULT NULL,
  `order_email` varchar(255) DEFAULT NULL,
  `order_purpose` text,
  `order_request_date` datetime DEFAULT NULL,
  `order_use_date` datetime DEFAULT NULL,
  `order_receive_date` datetime DEFAULT NULL,
  `order_approved_date` datetime DEFAULT NULL,
  `order_address` text,
  `order_total_price` varchar(255) DEFAULT NULL,
  `order_status_for_admin` varchar(255) DEFAULT NULL,
  `order_status` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `orders`
--

INSERT INTO `orders` VALUES (40,1,'2025/0001','Tide','1','tide@mail.com','test','2025-06-30 00:00:00','2025-07-12 00:00:00','2025-07-10 00:00:00','2025-06-30 15:07:12','dsfadfgasdfg','1218','approved','approved','2025-06-30 15:06:07','2025-06-30 15:07:12');

--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `guard_name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` VALUES (7,'Nullper','web','2024-11-06 16:00:30','2024-11-06 16:00:30');

--
-- Table structure for table `product_type`
--

CREATE TABLE `product_type` (
  `product_type_id` int NOT NULL AUTO_INCREMENT,
  `product_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`product_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `product_type`
--

INSERT INTO `product_type` VALUES (1,'Accessories','2025-06-13 10:45:44','2025-06-13 10:45:44'),(2,'Books & Stationery','2025-06-13 10:51:15','2025-06-13 10:51:15'),(3,'Collectibles','2025-06-13 10:52:50','2025-06-13 10:52:50'),(4,'Electronics','2025-06-13 10:53:09','2025-06-13 10:53:09'),(5,'Gift Sets','2025-06-13 10:53:19','2025-06-13 10:53:19'),(6,'Limited Edition Items','2025-06-13 10:53:44','2025-06-13 10:53:44'),(7,'Premium','2025-06-17 11:02:33','2025-06-17 11:02:33');

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `product_id` int NOT NULL AUTO_INCREMENT,
  `product_code` int DEFAULT NULL,
  `product_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `product_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `product_price` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `product_quantity` int DEFAULT NULL,
  `product_type` varchar(255) DEFAULT NULL,
  `product_stock` int DEFAULT NULL,
  `product_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `product_image` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `products`
--

INSERT INTO `products` VALUES (1,1,'ขวดน้ำ','ขวดน้ำ 3 สี','359',22,'7',NULL,'1','1749723562_ขวดน้ำ.jpg','2025-06-12 15:57:47','2025-06-26 10:27:10'),(3,2,'Fan',NULL,'500',11,'4',NULL,'1','1749723657_พัดลม.jpg','2025-06-12 16:48:45','2025-06-30 16:35:41');

--
-- Table structure for table `return_orders`
--

CREATE TABLE `return_orders` (
  `return_orders_id` int NOT NULL AUTO_INCREMENT,
  `return_orders_item_id` int DEFAULT NULL,
  `return_orders_quantity` int DEFAULT NULL,
  `return_orders_reason` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`return_orders_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `return_orders`
--


--
-- Table structure for table `role_has_permissions`
--

CREATE TABLE `role_has_permissions` (
  `permission_id` int unsigned NOT NULL,
  `role_id` int unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `role_has_permissions_role_id_foreign` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_has_permissions`
--

INSERT INTO `role_has_permissions` VALUES (7,1),(7,2),(7,3),(7,20);

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` VALUES (1,'Admin','web','2019-11-27 03:25:57','2019-11-27 03:25:57'),(2,'Requester','web','2023-06-08 00:00:00','2023-06-08 00:00:00'),(3,'Supervisor','web','2025-02-27 15:26:10','2025-02-27 15:26:10'),(20,'Authorize','web','2025-06-11 16:43:51','2025-06-11 16:43:51');

--
-- Table structure for table `school_division`
--

CREATE TABLE `school_division` (
  `school_division_id` int NOT NULL AUTO_INCREMENT,
  `school_division_name_en` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `school_division_name_th` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `school_division_shortname` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `school_division_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`school_division_id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `school_division`
--

INSERT INTO `school_division` VALUES (1,'SIIT Consulting Center','ศูนย์ให้คำปรึกษา','Consulting','Center','2022-05-10 11:07:55','2022-05-24 11:27:32'),(2,'Accounting Division','ฝ่ายบัญชี','ACC','Division','2022-05-10 11:20:20','2022-05-24 11:38:03'),(3,'Admission and Public Relations Division','ฝ่ายรับเข้าศึกษาและประชาสัมพันธ์','AD&PR','Division','2022-05-10 11:20:28','2024-08-29 11:34:37'),(4,'Academic Services and Registration Division','ฝ่ายบริการวิชาการและทะเบียน','AS&R','Division','2022-05-10 11:20:38','2022-06-07 10:54:46'),(5,'School of Bio-Chemical Engineering and Technology','ภาควิชาวิศวกรรมและเทคโนโลยีเคมีชีวภาพ','BCET','School','2022-05-10 11:20:52','2022-05-24 11:15:30'),(6,'Building and Ground Division','ฝ่ายอาคารและสถานที่','BG','Division','2022-05-10 11:21:01','2022-05-24 11:31:41'),(7,'Central Coordinating Division','ฝ่ายประสานงานกลาง','CCO','Division','2022-05-10 11:21:10','2022-05-24 11:37:26'),(8,'School of Civil Engineering and Technology','ภาควิชาวิศวกรรมและเทคโนโลยีโยธา','CET','School','2022-05-10 11:21:17','2022-05-24 11:13:01'),(9,'School of Integrated Science and Innovation','ภาควิชาวิทยาศาสตร์บูรณาการและนวัตกรรม','ISI','School','2022-05-10 11:24:28','2023-02-15 09:11:25'),(10,'Computer and Audiovisual Center','ศูนย์คอมพิวเตอร์และโสตทัศนศึกษา','COM&AV','Division','2022-05-10 11:24:36','2022-05-24 11:30:52'),(11,'Construction and Maintenance Technology Research Center','ศูนย์วิจัยเทคโนโลยีการก่อสร้างและบำรุงรักษา','CONTEC','Center','2022-05-10 11:24:45','2022-05-24 11:28:33'),(12,'Functional Advanced Materials Engineering','ศูนย์วิจัยวิศวกรรมวัสดุสมบัติพิเศษขั้นสูง','FAME','School','2022-05-10 11:24:56','2022-05-24 11:39:51'),(13,'Finance and Budget Division','ฝ่ายการเงินและงบประมาณ','FIN','Division','2022-05-10 11:25:02','2022-05-24 11:38:56'),(14,'International Affairs and Corporate Relations Division','ฝ่ายวิเทศและองค์กรสัมพันธ์','IA&CR','Division','2022-05-10 11:25:10','2022-05-24 11:32:38'),(15,'School of Information, Computer, and Communication Technology','ภาควิชาเทคโนโลยีสารสนเทศ คอมพิวเตอร์ และการสื่อสาร','ICT','School','2022-05-10 11:25:17','2022-05-24 11:18:39'),(16,'Library and Information Services Center','ห้องสมุดและศูนย์บริการข้อมูล','LIB&ISC','Division','2022-05-10 11:25:23','2022-05-24 11:29:46'),(17,'School of Manufacturing Systems and Mechanical Engineering','ภาควิชาวิศวกรรมเครื่องกลและระบบการผลิต','MSME','School','2022-05-10 11:25:32','2022-05-24 11:17:11'),(18,'School of Management Technology','ภาควิชาเทคโนโลยีการจัดการ','MT','School','2022-05-10 11:25:45','2022-05-24 11:26:41'),(19,'Office of the Director','สำนักผู้อำนวยการ','OD','Division','2022-05-10 11:25:53','2022-05-24 11:30:08'),(20,'Property Management Division','ฝ่ายจัดการทรัพย์สิน','PM','Division','2022-05-10 11:26:00','2022-05-24 11:31:19'),(21,'Research and Academic Quality Assurance Division','ฝ่ายวิจัยและประกันคุณภาพการศึกษา','R&QA','Division','2022-05-10 11:26:10','2022-05-24 11:29:29'),(22,'Student Affairs and Alumni Relations Division','ฝ่ายกิจการนักศึกษาและศิษย์เก่าสัมพันธ์','SA&AR','Division','2022-05-10 11:26:54','2022-05-24 11:38:39'),(23,'SIIT Academy','SIIT Academy','SIIT Academy','Center','2022-05-10 11:27:04','2022-05-24 11:28:07'),(24,'Supplies and Procurement Division','ฝ่ายพัสดุและจัดซื้อ','SP','Division','2022-05-10 11:27:15','2022-05-24 11:36:57'),(25,'Ground and Properties (Rangsit)','-','G&P-RS','Division','2024-08-29 00:00:00','2024-08-29 00:00:00'),(26,'Ground and Properties (Bangkadi)','-','G&P-BKD','Division','2024-08-29 00:00:00','2024-08-29 00:00:00'),(27,'Department of Common and Graduate Studies','-','CGS','School','2024-08-29 00:00:00','2024-08-29 00:00:00'),(28,'Academic Services Division (Bangkadi)','-','AS-BKD','Division','2024-08-29 00:00:00','2024-08-29 00:00:00'),(29,'Academic Services Division (Rangsit)','-','AS-RS','Division','2024-08-29 00:00:00','2024-08-29 00:00:00');

--
-- Table structure for table `user_meta`
--

CREATE TABLE `user_meta` (
  `user_id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_userid` int NOT NULL,
  `user_title` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `user_username` varchar(255) DEFAULT NULL,
  `user_fullname` varchar(255) NOT NULL,
  `user_firstname` varchar(255) NOT NULL,
  `user_lastname` varchar(255) NOT NULL,
  `user_position` varchar(255) DEFAULT NULL,
  `user_email` varchar(255) NOT NULL,
  `user_phone` varchar(50) DEFAULT NULL,
  `user_address` text,
  `user_picture` varchar(255) DEFAULT NULL,
  `user_status` varchar(255) DEFAULT NULL,
  `user_role` varchar(255) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `user_meta`
--

INSERT INTO `user_meta` VALUES (1,1,'Mr.',NULL,'','Consult','Admin',NULL,'consulting@siit.tu.ac.th',NULL,NULL,'userfile14429860371.png',NULL,'Admin','2023-07-21 11:05:32','2025-03-03 09:52:54'),(57,73,NULL,'Nongtest','Nongtest Nongtest','Nongtest','Nongtest',NULL,'nalinee@siit.tu.ac.th',NULL,NULL,NULL,NULL,'Admin','2025-06-12 11:04:27','2025-06-12 11:04:27');


