-- http://www.phpmyadmin.net
--




--
-- Database: `alicia_r_template`
--

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

--
-- Table structure for table `access_list`
--

CREATE TABLE IF NOT EXISTS `access_list` (
  `access_key` char(32) NOT NULL,
  `access_name` varchar(256) NOT NULL,
  `access_detail` text NOT NULL,
  `access_status` tinyint(1) NOT NULL,
  `access_group` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `access_list`
--

INSERT INTO `access_list` (`access_key`, `access_name`, `access_detail`, `access_status`, `access_group`) VALUES
('0d0c8a1e35744ff2b82698b68907231e', 'รายงาน >> แสดงรายงานทั่วไป', 'รายงาน >> แสดงรายงานทั่วไป', 1, 1),
('0dd4ee8ead7fea4f3e212a716446f490', 'ทันตแพทย์ >> ห้องตรวจ', 'ทันตแพทย์ >> ห้องตรวจ', 1, 2),
('1a564b7440e3db290cecade17ee31a58', 'การนัดหมาย >> แสดงการนัดหมาย', 'การนัดหมาย >> แสดงการนัดหมาย', 1, 1),
('2e13c9cc43f1c2e9127e1b7d6e46689a', 'ทันตแพทย์ >> แสดงประวัติผู้รับบริการที่เคยรักษา', 'ทันตแพทย์ >> แสดงประวัติผู้รับบริการที่เคยรักษา', 1, 2),
('33ae817a098658d00b65a896151a30f2', 'รายงาน >> รายงานรายได้ (สรรพากร)', 'รายงาน >> รายงานรายได้ (สรรพากร)', 0, 1),
('3597c88b7c302d3c7d5fd103c098bdb5', 'ทันตแพทย์ >> แสดงตารางนัดหมาย', 'ทันตแพทย์ >> แสดงตารางนัดหมาย', 1, 2),
('3a2064f5824b7a97cbbbb1f61f150b12', 'การนัดหมาย >> เพิ่ม ลบ แก้ไข ข้อมูลการนัดหมาย', 'การนัดหมาย >> เพิ่ม ลบ แก้ไข ข้อมูลการนัดหมาย', 1, 1),
('3c600d8b527f684c404c70387468b48b', 'การจัดการ >> เข้าถึงการจัดการข้อมูลเงินเดือนพนักงาน', 'การจัดการ >> เข้าถึงการจัดการข้อมูลเงินเดือนพนักงาน', 1, 1),
('47c5d634e86d6bdb53d2dea5e0e53053', 'การจัดการ >> แสดงข้อมูลการจัดการ', 'การจัดการ >> แสดงข้อมูลการจัดการ', 1, 1),
('487eb2dc82ed6b4f0ba00bd7c2b43492', 'ผู้รับบริการ >> เพิ่ม ลบ แก้ไข ข้อมูลผู้รับบริการ', 'ผู้รับบริการ >> เพิ่ม ลบ แก้ไข ข้อมูลผู้รับบริการ', 1, 1),
('608e3ec86f1930164c55db6fa383c7d2', 'รายงาน >> แสดงรายงานเงินเดือนพนักงาน', 'รายงาน >> แสดงรายงานเงินเดือนพนักงาน', 1, 1),
('6251916917632a85b10ab9b3dab04e85', 'การเงิน >> แก้ไขรายการชำระเงิน', 'การเงิน >> แก้ไขรายการชำระเงิน', 1, 1),
('6345e40bb415e4be92efbab40a96a557', 'รายงาน >> แสดงรายงานค่าใช้จ่ายทั่วไป', 'รายงาน >> แสดงรายงานค่าใช้จ่ายทั่วไป', 1, 1),
('741a92e4f0ffaae070b53b7e06fec466', 'ห้องตรวจ >> บันทึกข้อมูลการรักษา', 'ห้องตรวจ >> บันทึกข้อมูลการรักษา', 1, 1),
('851f6d2f0a1623a1ade13d3477a8ddeb', 'คลังยาและเวชภัณฑ์ >> แสดงข้อมูลคลังยาและเวชภัณฑ์', 'คลังยาและเวชภัณฑ์ >> แสดงข้อมูลคลังยาและเวชภัณฑ์', 1, 1),
('851fa328f91bec3071f3e23eb9934250', 'ผู้ดูแลระบบ', 'ผู้ใช้งานสามารถจัดการข้อมูลในส่วนของผู้ดูแลระบบได้', 1, 1),
('9317a3ac6600102730aae40f4dd1d83b', 'การเงิน >> แสดงข้อมูลการชำระเงิน', 'การเงิน >> แสดงข้อมูลการชำระเงิน', 1, 1),
('a4eb01ed36d2958a1c743bd9d2b0e51c', 'ห้องตรวจ >> แสดงห้องตรวจ', 'ห้องตรวจ >> แสดงห้องตรวจ', 1, 1),
('a5ecbfcc34723661b15d2f8695116268', 'การจัดการ >> เข้าถึงการจัดการข้อมูลค่าใช้จ่ายทั่วไป', 'การจัดการ >> เข้าถึงการจัดการข้อมูลค่าใช้จ่ายทั่วไป', 1, 1),
('bf77be03ecebc28c5c9d3b2b9a9e5058', 'ทันตแพทย์ >> จัดการส่วนแบ่งเองได้', 'ทันตแพทย์ >> จัดการส่วนแบ่งเองได้', 1, 2),
('c04144ca3187a338021202164a5da3df', 'ผู้รับบริการ >> แสดงข้อมูลผู้รับบริการ', 'ผู้รับบริการ >> มองเห็นข้อมูลผู้รับบริการ', 1, 1),
('c74debdb39e470887e903f03015e63e2', 'ห้องตรวจ >> มองเห็นส่วนแบ่งทันตแพทย์', 'ห้องตรวจ >> มองเห็นส่วนแบ่งทันตแพทย์', 1, 1),
('ec41e010a9af6d61f32bdd9bb1c816dc', 'คลังยาและเวชภัณฑ์ >> จัดการเพิ่มยาหรือเวชภัณฑ์เข้าคลังได้', 'คลังยาและเวชภัณฑ์ >> จัดการเพิ่มยาหรือเวชภัณฑ์เข้าคลังได้', 1, 1),
('ef79ff4ec3486093d2634a2af888bb65', 'ทันตแพทย์ >> แสดงประวัติการรับส่วนแบ่ง', 'ทันตแพทย์ >> แสดงประวัติการรับส่วนแบ่ง', 1, 2),
('fea4b54f3eae169b8202458ff0b7641f', 'ขายสินค้าได้', 'ผู้ใช้งานสามารถขายสินค้าหน้าร้านได้', 1, 1);

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

--
-- Table structure for table `access_user`
--

CREATE TABLE IF NOT EXISTS `access_user` (
  `access_key` char(32) NOT NULL,
  `user_key` char(32) NOT NULL,
  `access_status` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `access_user`
--

INSERT INTO `access_user` (`access_key`, `user_key`, `access_status`) VALUES
('a5ecbfcc34723661b15d2f8695116268', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('3c600d8b527f684c404c70387468b48b', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('47c5d634e86d6bdb53d2dea5e0e53053', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('3a2064f5824b7a97cbbbb1f61f150b12', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('1a564b7440e3db290cecade17ee31a58', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('6251916917632a85b10ab9b3dab04e85', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('9317a3ac6600102730aae40f4dd1d83b', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('fea4b54f3eae169b8202458ff0b7641f', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('ec41e010a9af6d61f32bdd9bb1c816dc', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('851f6d2f0a1623a1ade13d3477a8ddeb', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('851fa328f91bec3071f3e23eb9934250', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('487eb2dc82ed6b4f0ba00bd7c2b43492', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('c04144ca3187a338021202164a5da3df', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('33ae817a098658d00b65a896151a30f2', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('6345e40bb415e4be92efbab40a96a557', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('0d0c8a1e35744ff2b82698b68907231e', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('608e3ec86f1930164c55db6fa383c7d2', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('741a92e4f0ffaae070b53b7e06fec466', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('c74debdb39e470887e903f03015e63e2', 'f2372494babff1aa4d6ec3f67fb269ed', 1),
('a4eb01ed36d2958a1c743bd9d2b0e51c', 'f2372494babff1aa4d6ec3f67fb269ed', 1);

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

--
-- Table structure for table `appointment`
--

CREATE TABLE IF NOT EXISTS `appointment` (
  `apm_key` varchar(32) NOT NULL,
  `apm_code` varchar(16) NOT NULL,
  `pat_key` varchar(32) NOT NULL,
  `startdate` date NOT NULL,
  `starttime` time NOT NULL,
  `enddate` date NOT NULL,
  `endtime` time NOT NULL,
  `doctor_key` varchar(32) NOT NULL,
  `room_key` varchar(32) NOT NULL,
  `phone_number` varchar(15) NOT NULL,
  `note` text NOT NULL,
  `apm_status` tinyint(1) NOT NULL,
  `apf_key` varchar(32) NOT NULL DEFAULT '0842e671e134770b85b6bd8cd2a3edb8',
  `apm_pat_arrive` time NOT NULL,
  `fuf_key` varchar(32) NOT NULL,
  `amp_followup_note` text NOT NULL,
  `apm_cashier_note` text NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `publicdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `appointment_flag`
--

CREATE TABLE IF NOT EXISTS `appointment_flag` (
  `apf_key` varchar(32) NOT NULL,
  `apf_title` varchar(128) NOT NULL,
  `apf_color` varchar(32) NOT NULL,
  `apf_status` tinyint(1) NOT NULL,
  `apf_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `appointment_flag`
--

INSERT INTO `appointment_flag` (`apf_key`, `apf_title`, `apf_color`, `apf_status`, `apf_insert`) VALUES
('037cdfaf4d17cc73cb0d95d8ea5b256c', 'เลื่อนนัด', '#ff9900', 1, '2019-10-18 02:02:11'),
('0842e671e134770b85b6bd8cd2a3edb8', 'ไม่ระบุสถานะ', '#b8b8b8', 1, '2018-04-17 03:48:41'),
('dcf3dcdae127773c1136641a1864c068', 'ยืนยันการนัดหมาย', '#14db64', 1, '2018-04-26 23:25:32');

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

--
-- Table structure for table `appointment_recall_alert`
--

CREATE TABLE IF NOT EXISTS `appointment_recall_alert` (
  `ara_key` char(32) NOT NULL,
  `apm_key` varchar(32) NOT NULL,
  `pat_key` varchar(32) NOT NULL,
  `item_key` varchar(32) NOT NULL,
  `ara_start_date` date NOT NULL,
  `ara_alert_date` date NOT NULL,
  `ara_status` varchar(32) NOT NULL,
  `ara_note` text NOT NULL,
  `ara_user_key` varchar(32) NOT NULL,
  `ara_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `appointment_skip`
--

CREATE TABLE IF NOT EXISTS `appointment_skip` (
  `skip_key` char(32) NOT NULL,
  `apm_key` varchar(32) NOT NULL,
  `old_startdate` date NOT NULL,
  `old_starttime` time NOT NULL,
  `old_enddate` date NOT NULL,
  `old_endtime` time NOT NULL,
  `new_startdate` date NOT NULL,
  `new_starttime` time NOT NULL,
  `new_enddate` date NOT NULL,
  `new_endtime` time NOT NULL,
  `skip_user` varchar(32) NOT NULL,
  `skip_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `autonumber`
--

CREATE TABLE IF NOT EXISTS `autonumber` (
  `cn_count` int(4) unsigned zerofill NOT NULL,
  `finance_number` int(4) unsigned zerofill NOT NULL,
  `member_number` int(6) unsigned zerofill NOT NULL,
  `import_number` int(4) unsigned zerofill NOT NULL,
  `cn_prefix` varchar(16) NOT NULL,
  `cn_year` varchar(8) NOT NULL,
  `cn_month` varchar(8) NOT NULL,
  `finance_prefix` varchar(8) NOT NULL,
  `finance_year` varchar(8) NOT NULL,
  `finance_month` varchar(8) NOT NULL,
  `year` int(4) unsigned zerofill NOT NULL,
  `month` int(2) unsigned zerofill NOT NULL,
  `day` int(2) unsigned zerofill NOT NULL,
  `backup_path` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `autonumber`
--

INSERT INTO `autonumber` (`cn_count`, `finance_number`, `member_number`, `import_number`, `cn_prefix`, `cn_year`, `cn_month`, `finance_prefix`, `finance_year`, `finance_month`, `year`, `month`, `day`, `backup_path`) VALUES
(0001, 0001, 000001, 0001, 'AC', 'AD', 'NO', 'RA', 'AD', 'YES', 2021, 06, 17, 'D:\\\\');

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

--
-- Table structure for table `backup_logs`
--

CREATE TABLE IF NOT EXISTS `backup_logs` (
  `backup_key` varchar(32) NOT NULL,
  `backup_file` varchar(256) NOT NULL,
  `backup_upload` tinytext NOT NULL,
  `backup_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `user_key` varchar(32) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

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

CREATE TABLE IF NOT EXISTS `bank` (
  `bank_key` char(32) NOT NULL,
  `bank_title` varchar(128) NOT NULL,
  `bank_account_name` varchar(128) NOT NULL,
  `bank_account_number` varchar(128) NOT NULL,
  `bank_logo` varchar(64) NOT NULL,
  `bank_status` tinyint(1) NOT NULL,
  `bank_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `bank` (`bank_key`, `bank_title`, `bank_account_name`, `bank_account_number`, `bank_logo`, `bank_status`, `bank_insert`) VALUES
('1626eef5c28a479e1251cbdf8e5d1830', 'ธนาคารกรุงไทย', 'นายกัมพล เทียมพิน (KHUMPHOL TEARMPIN)', '455-0-22718-4', 'ktb.png', 1, '2019-06-06 04:37:58'),
('64afe57ad12b671988c2ae743d19fbbe', 'ธนาคารสิกรไทย', 'นายกัมพล เทียมพิน (KHUMPHOL TEARMPIN)', '471-2-42474-0', 'kbank.png', 1, '2019-06-06 04:37:58'),
('64b94b3750032e8b949a813cf1829404', 'ธนาคารออมสิน', 'นายกัมพล เทียมพิน (KHUMPHOL TEARMPIN)', '020253147423', 'gsb.png', 1, '2019-06-06 04:39:20'),
('654c4b98987c7b000579e18d57104d1c', 'True Money Wallet', 'นายกัมพล เทียมพิน (KHUMPHOL TEARMPIN)', '0810308082', 'tmw.png', 1, '2019-06-06 04:39:20'),
('ee3a4d3c054ca149a5edcbac8d131c51', 'บัตรเครดิต', 'บัตรเครดิต', 'บัตรเครดิต', 'credit.png', 1, '2020-01-04 06:29:41');

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

--
-- Table structure for table `credit_history`
--

CREATE TABLE IF NOT EXISTS `credit_history` (
  `credit_key` char(32) NOT NULL,
  `credit_amount` double NOT NULL,
  `credit_user_key` varchar(32) NOT NULL,
  `credit_bank` varchar(32) NOT NULL,
  `credit_slip` varchar(64) NOT NULL,
  `credit_note` text NOT NULL,
  `credit_type` tinyint(1) NOT NULL COMMENT '1=topup,2=gift,3=ref',
  `credit_lastupdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `credit_status` tinyint(4) NOT NULL,
  `credit_insert` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `credit_used`
--

CREATE TABLE IF NOT EXISTS `credit_used` (
  `cu_key` char(32) NOT NULL,
  `cu_type` varchar(32) NOT NULL,
  `cu_description` varchar(128) NOT NULL,
  `cu_amount` double NOT NULL,
  `cu_user_key` varchar(32) NOT NULL,
  `cu_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `doctor`
--

CREATE TABLE IF NOT EXISTS `doctor` (
  `doctor_key` varchar(32) NOT NULL,
  `doctor_name` varchar(64) NOT NULL,
  `doctor_lastname` varchar(64) NOT NULL,
  `doctor_email` varchar(128) NOT NULL,
  `doctor_phone` varchar(32) NOT NULL,
  `doctor_bank` varchar(128) NOT NULL,
  `doctor_bank_account` varchar(128) NOT NULL,
  `doctor_bank_no` varchar(128) NOT NULL,
  `doctor_cert` varchar(64) NOT NULL,
  `doctor_position` varchar(64) NOT NULL,
  `doctor_color` varchar(16) NOT NULL,
  `doctor_photo` varchar(128) NOT NULL,
  `doctor_line_user` varchar(64) NOT NULL,
  `doctor_status` tinyint(1) NOT NULL,
  `public_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `doctor_calendar`
--

CREATE TABLE IF NOT EXISTS `doctor_calendar` (
  `dc_key` char(32) NOT NULL,
  `doctor_key` varchar(32) NOT NULL,
  `bra_key` varchar(32) NOT NULL,
  `room_key` varchar(32) NOT NULL,
  `startdate` date NOT NULL,
  `starttime` time NOT NULL,
  `endtime` time NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `dc_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `doctor_calendar_header`
--

CREATE TABLE IF NOT EXISTS `doctor_calendar_header` (
  `dcap_key` varchar(32) NOT NULL,
  `dcap_title` varchar(128) NOT NULL,
  `dcap_start` date NOT NULL,
  `dcap_end` date NOT NULL,
  `dcap_status` tinyint(1) NOT NULL,
  `dcap_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `doctor_private_fund`
--

CREATE TABLE IF NOT EXISTS `doctor_private_fund` (
  `dpf_key` char(32) NOT NULL,
  `doctor_key` varchar(32) NOT NULL,
  `item_key` varchar(32) NOT NULL,
  `item_private_fee` double NOT NULL,
  `item_private_fee_type` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `drugs_export`
--

CREATE TABLE IF NOT EXISTS `drugs_export` (
  `exp_key` varchar(32) NOT NULL,
  `drug_key` varchar(32) NOT NULL,
  `drug_export` double NOT NULL,
  `finh_key` varchar(32) NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `export_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `drugs_import`
--

CREATE TABLE IF NOT EXISTS `drugs_import` (
  `imp_key` varchar(32) NOT NULL,
  `drug_key` varchar(32) NOT NULL,
  `drug_import` double NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `import_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `drugs_store`
--

CREATE TABLE IF NOT EXISTS `drugs_store` (
  `drug_key` varchar(32) NOT NULL,
  `item_key` varchar(32) NOT NULL,
  `drug_howto` text NOT NULL,
  `drug_warning` text NOT NULL,
  `drug_minimum` double NOT NULL,
  `drug_instore` double NOT NULL,
  `drug_alert` double NOT NULL,
  `drug_sub_stock` char(1) NOT NULL DEFAULT 'Y',
  `pay_with_out_drugs` char(1) NOT NULL DEFAULT 'N',
  `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `employees`
--

CREATE TABLE IF NOT EXISTS `employees` (
  `emp_key` varchar(32) NOT NULL,
  `emp_code` varchar(64) NOT NULL,
  `emp_pid` varchar(32) NOT NULL,
  `emp_name` varchar(64) NOT NULL,
  `emp_lastname` varchar(64) NOT NULL,
  `emp_address` text NOT NULL,
  `emp_position` varchar(256) NOT NULL,
  `emp_salary` double NOT NULL,
  `emp_photo` varchar(64) NOT NULL,
  `emp_bank_name` varchar(128) NOT NULL,
  `emp_bank_acc_number` varchar(128) NOT NULL,
  `emp_status` tinyint(1) NOT NULL,
  `emp_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `employee_document`
--

CREATE TABLE IF NOT EXISTS `employee_document` (
  `doc_key` char(32) NOT NULL,
  `emp_key` varchar(32) NOT NULL,
  `doc_title` varchar(128) NOT NULL,
  `doc_file` varchar(128) NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `doc_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `expenses`
--

CREATE TABLE IF NOT EXISTS `expenses` (
  `exp_key` char(32) NOT NULL,
  `exp_title` varchar(128) NOT NULL,
  `exp_detail` text NOT NULL,
  `exp_type` tinyint(1) NOT NULL COMMENT '1=กำหนดค่าเอง,2=ดึงมาจากตารางรายการค่าใช้จ่าย',
  `exp_vat` tinyint(1) NOT NULL COMMENT '0=No Vat,1=Vat',
  `exp_amount` double NOT NULL,
  `exp_amount_vat` double NOT NULL,
  `exp_date` date NOT NULL,
  `exp_user_insert` varchar(32) NOT NULL,
  `exp_user_edit` varchar(32) NOT NULL,
  `exp_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `expenses_header`
--

CREATE TABLE IF NOT EXISTS `expenses_header` (
  `expenses_key` char(32) NOT NULL,
  `expenses_title` varchar(128) NOT NULL,
  `expenses_start` date NOT NULL,
  `expenses_end` date NOT NULL,
  `expenses_status` tinyint(1) NOT NULL,
  `expenses_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `finance_debtor`
--

CREATE TABLE IF NOT EXISTS `finance_debtor` (
  `deb_key` char(32) NOT NULL,
  `finh_key` varchar(32) NOT NULL,
  `deb_amount` double NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `deb_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `finance_header`
--

CREATE TABLE IF NOT EXISTS `finance_header` (
  `finh_key` char(32) NOT NULL,
  `finh_number` varchar(32) NOT NULL,
  `finh_tax_number` varchar(32) NOT NULL,
  `finh_tax_active` tinyint(1) NOT NULL,
  `apm_key` varchar(32) NOT NULL,
  `finance_discount` double NOT NULL,
  `finance_discount_type` tinyint(1) NOT NULL,
  `finance_discount_value` double NOT NULL,
  `finance_discount_real` double NOT NULL,
  `finance_discount_real_type` tinyint(1) NOT NULL,
  `finance_discount_real_value` double NOT NULL,
  `op_key` varchar(32) NOT NULL DEFAULT 'f47944b0e798f93fbf4e95d14d1ddd32',
  `oc_key` varchar(32) NOT NULL,
  `finance_fee` double NOT NULL,
  `finance_fee_type` tinyint(1) NOT NULL,
  `finance_fee_value` double NOT NULL,
  `price_all` double NOT NULL,
  `price_all_total` double NOT NULL,
  `finh_pay_type` tinyint(1) NOT NULL COMMENT '1=เงินสด,2=บัตรเครดิต,3=โอนผ่านบัญชีธนาคาร,4=ค้างชำระ',
  `finh_create_card_type` tinyint(1) NOT NULL COMMENT '0=No Credit card,1=Visa,2=Master Card,3=american Express,5=Other',
  `finh_create_card_number` varchar(32) NOT NULL,
  `finh_type` tinyint(1) NOT NULL DEFAULT '1',
  `user_key` varchar(32) NOT NULL,
  `finh_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `finance_payment_method`
--

CREATE TABLE IF NOT EXISTS `finance_payment_method` (
  `fpm_key` char(32) NOT NULL,
  `finh_key` varchar(32) NOT NULL,
  `pay_by_cash` double NOT NULL,
  `pay_by_card` double NOT NULL,
  `pay_by_transfer` double NOT NULL,
  `fpm_user_key` varchar(32) NOT NULL,
  `fpm_insert` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `followup_flag`
--

CREATE TABLE IF NOT EXISTS `followup_flag` (
  `fuf_key` varchar(32) NOT NULL,
  `fuf_title` varchar(128) NOT NULL,
  `fuf_color` varchar(32) NOT NULL,
  `fuf_status` tinyint(1) NOT NULL,
  `fuf_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `followup_flag`
--

INSERT INTO `followup_flag` (`fuf_key`, `fuf_title`, `fuf_color`, `fuf_status`, `fuf_insert`) VALUES
('2b1616ecfa9fe1510d079cb1dad1e4eb', 'ยังไม่ได้ติดตามนัดหมาย', '#ffd800', 2, '2019-11-21 10:14:51'),
('391f465db643417281118588c3ec3464', 'ติดตามนัดหมายแล้วไม่มีนัดหมายเพิ่ม', '#1ed400', 1, '2019-11-21 10:15:09'),
('a08c0e12d37a34cd71f7b9a4e1269d17', 'ติดตามนัดหมายแล้วมีนัดหมายเพิ่ม', '#007ae2', 2, '2020-01-24 15:19:43'),
('cd79946d41e6f35d906f4e80f0a9e491', 'ยกเลิกการติดตามนัดหมาย', '#d74747', 1, '2020-01-24 15:19:43');

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

--
-- Table structure for table `items_categories`
--

CREATE TABLE IF NOT EXISTS `items_categories` (
  `categories_key` varchar(32) NOT NULL,
  `categories_code` varchar(16) NOT NULL,
  `categories_name` varchar(256) NOT NULL,
  `categories_status` tinyint(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `items_categories`
--

INSERT INTO `items_categories` (`categories_key`, `categories_code`, `categories_name`, `categories_status`) VALUES
('4181a35429da423d4df98640d2dc5b86', 'A001', 'ค่าบริการทางการแพทย์', 1),
('d59d44be6a7b72bc9f2a6bd3741e6c2a', 'S001', 'รายได้จากการขายสินค้าและยา', 1),
('36c5420a68681b0873664baae9a3dd9c', 'X001', 'รายได้ค่า X-Ray', 1);

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

--
-- Table structure for table `items_list`
--

CREATE TABLE IF NOT EXISTS `items_list` (
  `categories_key` varchar(32) NOT NULL,
  `item_key` varchar(32) NOT NULL,
  `item_code` varchar(16) NOT NULL,
  `item_name` varchar(256) NOT NULL,
  `item_price` double NOT NULL,
  `item_unit` varchar(32) NOT NULL DEFAULT 'a59e18c9eb4692403e8206628d121328',
  `item_is_drugs` char(1) NOT NULL DEFAULT 'N',
  `item_doctor_fee` double NOT NULL,
  `item_doctor_type` tinyint(1) NOT NULL COMMENT '0=No,1=Fixed,2=Percent',
  `item_commission_fee` double NOT NULL,
  `item_commission_type` tinyint(1) NOT NULL COMMENT '0=no,1=Fixed,2=Percent',
  `item_alert_amount` int(11) NOT NULL,
  `item_alert_type` varchar(16) NOT NULL,
  `item_status` tinyint(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `language`
--

CREATE TABLE IF NOT EXISTS `language` (
  `language_code` varchar(16) NOT NULL,
  `language_name` varchar(32) NOT NULL,
  `language_status` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `language`
--

INSERT INTO `language` (`language_code`, `language_name`, `language_status`) VALUES
('en', 'English', 0),
('th', 'ภาษาไทย', 1);

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

--
-- Table structure for table `line_connect`
--

CREATE TABLE IF NOT EXISTS `line_connect` (
  `lc_key` varchar(64) NOT NULL,
  `lc_id_number` varchar(32) NOT NULL,
  `lc_pat_cn` varchar(32) NOT NULL,
  `lc_pat_key` varchar(32) NOT NULL,
  `lc_status` tinyint(1) NOT NULL,
  `lc_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `list`
--

CREATE TABLE IF NOT EXISTS `list` (
  `cases` varchar(64) NOT NULL,
  `menu` varchar(64) NOT NULL,
  `pages` varchar(128) NOT NULL,
  `status` tinyint(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `list`
--

INSERT INTO `list` (`cases`, `menu`, `pages`, `status`) VALUES
('today', 'today', 'today/main.php', 1),
('patients', 'patients', 'patients/main.php', 1),
('appointments', 'appointments', 'appointments/main.php', 1),
('rooms', 'rooms', 'rooms/main.php', 1),
('cashier', 'cashier', 'cashier/main.php', 1),
('store', 'store', 'store/main.php', 1),
('report', 'report', 'report/main.php', 1),
('settings', 'settings', 'settings/main.php', 1),
('patient_insert', 'patients', 'patients/insert.php', 1),
('report_income', 'report', 'report/report_income.php', 1),
('report_saving', 'report', 'report/report_saving.php', 1),
('report_income_group', 'report', 'report/report_income_group.php', 1),
('report_doctor_fund', 'report', 'report/report_doctor_fund.php', 1),
('report_stock', 'report', 'report/report_stock.php', 1),
('report_stock_import', 'report', 'report/report_stock_import.php', 1),
('report_stock_export', 'report', 'report/report_stock_export.php', 1),
('report_data_patients', 'report', 'report/report_data_patients.php', 1),
('report_appointments', 'report', 'report/report_appointments.php', 1),
('report_billing', 'report', 'report/report_billing.php', 1),
('report_data_doctor', 'report', 'report/report_data_doctor.php', 1),
('report_data_users', 'report', 'report/report_data_users.php', 1),
('report_history', 'report', 'report/report_history.php', 1),
('settings_users', 'settings', 'settings/settings_users.php', 1),
('settings_doctor', 'settings', 'settings/settings_doctor.php', 1),
('settings_bill_format', 'settings', 'settings/settings_bill_format.php', 1),
('about_software', 'settings', 'settings/about_software.php', 1),
('settings_clinic', 'settings', 'settings/settings_clinic.php', 1),
('settings_rooms', 'settings', 'settings/settings_rooms.php', 1),
('settings_system_report', 'settings', 'settings/settings_system_report.php', 1),
('settings_number_format', 'settings', 'settings/settings_number_format.php', 1),
('settings_data_center', 'settings', 'settings/settings_data_center.php', 1),
('settings_income_group', 'settings', 'settings/settings_income_group.php', 1),
('settings_income_list', 'settings', 'settings/settings_income_list.php', 1),
('settings_promotion', 'settings', 'settings/settings_promotion.php', 1),
('settings_user_info', 'settings', 'settings/settings_user_info.php', 1),
('settings_zibb', 'settings', 'settings/settings_zibb.php', 1),
('settings_help', 'settings', 'settings/settings_help.php', 1),
('patient_detail', 'patients', 'patients/patient_detail.php', 1),
('patient_appointment', 'patients', 'patients/patient_appointment.php', 1),
('search', '', 'main/search.php', 1),
('treatments', 'rooms', 'treatments/main.php', 1),
('payment', 'cashier', 'cashier/payment.php', 1),
('drugs_detail', 'store', 'store/drugs_detail.php', 1),
('appointments_edit', 'appointments', 'appointments/appointments_edit.php', 1),
('settings_users_access', 'settings', 'settings/settings_user_access.php', 1),
('edit_settings_doctor', 'settings', 'settings/edit_settings_doctor.php', 1),
('edit_settings_rooms', 'settings', 'settings/edit_settings_rooms.php', 1),
('edit_settings_income_group', 'settings', 'settings/edit_settings_income_group.php', 1),
('edit_settings_income_list', 'settings', 'settings/edit_settings_income_list.php', 1),
('edit_settings_promotion', 'settings', 'settings/edit_settings_promotion.php', 1),
('appointments_detail', 'appointments', 'appointments/appointments_detail.php', 1),
('report_payment', 'report', 'report/report_payment.php', 1),
('master_clinics', 'master_clinics', 'pages/clinics.php', 1),
('master_payments', 'master_payments', 'pages/payments.php', 1),
('master_settings', 'master_settings', 'pages/settings.php', 1),
('master_news', 'master_news', 'pages/news.php', 1),
('master_questions', 'master_questions', 'pages/questions.php', 1),
('master_clinics_detail', 'master_clinics', 'pages/clinics_detail.php', 1),
('payment_debt', 'cashier', 'cashier/payment_debt.php', 1),
('settings_version', 'settings', 'settings/settings_version.php', 1),
('master_sql', 'master_sql', 'pages/master_sql.php', 1),
('settings_mail_show_detail', 'settings', 'settings/settings_mail_show_detail.php', 1),
('master_mail_alert', 'master_clinics', 'pages/mail_alert.php', 1),
('settings_package_payment', 'settings', 'settings/settings_package_payment.php', 1),
('administrator_cases', 'setting', 'administrator/administrator_cases.php', 1),
('administrator_menus', 'setting', 'administrator/administrator_menus.php', 1),
('management', 'management', 'management/main.php', 1),
('treatment_detail', 'rooms', 'treatments/treatment_detail.php', 1),
('patient_history', 'patients', 'patients/patient_history.php', 1),
('doctor_detail', 'settings', 'settings/doctor_detail.php', 1),
('settings_income_private_list', 'settings', 'settings/settings_income_private_list.php', 1),
('settings_backup', 'settings', 'settings/settings_backup.php', 1),
('view_appointment_all_day', 'appointments', 'appointments/view_appointment_all_day.php', 1),
('edit_appointment', 'appointments', 'appointments/edit_appointment.php', 1),
('settings_dental_treatments', 'settings', 'settings/settings_dental_treatments.php', 1),
('expenses', 'management', 'management/expenses.php', 1),
('settings_system', 'settings', 'settings/settings_system.php', 1),
('settings_employee', 'settings', 'settings/settings_employee.php', 1),
('treatment', 'rooms', 'rooms/treatment.php', 1),
('salary', 'management', 'management/salary.php', 1),
('drug_detail', 'store', 'store/drug_detail.php', 1),
('sell', '', 'sell/main.php', 1),
('cashier_detail', 'cashier', 'cashier/cashier_detail.php', 1),
('administrator_access_list', 'setting', 'administrator/administrator_access_list.php', 1),
('doctor_appointment', 'doctor_appointment', 'doctors/doctor_appointment.php', 1),
('doctor_fund', 'doctor_fund', 'doctors/doctor_fund.php', 1),
('doctor_patient', 'doctor_patient', 'doctors/doctor_patient.php', 1),
('getappointment', '', 'main/getappointment.php', 1),
('cashier_debtor', 'cashier', 'cashier/cashier_debtor.php', 1),
('report_income_summary', 'report', 'report/report_income_summary.php', 1),
('report_reciept', 'report', 'report/report_reciept.php', 1),
('report_summary_day', 'report', 'report/report_summary_day.php', 1),
('edit_cashier_detail', 'cashier', 'cashier/edit_cashier_detail.php', 1),
('settings_appointment_flag', 'settings', 'settings/settings_appointment_flag.php', 1),
('settings_patient_source', 'settings', 'settingssettings_patient_source.php', 1),
('branch', 'settings', 'settings/setting_branch.php', 1),
('appointment_list', 'appointments', 'appointments/appointment_list.php', 1),
('calendar', 'appointments', 'appointments/calendar.php', 1),
('doctor_rooms', 'doctor_rooms', 'rooms/doctor_rooms.php', 1),
('treatment_doctor', 'rooms', 'rooms/treatment_doctor.php', 1),
('view_appointment_doctor_day', 'appointments', 'appointments/view_appointment_doctor_day.php', 1),
('report_appointment', 'report', 'report/report_appointment.php', 1),
('report_patient_active', 'report', 'report/report_patient_active.php', 1),
('report_item_use', 'report', 'report/report_item_use.php', 1),
('report_income_group_detail', 'report', 'report/report_income_group_detail.php', 1),
('report_expenses', 'report', 'report/report_expenses.php', 1),
('report_expenses_detail', 'report', 'report/report_expenses_detail.php', 1),
('report_salary', 'report', 'report/report_salary.php', 1),
('setting_employees_detail', 'setting', 'settings/setting_employees_detail.php', 1),
('salary_detail', 'management', 'management/salary_detail.php', 1),
('salary_employee_detail', 'management', 'management/salary_employee_detail.php', 1),
('report_salary_detail', 'report', 'report/report_salary_detail.php', 1),
('report_salary_employee_detail', 'report', 'report/report_salary_employee_detail.php', 1),
('settings_followup_flag', 'settings', 'settings/settings_followup_flag.php', 1),
('followup', 'followup', 'management/followup.php', 1),
('management_doctor_fund', 'management', 'management/management_doctor_fund.php', 1),
('doctor_fund_detail', 'management', 'management/doctor_fund_detail.php', 1),
('doctor_fund_other_add', 'management', 'management/doctor_fund_other_add.php', 1),
('settings_pay', 'settings', 'settings/settings_pay.php', 1),
('settings_more_storage', 'settings', 'settings/settings_more_storage.php', 1),
('settings_credit', 'settings', 'settings/settings_credit.php', 1),
('treatment_add_history', 'management', 'management/treatment_add_history.php', 1),
('treatment_history', 'management', 'management/treatment_history.php', 1),
('report_summary_day_tax', 'report', 'report/report_summary_day_tax.php', 1),
('report_income_group_tax', 'report', 'report/report_income_group_tax.php', 1),
('report_doctor_fund_tax', 'report', 'report/report_doctor_fund_tax.php', 1),
('report_reciept_check_tax', 'report', 'report/report_reciept_check_tax.php', 1),
('report_autonumber_tax', 'report', 'report/report_autonumber_tax.php', 1),
('report_income_group_detail_tax', 'report', 'report/report_income_group_detail_tax.php', 1),
('settings_unit', 'setting', 'settings/settings_unit.php', 1),
('settings_patient_flag', 'setting', 'settings/settings_patient_flag.php', 1),
('add_appointment', 'main', 'main/add_appointment.php', 1),
('new_appointment', 'main', 'main/new_appointment.php', 1),
('management_doctor_calendar', 'management', 'management/management_doctor_calendar.php', 1),
('management_doctor_calendar_detail', 'management', 'management/management_doctor_calendar_detail.php', 1),
('settings_default_item', 'settings', 'settings/settings_default_item.php', 1);

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

--
-- Table structure for table `logs`
--

CREATE TABLE IF NOT EXISTS `logs` (
  `log_key` varchar(16) NOT NULL,
  `log_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `log_ipaddress` varchar(32) NOT NULL,
  `log_text` varchar(256) NOT NULL,
  `log_user` varchar(32) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `logs`
--

INSERT INTO `logs` (`log_key`, `log_date`, `log_ipaddress`, `log_text`, `log_user`) VALUES
('46f1cf72d91305b9', '2021-06-17 08:18:52', '::1', 'dump ออกจากระบบ.', 'f2372494babff1aa4d6ec3f67fb269ed');

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

--
-- Table structure for table `menus`
--

CREATE TABLE IF NOT EXISTS `menus` (
  `menu_key` char(32) NOT NULL,
  `menu_upkey` char(32) NOT NULL,
  `menu_icon` varchar(256) NOT NULL,
  `menu_name` varchar(128) NOT NULL,
  `menu_case` varchar(128) NOT NULL,
  `menu_link` varchar(256) NOT NULL,
  `menu_status` tinyint(1) NOT NULL,
  `menu_sorting` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `menus`
--

INSERT INTO `menus` (`menu_key`, `menu_upkey`, `menu_icon`, `menu_name`, `menu_case`, `menu_link`, `menu_status`, `menu_sorting`) VALUES
('0d0c8a1e35744ff2b82698b68907231e', '0d0c8a1e35744ff2b82698b68907231e', '<i class="LA_SYSTEM_ICON_PREFIX \n fa-chart-pie fa-fw"></i>', 'LA_NV_REPORTS', 'report', '?p=report', 1, 8),
('0dd4ee8ead7fea4f3e212a716446f490', '0dd4ee8ead7fea4f3e212a716446f490', '<i class="LA_SYSTEM_ICON_PREFIX fa-stretcher fa-fw"></i>', 'ห้องตรวจ', 'doctor_rooms', '?p=doctor_rooms', 1, 3),
('1a564b7440e3db290cecade17ee31a58', '1a564b7440e3db290cecade17ee31a58', '<i class="LA_SYSTEM_ICON_PREFIX fa-calendar-check fa-fw"></i>', 'LA_NV_APPOINTMENTS', 'appointments', '?p=appointments', 1, 4),
('2e13c9cc43f1c2e9127e1b7d6e46689a', '2e13c9cc43f1c2e9127e1b7d6e46689a', '<i class="LA_SYSTEM_ICON_PREFIX fa-id-badge fa-fw"></i>', 'ข้อมูลผู้รับบริการที่เคยรักษา', 'doctor_patient', '?p=doctor_patient', 1, 17),
('3597c88b7c302d3c7d5fd103c098bdb5', '3597c88b7c302d3c7d5fd103c098bdb5', '<i class="LA_SYSTEM_ICON_PREFIX fa-calendar-check fa-fw"></i>', 'ตารางนัดหมาย', 'doctor_appointment', '?p=doctor_appointment', 1, 15),
('46b6423f9e3043960266b283f27b47fc', '46b6423f9e3043960266b283f27b47fc', '<i class="LA_SYSTEM_ICON_PREFIX fa-sign-out fa-fw"></i>', 'LA_NV_LOGOUT', 'logout', '../core/logout.core.php', 1, 20),
('47c5d634e86d6bdb53d2dea5e0e53053', '47c5d634e86d6bdb53d2dea5e0e53053', '<i class="LA_SYSTEM_ICON_PREFIX \n fa-briefcase fa-fw"></i>', 'LA_NV_MANAGEMENT', 'management', '?p=management', 1, 7),
('5ae242ff82f3b6edc89b6e80d02318a4', '5ae242ff82f3b6edc89b6e80d02318a4', '<i class="LA_SYSTEM_ICON_PREFIX fa-cogs fa-fw"></i>', 'LA_NV_SETTINGS', 'settings', '?p=settings', 1, 18),
('851f6d2f0a1623a1ade13d3477a8ddeb', '851f6d2f0a1623a1ade13d3477a8ddeb', '<i class="LA_SYSTEM_ICON_PREFIX  fa-warehouse-alt fa-fw"></i>', 'LA_NV_STORE', 'store', '?p=store', 1, 6),
('8cd2bf0adaa2beb2ad078368ec875664', '8cd2bf0adaa2beb2ad078368ec875664', '<i class="LA_SYSTEM_ICON_PREFIX fa-clinic-medical fa-fw"></i>', 'หน้าแรก <span class="pull-right"><span class="badge" id="today_wait"></span>', '', 'index.php', 1, 0),
('9317a3ac6600102730aae40f4dd1d83b', '9317a3ac6600102730aae40f4dd1d83b', '<i class="LA_SYSTEM_ICON_PREFIX fa-cash-register fa-fw"></i>', 'การเงิน <span class="pull-right"><span class="badge" id="finance_wait"></span></span>', 'cashier', '?p=cashier', 1, 5),
('a4eb01ed36d2958a1c743bd9d2b0e51c', 'a4eb01ed36d2958a1c743bd9d2b0e51c', '<i class="LA_SYSTEM_ICON_PREFIX fa-stretcher fa-fw"></i>', 'LA_NV_ROOMS', 'rooms', '?p=rooms', 1, 3),
('c04144ca3187a338021202164a5da3df', 'c04144ca3187a338021202164a5da3df', '<i class="LA_SYSTEM_ICON_PREFIX fa-hospital-user fa-fw"></i>', 'LA_NV_PATIENTS', 'patients', '?p=patients', 1, 2),
('df8827fb98d409590f0996c76cd34196', 'df8827fb98d409590f0996c76cd34196', '<i class="fa flaticon-vertical4 fa-fw"></i>', 'LA_NV_TODAY', 'today', '?p=today', 0, 1),
('ef79ff4ec3486093d2634a2af888bb65', 'ef79ff4ec3486093d2634a2af888bb65', '<i class="LA_SYSTEM_ICON_PREFIX fa-chart-pie fa-fw"></i>', 'ประวัติการรับส่วนแบ่ง', 'doctor_fund', '?p=doctor_fund', 1, 16);

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

--
-- Table structure for table `modules`
--

CREATE TABLE IF NOT EXISTS `modules` (
  `mod_key` char(32) NOT NULL,
  `mod_title` varchar(128) NOT NULL,
  `mod_detail` text NOT NULL,
  `mod_type` varchar(128) NOT NULL,
  `mod_expire` datetime NOT NULL,
  `mod_status` tinyint(1) NOT NULL,
  `mod_user_key` varchar(32) NOT NULL,
  `mod_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `month`
--

CREATE TABLE IF NOT EXISTS `month` (
  `id` int(11) NOT NULL,
  `month_th` varchar(32) NOT NULL,
  `month_en` varchar(32) NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `month`
--

INSERT INTO `month` (`id`, `month_th`, `month_en`) VALUES
(1, 'มกราคม', 'January'),
(2, 'กุมภาพันธ์', 'February'),
(3, 'มีนาคม', 'March'),
(4, 'เมษายน', 'April'),
(5, 'พฤษภาคม', 'May'),
(6, 'มิถุนายน', 'June'),
(7, 'กรกฎาคม', 'July'),
(8, 'สิงหาคม', 'August'),
(9, 'กันยายน', 'September'),
(10, 'ตุลาคม', 'October'),
(11, 'พฤศจิกายน', 'November'),
(12, 'ธันวาคม', 'December');

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

--
-- Table structure for table `mstatus`
--

CREATE TABLE IF NOT EXISTS `mstatus` (
  `id` int(11) NOT NULL,
  `mstatus_th` varchar(32) NOT NULL,
  `mstatus_en` varchar(32) NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mstatus`
--

INSERT INTO `mstatus` (`id`, `mstatus_th`, `mstatus_en`) VALUES
(1, 'โสด', 'Single'),
(2, 'สมรส', 'Marriage'),
(3, 'หย่า', 'Divorce'),
(4, 'หม้าย', 'Widow'),
(5, 'สมณะ', 'Cleric');

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

--
-- Table structure for table `other_charge`
--

CREATE TABLE IF NOT EXISTS `other_charge` (
  `oc_key` char(32) NOT NULL,
  `oc_title` varchar(128) NOT NULL,
  `oc_type` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `other_charge`
--

INSERT INTO `other_charge` (`oc_key`, `oc_title`, `oc_type`) VALUES
('2ff0740abe7cefd1c38e166c5ca56c8b', 'ค่าทำเนียมบัตรเครดิต', 0),
('37a6259cc0c1dae299a7866489dff0bd', '', 2),
('a7b36a6dcb03c729f5161d0de1e91aee', 'ภาษีมูลค่าเพิ่ม', 0),
('bd0e8fef0805793115cdf316c47cc513', 'ค่าบริการอื่น ๆ', 0);

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

--
-- Table structure for table `other_pay`
--

CREATE TABLE IF NOT EXISTS `other_pay` (
  `op_key` char(32) NOT NULL,
  `op_title` varchar(128) NOT NULL,
  `op_type` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `other_pay`
--

INSERT INTO `other_pay` (`op_key`, `op_title`, `op_type`) VALUES
('38b7759ae80d28ac809c58f37ffbb9ba', 'ส่วนลด', 1),
('c76d8ce077e68787cf11b630e568332b', 'หักประกันสังคม', 1),
('f47944b0e798f93fbf4e95d14d1ddd32', '', 2);

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

--
-- Table structure for table `patient`
--

CREATE TABLE IF NOT EXISTS `patient` (
  `pat_key` varchar(32) NOT NULL,
  `pat_cn` varchar(16) NOT NULL,
  `pat_no` varchar(32) NOT NULL,
  `pat_cid` char(13) NOT NULL,
  `pat_prefix` varchar(16) NOT NULL,
  `pat_name` varchar(64) NOT NULL,
  `pat_midname` varchar(64) NOT NULL,
  `pat_lastname` varchar(64) NOT NULL,
  `pat_nickname` varchar(32) NOT NULL,
  `pat_photo` varchar(128) NOT NULL DEFAULT 'noimg.jpg',
  `pat_sex` varchar(8) NOT NULL,
  `pat_born` date NOT NULL,
  `pat_address` varchar(128) NOT NULL,
  `pat_subdistrict` varchar(64) NOT NULL,
  `pat_district` varchar(64) NOT NULL,
  `pat_province` varchar(64) NOT NULL,
  `pat_zipcode` varchar(10) NOT NULL,
  `pat_phone` varchar(16) NOT NULL,
  `pat_email` varchar(64) NOT NULL,
  `pat_diseases` varchar(64) NOT NULL,
  `pat_allergic` varchar(64) NOT NULL,
  `pat_doctor` varchar(32) NOT NULL,
  `pat_plan` text NOT NULL,
  `pat_line_user` varchar(64) NOT NULL,
  `pat_ptf_key` varchar(32) NOT NULL,
  `pat_note` text NOT NULL,
  `pat_last_visit` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `pat_active_status` tinyint(1) NOT NULL DEFAULT '1',
  `pat_create` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `patient_flag`
--

CREATE TABLE IF NOT EXISTS `patient_flag` (
  `ptf_key` varchar(32) NOT NULL,
  `ptf_title` varchar(128) NOT NULL,
  `ptf_color` varchar(32) NOT NULL,
  `ptf_status` tinyint(1) NOT NULL,
  `ptf_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `patient_flag`
--

INSERT INTO `patient_flag` (`ptf_key`, `ptf_title`, `ptf_color`, `ptf_status`, `ptf_insert`) VALUES
('c179aebe5f6a8d4de72cb871836190e1', 'ประกันสังคม', '#c726f0', 1, '2020-11-25 03:06:01'),
('e5eb77c4d63097e39f6755f613ecd68f', 'จ่ายเอง', '#3864ff', 1, '2020-11-25 03:05:50'),
('f4f1d329857a1b3a9e4a019e77dc9f15', 'ประกันบริษัท', '#17ff3c', 1, '2020-11-25 03:06:47');

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

--
-- Table structure for table `plugins`
--

CREATE TABLE IF NOT EXISTS `plugins` (
  `plug_key` char(32) NOT NULL,
  `plug_title` varchar(128) NOT NULL,
  `plug_description` text NOT NULL,
  `plug_type` tinyint(4) NOT NULL,
  `plug_price` double NOT NULL,
  `plug_active_date` datetime NOT NULL,
  `plug_status` tinyint(1) NOT NULL,
  `plug_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `prefix`
--

CREATE TABLE IF NOT EXISTS `prefix` (
  `id` int(11) NOT NULL,
  `prefix_th` varchar(32) NOT NULL,
  `prefix_en` varchar(32) NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `prefix`
--

INSERT INTO `prefix` (`id`, `prefix_th`, `prefix_en`) VALUES
(2, 'นาย', 'นาย'),
(3, 'นาง', 'นาง'),
(4, 'นางสาว', 'นางสาว'),
(1, 'คุณ', 'คุณ'),
(6, 'ด.ช.', 'ด.ช.'),
(7, 'ด.ญ.', 'ด.ญ.'),
(8, 'Mr.', 'Mr.'),
(9, 'Mrs.', 'Mrs.'),
(10, 'Miss', 'Miss');

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

--
-- Table structure for table `report_income_group`
--

CREATE TABLE IF NOT EXISTS `report_income_group` (
  `incg_key` varchar(32) NOT NULL,
  `incg_title` varchar(128) NOT NULL,
  `incg_start` date NOT NULL,
  `incg_end` date NOT NULL,
  `incg_status` tinyint(1) NOT NULL,
  `incg_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `report_income_summary_header`
--

CREATE TABLE IF NOT EXISTS `report_income_summary_header` (
  `rish_key` char(32) NOT NULL,
  `rish_title` varchar(128) NOT NULL,
  `rish_start` date NOT NULL,
  `rish_end` date NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `rish_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `room`
--

CREATE TABLE IF NOT EXISTS `room` (
  `room_key` varchar(32) NOT NULL,
  `room_name` varchar(32) NOT NULL,
  `room_des` text NOT NULL,
  `room_status` tinyint(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `room`
--

INSERT INTO `room` (`room_key`, `room_name`, `room_des`, `room_status`) VALUES
('673beee118378467bbfedd1a7f12a0f2', 'ห้องตรวจ 1', 'ห้องตรวจ 1', 1),
('f32fe2e4d487b9e154c947b2adf3a5d5', 'ห้องตรวจ 2', 'ห้องตรวจ 2', 1);

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

--
-- Table structure for table `salary_employees`
--

CREATE TABLE IF NOT EXISTS `salary_employees` (
  `semp_key` char(32) NOT NULL,
  `emp_key` varchar(32) NOT NULL,
  `salary_key` varchar(32) NOT NULL,
  `semp_salary` double NOT NULL,
  `semp_status` tinyint(1) NOT NULL,
  `semp_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `salary_header`
--

CREATE TABLE IF NOT EXISTS `salary_header` (
  `salary_key` char(32) NOT NULL,
  `salary_title` varchar(128) NOT NULL,
  `salary_start` date NOT NULL,
  `salary_end` date NOT NULL,
  `salary_status` tinyint(1) NOT NULL,
  `salary_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `salary_other_income`
--

CREATE TABLE IF NOT EXISTS `salary_other_income` (
  `soin_key` char(32) NOT NULL,
  `emp_key` varchar(32) NOT NULL,
  `salary_key` varchar(32) NOT NULL,
  `soin_title` varchar(128) NOT NULL,
  `soin_date` date NOT NULL,
  `soin_amount` double NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `soin_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `salary_other_outcome`
--

CREATE TABLE IF NOT EXISTS `salary_other_outcome` (
  `sooc_key` char(32) NOT NULL,
  `emp_key` varchar(32) NOT NULL,
  `salary_key` varchar(32) NOT NULL,
  `sooc_title` varchar(128) NOT NULL,
  `sooc_date` date NOT NULL,
  `sooc_amount` double NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `sooc_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `sell_detail`
--

CREATE TABLE IF NOT EXISTS `sell_detail` (
  `ds_key` char(32) NOT NULL,
  `sellh_key` varchar(32) NOT NULL,
  `pro_key` varchar(32) NOT NULL,
  `ds_quantity` double NOT NULL,
  `ds_price_per_unit` double NOT NULL,
  `unit_key` varchar(32) NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `ds_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `sell_header`
--

CREATE TABLE IF NOT EXISTS `sell_header` (
  `sellh_key` char(32) NOT NULL,
  `finh_number` varchar(32) NOT NULL,
  `sellh_name` varchar(32) NOT NULL,
  `sellh_note` text NOT NULL,
  `finance_discount` double NOT NULL,
  `finance_discount_type` tinyint(1) NOT NULL,
  `finance_discount_value` double NOT NULL,
  `op_key` varchar(32) NOT NULL,
  `finance_other_pay` double NOT NULL,
  `finance_other_pay_type` tinyint(4) NOT NULL,
  `finance_other_pay_value` double NOT NULL,
  `oc_key` varchar(32) NOT NULL,
  `finance_fee` double NOT NULL,
  `finance_fee_type` tinyint(1) NOT NULL,
  `finance_fee_value` double NOT NULL,
  `price_all` double NOT NULL,
  `price_all_total` double NOT NULL,
  `finh_pay_type` tinyint(1) NOT NULL COMMENT '1=เงินสด,2=บัตรเครดิต,3=โอนผ่านบัญชีธนาคาร,4=ค้างชำระ,5=ชำระหนี้ครบแล้ว',
  `finh_create_card_type` tinyint(1) NOT NULL COMMENT '0=No Credit card,1=Visa,2=Master Card,3=american Express,5=Other',
  `finh_create_card_number` varchar(32) NOT NULL,
  `finh_type` tinyint(1) NOT NULL DEFAULT '1',
  `user_key` varchar(32) NOT NULL,
  `finh_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `sell_temp`
--

CREATE TABLE IF NOT EXISTS `sell_temp` (
  `sell_key` char(32) NOT NULL,
  `item_key` varchar(32) NOT NULL,
  `sell_price_per_unit` double NOT NULL,
  `sell_amount` double NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `sell_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `sex`
--

CREATE TABLE IF NOT EXISTS `sex` (
  `id` int(11) NOT NULL,
  `sex_th` varchar(32) NOT NULL,
  `sex_en` varchar(32) NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `sex`
--

INSERT INTO `sex` (`id`, `sex_th`, `sex_en`) VALUES
(1, 'ชาย', 'Male'),
(2, 'หญิง', 'Female'),
(3, 'ไม่ระบุ', 'Unknown');

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

--
-- Table structure for table `system_font_size`
--

CREATE TABLE IF NOT EXISTS `system_font_size` (
  `font_key` char(32) NOT NULL,
  `font_name` varchar(128) NOT NULL,
  `font_size_text` text NOT NULL,
  `font_status` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `system_font_size`
--

INSERT INTO `system_font_size` (`font_key`, `font_name`, `font_size_text`, `font_status`) VALUES
('6c3ca25445248c1dff79d51ad9fa4082', '14px', 'font-size:14px;', 1),
('74af75636b4e933684d63b617c97f398', '24px', 'font-size:24px;', 1),
('bffeb9ae0d04ffc7affc3701f9858932', '22px', 'font-size:22px;', 1),
('dd7e28065e654467be0f9c16f3bd987d', '16px', 'font-size:16px;', 1),
('e215155479796a0bdcad2326ffca09c7', '18px', 'font-size:18px;', 1),
('ff9ec5b758824e67edcf5ecc7e635f6f', '20px', 'font-size:20px;', 1);

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

--
-- Table structure for table `system_info`
--

CREATE TABLE IF NOT EXISTS `system_info` (
  `site_key` char(32) NOT NULL,
  `clinic_title` varchar(256) NOT NULL,
  `clinic_drugs` varchar(32) NOT NULL,
  `clinic_xray` varchar(32) NOT NULL,
  `clinic_address` text NOT NULL,
  `clinic_latitude` double(18,15) NOT NULL,
  `clinic_longitude` double(18,15) NOT NULL,
  `site_logo` varchar(256) NOT NULL,
  `site_favicon` varchar(256) NOT NULL,
  `time_zone` varchar(128) NOT NULL,
  `year_type` varchar(16) NOT NULL,
  `year_format` varchar(32) NOT NULL,
  `reciept_logo_en` varchar(128) NOT NULL,
  `reciept_title_en` varchar(128) NOT NULL,
  `reciept_address_en` text NOT NULL,
  `reciept_note_en` text NOT NULL,
  `reciept_bottom_left_en` text NOT NULL,
  `reciept_bottom_right_en` text NOT NULL,
  `reciept_logo_th` varchar(128) NOT NULL,
  `reciept_title_th` varchar(128) NOT NULL,
  `reciept_address_th` text NOT NULL,
  `reciept_note_th` text NOT NULL,
  `reciept_bottom_left_th` text NOT NULL,
  `reciept_bottom_right_th` text NOT NULL,
  `sell_key` varchar(32) NOT NULL,
  `vat_include` double NOT NULL,
  `system_tax` double NOT NULL,
  `followup_before_day` int(11) NOT NULL,
  `system_storage` int(11) NOT NULL DEFAULT '10',
  `system_patient` int(11) NOT NULL,
  `system_clinic` varchar(128) NOT NULL,
  `system_database` varchar(128) NOT NULL,
  `system_expire` date NOT NULL,
  `system_service_price` double NOT NULL,
  `system_service_type` varchar(32) NOT NULL,
  `system_credit` double NOT NULL,
  `line_chanel_secret` varchar(128) NOT NULL,
  `line_chanel_token` varchar(128) NOT NULL,
  `line_account_preconnect_type` varchar(32) NOT NULL,
  `line_account_preconnect_text` text NOT NULL,
  `line_account_connect_type` varchar(128) NOT NULL,
  `line_account_connect_text` text NOT NULL,
  `credit_patient_price` double NOT NULL,
  `credit_appointment_price` double NOT NULL,
  `credit_sell_price` double NOT NULL,
  `credit_sms_price` double NOT NULL,
  `credit_storage_price` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `system_info`
--

INSERT INTO `system_info` (`site_key`, `clinic_title`, `clinic_drugs`, `clinic_xray`, `clinic_address`, `clinic_latitude`, `clinic_longitude`, `site_logo`, `site_favicon`, `time_zone`, `year_type`, `year_format`, `reciept_logo_en`, `reciept_title_en`, `reciept_address_en`, `reciept_note_en`, `reciept_bottom_left_en`, `reciept_bottom_right_en`, `reciept_logo_th`, `reciept_title_th`, `reciept_address_th`, `reciept_note_th`, `reciept_bottom_left_th`, `reciept_bottom_right_th`, `sell_key`, `vat_include`, `system_tax`, `followup_before_day`, `system_storage`, `system_patient`, `system_clinic`, `system_database`, `system_expire`, `system_service_price`, `system_service_type`, `system_credit`, `line_chanel_secret`, `line_chanel_token`, `line_account_preconnect_type`, `line_account_preconnect_text`, `line_account_connect_type`, `line_account_connect_text`, `credit_patient_price`, `credit_appointment_price`, `credit_sell_price`, `credit_sms_price`, `credit_storage_price`) VALUES
('8f411b77c389d5de467af8f2c0e91cda', 'Clinic', 'd59d44be6a7b72bc9f2a6bd3741e6c2a', '36c5420a68681b0873664baae9a3dd9c', '', 0.000000000000000, 0.000000000000000, 'logo.png', 'icon.png', 'Asia/Bangkok', 'BE', '3', '9c1b152c1fca121146c14b5c40ffbe34.png', 'Reciept', 'Address........................................................................', 'Note........................................................................', '(.............................................................)<br/>Payer', '(.............................................................)<br/>Payee', '875bdfdcdfa56ffed907b9f1436c811d.png', 'ใบเสร็จรับเงิน', 'ที่อยู่........................................................................', 'หมายเหตุ........................................................................', '(.............................................................)<br/>ผู้จ่ายเงิน', '(.............................................................)<br/>ผู้รับเงิน', 'f8895f347b4bf9185d34118b9d853d23', 7, 20, 5, 1, 0, 'Clinic', 'alicia_006', '2021-06-17', 0, 'none', 0, '', '', '', '', '', '', 5, 3, 2, 1, 1000);

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

--
-- Table structure for table `tooths`
--

CREATE TABLE IF NOT EXISTS `tooths` (
  `tooth_key` char(32) NOT NULL,
  `tooth_type` varchar(16) NOT NULL,
  `tooth_number` int(11) NOT NULL,
  `tooth_icon` varchar(256) NOT NULL,
  `tooth_sorting` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tooths`
--

INSERT INTO `tooths` (`tooth_key`, `tooth_type`, `tooth_number`, `tooth_icon`, `tooth_sorting`) VALUES
('074d5d17d831582ffcaf1edde78d2adb', 'child', 28, 'icon-c2108', 18),
('07ae153a4f9e087201edbdd5a4c12d5e', 'adult', 27, 'icon-1115', 15),
('081b16bcd52a14c866fe2ab1ae3c065a', 'child', 29, 'icon-c2109', 19),
('0ae79a56a8ffad7be7d27b4ab266a912', 'child', 14, 'icon-c1104', 4),
('11340131feec68e7ca463f960f0f341c', 'adult', 11, 'icon-1101', 1),
('1821e85b82eef4439c2f8c3fc98d4e90', 'adult', 41, 'icon-2109', 29),
('2169184650ee32062f115ec35faf6c9b', 'adult', 14, 'icon-1104', 4),
('26c91801f25caaf4bf5db26f6ad5802b', 'adult', 47, 'icon-2115', 35),
('306754ce45dc3a2441a1828dcf3fe238', 'adult', 45, 'icon-2113', 33),
('336efc5a2cdd35d98e8aa99afe35af86', 'adult', 32, 'icon-2102', 22),
('3758981810f104dacd144b2df63d5199', 'adult', 33, 'icon-2103', 23),
('403aee4f97916bc68b21f4dc89a5fba8', 'adult', 43, 'icon-2111', 31),
('4d41ca3ae901a60c9d82d1eb80b58661', 'child', 17, 'icon-c1107', 7),
('547d9b61ebf6828f37f3f1616b06eb94', 'adult', 18, 'icon-1108', 8),
('5c385d6d334ea0a9301bd28ea067aba7', 'child', 12, 'icon-c1102', 2),
('5f7478e5278270a0851340d2deda3943', 'child', 25, 'icon-c2105', 15),
('62a0e3d0e8d9db40e64419904a137c32', 'adult', 17, 'icon-1107', 7),
('6458f3bfa6486a2be61b9fb6f37645c8', 'adult', 22, 'icon-1110', 10),
('647e24fdbfcbc54e7dbb98e11c45059b', 'child', 19, 'icon-c1109', 9),
('7850737a42d9d21cac6fee3958d95f5f', 'adult', 25, 'icon-1113', 13),
('7cd98be5e1169540c0d3bffad38df058', 'adult', 36, 'icon-2106', 26),
('801886d15a07a0f786169c3fa4c54b34', 'child', 20, 'icon-c1110', 10),
('838ff8b78dfbe82b2bc6c681f0cb390f', 'adult', 28, 'icon-1116', 16),
('8557acbd605dce2d0a6106c47bcd2338', 'child', 26, 'icon-c2106', 16),
('856deecf45fa4ace6b5b49bd4ad54acf', 'child', 18, 'icon-c1108', 8),
('8807ea68c5175d0173220bec0542d2e9', 'adult', 35, 'icon-2105', 25),
('88676f41f30573cd40803b102b052cc5', 'adult', 34, 'icon-2104', 24),
('99c91b979d234058c005ea53bf19594d', 'child', 11, 'icon-c1101', 1),
('99ff292e23794ad843b5d75c459ed289', 'child', 22, 'icon-c2102', 12),
('9c8a0632757d66bb9ae533b2d0a7a0fa', 'adult', 15, 'icon-1105', 5),
('a126f3646da124e2839a6bbbd2f1400f', 'adult', 21, 'icon-1109', 9),
('a1ce2b3db8ca6d0a488dcda486570695', 'adult', 31, 'icon-2101', 21),
('a4157eabf48518bb189351bcf3b52e21', 'child', 21, 'icon-c2101', 11),
('a43c7f3d9d0f4a718450633e3765b67c', 'adult', 24, 'icon-1112', 12),
('a74c3599ba5233f66e6d90523e0d7975', 'adult', 44, 'icon-2112', 32),
('bbf2466e744a50035030927d7283f2b3', 'adult', 26, 'icon-1114', 14),
('cceb37600876af8163b31e0ce7400aeb', 'adult', 42, 'icon-2110', 30),
('d0a4f1984f1ee1f764a04b6536d96b1b', 'child', 13, 'icon-c1103', 3),
('d161425547c059ba556e30cf612fb974', 'adult', 13, 'icon-1103', 3),
('d4e99aaa1f75eb02a66f89dc95ca6e3c', 'child', 15, 'icon-c1105', 5),
('d7b24e66a3c4ea77a4a224995bc3899a', 'adult', 16, 'icon-1106', 6),
('d81fee4887336b1dba216cfff99bd9e6', 'child', 30, 'icon-c2110', 20),
('dc9b670b36ec41cd821e65daa6aead0c', 'adult', 48, 'icon-2116', 36),
('de118786b5cddc3188d04a75e15d854e', 'child', 23, 'icon-c2103', 13),
('e174b03de89decac4d4ed2da3ba1f5df', 'adult', 38, 'icon-2108', 28),
('e4a7fc9521d0b60fcbb982035b644b5e', 'adult', 23, 'icon-1111', 11),
('e77aa1b8a24da9674c86f83bb588777b', 'child', 16, 'icon-c1106', 6),
('e77fac5cdb5092a34b13bb2cb29efe5a', 'adult', 46, 'icon-2114', 34),
('e97ee6d270685ce8f551bf2353027d5b', 'adult', 37, 'icon-2107', 27),
('ed20a959d410ccd843d9e1dfcee04228', 'adult', 12, 'icon-1102', 2),
('f13904a0edbe91cc85cfd7b824d9b801', 'child', 24, 'icon-c2104', 14),
('f1852259718f260ca67402fd8acb42f8', 'child', 27, 'icon-c2107', 17);

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

--
-- Table structure for table `treatments`
--

CREATE TABLE IF NOT EXISTS `treatments` (
  `treatmentuser_key` varchar(32) NOT NULL,
  `room_key` varchar(32) NOT NULL,
  `pat_key` varchar(32) NOT NULL,
  `doctor_key` varchar(32) NOT NULL,
  `treatment_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `treatment_case` varchar(32) NOT NULL,
  `treatment_status` tinyint(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `treatments_detail`
--

CREATE TABLE IF NOT EXISTS `treatments_detail` (
  `treatd_key` char(32) NOT NULL,
  `treatt_key` varchar(32) NOT NULL,
  `treath_key` varchar(32) NOT NULL,
  `treatd_note` text NOT NULL,
  `treatd_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `treatments_doctor`
--

CREATE TABLE IF NOT EXISTS `treatments_doctor` (
  `treatsdc_key` char(32) NOT NULL,
  `treath_key` varchar(32) NOT NULL,
  `item_key` varchar(32) NOT NULL,
  `item_doctor_fee` double NOT NULL,
  `item_doctor_type` tinyint(1) NOT NULL,
  `doctor_key` varchar(32) NOT NULL,
  `item_price` double NOT NULL,
  `treatsdc_amount` double NOT NULL,
  `treatsdc_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `treatments_document`
--

CREATE TABLE IF NOT EXISTS `treatments_document` (
  `treatdc_key` char(32) NOT NULL,
  `treath_key` varchar(32) NOT NULL,
  `pat_key` varchar(32) NOT NULL,
  `apm_key` varchar(32) NOT NULL,
  `treatdc_title` varchar(128) NOT NULL,
  `treatdc_file` varchar(128) NOT NULL,
  `treatdc_type` tinyint(1) NOT NULL COMMENT '1=document,2=x-ray,3=other',
  `treatdc_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `treatments_expense`
--

CREATE TABLE IF NOT EXISTS `treatments_expense` (
  `treatex_key` char(32) NOT NULL,
  `treath_key` varchar(32) NOT NULL,
  `item_key` varchar(32) NOT NULL,
  `treatex_amount` double NOT NULL,
  `treatex_price_per_unit` double NOT NULL,
  `treatex_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `treatments_header`
--

CREATE TABLE IF NOT EXISTS `treatments_header` (
  `treath_key` char(32) NOT NULL,
  `apm_key` varchar(32) NOT NULL,
  `treath_type` varchar(16) NOT NULL DEFAULT 'adult',
  `treath_weight` double NOT NULL,
  `treath_height` double NOT NULL,
  `treath_pressure_low` double NOT NULL,
  `treath_pressure_high` double NOT NULL,
  `treath_temperature` double NOT NULL,
  `treath_pulse_rate` varchar(32) NOT NULL,
  `treath_note` text NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `treath_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `treatments_info`
--

CREATE TABLE IF NOT EXISTS `treatments_info` (
  `tmi_key` char(32) NOT NULL,
  `tmi_title` varchar(128) NOT NULL,
  `tmi_color` varchar(32) NOT NULL DEFAULT '#9036ff',
  `tmi_status` tinyint(1) NOT NULL,
  `tmi_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `treatments_tooth`
--

CREATE TABLE IF NOT EXISTS `treatments_tooth` (
  `treatt_key` char(32) NOT NULL,
  `treath_key` varchar(32) NOT NULL,
  `tooth_key` varchar(32) NOT NULL,
  `tmi_key` varchar(32) NOT NULL,
  `treatt_note` text NOT NULL,
  `treatt_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `unit_type`
--

CREATE TABLE IF NOT EXISTS `unit_type` (
  `unit_key` varchar(32) NOT NULL,
  `unit_label` varchar(32) NOT NULL,
  `unit_status` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `unit_type`
--

INSERT INTO `unit_type` (`unit_key`, `unit_label`, `unit_status`) VALUES
('9bdf20c4418deb338c8ef521f0b26ec5', 'ซี่', 1),
('ad6aa5ca0ed7af49bdab82b3258a06c0', 'ชิ้น', 1),
('c314c3c2511a29e3d4cd6dc9aa6e6021', 'อัน', 1),
('3deebc16e86953df1a4092d3955416f6', 'ชุด', 1),
('a59e18c9eb4692403e8206628d121328', 'ครั้ง', 1),
('f4bb89251485bb085d794af9245caf58', 'เม็ด', 1),
('c9568fcf108d1c2a5d2c580d556b8f53', 'ขวด', 1),
('baf47b1bdad84fb68670525820097a09', 'ฟิล์ม', 1),
('bbc9e1f848f464051e8e84103d1567db', 'หลอด', 1),
('162cacf0d591b432412c89437dea28e0', 'ตลับ', 1),
('acf212c78cafdd55bfaf2c76e8093965', 'กล่อง', 1);

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

--
-- Table structure for table `user`
--

CREATE TABLE IF NOT EXISTS `user` (
  `user_key` char(32) NOT NULL,
  `name` varchar(64) NOT NULL,
  `lastname` varchar(64) NOT NULL,
  `username` varchar(64) NOT NULL,
  `password` varchar(60) NOT NULL,
  `birthday` date NOT NULL,
  `user_photo` varchar(128) NOT NULL DEFAULT 'noimg.jpg',
  `user_class` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=user,2=doctor,3=super admin',
  `position` varchar(128) NOT NULL,
  `user_language` varchar(8) NOT NULL DEFAULT 'th',
  `user_branch` varchar(32) NOT NULL,
  `cashier_default` varchar(32) NOT NULL,
  `user_theme` varchar(128) NOT NULL DEFAULT 'light_gray.css',
  `system_font_size` varchar(32) NOT NULL DEFAULT 'dd7e28065e654467be0f9c16f3bd987d',
  `system_icon_prefix` varchar(32) NOT NULL DEFAULT 'fad',
  `email` varchar(128) NOT NULL,
  `user_status` tinyint(1) NOT NULL,
  `user_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`user_key`, `name`, `lastname`, `username`, `password`, `birthday`, `user_photo`, `user_class`, `position`, `user_language`, `user_branch`, `cashier_default`, `user_theme`, `system_font_size`, `system_icon_prefix`, `email`, `user_status`, `user_insert`) VALUES
('f2372494babff1aa4d6ec3f67fb269ed', 'Alicia', 'Administrator', 'dump', '$1$w5yBHzMR$YMXcJJQoyiz9/E6ngVZJq.', '2017-01-01', 'noimg.jpg', 1, '', '', '', '', 'light_gray.css', 'dd7e28065e654467be0f9c16f3bd987d', 'fat', 'khumphol@gmail.com', 1, '0000-00-00 00:00:00');

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

--
-- Table structure for table `user_default`
--

CREATE TABLE IF NOT EXISTS `user_default` (
  `def_key` char(32) NOT NULL,
  `user_key` varchar(32) NOT NULL,
  `user_username` varchar(64) NOT NULL,
  `user_password` varchar(64) NOT NULL,
  `def_change` tinyint(1) NOT NULL,
  `def_insert` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `user_online`
--

CREATE TABLE IF NOT EXISTS `user_online` (
  `osession` varchar(128) CHARACTER SET utf8 NOT NULL DEFAULT '',
  `user_key` varchar(32) CHARACTER SET utf8 NOT NULL,
  `otime` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `access_list`
--
ALTER TABLE `access_list`
  ADD PRIMARY KEY (`access_key`);

--
-- Indexes for table `appointment`
--
ALTER TABLE `appointment`
  ADD PRIMARY KEY (`apm_key`);

--
-- Indexes for table `appointment_flag`
--
ALTER TABLE `appointment_flag`
  ADD PRIMARY KEY (`apf_key`);

--
-- Indexes for table `appointment_recall_alert`
--
ALTER TABLE `appointment_recall_alert`
  ADD PRIMARY KEY (`ara_key`);

--
-- Indexes for table `appointment_skip`
--
ALTER TABLE `appointment_skip`
  ADD PRIMARY KEY (`skip_key`);

--
-- Indexes for table `autonumber`
--
ALTER TABLE `autonumber`
  ADD PRIMARY KEY (`cn_count`);

--
-- Indexes for table `backup_logs`
--
ALTER TABLE `backup_logs`
  ADD PRIMARY KEY (`backup_key`);

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

--
-- Indexes for table `credit_history`
--
ALTER TABLE `credit_history`
  ADD PRIMARY KEY (`credit_key`);

--
-- Indexes for table `credit_used`
--
ALTER TABLE `credit_used`
  ADD PRIMARY KEY (`cu_key`);

--
-- Indexes for table `doctor`
--
ALTER TABLE `doctor`
  ADD PRIMARY KEY (`doctor_key`);

--
-- Indexes for table `doctor_calendar`
--
ALTER TABLE `doctor_calendar`
  ADD PRIMARY KEY (`dc_key`);

--
-- Indexes for table `doctor_calendar_header`
--
ALTER TABLE `doctor_calendar_header`
  ADD PRIMARY KEY (`dcap_key`);

--
-- Indexes for table `doctor_private_fund`
--
ALTER TABLE `doctor_private_fund`
  ADD PRIMARY KEY (`dpf_key`);

--
-- Indexes for table `drugs_export`
--
ALTER TABLE `drugs_export`
  ADD PRIMARY KEY (`exp_key`);

--
-- Indexes for table `drugs_import`
--
ALTER TABLE `drugs_import`
  ADD PRIMARY KEY (`imp_key`);

--
-- Indexes for table `drugs_store`
--
ALTER TABLE `drugs_store`
  ADD PRIMARY KEY (`drug_key`);

--
-- Indexes for table `employees`
--
ALTER TABLE `employees`
  ADD PRIMARY KEY (`emp_key`);

--
-- Indexes for table `employee_document`
--
ALTER TABLE `employee_document`
  ADD PRIMARY KEY (`doc_key`);

--
-- Indexes for table `expenses`
--
ALTER TABLE `expenses`
  ADD PRIMARY KEY (`exp_key`);

--
-- Indexes for table `expenses_header`
--
ALTER TABLE `expenses_header`
  ADD PRIMARY KEY (`expenses_key`);

--
-- Indexes for table `finance_debtor`
--
ALTER TABLE `finance_debtor`
  ADD PRIMARY KEY (`deb_key`);

--
-- Indexes for table `finance_header`
--
ALTER TABLE `finance_header`
  ADD PRIMARY KEY (`finh_key`);

--
-- Indexes for table `finance_payment_method`
--
ALTER TABLE `finance_payment_method`
  ADD PRIMARY KEY (`fpm_key`);

--
-- Indexes for table `followup_flag`
--
ALTER TABLE `followup_flag`
  ADD PRIMARY KEY (`fuf_key`);

--
-- Indexes for table `items_categories`
--
ALTER TABLE `items_categories`
  ADD PRIMARY KEY (`categories_key`);

--
-- Indexes for table `items_list`
--
ALTER TABLE `items_list`
  ADD PRIMARY KEY (`item_key`);

--
-- Indexes for table `language`
--
ALTER TABLE `language`
  ADD PRIMARY KEY (`language_code`);

--
-- Indexes for table `line_connect`
--
ALTER TABLE `line_connect`
  ADD PRIMARY KEY (`lc_key`);

--
-- Indexes for table `list`
--
ALTER TABLE `list`
  ADD PRIMARY KEY (`cases`);

--
-- Indexes for table `logs`
--
ALTER TABLE `logs`
  ADD PRIMARY KEY (`log_key`);

--
-- Indexes for table `menus`
--
ALTER TABLE `menus`
  ADD PRIMARY KEY (`menu_key`);

--
-- Indexes for table `modules`
--
ALTER TABLE `modules`
  ADD PRIMARY KEY (`mod_key`);

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

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

--
-- Indexes for table `other_charge`
--
ALTER TABLE `other_charge`
  ADD PRIMARY KEY (`oc_key`);

--
-- Indexes for table `other_pay`
--
ALTER TABLE `other_pay`
  ADD PRIMARY KEY (`op_key`);

--
-- Indexes for table `patient`
--
ALTER TABLE `patient`
  ADD PRIMARY KEY (`pat_key`);

--
-- Indexes for table `patient_flag`
--
ALTER TABLE `patient_flag`
  ADD PRIMARY KEY (`ptf_key`);

--
-- Indexes for table `plugins`
--
ALTER TABLE `plugins`
  ADD PRIMARY KEY (`plug_key`);

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

--
-- Indexes for table `report_income_group`
--
ALTER TABLE `report_income_group`
  ADD PRIMARY KEY (`incg_key`);

--
-- Indexes for table `report_income_summary_header`
--
ALTER TABLE `report_income_summary_header`
  ADD PRIMARY KEY (`rish_key`);

--
-- Indexes for table `room`
--
ALTER TABLE `room`
  ADD PRIMARY KEY (`room_key`);

--
-- Indexes for table `salary_employees`
--
ALTER TABLE `salary_employees`
  ADD PRIMARY KEY (`semp_key`);

--
-- Indexes for table `salary_header`
--
ALTER TABLE `salary_header`
  ADD PRIMARY KEY (`salary_key`);

--
-- Indexes for table `salary_other_income`
--
ALTER TABLE `salary_other_income`
  ADD PRIMARY KEY (`soin_key`);

--
-- Indexes for table `salary_other_outcome`
--
ALTER TABLE `salary_other_outcome`
  ADD PRIMARY KEY (`sooc_key`);

--
-- Indexes for table `sell_detail`
--
ALTER TABLE `sell_detail`
  ADD PRIMARY KEY (`ds_key`);

--
-- Indexes for table `sell_header`
--
ALTER TABLE `sell_header`
  ADD PRIMARY KEY (`sellh_key`);

--
-- Indexes for table `sell_temp`
--
ALTER TABLE `sell_temp`
  ADD PRIMARY KEY (`sell_key`);

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

--
-- Indexes for table `system_font_size`
--
ALTER TABLE `system_font_size`
  ADD PRIMARY KEY (`font_key`);

--
-- Indexes for table `system_info`
--
ALTER TABLE `system_info`
  ADD PRIMARY KEY (`site_key`);

--
-- Indexes for table `tooths`
--
ALTER TABLE `tooths`
  ADD PRIMARY KEY (`tooth_key`);

--
-- Indexes for table `treatments`
--
ALTER TABLE `treatments`
  ADD PRIMARY KEY (`treatmentuser_key`);

--
-- Indexes for table `treatments_detail`
--
ALTER TABLE `treatments_detail`
  ADD PRIMARY KEY (`treatd_key`);

--
-- Indexes for table `treatments_doctor`
--
ALTER TABLE `treatments_doctor`
  ADD PRIMARY KEY (`treatsdc_key`);

--
-- Indexes for table `treatments_document`
--
ALTER TABLE `treatments_document`
  ADD PRIMARY KEY (`treatdc_key`);

--
-- Indexes for table `treatments_expense`
--
ALTER TABLE `treatments_expense`
  ADD PRIMARY KEY (`treatex_key`);

--
-- Indexes for table `treatments_header`
--
ALTER TABLE `treatments_header`
  ADD PRIMARY KEY (`treath_key`);

--
-- Indexes for table `treatments_info`
--
ALTER TABLE `treatments_info`
  ADD PRIMARY KEY (`tmi_key`);

--
-- Indexes for table `treatments_tooth`
--
ALTER TABLE `treatments_tooth`
  ADD PRIMARY KEY (`treatt_key`);

--
-- Indexes for table `unit_type`
--
ALTER TABLE `unit_type`
  ADD PRIMARY KEY (`unit_key`);

--
-- Indexes for table `user`
--
ALTER TABLE `user`
  ADD PRIMARY KEY (`user_key`);

--
-- Indexes for table `user_default`
--
ALTER TABLE `user_default`
  ADD PRIMARY KEY (`def_key`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `month`
--
ALTER TABLE `month`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `mstatus`
--
ALTER TABLE `mstatus`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `prefix`
--
ALTER TABLE `prefix`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `sex`
--
ALTER TABLE `sex`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
