-- phpMyAdmin SQL Dump
-- version 4.0.10.20
-- https://www.phpmyadmin.net
--
-- โฮสต์: localhost
-- เวลาในการสร้าง: 07 ธ.ค. 2020  18:11น.
-- เวอร์ชั่นของเซิร์ฟเวอร์: 5.1.73
-- รุ่นของ PHP: 5.3.3

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!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 */;
/*!40101 SET NAMES utf8 */;

--
-- ฐานข้อมูล: `std6302`
--

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

--
-- โครงสร้างตาราง `bad`
--

CREATE TABLE IF NOT EXISTS `bad` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `idstu` int(5) NOT NULL,
  `name` varchar(300) NOT NULL,
  `room` varchar(255) NOT NULL,
  `detail` varchar(1000) NOT NULL,
  `pic` varchar(500) NOT NULL,
  `score` int(2) NOT NULL,
  `input` varchar(300) NOT NULL,
  `date` varchar(255) NOT NULL,
  `time` varchar(255) NOT NULL,
  `log` varchar(300) NOT NULL,
  `idx` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `bg_bad`
--

CREATE TABLE IF NOT EXISTS `bg_bad` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `idstu` int(5) NOT NULL,
  `name` varchar(300) NOT NULL,
  `room` varchar(255) NOT NULL,
  `detail` varchar(1000) NOT NULL,
  `pic` varchar(300) NOT NULL,
  `log` varchar(500) NOT NULL,
  `date` varchar(255) NOT NULL,
  `time` varchar(255) NOT NULL,
  `teacher` varchar(255) NOT NULL,
  `idx` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `bg_good`
--

CREATE TABLE IF NOT EXISTS `bg_good` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `idstu` int(5) NOT NULL,
  `name` varchar(300) NOT NULL,
  `room` varchar(255) NOT NULL,
  `detail` varchar(1000) NOT NULL,
  `pic` varchar(300) NOT NULL,
  `log` varchar(500) NOT NULL,
  `date` varchar(255) NOT NULL,
  `time` varchar(255) NOT NULL,
  `teacher` varchar(255) NOT NULL,
  `idx` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `bkchak`
--

CREATE TABLE IF NOT EXISTS `bkchak` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `idstu` int(6) NOT NULL,
  `name` varchar(255) NOT NULL,
  `room` varchar(255) NOT NULL,
  `date` date NOT NULL,
  `time` varchar(255) NOT NULL,
  `rfid` varchar(20) NOT NULL,
  `idx` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `bkchak_t`
--

CREATE TABLE IF NOT EXISTS `bkchak_t` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `idstu` int(6) NOT NULL,
  `name` varchar(255) NOT NULL,
  `room` varchar(255) NOT NULL,
  `date` date NOT NULL,
  `time` varchar(255) NOT NULL,
  `rfid` varchar(20) NOT NULL,
  `idx` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;

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

--
-- โครงสร้างตาราง `bk_cab`
--

CREATE TABLE IF NOT EXISTS `bk_cab` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idvi` varchar(255) NOT NULL,
  `room` varchar(255) NOT NULL,
  `cab` int(2) NOT NULL,
  `date` varchar(255) NOT NULL,
  `idstu` varchar(10) NOT NULL,
  `name` varchar(500) NOT NULL,
  `idx` int(1) NOT NULL,
  `time` varchar(255) NOT NULL,
  `rfid` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `chkstu`
--

CREATE TABLE IF NOT EXISTS `chkstu` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `idstu` int(6) NOT NULL,
  `name` varchar(500) NOT NULL,
  `room` varchar(255) NOT NULL,
  `date_out` varchar(500) NOT NULL,
  `time_out` varchar(255) NOT NULL,
  `date_in` varchar(500) NOT NULL,
  `time_in` varchar(255) NOT NULL,
  `detail` varchar(500) NOT NULL,
  `taecher_out` varchar(500) NOT NULL,
  `taecher_in` varchar(500) NOT NULL,
  `idx` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=54 ;

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

--
-- โครงสร้างตาราง `ck`
--

CREATE TABLE IF NOT EXISTS `ck` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idstu` int(5) NOT NULL,
  `name` varchar(300) NOT NULL,
  `room` varchar(20) NOT NULL,
  `ck` varchar(255) NOT NULL,
  `date` date NOT NULL,
  `input` varchar(300) NOT NULL,
  `scoregood` int(2) NOT NULL,
  `scorebad` int(2) NOT NULL,
  `time` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `ckdate`
