-- https://www.phpmyadmin.net/
--
-- 생성 시간: 25-06-06 22:59
-- 서버 버전: 10.11.6-MariaDB-0+deb12u1
-- PHP 버전: 8.2.20

START TRANSACTION;



--
-- 데이터베이스: `temp`
--

-- --------------------------------------------------------

--
-- 테이블 구조 `category_list`
--

CREATE TABLE `category_list` (
  `id` int(30) NOT NULL,
  `category` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- 테이블의 덤프 데이터 `category_list`
--

INSERT INTO `category_list` (`id`, `category`) VALUES
(6, 'president'),
(7, 'Deputy president'),
(8, 'sample category');

-- --------------------------------------------------------

--
-- 테이블 구조 `ip_location`
--

CREATE TABLE `ip_location` (
  `id` int(11) NOT NULL,
  `app_id` varchar(32) DEFAULT NULL,
  `ip` varchar(50) NOT NULL,
  `isp` varchar(50) NOT NULL,
  `country` varchar(50) NOT NULL,
  `do` varchar(50) NOT NULL,
  `city` varchar(50) NOT NULL,
  `date` varchar(64) DEFAULT NULL,
  `time` varchar(32) DEFAULT NULL,
  `app_name` varchar(64) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- 테이블의 덤프 데이터 `ip_location`
--

INSERT INTO `ip_location` (`id`, `app_id`, `ip`, `isp`, `country`, `do`, `city`, `date`, `time`, `app_name`) VALUES
(1, NULL, '37.19.199.141', 'Datacamp Limited', 'United States', 'New York', 'longisland', NULL, NULL, NULL),
(2, '250331', '210.178.9.87', 'Korea Telecom', 'South Korea', 'Gyeonggi-do', 'Seongnam-si', 'Mar31 11:50:06', '1743389406', '/temp/ip-location'),
(3, 'ip_location', '175.214.47.146', 'Korea Telecom', 'South Korea', 'Gyeonggi-do', 'Gwangju', 'May01 07:13:39', '1746051219', '/temp/ip-location'),
(4, '타지 실험', '211.241.95.181', 'DACOM-PUBNETPLUS', 'South Korea', 'Gyeonggi-do', 'Gwangju', 'May01 11:23:20', '1746066200', '/temp/ip-location'),
(5, '타지 실험', '121.157.180.215', 'Korea Telecom', 'South Korea', 'Gyeonggi-do', 'Seongnam-si', 'May01 11:24:48', '1746066288', '/temp/ip-location'),
(6, '타지 실험', '157.97.134.119', 'PacketHub S.A.', 'United States', 'Washington', 'Seattle', 'May01 12:32:48', '1746070368', '/temp/ip-location'),
(7, '타지 실험', '210.178.9.94', 'Korea Telecom', 'South Korea', 'Gyeonggi-do', 'Seongnam-si', 'May01 12:39:37', '1746070777', '/temp/ip-location'),
(8, '타지 실험', '2001:e60:9353:3661::1328:d40e', 'Korea Telecom', 'South Korea', 'Seoul', 'Yongsan-gu', 'May01 13:54:08', '1746075248', '/temp/ip-location'),
(9, '타지 실험', '211.241.95.181', 'DACOM-PUBNETPLUS', 'South Korea', 'Gyeonggi-do', 'Gwangju', 'May01 14:26:53', '1746077213', '/temp/ip-location'),
(10, 'ip_location1', '2001:2d8:e65e:4b8:913:5e5e:fa4d:e2fa', 'SK Telecom', 'South Korea', 'Seoul', 'Seoul', 'May02 17:25:43', '1746174343', '/temp/ip-location'),
(11, 'ip_location1', '175.214.47.146', 'Korea Telecom', 'South Korea', 'Gyeonggi-do', 'Gwangju', 'May02 18:37:47', '1746178667', '/temp/ip-location'),
(12, 'ip_location1', '2001:2d8:e65e:4b8:913:5e5e:fa4d:e2fa', 'SK Telecom', 'South Korea', 'Seoul', 'Seoul', 'May02 20:15:09', '1746184509', '/temp/ip-location'),
(52, 'ip_location1', '175.214.47.146', 'Korea Telecom', 'South Korea', 'Gyeonggi-do', 'Gwangju', 'May05 15:41:52', '1746427312', '/temp/ip-location'),
(53, 'ip_location1', '175.214.47.146', 'Korea Telecom', 'South Korea', 'Gyeonggi-do', 'Gwangju', 'May09 13:33:48', '1746765228', '/temp/ip-location'),
(54, 'ip_location1', '175.214.47.146', 'Korea Telecom', 'South Korea', 'Gyeonggi-do', 'Gwangju', 'May09 13:35:54', '1746765354', '/temp/ip-location'),
(55, 'ip_location1', '175.214.47.146', 'Korea Telecom', 'South Korea', 'Gyeonggi-do', 'Gwangju', 'May09 13:36:02', '1746765362', '/temp/ip-location'),
(56, 'ip_location1', '175.214.47.146', 'Korea Telecom', 'South Korea', 'Gyeonggi-do', 'Gwangju', 'May09 13:39:23', '1746765563', '/temp/ip-location'),
(57, 'ip_location1', '175.214.47.146', 'Korea Telecom', 'South Korea', 'Gyeonggi-do', 'Gwangju', 'May09 13:52:52', '1746766372', '/temp/ip-location'),
(58, 'ip_location1', '211.115.155.250', 'Korea Telecom', 'South Korea', 'Gyeonggi-do', 'Seongnam-si', 'May25 10:39:49', '1748137189', '/temp/TRASH/ip-location');

-- --------------------------------------------------------

--
-- 테이블 구조 `tbl_admin`
--

CREATE TABLE `tbl_admin` (
  `aid` int(11) NOT NULL,
  `admin_username` varchar(30) NOT NULL,
  `admin_password` varchar(30) NOT NULL,
  `time_stamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- 테이블의 덤프 데이터 `tbl_admin`
--

INSERT INTO `tbl_admin` (`aid`, `admin_username`, `admin_password`, `time_stamp`) VALUES
(1, 'admin', 'codeastro', '2021-04-03 14:33:10');

-- --------------------------------------------------------

--
-- 테이블 구조 `tbl_users`
--

CREATE TABLE `tbl_users` (
  `id` int(5) NOT NULL,
  `full_name` varchar(32) NOT NULL,
  `email` varchar(32) NOT NULL,
  `voter_id` int(10) NOT NULL,
  `voted_for` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- 테이블의 덤프 데이터 `tbl_users`
--

INSERT INTO `tbl_users` (`id`, `full_name`, `email`, `voter_id`, `voted_for`) VALUES
(1, 'Bill Hill', 'virginhill@gmail.com', 696978, 'JM'),
(3, 'David J Jackson', 'jckgn@gmail.com', 753960, 'JM'),
(4, 'David Murphy', 'murphyuniverse@mail.com', 789674, 'JM'),
(5, 'Max Gerber', 'kgerber@gmail.com', 612002, 'JM'),
(6, 'Patricia Bidwell', 'bidwellp@gmail.com', 3687430, 'JM'),
(7, 'Sebastian Chaney', 'sebsta@gmail.com', 3674629, 'JRZ'),
(8, 'Pennie Hain', 'pennisch@gmail.com', 9989378, 'DM'),
(9, 'Margaret K Vinson', 'margaretfk@gmail.com', 2294940, 'MAD'),
(10, 'Jerry J Hudkins', 'puticns@gmail.com', 6066483, 'MAD'),
(11, 'Michael C Wilson', 'wilsonc@yahoo.com', 9749403, 'JRZ'),
(12, 'Robert French', 'robertof@gmail.com', 9566678, 'MAD'),
(13, 'Bernard T Hamilton', 'hamiltonb@gmail.com', 696969, 'JM'),
(14, 'Lawrence C Godsey', 'godsey1169@gmail.com', 124588, 'DM'),
(15, 'Ivan Blackwell', 'rndiwelvan@gmail.com', 696478, 'DM'),
(16, 'Christine Pennie', 'pennict@gmail.com', 452200, 'DM'),
(17, 'Bruno Denn', 'denbru@gmail.com', 178540, 'MAD'),
(18, 'Will Williams', 'williamswi@gmail.com', 369741, 'DM'),
(19, 'James Barnes', 'barnesismine@gmail.com', 852145, 'DM'),
(20, 'Tommy Hiddle', 'hiddlet@gmail.com', 852000, 'DM'),
(21, 'John Stelpw', 'stejo@gmail.com', 782200, 'DM'),
(22, 'James Rhoades', 'rhoadesj02@gmail.com', 197352, 'JRZ'),
(23, 'Mia Adams', 'adams.mia6@gmail.com', 699660, 'JRZ'),
(24, 'Amy Nelcon', 'nelconam@gmail.com', 719645, 'MAD'),
(25, 'Henry Doe', 'henry7755@gmail.com', 123121, 'JW'),
(26, 'Thomas Yorkke', 'yorkehead@gmail.com', 130058, 'JW'),
(27, 'Colin Greenwwod', 'greenco002@gmail.com', 703969, 'JW'),
(29, 'Harry Denn', 'harryden66@gmail.com', 852069, 'DM'),
(30, 'Johnny Moore', 'moorejh@gmail.com', 852476, 'JM'),
(31, 'Marky Doee', 'marky667@gmail.com', 710009, 'DM'),
(32, 'Danny', 'danny2@gmail.com', 555520, 'MAD'),
(38, 'kskang', 'kskang2@gmail.com', 333, 'JM'),
(39, 'mekang', 'mekang1@gmail.com', 777, 'JM');

-- --------------------------------------------------------

--
-- 테이블 구조 `users`
--

CREATE TABLE `users` (
  `id` int(30) NOT NULL,
  `name` varchar(200) NOT NULL,
  `username` varchar(100) NOT NULL,
  `password` varchar(200) NOT NULL,
  `type` tinyint(1) NOT NULL DEFAULT 2 COMMENT '1+admin , 2 = users'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- 테이블의 덤프 데이터 `users`
--

INSERT INTO `users` (`id`, `name`, `username`, `password`, `type`) VALUES
(1, 'Administrator', 'admin', 'password', 1),
(6, '', 'mary', '123', 1),
(7, '', 'guest', 'guest', 2);

-- --------------------------------------------------------

--
-- 테이블 구조 `votes`
--

CREATE TABLE `votes` (
  `id` int(30) NOT NULL,
  `voting_id` int(30) NOT NULL,
  `category_id` int(30) NOT NULL,
  `voting_opt_id` int(30) NOT NULL,
  `user_id` int(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- 테이블의 덤프 데이터 `votes`
--

INSERT INTO `votes` (`id`, `voting_id`, `category_id`, `voting_opt_id`, `user_id`) VALUES
(1, 1, 1, 1, 3),
(2, 1, 3, 5, 3),
(3, 1, 4, 6, 3),
(4, 1, 4, 7, 3),
(5, 1, 4, 8, 3),
(6, 1, 4, 9, 3),
(7, 1, 1, 3, 4),
(8, 1, 3, 12, 4),
(9, 1, 4, 6, 4),
(10, 1, 4, 8, 4),
(11, 1, 4, 10, 4),
(12, 1, 4, 11, 4),
(13, 1, 1, 3, 5),
(14, 1, 3, 5, 5),
(15, 1, 4, 6, 5),
(16, 1, 4, 7, 5),
(17, 1, 4, 8, 5),
(18, 1, 4, 9, 5),
(19, 5, 7, 21, 7);

-- --------------------------------------------------------

--
-- 테이블 구조 `voting_cat_settings`
--

CREATE TABLE `voting_cat_settings` (
  `id` int(30) NOT NULL,
  `voting_id` int(30) NOT NULL,
  `category_id` int(30) NOT NULL,
  `max_selection` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- 테이블의 덤프 데이터 `voting_cat_settings`
--

INSERT INTO `voting_cat_settings` (`id`, `voting_id`, `category_id`, `max_selection`) VALUES
(1, 1, 1, 1),
(2, 1, 3, 1),
(3, 1, 4, 4);

-- --------------------------------------------------------

--
-- 테이블 구조 `voting_list`
--

CREATE TABLE `voting_list` (
  `id` int(30) NOT NULL,
  `title` varchar(250) NOT NULL,
  `description` text NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- 테이블의 덤프 데이터 `voting_list`
--

INSERT INTO `voting_list` (`id`, `title`, `description`, `is_default`) VALUES
(5, 'Sample', 'this is a sample', 0),
(6, 'sample2', 'sample233', 1);

-- --------------------------------------------------------

--
-- 테이블 구조 `voting_opt`
--

CREATE TABLE `voting_opt` (
  `id` int(30) NOT NULL,
  `voting_id` int(30) NOT NULL,
  `category_id` int(30) NOT NULL,
  `image_path` text NOT NULL,
  `opt_txt` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- 테이블의 덤프 데이터 `voting_opt`
--

INSERT INTO `voting_opt` (`id`, `voting_id`, `category_id`, `image_path`, `opt_txt`) VALUES
(18, 5, 7, '1661957820_1.jpg', 'victor'),
(19, 5, 7, '1661957820_2.jpg', 'sam'),
(21, 5, 7, '1743053640_me.jpg', 'ME Kang'),
(22, 6, 6, '1743370260_mekang16a - 복사11본.jpg', 'mekang'),
(23, 6, 6, '1743370320_DSC02737.jpg', '강모은');

--
-- 덤프된 테이블의 인덱스
--

--
-- 테이블의 인덱스 `category_list`
--
ALTER TABLE `category_list`
  ADD PRIMARY KEY (`id`);

--
-- 테이블의 인덱스 `ip_location`
--
ALTER TABLE `ip_location`
  ADD PRIMARY KEY (`id`);

--
-- 테이블의 인덱스 `tbl_admin`
--
ALTER TABLE `tbl_admin`
  ADD PRIMARY KEY (`aid`);

--
-- 테이블의 인덱스 `tbl_users`
--
ALTER TABLE `tbl_users`
  ADD PRIMARY KEY (`id`);

--
-- 테이블의 인덱스 `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`);

--
-- 테이블의 인덱스 `votes`
--
ALTER TABLE `votes`
  ADD PRIMARY KEY (`id`);

--
-- 테이블의 인덱스 `voting_cat_settings`
--
ALTER TABLE `voting_cat_settings`
  ADD PRIMARY KEY (`id`);

--
-- 테이블의 인덱스 `voting_list`
--
ALTER TABLE `voting_list`
  ADD PRIMARY KEY (`id`);

--
-- 테이블의 인덱스 `voting_opt`
--
ALTER TABLE `voting_opt`
  ADD PRIMARY KEY (`id`);

--
-- 덤프된 테이블의 AUTO_INCREMENT
--

--
-- 테이블의 AUTO_INCREMENT `category_list`
--
ALTER TABLE `category_list`
  MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- 테이블의 AUTO_INCREMENT `ip_location`
--
ALTER TABLE `ip_location`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=59;

--
-- 테이블의 AUTO_INCREMENT `tbl_admin`
--
ALTER TABLE `tbl_admin`
  MODIFY `aid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- 테이블의 AUTO_INCREMENT `tbl_users`
--
ALTER TABLE `tbl_users`
  MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;

--
-- 테이블의 AUTO_INCREMENT `users`
--
ALTER TABLE `users`
  MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- 테이블의 AUTO_INCREMENT `votes`
--
ALTER TABLE `votes`
  MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- 테이블의 AUTO_INCREMENT `voting_cat_settings`
--
ALTER TABLE `voting_cat_settings`
  MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- 테이블의 AUTO_INCREMENT `voting_list`
--
ALTER TABLE `voting_list`
  MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- 테이블의 AUTO_INCREMENT `voting_opt`
--
ALTER TABLE `voting_opt`
  MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
COMMIT;

