-- https://www.phpmyadmin.net/
--




--
-- Database: `ewis_hrm`
--

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

--
-- Table structure for table `branch`
--

CREATE TABLE `branch` (
  `branch_id` int(11) NOT NULL,
  `name` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `branch`
--

INSERT INTO `branch` (`branch_id`, `name`) VALUES
(301, 'Kandy'),
(302, 'Kurunagala'),
(303, 'Jaffna');

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

--
-- Table structure for table `employee_attendance`
--

CREATE TABLE `employee_attendance` (
  `eid_id` int(11) NOT NULL,
  `at_date` varchar(50) NOT NULL,
  `lec_nic` varchar(20) NOT NULL,
  `attendance_state` varchar(50) NOT NULL DEFAULT 'T'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `employee_attendance`
--

INSERT INTO `employee_attendance` (`eid_id`, `at_date`, `lec_nic`, `attendance_state`) VALUES
(1, '2018-01-04', '999999999V', 'T'),
(2, '2018-01-04', '444444444V', 'T'),
(3, '2018-01-04', '666666666V', 'T'),
(4, '2018-01-04', '333333333V', 'T'),
(5, '2018-01-04', '888888888V', 'T');

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

--
-- Table structure for table `employee_intern`
--

CREATE TABLE `employee_intern` (
  `ei_id` int(11) NOT NULL,
  `ei_nic` varchar(50) NOT NULL,
  `ei_type` varchar(100) DEFAULT NULL,
  `ei_start_date` varchar(50) DEFAULT NULL,
  `ei_end_date` varchar(50) DEFAULT NULL,
  `ei_current_state` varchar(50) DEFAULT NULL,
  `ei_remark` varchar(350) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `employee_intern`
--

INSERT INTO `employee_intern` (`ei_id`, `ei_nic`, `ei_type`, `ei_start_date`, `ei_end_date`, `ei_current_state`, `ei_remark`) VALUES
(1, '444444444V', 'Intern', '2018-01-04', '2018-07-03', 'T', NULL);

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

--
-- Table structure for table `employee_leave`
--

CREATE TABLE `employee_leave` (
  `el_id` int(250) NOT NULL,
  `emp_nic` varchar(12) NOT NULL,
  `t_type` varchar(50) NOT NULL,
  `leave_type` varchar(350) DEFAULT NULL,
  `l_reason` varchar(350) DEFAULT NULL,
  `leave_from` varchar(50) DEFAULT NULL,
  `leave_to` varchar(50) DEFAULT NULL,
  `day_time` varchar(150) DEFAULT 'Full-Days',
  `added_date` varchar(50) DEFAULT NULL,
  `approval_state` varchar(50) NOT NULL DEFAULT 'F',
  `approved_by` varchar(300) DEFAULT 'PENDING'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `employee_leave`
--

INSERT INTO `employee_leave` (`el_id`, `emp_nic`, `t_type`, `leave_type`, `l_reason`, `leave_from`, `leave_to`, `day_time`, `added_date`, `approval_state`, `approved_by`) VALUES
(1, '666666666V', 'Full-Day', 'Annual Leave', 'qweqewqew', '2018-01-04', '2018-01-04', 'Full-Days', '2018-01-04', 'T', 'Authorized by  , on 2018-01-04. Remarks : '),
(2, '666666666V', 'Full-Day', 'Annual Leave', 'testing annual leave', '2018-01-04', '2018-01-04', 'Full-Days', '2018-01-04', 'T', 'Authorized by I am Admin , on 2018-01-04. Remarks : okay.'),
(3, '666666666V', 'Half-Day', 'Annual Leave', '23r234', '2018-01-04', '2018-01-04', 'Afternoon Half', '2018-01-04', 'T', 'Authorized by I am Admin , on 2018-01-04. Remarks : '),
(4, '666666666V', 'Full-Day', 'Medical Leave', '456', '2018-01-04', '2018-01-04', 'Full-Days', '2018-01-04', 'T', 'Authorized by I am Admin , on 2018-01-04. Remarks : t'),
(5, '888888888V', 'Full-Day', 'Annual Leave', '1231321321', '2018-01-04', '2018-01-05', 'Full-Days', '2018-01-04', 'T', 'Authorized by I am Admin , on 2018-01-04. Remarks : 132'),
(6, '444444444V', 'Full-Day', 'Annual Leave', '456', '2018-01-04', '2018-01-05', 'Full-Days', '2018-01-04', 'T', 'Authorized by I am Admin , on 2018-01-04. Remarks : qweqweqweqwe'),
(7, '444444444V', 'Short-Leave', 'Annual Leave', 'qwe', '2018-01-04', '2018-01-04', 'Afternoon Half', '2018-01-04', 'T', 'Authorized by I am Admin , on 2018-01-04. Remarks : g'),
(8, '444444444V', 'Half-Day', 'Casual Leave', 'test dfkjdshfdsjkhfdskjfh', '2018-01-04', '2018-01-04', 'Morning Half', '2018-01-04', 'T', 'Authorized by I am Admin , on 2018-01-04. Remarks : qweqewq');

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

--
-- Table structure for table `employee_promotions`
--

CREATE TABLE `employee_promotions` (
  `ep_id` int(200) NOT NULL,
  `emp_nic` varchar(12) NOT NULL,
  `emp_post` varchar(150) DEFAULT NULL,
  `worked_from` varchar(50) DEFAULT NULL,
  `worked_to` varchar(50) DEFAULT NULL,
  `e_salary` varchar(50) DEFAULT NULL,
  `emp_state` varchar(200) NOT NULL DEFAULT 'Active'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `employee_promotions`
--

INSERT INTO `employee_promotions` (`ep_id`, `emp_nic`, `emp_post`, `worked_from`, `worked_to`, `e_salary`, `emp_state`) VALUES
(1, '999999999V', 'RootAdmin', '2017-12-26', 'Present', '123456', 'Active'),
(2, '777777777V', 'Academic Manager', '2018-01-04', 'Present', '1500', 'Active'),
(3, '444444444V', 'Intern', '2018-01-04', 'Present', '1500', 'Active'),
(4, '666666666V', 'Lecturer', '2018-01-04', '2018-01-04', '1500', 'Promoted'),
(5, '333333333V', 'Admin', '2018-01-04', 'Present', '15000', 'Active'),
(6, '888888888V', 'Senior Lecturer', '2018-01-04', 'Present', '12500', 'Active'),
(7, '666666666V', 'Senior Lecturer', '2018-01-04', '2018-01-04', '2000', 'Retired');

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

--
-- Table structure for table `employee_qualifications`
--

CREATE TABLE `employee_qualifications` (
  `eq_id` int(200) NOT NULL,
  `emp_nic` varchar(12) NOT NULL,
  `q_type` varchar(50) DEFAULT NULL,
  `q_des` longtext,
  `q_date` varchar(50) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `employee_qualifications`
--

INSERT INTO `employee_qualifications` (`eq_id`, `emp_nic`, `q_type`, `q_des`, `q_date`) VALUES
(1, '666666666V', 'Academic', 'fdsafdsadfs  tre', '2018-01-04');

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

--
-- Table structure for table `employee_res`
--

CREATE TABLE `employee_res` (
  `er_id` int(200) NOT NULL,
  `emp_nic` varchar(12) NOT NULL,
  `re_date` varchar(50) DEFAULT NULL,
  `re_type` varchar(100) DEFAULT NULL,
  `re_reason` longtext,
  `n_state` varchar(50) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `employee_res`
--

INSERT INTO `employee_res` (`er_id`, `emp_nic`, `re_date`, `re_type`, `re_reason`, `n_state`) VALUES
(1, '666666666V', '2018-01-04', 'Retirement', 'i am tfkjdsfs\r\ncsa\r\nsad\r\nsa\r\ndsd', 'T');

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

--
-- Table structure for table `employee_salary`
--

CREATE TABLE `employee_salary` (
  `es_id` int(200) NOT NULL,
  `emp_nic` varchar(12) NOT NULL,
  `salary` varchar(50) NOT NULL,
  `last_updated` varchar(100) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `employee_salary`
--

INSERT INTO `employee_salary` (`es_id`, `emp_nic`, `salary`, `last_updated`) VALUES
(1, '999999999V', '123456', '2017-12-26'),
(2, '777777777V', '1500', '2018-01-04'),
(3, '444444444V', '1500', '2018-01-04'),
(4, '666666666V', '2000', '2018-01-04'),
(5, '333333333V', '15000', '2018-01-04'),
(6, '888888888V', '12500', '2018-01-04');

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

--
-- Table structure for table `employee_types`
--

CREATE TABLE `employee_types` (
  `et_id` int(200) NOT NULL,
  `t_type` varchar(100) NOT NULL,
  `t_value` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `employee_types`
--

INSERT INTO `employee_types` (`et_id`, `t_type`, `t_value`) VALUES
(1, 'Staff', 'Staff'),
(2, 'Lab Assistance', 'Lab_Assistance'),
(3, 'Lecturer', 'Lecturer'),
(4, 'Senior Lecturer', 'Senior_Lecturer'),
(5, 'Academic Manager', 'Academic_Manager'),
(6, 'Intern', 'Intern'),
(7, 'Admin', 'Admin');

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

--
-- Table structure for table `meeting_minutes`
--

CREATE TABLE `meeting_minutes` (
  `mmid` int(250) NOT NULL,
  `meeting_date` varchar(50) NOT NULL,
  `minutes` longtext NOT NULL,
  `next_meeting` varchar(50) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `meeting_minutes`
--

INSERT INTO `meeting_minutes` (`mmid`, `meeting_date`, `minutes`, `next_meeting`) VALUES
(1, '2018-01-18', 'jhgfhjgfgfh\r\nhgdhgfd', '2018-01-04');

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

--
-- Table structure for table `meeting_schedules`
--

CREATE TABLE `meeting_schedules` (
  `ms_id` int(250) NOT NULL,
  `meeting_date` varchar(50) NOT NULL,
  `m_time` varchar(50) DEFAULT NULL,
  `m_venue` varchar(150) DEFAULT NULL,
  `meeting_state` varchar(250) DEFAULT NULL,
  `meeting_info` varchar(500) DEFAULT NULL,
  `m_emp_type` varchar(100) DEFAULT NULL,
  `m_branch_id` varchar(50) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `meeting_schedules`
--

INSERT INTO `meeting_schedules` (`ms_id`, `meeting_date`, `m_time`, `m_venue`, `meeting_state`, `meeting_info`, `m_emp_type`, `m_branch_id`) VALUES
(1, '2018-01-04', '15:00', 'Main Office', 'A new meeting has been scheduled.', 'testinggfghf', 'all_employees', '301');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `branch`
--
ALTER TABLE `branch`
  ADD PRIMARY KEY (`branch_id`);

--
-- Indexes for table `employee_attendance`
--
ALTER TABLE `employee_attendance`
  ADD PRIMARY KEY (`eid_id`);

--
-- Indexes for table `employee_intern`
--
ALTER TABLE `employee_intern`
  ADD PRIMARY KEY (`ei_id`);

--
-- Indexes for table `employee_leave`
--
ALTER TABLE `employee_leave`
  ADD PRIMARY KEY (`el_id`);

--
-- Indexes for table `employee_promotions`
--
ALTER TABLE `employee_promotions`
  ADD PRIMARY KEY (`ep_id`);

--
-- Indexes for table `employee_qualifications`
--
ALTER TABLE `employee_qualifications`
  ADD PRIMARY KEY (`eq_id`);

--
-- Indexes for table `employee_res`
--
ALTER TABLE `employee_res`
  ADD PRIMARY KEY (`er_id`);

--
-- Indexes for table `employee_salary`
--
ALTER TABLE `employee_salary`
  ADD PRIMARY KEY (`es_id`);

--
-- Indexes for table `employee_types`
--
ALTER TABLE `employee_types`
  ADD PRIMARY KEY (`et_id`);

--
-- Indexes for table `meeting_minutes`
--
ALTER TABLE `meeting_minutes`
  ADD PRIMARY KEY (`mmid`);

--
-- Indexes for table `meeting_schedules`
--
ALTER TABLE `meeting_schedules`
  ADD PRIMARY KEY (`ms_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `branch`
--
ALTER TABLE `branch`
  MODIFY `branch_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=304;
--
-- AUTO_INCREMENT for table `employee_attendance`
--
ALTER TABLE `employee_attendance`
  MODIFY `eid_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `employee_intern`
--
ALTER TABLE `employee_intern`
  MODIFY `ei_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `employee_leave`
--
ALTER TABLE `employee_leave`
  MODIFY `el_id` int(250) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `employee_promotions`
--
ALTER TABLE `employee_promotions`
  MODIFY `ep_id` int(200) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `employee_qualifications`
--
ALTER TABLE `employee_qualifications`
  MODIFY `eq_id` int(200) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `employee_res`
--
ALTER TABLE `employee_res`
  MODIFY `er_id` int(200) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `employee_salary`
--
ALTER TABLE `employee_salary`
  MODIFY `es_id` int(200) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `employee_types`
--
ALTER TABLE `employee_types`
  MODIFY `et_id` int(200) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `meeting_minutes`
--
ALTER TABLE `meeting_minutes`
  MODIFY `mmid` int(250) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `meeting_schedules`
--
ALTER TABLE `meeting_schedules`
  MODIFY `ms_id` int(250) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