--

CREATE TABLE IF NOT EXISTS `ckdate` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `total_stu` int(6) NOT NULL,
  `idx` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=121 ;

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

--
-- โครงสร้างตาราง `cklast`
--

CREATE TABLE IF NOT EXISTS `cklast` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idstu` int(5) NOT NULL,
  `name` varchar(300) NOT NULL,
  `room` varchar(20) NOT NULL,
  `ck` varchar(255) NOT NULL,
  `date` date NOT NULL,
  `input` varchar(300) NOT NULL,
  `scoregood` int(2) NOT NULL,
  `scorebad` int(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `ck_information`
--

CREATE TABLE IF NOT EXISTS `ck_information` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `room` varchar(255) NOT NULL,
  `date` date NOT NULL,
  `m1` int(3) NOT NULL,
  `k1` int(3) NOT NULL,
  `l1` int(3) NOT NULL,
  `s1` int(3) NOT NULL,
  `m2` int(3) NOT NULL,
  `k2` int(3) NOT NULL,
  `l2` int(3) NOT NULL,
  `s2` int(3) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `ck_log`
--

CREATE TABLE IF NOT EXISTS `ck_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `room` varchar(20) NOT NULL,
  `date` date NOT NULL,
  `input` varchar(300) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `ck_log_t`
--

CREATE TABLE IF NOT EXISTS `ck_log_t` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `room` varchar(20) NOT NULL,
  `date` date NOT NULL,
  `input` varchar(300) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `ck_t`
--

