-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 14, 2020 at 07:13 AM
-- Server version: 10.2.14-MariaDB
-- PHP Version: 7.2.5

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
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 utf8mb4 */;

--
-- Database: `mkarea3_amssplus`
--

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

--
-- Table structure for table `idocument_comment`
--

CREATE TABLE `idocument_comment` (
  `id` int(11) NOT NULL,
  `document_id` int(10) NOT NULL COMMENT 'รหัสบันทึกข้อความ',
  `rec_id` varchar(100) CHARACTER SET utf8 NOT NULL,
  `person_comments_id` varchar(20) CHARACTER SET utf8 NOT NULL,
  `person_comments_name` varchar(255) CHARACTER SET utf8 NOT NULL,
  `person_comments_position` varchar(255) CHARACTER SET utf8 NOT NULL,
  `comments_select` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `comments_txt` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `comments_etctxt` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `comments_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `comments_type` int(2) DEFAULT NULL,
  `comments_status` int(5) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `idocument_comment2`
--

CREATE TABLE `idocument_comment2` (
  `id` int(11) NOT NULL,
  `document_id` int(10) NOT NULL COMMENT 'รหัสบันทึกข้อความ',
  `rec_id` varchar(25) CHARACTER SET utf8 NOT NULL,
  `person_comments_id` int(20) NOT NULL,
  `person_comments_name` varchar(255) CHARACTER SET utf8 NOT NULL,
  `person_comments_position` varchar(255) CHARACTER SET utf8 NOT NULL,
  `comments_select` int(2) NOT NULL,
  `comments_txt` varchar(255) CHARACTER SET utf8 NOT NULL,
  `comments_etctxt` varchar(255) CHARACTER SET utf8 NOT NULL,
  `comments_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `comments_type` int(2) NOT NULL,
  `comments_status` int(5) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `idocument_files`
--

CREATE TABLE `idocument_files` (
  `id` int(11) NOT NULL,
  `document_id` int(10) DEFAULT NULL COMMENT 'รหัสบันทึกข้อความ',
  `file_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT 'ชื่อไฟล์แนบ',
  `file_des` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT 'รายละเอียดไฟล์แนบ',
  `filetype` varchar(5) CHARACTER SET utf8 DEFAULT NULL,
  `docType` varchar(10) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `idocument_main`
--

CREATE TABLE `idocument_main` (
  `id` int(6) NOT NULL,
  `workgroup` int(4) NOT NULL COMMENT 'กลุ่มงาน,ส่วนราชการ',
  `workgroup_txt` text CHARACTER SET utf8 NOT NULL,
  `book_year` int(4) NOT NULL COMMENT 'ปีของบันทึก',
  `book_number` int(5) NOT NULL COMMENT 'เลขที่บันทึก (เฉพาะตัวเลข)',
  `book_no` varchar(50) CHARACTER SET utf8 NOT NULL COMMENT 'เลขที่บันทึก',
  `book_date` date NOT NULL COMMENT 'ลงวันที่ "2018-07-13"',
  `subject` text CHARACTER SET utf8 NOT NULL COMMENT 'เรื่อง',
  `pre_doc_id` varchar(100) CHARACTER SET utf8 NOT NULL COMMENT 'ร่างหนังสือส่ง',
  `book_to` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT 'เรียนถึง?',
  `content1` text CHARACTER SET utf8 NOT NULL COMMENT 'เนื้อหาบันทึกข้อความ',
  `content2` text CHARACTER SET utf8 NOT NULL COMMENT 'ย่อหน้า2',
  `content3` text CHARACTER SET utf8 NOT NULL COMMENT 'ย่อหน้า2',
  `officer` varchar(20) CHARACTER SET utf8 NOT NULL COMMENT 'ผู้บันทึก',
  `officer_name` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT 'ผู้บันทึก(ชื่อ-สกุล)',
  `officer_position` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT 'ผู้บันทึก(ตำแหน่ง',
  `book_status` int(1) NOT NULL COMMENT 'สถานะ ร่าง เสนอ',
  `book_type` int(1) NOT NULL COMMENT 'ประเภทบันทึกเสนอ ปกติ,ด่วน'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `idocument_sendto`
--

CREATE TABLE `idocument_sendto` (
  `id` int(11) NOT NULL,
  `document_id` int(10) NOT NULL COMMENT 'รหัสบันทึกข้อความ',
  `rec_id` varchar(50) CHARACTER SET utf8 NOT NULL,
  `rec_from` varchar(25) CHARACTER SET utf8 DEFAULT NULL,
  `person_id` varchar(20) CHARACTER SET utf8 NOT NULL,
  `send_time` timestamp NOT NULL DEFAULT current_timestamp(),
  `open_time` datetime DEFAULT NULL,
  `document_from` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
  `status` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `idocument_status`
--

CREATE TABLE `idocument_status` (
  `bookstatusid` int(11) NOT NULL,
  `bookstatusname` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `position_use` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Indexes for dumped tables
--

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

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `idocument_comment`
--
ALTER TABLE `idocument_comment`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `idocument_files`
--
ALTER TABLE `idocument_files`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `idocument_main`
--
ALTER TABLE `idocument_main`
  MODIFY `id` int(6) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `idocument_sendto`
--
ALTER TABLE `idocument_sendto`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
COMMIT;

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