<?php
/** ensure this file is being included by a parent file */
defined( '_VALID_' ) or die( 'Direct Access to this location is not allowed.' );
//ส่วนการสร้างตารางระบบย่อย
$sql_create="CREATE TABLE IF NOT EXISTS `person_education_class` (
`id` tinyint(11) NOT NULL auto_increment,
`code` varchar(2) NOT NULL COMMENT 'รหัสรายการ',
`name` varchar(255) NOT NULL COMMENT 'ชื่อรายการ',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6" ;
$query = mysqli_query($connect,$sql_create);
$sql_create="INSERT INTO `person_education_class` (`id`, `code`, `name`) VALUES
(1, '01', 'ปริญญาเอก'),
(2, '02', 'ปริญญาโท'),
(3, '03', 'ปริญญาตรี'),
(4, '04', 'อนุปริญญาหรือเทียบเท่า'),
(5, '05', 'ต่ำกว่าอนุปริญญา')" ;
$query = mysqli_query($connect,$sql_create);
$sql_create="CREATE TABLE IF NOT EXISTS `person_position_class` (
`id` tinyint(11) NOT NULL auto_increment,
`code` varchar(2) NOT NULL COMMENT 'รหัสรายการ',
`name` varchar(255) NOT NULL COMMENT 'ชื่อรายการ',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=9" ;
$query = mysqli_query($connect,$sql_create);
$sql_create="INSERT INTO `person_position_class` (`id`, `code`, `name`) VALUES
(1, '01', 'เชี่ยวชาญพิเศษ'),
(2, '02', 'เชี่ยวชาญ'),
(3, '03', 'ชำนาญการพิเศษ'),
(4, '04', 'ชำนาญการ'),
(5, '05', 'ปฏิบัติงาน'),
(6, '06', 'ชำนาญงาน'),
(7, '07', 'อาวุโส'),
(8, '08', 'ไม่มีวิทยฐานะ')";
$query = mysqli_query($connect,$sql_create);
$sql_create="CREATE TABLE IF NOT EXISTS `person_detail` (
`id` int(11) unsigned NOT NULL auto_increment,
`person_id` varchar(13) NOT NULL,
`position_class` varchar(2) NOT NULL,
`education_class` varchar(2) NOT NULL,
`major` varchar(255) NOT NULL,
`sex` varchar(1) NOT NULL,
`nickname` varchar(50) NOT NULL,
`birth_day` date NOT NULL default '0000-00-00',
`start_day` date NOT NULL default '0000-00-00',
`end_day` date NOT NULL default '0000-00-00',
`email` varchar(255) NOT NULL,
`tel` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE (`person_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1" ;
$query = mysqli_query($connect,$sql_create);
?>