CREATE TABLE IF NOT EXISTS `ck_t` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idstu` int(5) NOT NULL,
  `name` varchar(300) NOT NULL,
  `room` varchar(20) NOT NULL,
  `ck` varchar(255) NOT NULL,
  `date` date NOT NULL,
  `input` varchar(300) NOT NULL,
  `scoregood` int(2) NOT NULL,
  `scorebad` int(2) NOT NULL,
  `time` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `eq_data`
--

CREATE TABLE IF NOT EXISTS `eq_data` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `id_stu` int(5) NOT NULL,
  `name` varchar(500) NOT NULL,
  `room` int(10) NOT NULL,
  `eq1` int(1) NOT NULL,
  `eq2` int(1) NOT NULL,
  `eq3` int(1) NOT NULL,
  `eq4` int(1) NOT NULL,
  `eq5` int(1) NOT NULL,
  `eq6` int(1) NOT NULL,
  `eq7` int(1) NOT NULL,
  `eq8` int(1) NOT NULL,
  `eq9` int(1) NOT NULL,
  `eq10` int(1) NOT NULL,
  `eq11` int(1) NOT NULL,
  `eq12` int(1) NOT NULL,
  `eq13` int(1) NOT NULL,
  `eq14` int(1) NOT NULL,
  `eq15` int(1) NOT NULL,
  `eq16` int(1) NOT NULL,
  `eq17` int(1) NOT NULL,
  `eq18` int(1) NOT NULL,
  `eq19` int(1) NOT NULL,
  `eq20` int(1) NOT NULL,
  `eq21` int(1) NOT NULL,
  `eq22` int(1) NOT NULL,
  `eq23` int(1) NOT NULL,
  `eq24` int(1) NOT NULL,
  `eq25` int(1) NOT NULL,
  `eq26` int(1) NOT NULL,
  `eq27` int(1) NOT NULL,
  `eq28` int(1) NOT NULL,
  `eq29` int(1) NOT NULL,
  `eq30` int(1) NOT NULL,
  `eq31` int(1) NOT NULL,
  `eq32` int(1) NOT NULL,
  `eq33` int(1) NOT NULL,
  `eq34` int(1) NOT NULL,
  `eq35` int(1) NOT NULL,
  `eq36` int(1) NOT NULL,
  `eq37` int(1) NOT NULL,
  `eq38` int(1) NOT NULL,
  `eq39` int(1) NOT NULL,
  `eq40` int(1) NOT NULL,
  `eq41` int(1) NOT NULL,
  `eq42` int(1) NOT NULL,
  `eq43` int(1) NOT NULL,
  `eq44` int(1) NOT NULL,
  `eq45` int(1) NOT NULL,
  `eq46` int(1) NOT NULL,
  `eq47` int(1) NOT NULL,
  `eq48` int(1) NOT NULL,
  `eq49` int(1) NOT NULL,
  `eq50` int(1) NOT NULL,
  `eq51` int(1) NOT NULL,
  `eq52` int(1) NOT NULL,
  `date` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `eq_process`
--

CREATE TABLE IF NOT EXISTS `eq_process` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `id_stu` int(5) NOT NULL,
  `name` varchar(500) NOT NULL,
  `room` varchar(10) NOT NULL,
  `dt1` int(1) NOT NULL,
  `dt2` int(1) NOT NULL,
  `dt3` int(1) NOT NULL,
  `dp1` varchar(255) NOT NULL,
  `dp2` varchar(255) NOT NULL,
  `dp3` varchar(255) NOT NULL,
  `kt1` int(1) NOT NULL,
  `kt2` int(1) NOT NULL,
  `kt3` int(1) NOT NULL,
  `kp1` varchar(255) NOT NULL,
  `kp2` varchar(255) NOT NULL,
  `kp3` varchar(255) NOT NULL,
  `st1` int(1) NOT NULL,
  `st2` int(1) NOT NULL,
  `st3` int(1) NOT NULL,
  `sp1` varchar(255) NOT NULL,
  `sp2` varchar(255) NOT NULL,
  `sp3` varchar(255) NOT NULL,
  `de` int(1) NOT NULL,
  `dep` varchar(255) NOT NULL,
  `ke` int(1) NOT NULL,
  `kep` varchar(255) NOT NULL,
  `su` int(1) NOT NULL,
  `sup` varchar(255) NOT NULL,
  `tt` int(1) NOT NULL,
  `tp` varchar(255) NOT NULL,
  `idx` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `good`
--

CREATE TABLE IF NOT EXISTS `good` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `idstu` int(5) NOT NULL,
  `name` varchar(300) NOT NULL,
  `room` varchar(255) NOT NULL,
  `detail` varchar(1000) NOT NULL,
  `pic` varchar(500) NOT NULL,
  `score` int(2) NOT NULL,
  `input` varchar(300) NOT NULL,
  `date` varchar(255) NOT NULL,
  `time` varchar(255) NOT NULL,
  `log` varchar(300) NOT NULL,
  `idx` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `group_bk`
--

CREATE TABLE IF NOT EXISTS `group_bk` (
  `id` int(4) NOT NULL AUTO_INCREMENT,
  `idgroup` int(4) NOT NULL,
  `idstu` int(6) NOT NULL,
  `namestu` varchar(500) NOT NULL,
  `room` varchar(255) NOT NULL,
  `id_teacher` int(3) NOT NULL,
  `idx` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `group_id`
--

CREATE TABLE IF NOT EXISTS `group_id` (
  `idgroup` int(4) NOT NULL,
  `name` varchar(255) NOT NULL,
  `idteacher` int(3) NOT NULL,
  `idx` int(11) NOT NULL,
  PRIMARY KEY (`idgroup`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- โครงสร้างตาราง `group_store`
--

CREATE TABLE IF NOT EXISTS `group_store` (
  `id` int(4) NOT NULL AUTO_INCREMENT,
  `idstu` int(6) NOT NULL,
  `namestu` varchar(500) NOT NULL,
  `room` varchar(255) NOT NULL,
  `id_teacher` int(3) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `manager-sdq`
--

CREATE TABLE IF NOT EXISTS `manager-sdq` (
  `id` int(5) NOT NULL,
  `name` varchar(500) NOT NULL,
  `username` varchar(15) NOT NULL,
  `pass` varchar(15) NOT NULL,
  `detel` varchar(255) NOT NULL,
  `lastlogin` varchar(255) NOT NULL,
  `idx` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- โครงสร้างตาราง `master`
--

CREATE TABLE IF NOT EXISTS `master` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `username` varchar(100) NOT NULL,
  `password` varchar(30) NOT NULL,
  `name` varchar(255) NOT NULL,
  `lastlogin` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

--
-- dump ตาราง `master`
--

INSERT INTO `master` (`id`, `username`, `password`, `name`, `lastlogin`) VALUES
(1, 'admin', 'tepleelaschool281', 'admin', ''),
(2, 'director', 'tepleela', 'ผู้อำนวยการโรงเรียนเทพลีลา', ''),
(3, 'personal', 'tepleelaschool281', 'กลุ่มบริหารงานบุคคล', '');

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

--
-- โครงสร้างตาราง `mis_room`
--

CREATE TABLE IF NOT EXISTS `mis_room` (
  `id` int(2) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `teacher` varchar(700) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `moter_stu`
--

CREATE TABLE IF NOT EXISTS `moter_stu` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `id_stu` int(6) NOT NULL,
  `name` varchar(500) NOT NULL,
  `room` varchar(255) NOT NULL,
  `id_moter` varchar(255) NOT NULL,
  `detail` varchar(500) NOT NULL,
  `pic` varchar(500) NOT NULL,
  `teacher` varchar(500) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `msg`
--

CREATE TABLE IF NOT EXISTS `msg` (
  `id` int(4) NOT NULL AUTO_INCREMENT,
  `s1` int(6) NOT NULL,
  `data` varchar(1000) NOT NULL,
  `s2` int(4) NOT NULL,
  `grop` int(2) NOT NULL,
  `idx` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `process_father`
--

CREATE TABLE IF NOT EXISTS `process_father` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `id_stu` varchar(5) NOT NULL,
  `name` varchar(255) NOT NULL,
  `class` varchar(10) NOT NULL,
  `df1` int(1) NOT NULL,
  `df2` int(1) NOT NULL,
  `df3` int(1) NOT NULL,
  `df4` int(1) NOT NULL,
  `df5` int(1) NOT NULL,
  `df6` int(1) NOT NULL,
  `df7` int(1) NOT NULL,
  `pf1` varchar(255) NOT NULL,
  `pf2` varchar(255) NOT NULL,
  `pf3` varchar(255) NOT NULL,
  `pf4` varchar(255) NOT NULL,
  `pf5` varchar(255) NOT NULL,
  `pf6` varchar(255) NOT NULL,
  `pf7` varchar(255) NOT NULL,
  `idxf` varchar(1) NOT NULL,
  `totalf` int(3) NOT NULL,
  `processf` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `process_stu`
--

CREATE TABLE IF NOT EXISTS `process_stu` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `id_stu` varchar(5) NOT NULL,
  `name` varchar(500) NOT NULL,
  `class` varchar(10) NOT NULL,
  `d1` int(1) NOT NULL,
  `d2` int(1) NOT NULL,
  `d3` int(1) NOT NULL,
  `d4` int(1) NOT NULL,
  `d5` int(1) NOT NULL,
  `d6` varchar(255) NOT NULL,
  `d7` int(1) NOT NULL,
  `p1` varchar(255) NOT NULL,
  `p2` varchar(255) NOT NULL,
  `p3` varchar(255) NOT NULL,
  `p4` varchar(255) NOT NULL,
  `p5` varchar(255) NOT NULL,
  `p6` varchar(255) NOT NULL,
  `p7` varchar(255) NOT NULL,
  `idx` varchar(1) NOT NULL,
  `total` int(3) NOT NULL,
  `process` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `process_teacher`
--

CREATE TABLE IF NOT EXISTS `process_teacher` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `id_stu` varchar(5) NOT NULL,
  `name` varchar(255) NOT NULL,
  `class` varchar(10) NOT NULL,
  `dt1` int(1) NOT NULL,
  `dt2` int(1) NOT NULL,
  `dt3` int(1) NOT NULL,
  `dt4` int(1) NOT NULL,
  `dt5` int(1) NOT NULL,
  `dt6` int(1) NOT NULL,
  `dt7` int(1) NOT NULL,
  `pt1` varchar(255) NOT NULL,
  `pt2` varchar(255) NOT NULL,
  `pt3` varchar(255) NOT NULL,
  `pt4` varchar(255) NOT NULL,
  `pt5` varchar(255) NOT NULL,
  `pt6` varchar(255) NOT NULL,
  `pt7` varchar(255) NOT NULL,
  `idxt` varchar(1) NOT NULL,
  `totalt` int(3) NOT NULL,
  `processt` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `score`
--

CREATE TABLE IF NOT EXISTS `score` (
  `id` int(2) NOT NULL AUTO_INCREMENT,
  `good` int(2) NOT NULL,
  `bad` int(2) NOT NULL,
  `user` varchar(255) NOT NULL,
  `date` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

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

--
-- โครงสร้างตาราง `sdq_father`
--

CREATE TABLE IF NOT EXISTS `sdq_father` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `id_stu` int(5) NOT NULL,
  `name` varchar(255) NOT NULL,
  `class` varchar(10) NOT NULL,
  `idx` varchar(1) NOT NULL,
  `date` varchar(255) NOT NULL,
  `q1` int(1) NOT NULL,
  `q2` int(1) NOT NULL,
  `q3` int(1) NOT NULL,
  `q4` int(1) NOT NULL,
  `q5` int(1) NOT NULL,
  `q6` int(1) NOT NULL,
  `q7` int(1) NOT NULL,
  `q8` int(1) NOT NULL,
  `q9` int(1) NOT NULL,
  `q10` int(1) NOT NULL,
  `q11` int(1) NOT NULL,
  `q12` int(1) NOT NULL,
  `q13` int(1) NOT NULL,
  `q14` int(1) NOT NULL,
  `q15` int(1) NOT NULL,
  `q16` int(1) NOT NULL,
  `q17` int(1) NOT NULL,
  `q18` int(1) NOT NULL,
  `q19` int(1) NOT NULL,
  `q20` int(1) NOT NULL,
  `q21` int(1) NOT NULL,
  `q22` int(1) NOT NULL,
  `q23` int(1) NOT NULL,
  `q24` int(1) NOT NULL,
  `q25` int(1) NOT NULL,
  `q26` int(1) NOT NULL,
  `q27` int(1) NOT NULL,
  `q28` int(1) NOT NULL,
  `q29` int(1) NOT NULL,
  `q30` int(1) NOT NULL,
  `q31` int(1) NOT NULL,
  `q32` int(1) NOT NULL,
  `q33` int(1) NOT NULL,
  `father` varchar(255) NOT NULL,
  `idx26` varchar(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `sdq_stu`
--

CREATE TABLE IF NOT EXISTS `sdq_stu` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `id_stu` int(5) NOT NULL,
  `name` varchar(255) CHARACTER SET tis620 COLLATE tis620_bin NOT NULL,
  `class` varchar(10) NOT NULL,
  `idx` varchar(1) NOT NULL,
  `date` varchar(255) NOT NULL,
  `q1` int(1) NOT NULL,
  `q2` int(1) NOT NULL,
  `q3` int(1) NOT NULL,
  `q4` int(1) NOT NULL,
  `q5` int(1) NOT NULL,
  `q6` int(1) NOT NULL,
  `q7` int(1) NOT NULL,
  `q8` int(1) NOT NULL,
  `q9` int(1) NOT NULL,
  `q10` int(1) NOT NULL,
  `q11` int(1) NOT NULL,
  `q12` int(1) NOT NULL,
  `q13` int(1) NOT NULL,
  `q14` int(1) NOT NULL,
  `q15` int(1) NOT NULL,
  `q16` int(1) NOT NULL,
  `q17` int(1) NOT NULL,
  `q18` int(1) NOT NULL,
  `q19` int(1) NOT NULL,
  `q20` int(1) NOT NULL,
  `q21` int(1) NOT NULL,
  `q22` int(1) NOT NULL,
  `q23` int(1) NOT NULL,
  `q24` int(1) NOT NULL,
  `q25` int(1) NOT NULL,
  `q26` int(1) NOT NULL,
  `q27` int(1) NOT NULL,
  `q28` int(1) NOT NULL,
  `q29` int(1) NOT NULL,
  `q30` int(1) NOT NULL,
  `q31` int(1) NOT NULL,
  `q32` int(1) NOT NULL,
  `q33` int(1) NOT NULL,
  `total` int(3) NOT NULL,
  `process` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `sdq_teacher`
--

CREATE TABLE IF NOT EXISTS `sdq_teacher` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `id_stu` int(5) NOT NULL,
  `name` varchar(255) NOT NULL,
  `class` varchar(10) NOT NULL,
  `idx` varchar(1) NOT NULL,
  `date` varchar(255) NOT NULL,
  `q1` int(1) NOT NULL,
  `q2` int(1) NOT NULL,
  `q3` int(1) NOT NULL,
  `q4` int(1) NOT NULL,
  `q5` int(1) NOT NULL,
  `q6` int(1) NOT NULL,
  `q7` int(1) NOT NULL,
  `q8` int(1) NOT NULL,
  `q9` int(1) NOT NULL,
  `q10` int(1) NOT NULL,
  `q11` int(1) NOT NULL,
  `q12` int(1) NOT NULL,
  `q13` int(1) NOT NULL,
  `q14` int(1) NOT NULL,
  `q15` int(1) NOT NULL,
  `q16` int(1) NOT NULL,
  `q17` int(1) NOT NULL,
  `q18` int(1) NOT NULL,
  `q19` int(1) NOT NULL,
  `q20` int(1) NOT NULL,
  `q21` int(1) NOT NULL,
  `q22` int(1) NOT NULL,
  `q23` int(1) NOT NULL,
  `q24` int(1) NOT NULL,
  `q25` int(1) NOT NULL,
  `q26` int(1) NOT NULL,
  `q27` int(1) NOT NULL,
  `q28` int(1) NOT NULL,
  `q29` int(1) NOT NULL,
  `q30` int(1) NOT NULL,
  `q31` int(1) NOT NULL,
  `q32` int(1) NOT NULL,
  `q33` int(1) NOT NULL,
  `teacher` varchar(255) NOT NULL,
  `idx26` varchar(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `stu`
--

CREATE TABLE IF NOT EXISTS `stu` (
  `idstu` int(5) NOT NULL,
  `name` varchar(300) NOT NULL,
  `pass` varchar(20) NOT NULL,
  `room` varchar(255) NOT NULL,
  `num` int(2) NOT NULL,
  `good_score` int(4) NOT NULL,
  `bad_score` int(4) NOT NULL,
  `score_total` int(4) NOT NULL,
  `idx` int(1) NOT NULL,
  `name_eng` varchar(350) NOT NULL,
  `birthday` varchar(255) NOT NULL,
  `grop` varchar(10) NOT NULL,
  `father` varchar(350) NOT NULL,
  `f_tel` varchar(12) NOT NULL,
  `mother` varchar(350) NOT NULL,
  `m_tel` varchar(12) NOT NULL,
  `status` varchar(500) NOT NULL,
  `idcard` varchar(14) NOT NULL,
  `rfid` varchar(20) NOT NULL,
  `idxstu` int(1) NOT NULL,
  `idxfather` int(1) NOT NULL,
  `idxteacher` int(2) NOT NULL,
  `idxeq` int(1) NOT NULL,
  `pic` varchar(500) NOT NULL,
  `address` varchar(700) NOT NULL,
  PRIMARY KEY (`idstu`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- โครงสร้างตาราง `t1`
--

CREATE TABLE IF NOT EXISTS `t1` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idstu` varchar(6) NOT NULL,
  `name` varchar(500) NOT NULL,
  `room` varchar(255) NOT NULL,
  `ck` varchar(255) NOT NULL,
  `cab` int(1) NOT NULL,
  `id_teacher` varchar(255) NOT NULL,
  `date` varchar(255) NOT NULL,
  `input` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `t2`
