-- https://www.phpmyadmin.net/
--




--
-- Database: `run`
--

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

--
-- Table structure for table `bank`
--

CREATE TABLE `bank` (
  `id` int(11) NOT NULL,
  `bank_name` varchar(255) DEFAULT NULL,
  `bank_acc_name` varchar(255) DEFAULT NULL,
  `bank_acc_no` varchar(20) DEFAULT NULL,
  `bank_acc_type` varchar(255) DEFAULT NULL,
  `status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `bank`
--

INSERT INTO `bank` (`id`, `bank_name`, `bank_acc_name`, `bank_acc_no`, `bank_acc_type`, `status`) VALUES
(1, 'ธนาคารไทยพาณิชย์', 'สมาคมนักวิ่งเพื่อสุขภาพ', '123-4-56780-0', 'ออมทรัพย์', 'enable');

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

--
-- Table structure for table `competition`
--

CREATE TABLE `competition` (
  `id` int(11) NOT NULL,
  `com_name` varchar(100) CHARACTER SET utf8 DEFAULT NULL,
  `com_km` float DEFAULT NULL,
  `com_money` decimal(10,0) NOT NULL,
  `com_limit` char(3) CHARACTER SET utf8 NOT NULL,
  `com_age_start` int(11) DEFAULT NULL,
  `com_age_end` int(11) DEFAULT NULL,
  `com_colorcode` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `status` varchar(10) CHARACTER SET utf8 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `competition`
--

INSERT INTO `competition` (`id`, `com_name`, `com_km`, `com_money`, `com_limit`, `com_age_start`, `com_age_end`, `com_colorcode`, `status`) VALUES
(14, 'Mini', 10.3, '400', 'no', 0, 0, 'success', 'enable'),
(15, 'Funrun', 5.4, '400', 'no', 0, 0, 'success', 'enable'),
(16, 'เดิน', 3, '350', 'no', 0, 0, 'success', 'enable'),
(18, '', 10, '1000', 'no', 0, 0, 'success', 'enable');

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

--
-- Table structure for table `competition_age`
--

CREATE TABLE `competition_age` (
  `id` int(11) NOT NULL,
  `com_id` int(11) NOT NULL,
  `ca_sex` varchar(10) DEFAULT NULL,
  `ca_start` int(11) DEFAULT NULL,
  `ca_end` int(11) DEFAULT NULL,
  `status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `competition_age`
--

INSERT INTO `competition_age` (`id`, `com_id`, `ca_sex`, `ca_start`, `ca_end`, `status`) VALUES
(1, 1, 'male', 0, 15, 'enable'),
(2, 1, 'male', 16, 24, 'enable'),
(3, 1, 'male', 25, 29, 'enable'),
(4, 1, 'male', 30, 34, 'enable'),
(5, 2, 'male', 8, 15, 'enable'),
(6, 2, 'male', 16, 40, 'enable'),
(7, 2, 'male', 41, 99, 'enable'),
(8, 3, 'male', 8, 29, 'enable'),
(9, 3, 'male', 30, 99, 'enable'),
(10, 4, 'male', 8, 12, 'disable'),
(11, 4, 'male', 12, 18, 'enable'),
(12, 1, 'female', 0, 15, 'enable'),
(13, 1, 'female', 16, 24, 'enable'),
(14, 1, 'female', 30, 34, 'enable'),
(15, 1, 'female', 35, 39, 'enable'),
(16, 1, 'female', 50, 54, 'enable'),
(17, 1, 'female', 55, 59, 'enable'),
(18, 1, 'female', 60, 99, 'enable'),
(19, 1, 'male', 35, 39, 'enable'),
(20, 1, 'male', 40, 44, 'enable'),
(21, 1, 'male', 45, 49, 'enable'),
(22, 1, 'male', 50, 54, 'enable'),
(23, 1, 'male', 55, 59, 'enable'),
(24, 1, 'male', 60, 64, 'enable'),
(25, 1, 'male', 65, 69, 'enable'),
(26, 1, 'male', 70, 99, 'enable'),
(27, 2, 'female', 0, 15, 'enable'),
(28, 2, 'female', 16, 25, 'enable'),
(29, 2, 'female', 26, 40, 'enable'),
(30, 2, 'female', 41, 60, 'enable'),
(31, 2, 'female', 61, 99, 'enable'),
(32, 3, 'female', 0, 20, 'enable'),
(33, 3, 'female', 21, 40, 'enable'),
(34, 2, 'male', 0, 50, 'enable'),
(38, 11, 'male', -15, -15, 'enable'),
(39, 11, 'male', 16, 39, 'enable'),
(40, 12, 'male', 0, 15, 'enable'),
(41, 12, 'male', 55, 59, 'enable'),
(42, 12, 'male', 60, 99, 'enable'),
(43, 14, 'male', 0, 15, 'enable'),
(44, 14, 'male', 16, 24, 'enable'),
(45, 14, 'male', 25, 29, 'enable'),
(46, 14, 'female', 0, 15, 'enable'),
(47, 14, 'female', 16, 24, 'enable'),
(48, 14, 'female', 24, 29, 'enable'),
(49, 14, 'male', 70, 99, 'enable'),
(50, 14, 'female', 60, 99, 'enable'),
(51, 15, 'male', 0, 15, 'enable'),
(52, 15, 'male', 16, 39, 'enable'),
(53, 15, 'male', 40, 99, 'enable'),
(54, 15, 'female', 0, 15, 'enable'),
(55, 15, 'female', 16, 39, 'enable'),
(56, 15, 'female', 40, 99, 'enable'),
(57, 16, 'male', 0, 99, 'enable');

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

--
-- Table structure for table `group_register`
--

CREATE TABLE `group_register` (
  `id` int(11) NOT NULL,
  `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `approve_date` datetime DEFAULT NULL,
  `group_code` int(11) DEFAULT NULL,
  `group_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `contact_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `contact_surname` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `contact_email` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `contact_mobile` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
  `h_no` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `h_subdistrict` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `h_district` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `province_id` int(11) DEFAULT NULL,
  `h_province` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `h_postal` varchar(5) CHARACTER SET utf8 DEFAULT NULL,
  `s_send_id` int(11) DEFAULT NULL,
  `s_send_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `pay_total` decimal(12,4) DEFAULT NULL,
  `pay_date` datetime DEFAULT NULL,
  `pay_picture` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `status` varchar(20) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `province`
--

CREATE TABLE `province` (
  `id` int(11) NOT NULL,
  `province_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='province';

--
-- Dumping data for table `province`
--

INSERT INTO `province` (`id`, `province_name`) VALUES
(1, 'กรุงเทพมหานคร '),
(2, 'กระบี่ '),
(3, 'กาญจนบุรี '),
(4, 'กาฬสินธุ์ '),
(5, 'กำแพงเพชร '),
(6, 'ขอนแก่น '),
(7, 'จันทบุรี '),
(8, 'ฉะเชิงเทรา '),
(9, 'ชลบุรี '),
(10, 'ชัยนาท '),
(11, 'ชัยภูมิ '),
(12, 'ชุมพร '),
(13, 'เชียงราย '),
(14, 'เชียงใหม่ '),
(15, 'ตรัง '),
(16, 'ตราด '),
(17, 'ตาก '),
(18, 'นครนายก '),
(19, 'นครปฐม '),
(20, 'นครพนม '),
(21, 'นครราชสีมา '),
(22, 'นครศรีธรรมราช '),
(23, 'นครสวรรค์ '),
(24, 'นนทบุรี '),
(25, 'นราธิวาส '),
(26, 'น่าน '),
(27, 'บึงกาฬ '),
(28, 'บุรีรัมย์ '),
(29, 'ปทุมธานี '),
(30, 'ประจวบคีรีขันธ์ '),
(31, 'ปราจีนบุรี '),
(32, 'ปัตตานี '),
(33, 'พระนครศรีอยุธยา '),
(34, 'พังงา '),
(35, 'พัทลุง '),
(36, 'พิจิตร '),
(37, 'พิษณุโลก '),
(38, 'เพชรบุรี '),
(39, 'เพชรบูรณ์ '),
(40, 'แพร่ '),
(41, 'พะเยา '),
(42, 'ภูเก็ต '),
(43, 'มหาสารคาม '),
(44, 'มุกดาหาร '),
(45, 'แม่ฮ่องสอน '),
(46, 'ยะลา '),
(47, 'ยโสธร '),
(48, 'ร้อยเอ็ด '),
(49, 'ระนอง '),
(50, 'ระยอง '),
(51, 'ราชบุรี '),
(52, 'ลพบุรี '),
(53, 'ลำปาง '),
(54, 'ลำพูน '),
(55, 'เลย '),
(56, 'ศรีสะเกษ '),
(57, 'สกลนคร '),
(58, 'สงขลา '),
(59, 'สตูล '),
(60, 'สมุทรปราการ '),
(61, 'สมุทรสงคราม '),
(62, 'สมุทรสาคร '),
(63, 'สระแก้ว '),
(64, 'สระบุรี '),
(65, 'สิงห์บุรี '),
(66, 'สุโขทัย '),
(67, 'สุพรรณบุรี '),
(68, 'สุราษฎร์ธานี '),
(69, 'สุรินทร์ '),
(70, 'หนองคาย '),
(71, 'หนองบัวลำภู '),
(72, 'อ่างทอง '),
(73, 'อุดรธานี '),
(74, 'อุทัยธานี '),
(75, 'อุตรดิตถ์ '),
(76, 'อุบลราชธานี '),
(77, 'อำนาจเจริญ');

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

--
-- Table structure for table `register`
--

CREATE TABLE `register` (
  `id` int(11) NOT NULL,
  `code` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `no` int(11) DEFAULT NULL,
  `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `approve_date` datetime DEFAULT NULL,
  `com_id` int(10) NOT NULL COMMENT 'competition id',
  `com_name` varchar(100) DEFAULT NULL,
  `com_age_id` int(11) DEFAULT NULL,
  `com_age_name` varchar(100) DEFAULT NULL,
  `name_th` varchar(30) DEFAULT NULL,
  `surname_th` varchar(30) DEFAULT NULL,
  `name_en` varchar(30) DEFAULT NULL,
  `surname_en` varchar(30) DEFAULT NULL,
  `idcardno` varchar(20) DEFAULT NULL,
  `b_date` date DEFAULT NULL,
  `age` int(11) DEFAULT NULL,
  `sex` varchar(6) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `h_no` varchar(255) DEFAULT NULL,
  `h_subdistrict` varchar(255) DEFAULT NULL,
  `h_district` varchar(255) DEFAULT NULL,
  `province_id` int(80) NOT NULL,
  `h_province` varchar(255) DEFAULT NULL,
  `h_postal` int(5) DEFAULT NULL,
  `s_form_id` int(11) DEFAULT NULL,
  `s_form_name` varchar(255) DEFAULT NULL,
  `s_size_id` int(10) DEFAULT NULL,
  `s_size_name` varchar(255) DEFAULT NULL,
  `s_send_id` int(20) DEFAULT NULL,
  `s_send_name` varchar(255) DEFAULT NULL,
  `pay_total` decimal(12,4) DEFAULT NULL,
  `pay_date` datetime DEFAULT NULL,
  `pay_picture` varchar(255) DEFAULT NULL,
  `group_id` int(11) DEFAULT NULL,
  `group_name` varchar(255) DEFAULT NULL,
  `status` varchar(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `send`
--

CREATE TABLE `send` (
  `id` int(11) NOT NULL,
  `startno` int(11) DEFAULT NULL,
  `endno` int(11) DEFAULT NULL,
  `send_name` varchar(255) DEFAULT NULL,
  `send_money` decimal(10,0) DEFAULT NULL,
  `send_detail` varchar(255) DEFAULT NULL,
  `status` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `send`
--

INSERT INTO `send` (`id`, `startno`, `endno`, `send_name`, `send_money`, `send_detail`, `status`) VALUES
(7, NULL, NULL, 'ส่งทางไปรษณีย์', '50', 'ต่อ 1 เบอร์', 'enable'),
(8, NULL, NULL, 'รับด้วยตนเอง', '0', 'วันที่ 2 ธันวาคม 2560 เวลา 10.00-20.00 น. ณ สถานที่จัดการแข่งขัน (หน้าศาลากลางจังหวัดสมุทรสงคราม)', 'disable');

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

--
-- Table structure for table `shirt`
--

CREATE TABLE `shirt` (
  `id` int(11) NOT NULL,
  `shirt_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `shirt_imagename` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `status` varchar(10) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `shirt`
--

INSERT INTO `shirt` (`id`, `shirt_name`, `shirt_imagename`, `status`) VALUES
(25, 'แขนสั้น', 'image/shirt/T-S.jpg', 'enable'),
(26, 'แขนกุด', 'image/shirt/T-K.jpg', 'enable'),
(27, 'เสื้อกล้าม', 'image/shirt/148303.jpg', 'disable');

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

--
-- Table structure for table `shirt_size`
--

CREATE TABLE `shirt_size` (
  `id` int(11) NOT NULL,
  `shirtsize_name` varchar(255) DEFAULT NULL,
  `shirtsize_value` varchar(255) DEFAULT NULL,
  `status` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `shirt_size`
--

INSERT INTO `shirt_size` (`id`, `shirtsize_name`, `shirtsize_value`, `status`) VALUES
(15, 'S', '36"', 'enable'),
(16, 'M', '38"', 'enable'),
(17, 'L', '40"', 'enable'),
(18, 'XL', '42"', 'enable');

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

--
-- Table structure for table `tmp_register`
--

CREATE TABLE `tmp_register` (
  `id` int(11) NOT NULL,
  `code` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `no` int(11) DEFAULT NULL,
  `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `com_id` int(10) NOT NULL COMMENT 'competition id',
  `com_name` varchar(100) DEFAULT NULL,
  `com_age_id` int(11) DEFAULT NULL,
  `com_age_name` varchar(100) DEFAULT NULL,
  `name_th` varchar(30) DEFAULT NULL,
  `surname_th` varchar(30) DEFAULT NULL,
  `name_en` varchar(30) DEFAULT NULL,
  `surname_en` varchar(30) DEFAULT NULL,
  `idcardno` varchar(20) DEFAULT NULL,
  `b_date` date DEFAULT NULL,
  `age` int(11) DEFAULT NULL,
  `sex` varchar(6) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `h_no` varchar(255) DEFAULT NULL,
  `h_subdistrict` varchar(255) DEFAULT NULL,
  `h_district` varchar(255) DEFAULT NULL,
  `province_id` int(80) NOT NULL,
  `h_province` varchar(255) DEFAULT NULL,
  `h_postal` int(5) DEFAULT NULL,
  `s_form_id` int(11) DEFAULT NULL,
  `s_form_name` varchar(255) DEFAULT NULL,
  `s_size_id` int(10) DEFAULT NULL,
  `s_size_name` varchar(255) DEFAULT NULL,
  `s_send_id` int(20) DEFAULT NULL,
  `s_send_name` varchar(255) DEFAULT NULL,
  `pay_total` decimal(10,0) DEFAULT NULL,
  `pay_date` datetime DEFAULT NULL,
  `pay_picture` varchar(255) DEFAULT NULL,
  `group_id` int(11) DEFAULT NULL,
  `group_name` varchar(255) DEFAULT NULL,
  `status` varchar(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `user_group`
--

CREATE TABLE `user_group` (
  `id` int(11) NOT NULL,
  `ug_name` varchar(255) DEFAULT NULL,
  `regis_list` varchar(10) DEFAULT NULL,
  `regis_list_edit` varchar(10) DEFAULT NULL,
  `regis_list_del` varchar(10) DEFAULT NULL,
  `regis_individual` varchar(10) DEFAULT NULL,
  `regis_individual_edit` varchar(10) DEFAULT NULL,
  `regis_individual_del` varchar(10) DEFAULT NULL,
  `regis_approve` varchar(10) DEFAULT NULL,
  `regis_approve_edit` varchar(10) DEFAULT NULL,
  `regis_approve_del` varchar(10) DEFAULT NULL,
  `regis_group_list` varchar(10) DEFAULT NULL,
  `regis_group_list_edit` varchar(10) DEFAULT NULL,
  `regis_group_list_del` varchar(10) DEFAULT NULL,
  `regis_send` varchar(10) DEFAULT NULL,
  `regis_send_edit` varchar(10) DEFAULT NULL,
  `regis_send_del` varchar(10) DEFAULT NULL,
  `system_config` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `user_group`
--

INSERT INTO `user_group` (`id`, `ug_name`, `regis_list`, `regis_list_edit`, `regis_list_del`, `regis_individual`, `regis_individual_edit`, `regis_individual_del`, `regis_approve`, `regis_approve_edit`, `regis_approve_del`, `regis_group_list`, `regis_group_list_edit`, `regis_group_list_del`, `regis_send`, `regis_send_edit`, `regis_send_del`, `system_config`) VALUES
(1, 'user', 'yes', 'yes', 'no', 'yes', 'yes', 'no', 'yes', 'yes', 'no', 'yes', 'yes', 'no', 'yes', 'yes', 'no', 'no'),
(99, 'admin', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `bank`
--
ALTER TABLE `bank`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `competition`
--
ALTER TABLE `competition`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `competition_age`
--
ALTER TABLE `competition_age`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `group_register`
--
ALTER TABLE `group_register`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `province`
--
ALTER TABLE `province`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `register`
--
ALTER TABLE `register`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `send`
--
ALTER TABLE `send`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `shirt`
--
ALTER TABLE `shirt`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `shirt_size`
--
ALTER TABLE `shirt_size`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tmp_register`
--
ALTER TABLE `tmp_register`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `user_group`
--
ALTER TABLE `user_group`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `bank`
--
ALTER TABLE `bank`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `competition`
--
ALTER TABLE `competition`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `competition_age`
--
ALTER TABLE `competition_age`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=58;
--
-- AUTO_INCREMENT for table `group_register`
--
ALTER TABLE `group_register`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `province`
--
ALTER TABLE `province`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=78;
--
-- AUTO_INCREMENT for table `register`
--
ALTER TABLE `register`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `send`
--
ALTER TABLE `send`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `shirt`
--
ALTER TABLE `shirt`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT for table `shirt_size`
--
ALTER TABLE `shirt_size`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `tmp_register`
--
ALTER TABLE `tmp_register`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=53;
