-- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 27, 2014 at 05:31 AM
-- Server version: 5.5.39
-- PHP Version: 5.4.31

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

--
-- Database: `afm_ass`
--

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

--
-- Table structure for table `album`
--

CREATE TABLE IF NOT EXISTS `album` (
`AlbumID` int(4) unsigned zerofill NOT NULL,
  `AlbumName` varchar(100) NOT NULL,
  `AlbumShot` varchar(100) NOT NULL
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

--
-- Dumping data for table `album`
--

INSERT INTO `album` (`AlbumID`, `AlbumName`, `AlbumShot`) VALUES
(0001, 'ดอกไม้', '1.jpg');

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

--
-- Table structure for table `gallery`
--

CREATE TABLE IF NOT EXISTS `gallery` (
`GalleryID` int(4) unsigned zerofill NOT NULL,
  `Gadget_id` int(4) unsigned zerofill NOT NULL,
  `Galleryname` varchar(50) NOT NULL,
  `GalleryShot` varchar(200) NOT NULL
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=47 ;

--
-- Dumping data for table `gallery`
--

INSERT INTO `gallery` (`GalleryID`, `Gadget_id`, `Galleryname`, `GalleryShot`) VALUES
(0045, 0002, '', 'Water lilies.jpg'),
(0038, 0002, '', '2014-11-13-15-14-26Water lilies.jpg'),
(0046, 0002, '', 'Winter.jpg'),
(0041, 0002, '', 'Water lilies.jpg'),
(0042, 0002, '', 'Winter.jpg'),
(0043, 0002, '', 'Blue hills.jpg'),
(0044, 0002, '', 'Sunset.jpg'),
(0034, 0002, '', '2014-11-13-15-10-13Blue hills.jpg'),
(0040, 0002, '', 'Sunset.jpg'),
(0039, 0002, '', 'Blue hills.jpg'),
(0024, 0002, '', 'Sunset.jpg');

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

--
-- Table structure for table `tb_department`
--

CREATE TABLE IF NOT EXISTS `tb_department` (
`Department_id` int(4) unsigned zerofill NOT NULL,
  `Department` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Departmentcode` int(4) unsigned zerofill NOT NULL,
  `Departmentname` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=12 ;

--
-- Dumping data for table `tb_department`
--

INSERT INTO `tb_department` (`Department_id`, `Department`, `Departmentcode`, `Departmentname`) VALUES
(0001, 'Account', 9889, 'บัญชี'),
(0002, 'Purchase', 1379, 'จัดซื้อ'),
(0003, 'Inter', 5555, 'อินเตอร์'),
(0004, 'Human Resources', 4488, 'ทรัพยากรบุคคล'),
(0005, 'Stock', 3995, 'คลังสินค้า'),
(0006, 'Marketing', 2007, 'การตลาด'),
(0007, 'Managing Director', 0000, 'เอ็มดี'),
(0008, 'Information technology', 0070, 'สารสนเทศ'),
(0009, 'Farm', 1111, 'ฟาร์ม'),
(0010, 'Sales', 2222, 'ขาย'),
(0011, 'Customer Service', 3333, 'บริการลูกค้า');

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

--
-- Table structure for table `tb_gadget`
--

CREATE TABLE IF NOT EXISTS `tb_gadget` (
`Gadget_id` int(4) unsigned zerofill NOT NULL,
  `Gadgettype_id` int(4) unsigned zerofill NOT NULL,
  `Brand` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Model` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Date_purchase` date NOT NULL,
  `Amount` int(8) NOT NULL,
  `Unit` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Serial` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Number_repair` int(8) NOT NULL,
  `Gadget_user` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Department_user` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Detail` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=3 ;

--
-- Dumping data for table `tb_gadget`
--

INSERT INTO `tb_gadget` (`Gadget_id`, `Gadgettype_id`, `Brand`, `Model`, `Date_purchase`, `Amount`, `Unit`, `Serial`, `Number_repair`, `Gadget_user`, `Department_user`, `Detail`) VALUES
(0002, 0002, 'DELL', 'HP-340', '2014-11-13', 2, 'เครื่อง', '99HK-346-D789', 4, 'นานา จิดตัง', '0002', 'สวัสดีจ้า อิอิ');

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

--
-- Table structure for table `tb_gadgettype`
--

CREATE TABLE IF NOT EXISTS `tb_gadgettype` (
`Gadgettype_id` int(4) unsigned zerofill NOT NULL,
  `Gadgettype` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=7 ;

--
-- Dumping data for table `tb_gadgettype`
--

INSERT INTO `tb_gadgettype` (`Gadgettype_id`, `Gadgettype`) VALUES
(0001, 'Personal Computer'),
(0002, 'Notebook'),
(0003, 'Printer'),
(0004, 'Projector'),
(0006, 'Monitor');

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

--
-- Table structure for table `tb_user`
--

CREATE TABLE IF NOT EXISTS `tb_user` (
`User_id` int(4) unsigned zerofill NOT NULL,
  `Username` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Password` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Email` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Tel` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Position` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Department` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Image` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `Usertype_id` int(4) unsigned zerofill NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=6 ;

--
-- Dumping data for table `tb_user`
--

INSERT INTO `tb_user` (`User_id`, `Username`, `Password`, `Name`, `Email`, `Tel`, `Position`, `Department`, `Image`, `Usertype_id`) VALUES
(0003, 'admin', '1234', 'ณเดช คุ้กกี้', 'ทฟทฟทฟท@hotmail.com', '7987987', 'นักศึกษาฝึกงาน', '0008', 'noimg.gif', 0001),
(0005, 'asdf', 'asdf', 'asdf', 'asdf@hotmail.com', '897654', '132', '0001', 'noimg.gif', 0001);

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

--
-- Table structure for table `tb_usertype`
--

CREATE TABLE IF NOT EXISTS `tb_usertype` (
`Usertype_id` int(4) unsigned zerofill NOT NULL,
  `Usertype` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=3 ;

--
-- Dumping data for table `tb_usertype`
--

INSERT INTO `tb_usertype` (`Usertype_id`, `Usertype`) VALUES
(0001, 'Admin'),
(0002, 'Guest');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `album`
--
ALTER TABLE `album`
 ADD PRIMARY KEY (`AlbumID`);

--
-- Indexes for table `gallery`
--
ALTER TABLE `gallery`
 ADD PRIMARY KEY (`GalleryID`);

--
-- Indexes for table `tb_department`
--
ALTER TABLE `tb_department`
 ADD PRIMARY KEY (`Department_id`);

--
-- Indexes for table `tb_gadget`
--
ALTER TABLE `tb_gadget`
 ADD PRIMARY KEY (`Gadget_id`);

--
-- Indexes for table `tb_gadgettype`
--
ALTER TABLE `tb_gadgettype`
 ADD PRIMARY KEY (`Gadgettype_id`);

--
-- Indexes for table `tb_user`
--
ALTER TABLE `tb_user`
 ADD PRIMARY KEY (`User_id`);

--
-- Indexes for table `tb_usertype`
--
ALTER TABLE `tb_usertype`
 ADD PRIMARY KEY (`Usertype_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `album`
--
ALTER TABLE `album`
MODIFY `AlbumID` int(4) unsigned zerofill NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `gallery`
--
ALTER TABLE `gallery`
MODIFY `GalleryID` int(4) unsigned zerofill NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=47;
--
-- AUTO_INCREMENT for table `tb_department`
--
ALTER TABLE `tb_department`
MODIFY `Department_id` int(4) unsigned zerofill NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `tb_gadget`
--
ALTER TABLE `tb_gadget`
MODIFY `Gadget_id` int(4) unsigned zerofill NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `tb_gadgettype`
--
ALTER TABLE `tb_gadgettype`
MODIFY `Gadgettype_id` int(4) unsigned zerofill NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `tb_user`
--
ALTER TABLE `tb_user`
MODIFY `User_id` int(4) unsigned zerofill NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `tb_usertype`
--
ALTER TABLE `tb_usertype`
MODIFY `Usertype_id` int(4) unsigned zerofill NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
/*!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 */;