--

CREATE TABLE IF NOT EXISTS `t2` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idstu` varchar(6) NOT NULL,
  `name` varchar(500) NOT NULL,
  `room` varchar(255) NOT NULL,
  `ck` varchar(255) NOT NULL,
  `cab` int(1) NOT NULL,
  `id_teacher` varchar(255) NOT NULL,
  `date` varchar(255) NOT NULL,
  `input` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `t3`
--

CREATE TABLE IF NOT EXISTS `t3` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idstu` varchar(6) NOT NULL,
  `name` varchar(500) NOT NULL,
  `room` varchar(255) NOT NULL,
  `ck` varchar(255) NOT NULL,
  `cab` int(1) NOT NULL,
  `id_teacher` varchar(255) NOT NULL,
  `date` varchar(255) NOT NULL,
  `input` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `t4`
--

CREATE TABLE IF NOT EXISTS `t4` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idstu` varchar(6) NOT NULL,
  `name` varchar(500) NOT NULL,
  `room` varchar(255) NOT NULL,
  `ck` varchar(255) NOT NULL,
  `cab` int(1) NOT NULL,
  `id_teacher` varchar(255) NOT NULL,
  `date` varchar(255) NOT NULL,
  `input` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `t5`
--

CREATE TABLE IF NOT EXISTS `t5` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idstu` varchar(6) NOT NULL,
  `name` varchar(500) NOT NULL,
  `room` varchar(255) NOT NULL,
  `ck` varchar(255) NOT NULL,
  `cab` int(1) NOT NULL,
  `id_teacher` varchar(255) NOT NULL,
  `date` varchar(255) NOT NULL,
  `input` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `teacher`
--

CREATE TABLE IF NOT EXISTS `teacher` (
  `id` int(3) NOT NULL AUTO_INCREMENT,
  `username` varchar(300) NOT NULL,
  `name` varchar(300) NOT NULL,
  `pass` varchar(20) NOT NULL,
  `room` varchar(255) NOT NULL,
  `lastlogin` varchar(255) NOT NULL,
  `idx` varchar(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=120 ;

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

--
-- โครงสร้างตาราง `vicha_all`
--

CREATE TABLE IF NOT EXISTS `vicha_all` (
  `id` int(3) NOT NULL AUTO_INCREMENT,
  `vicha_code` varchar(255) NOT NULL,
  `vicha_name` varchar(500) NOT NULL,
  `unit` varchar(3) NOT NULL,
  `grop` varchar(500) NOT NULL,
  `lavel` varchar(255) NOT NULL,
  `idx` varchar(2) NOT NULL,
  `idxteacher` varchar(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

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

--
-- โครงสร้างตาราง `vicha_cklog`
--

CREATE TABLE IF NOT EXISTS `vicha_cklog` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `id_teacher` varchar(255) NOT NULL,
  `vicha_code` varchar(255) NOT NULL,
  `room` varchar(255) NOT NULL,
  `date` varchar(255) NOT NULL,
  `input` varchar(255) NOT NULL,
  `cab` int(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- โครงสร้างตาราง `vicha_teacher`
--

CREATE TABLE IF NOT EXISTS `vicha_teacher` (
  `id` int(3) NOT NULL AUTO_INCREMENT,
  `id_vicha` int(2) NOT NULL,
  `id_code` varchar(255) NOT NULL,
  `teacher` varchar(500) NOT NULL,
  `room` varchar(255) NOT NULL,
  `wan` int(1) NOT NULL,
  `cab` int(1) NOT NULL,
  `hh` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

/*!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 */;
