-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 05, 2021 at 11:12 AM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 8.0.7

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `tmisdb`
--

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

--
-- Table structure for table `academic_history`
--

CREATE TABLE `academic_history` (
  `id` bigint(20) NOT NULL,
  `person_id` varchar(100) NOT NULL,
  `institution` varchar(100) NOT NULL,
  `institution_type` varchar(100) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `certificate_name` varchar(300) NOT NULL,
  `certificate_number` varchar(100) NOT NULL,
  `is_highest` enum('Y','N') NOT NULL DEFAULT 'N',
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=155 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `academic_history`
--

INSERT INTO `academic_history` (`id`, `person_id`, `institution`, `institution_type`, `start_date`, `end_date`, `certificate_name`, `certificate_number`, `is_highest`, `date_added`, `added_by`) VALUES
(4, '981', 'Makerere', 'University', '2018-07-01', '2021-07-01', 'PhD Codeignite', '585325', 'Y', '2021-07-03 01:17:03', '974'),
(6, '982', 'Georgia State University', 'University', '2005-08-01', '2009-01-01', 'MSc Civil Engineering', '453234YU', 'Y', '2021-07-03 03:13:36', '975'),
(7, '983', 'Georgia State University', 'University', '2001-08-01', '2005-01-01', 'Bachelors', '78343', 'Y', '2021-07-03 12:08:48', '976');

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

--
-- Table structure for table `address`
--

CREATE TABLE `address` (
  `id` bigint(20) NOT NULL,
  `parent_id` varchar(100) NOT NULL,
  `parent_type` varchar(100) NOT NULL,
  `address_type` enum('physical','postal') NOT NULL DEFAULT 'physical',
  `importance` varchar(100) NOT NULL,
  `is_primary` enum('Y','N') NOT NULL DEFAULT 'Y',
  `details` varchar(500) NOT NULL,
  `county` varchar(100) NOT NULL,
  `district_id` varchar(100) NOT NULL,
  `country_id` varchar(100) NOT NULL,
  `zipcode` varchar(10) NOT NULL,
  `direction_notes` text NOT NULL,
  `status` enum('pending','active','verified','inactive') NOT NULL DEFAULT 'pending',
  `date_added` datetime NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=110 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `address`
--

INSERT INTO `address` (`id`, `parent_id`, `parent_type`, `address_type`, `importance`, `is_primary`, `details`, `county`, `district_id`, `country_id`, `zipcode`, `direction_notes`, `status`, `date_added`) VALUES
(1, '977', 'person', 'physical', 'birthplace', 'Y', 'Plot 12 Kira Road', 'Bukoto Mid West', '30', '219', '', '', 'pending', '2021-07-01 16:08:13'),
(2, '978', 'person', 'physical', 'birthplace', 'Y', 'Plot 12 Kira Road', 'Bukoto Mid West', '30', '219', '', '', 'pending', '2021-07-01 16:19:55'),
(3, '979', 'person', 'physical', 'birthplace', 'Y', 'Plot 12 Kira Road', 'Bukoto Mid West', '30', '219', '', '', 'pending', '2021-07-01 16:20:20'),
(4, '980', 'person', 'physical', 'birthplace', 'Y', 'Plot 12 Kira Road', 'Bukoto Mid West', '30', '219', '', '', 'pending', '2021-07-01 16:24:02'),
(5, '981', 'person', 'physical', 'birthplace', 'Y', 'Plot 12 Kira Road', 'Bukoto Mid West', '30', '219', '', '', 'pending', '2021-07-01 16:36:12'),
(6, '981', 'person', 'physical', 'permanent', 'Y', 'Plot 10 Kamoli', 'Kagoma', '56', '219', '', '', 'pending', '2021-07-01 16:49:07'),
(7, '981', 'person', 'physical', 'contact', 'Y', 'Plot 300', 'Samia Bugwe South', '43', '219', '', '', 'pending', '2021-07-01 16:49:08'),
(16, '17', 'person', 'physical', 'contact', 'Y', 'Plot 20', 'Hoima Municipality', '49', '219', '', '', 'pending', '2021-07-01 20:47:57'),
(19, '22', 'person', 'physical', 'contact', 'Y', 'Plot 23', 'Iganga M.C', '55', '219', '', '', 'pending', '2021-07-01 21:23:59'),
(51, '982', 'person', 'physical', 'birthplace', 'Y', 'Savannah', 'Atalanta', 'Gergia', '223', '', '', 'pending', '2021-07-03 03:02:42'),
(52, '982', 'person', 'physical', 'permanent', 'Y', 'Avondale Estates', 'Atalanta', 'Georgia', '223', '', '', 'pending', '2021-07-03 03:05:36'),
(53, '982', 'person', 'physical', 'contact', 'Y', 'Avondale Estates', 'Atalanta', 'Georgia', '223', '', '', 'pending', '2021-07-03 03:05:36'),
(58, '983', 'person', 'physical', 'birthplace', 'Y', 'GA 30302', 'Atalanta', 'Georgia', '223', '', '', 'pending', '2021-07-03 12:01:35'),
(59, '983', 'person', 'physical', 'permanent', 'Y', '7D336 GA', 'Atalanta', 'Georgia', '219', '', '', 'pending', '2021-07-03 12:06:02'),
(60, '983', 'person', 'physical', 'contact', 'Y', '7D336 GA', 'Atalanta', 'Georgia', '219', '', '', 'pending', '2021-07-03 12:06:02');

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

--
-- Table structure for table `application`
--

CREATE TABLE `application` (
  `id` bigint(20) NOT NULL,
  `vacancy_id` varchar(100) NOT NULL,
  `status` enum('saved','submitted','shortlisted','awarded','rejected','archived') NOT NULL DEFAULT 'saved',
  `user_id` varchar(100) NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime NOT NULL,
  `last_updated_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=862 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `approval_chain`
--

CREATE TABLE `approval_chain` (
  `id` bigint(20) NOT NULL,
  `chain_type` varchar(100) NOT NULL,
  `step_number` varchar(10) NOT NULL,
  `max_steps` int(11) NOT NULL,
  `subject_id` varchar(100) NOT NULL,
  `originator_id` varchar(100) NOT NULL,
  `approver_id` varchar(500) NOT NULL,
  `actual_approver` varchar(100) NOT NULL,
  `status` enum('pending','approved','rejected','confirmed','certified') NOT NULL DEFAULT 'pending',
  `comment` varchar(500) NOT NULL,
  `date_created` datetime NOT NULL,
  `last_updated` datetime DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB AVG_ROW_LENGTH=195 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `approval_chain`
--

INSERT INTO `approval_chain` (`id`, `chain_type`, `step_number`, `max_steps`, `subject_id`, `originator_id`, `approver_id`, `actual_approver`, `status`, `comment`, `date_created`, `last_updated`) VALUES
(1, 'registration', '1', 4, '974', '974', '974', '974', 'pending', 'Application Submitted', '2021-07-03 00:14:53', '2021-07-03 02:54:02'),
(2, 'registration', '2', 4, '974', '974', '25', '86', 'approved', 'Glory Hallelujah', '2021-07-03 02:54:55', NULL),
(3, 'registration', '1', 4, '976', '', '20,86', '976', 'approved', 'New application Submitted.', '2021-07-03 12:09:12', NULL),
(4, 'registration', '2', 4, '976', '976', '25', '86', 'approved', 'Old Church Basement', '2021-07-03 12:10:03', NULL),
(5, 'registration', '3', 4, '974', '86', '971', '25', 'approved', 'This is my before and after; I was dead and I am alive.', '2021-07-05 11:23:16', NULL);

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

--
-- Table structure for table `approval_chain_scope`
--

CREATE TABLE `approval_chain_scope` (
  `id` bigint(20) NOT NULL,
  `approver` varchar(100) NOT NULL,
  `scope` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=1024 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `approval_chain_scope`
--

INSERT INTO `approval_chain_scope` (`id`, `approver`, `scope`) VALUES
(1, 'applicant', ''),
(2, 'teacher', 'self'),
(3, 'data', 'self'),
(4, 'manager', 'institution'),
(5, 'cao', 'county'),
(6, 'deo', 'district'),
(7, 'dsc', 'district'),
(8, 'mops', 'country'),
(9, 'moes', 'country'),
(10, 'psc', 'country'),
(11, 'hr', 'country'),
(12, 'tiet', 'country'),
(13, 'admin', 'system'),
(14, 'esc', 'country'),
(15, 'tiet_officer', 'country'),
(16, 'tiet_commissioner', 'country');

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

--
-- Table structure for table `approval_chain_setting`
--

CREATE TABLE `approval_chain_setting` (
  `id` bigint(20) NOT NULL,
  `chain_type` varchar(100) NOT NULL,
  `step_number` int(11) NOT NULL,
  `max_steps` int(11) NOT NULL,
  `originators` varchar(300) NOT NULL,
  `approvers` varchar(300) NOT NULL,
  `step_actions` varchar(500) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=564 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `approval_chain_setting`
--

INSERT INTO `approval_chain_setting` (`id`, `chain_type`, `step_number`, `max_steps`, `originators`, `approvers`, `step_actions`) VALUES
(1, 'vacancy', 1, 3, '', 'admin,moes,deo', 'notify_next_chain_party'),
(2, 'vacancy', 2, 3, 'admin,moes,deo', 'mops', 'notify_previous_and_next_chain_parties'),
(3, 'vacancy', 3, 3, 'mops', 'admin,esc', 'publish_job_notice,notify_previous_chain_parties'),
(4, 'confirmation', 1, 3, '', 'teacher', 'notify_next_chain_party'),
(5, 'confirmation', 2, 3, 'teacher', 'moes,cao', 'issue_confirmation_letter,notify_previous_and_next_chain_parties'),
(6, 'confirmation', 3, 3, 'moes,cao', 'esc,dsc', 'notify_previous_chain_parties'),
(7, 'registration', 1, 4, '', 'admin,data,hr,teacher', 'notify_next_chain_party'),
(8, 'registration', 2, 4, 'admin,data,hr,teacher', 'hr', 'issue_file_number'),
(9, 'registration', 3, 4, 'hr', 'tiet,tiet_officer', 'save_registration_certificate,notify_next_chain_party'),
(10, 'transfer', 1, 5, '', 'teacher,manager', 'notify_next_chain_party'),
(11, 'transfer', 2, 5, 'teacher,manager', 'manager', 'notify_previous_and_next_chain_parties'),
(12, 'transfer', 3, 5, 'manager', 'moes,cao', 'issue_transfer_letter,change_teacher_posting,notify_previous_and_next_chain_parties'),
(13, 'transfer', 4, 5, 'moes,cao', 'manager', 'submit_transfer_pca,notify_previous_and_next_chain_parties'),
(14, 'transfer', 5, 5, 'manager', 'psc', 'confirm_transfer,notify_previous_chain_parties'),
(15, 'leave', 1, 4, '', 'teacher,manager', 'notify_next_chain_party'),
(16, 'leave', 2, 4, 'teacher,manager', 'moes,cao', 'notify_previous_and_next_chain_parties'),
(17, 'leave', 3, 4, 'moes,cao', 'esc,dsc', 'notify_previous_and_next_chain_parties'),
(18, 'leave', 4, 4, 'esc,dsc', 'moes,cao', 'send_verification_letter,notify_previous_chain_parties'),
(19, 'retirement', 1, 2, '', 'teacher,manager', 'notify_next_chain_party'),
(20, 'retirement', 2, 2, 'teacher,manager', 'manager', 'confirm_retirement,notify_previous_chain_parties'),
(21, 'secrecy', 1, 2, '', 'teacher', 'notify_next_chain_party'),
(22, 'secrecy', 2, 2, 'teacher', 'admin,esc,dsc', 'apply_data_secrecy,notify_previous_chain_parties'),
(23, 'data', 1, 2, '', 'admin,data', 'notify_next_chain_party'),
(24, 'data', 2, 2, 'admin,data', 'admin', 'activate_data_records,notify_previous_chain_parties'),
(25, 'recommendation', 1, 2, '', 'manager', 'notify_next_chain_party'),
(26, 'recommendation', 2, 2, 'manager', 'esc,dsc', 'notify_previous_chain_parties'),
(27, 'census', 1, 2, '', 'manager', 'notify_next_chain_party'),
(28, 'census', 2, 2, 'manager', 'moes,cao', 'notify_previous_chain_parties'),
(29, 'registration', 4, 4, 'tiet_officer', 'tiet_commissioner', 'issue_registration_certificate,notify_previous_chain_parties');

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

--
-- Table structure for table `carrier`
--

CREATE TABLE `carrier` (
  `id` bigint(20) NOT NULL,
  `name` varchar(300) NOT NULL,
  `displayed_name` varchar(300) NOT NULL,
  `country_code` varchar(10) NOT NULL,
  `sms_email_domain` varchar(300) NOT NULL,
  `mms_email_domain` varchar(300) NOT NULL,
  `number_stubs` text NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=2340 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `carrier`
--

INSERT INTO `carrier` (`id`, `name`, `displayed_name`, `country_code`, `sms_email_domain`, `mms_email_domain`, `number_stubs`) VALUES
(1, 'mtn', 'MTN Uganda', '256', 'mtn.co.ug', 'mtn.co.ug', '077,078'),
(2, 'airtel', 'Airtel Uganda', '256', 'ug.airtel.com', 'ug.airtel.com', '070,075'),
(3, 'utl', 'Uganda Telecom', '256', 'utl.co.ug', 'utl.co.ug', '071'),
(4, 'orange', 'Orange Uganda', '256', 'orange.ug', 'orange.ug', '079'),
(7, 'k2', 'K2 Telecom', '256', '', '', '073'),
(8, 'smart', 'Smart Telecom Uganda', '256', 'smart.ug', 'smart.ug', '074'),
(9, 'vodafone', 'Vodafone Uganda', '256', 'vodafone.co.ug', 'vodafone.co.ug', '076');

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

--
-- Table structure for table `census`
--

CREATE TABLE `census` (
  `id` bigint(20) NOT NULL,
  `teacher_id` varchar(100) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `weekly_workload_average` varchar(100) NOT NULL,
  `status` enum('pending','active','inactive') NOT NULL DEFAULT 'pending',
  `added_by` varchar(100) NOT NULL,
  `date_added` datetime NOT NULL,
  `last_updated_by` varchar(100) NOT NULL,
  `last_updated` datetime NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=2730 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `census_responsibility`
--

CREATE TABLE `census_responsibility` (
  `id` bigint(20) NOT NULL,
  `census_id` varchar(100) NOT NULL,
  `responsibility_id` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=2340 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `census_training`
--

CREATE TABLE `census_training` (
  `id` bigint(20) NOT NULL,
  `census_id` varchar(100) NOT NULL,
  `training_id` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=1489 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `contact`
--

CREATE TABLE `contact` (
  `id` bigint(20) NOT NULL,
  `contact_type` varchar(100) NOT NULL,
  `carrier_id` varchar(100) NOT NULL,
  `details` varchar(300) NOT NULL,
  `parent_id` varchar(100) NOT NULL,
  `parent_type` varchar(100) NOT NULL,
  `date_added` datetime NOT NULL,
  `is_primary` enum('Y','N') NOT NULL DEFAULT 'Y',
  `status` enum('active','inactive') NOT NULL DEFAULT 'active'
) ENGINE=InnoDB AVG_ROW_LENGTH=109 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `contact`
--

INSERT INTO `contact` (`id`, `contact_type`, `carrier_id`, `details`, `parent_id`, `parent_type`, `date_added`, `is_primary`, `status`) VALUES
(24, 'email', '', 'admin@tmis.go.ug', '17', 'person', '2015-01-19 08:47:37', 'Y', 'active'),
(27, 'telephone', '', '0772423377', '17', 'person', '2015-01-21 13:37:11', 'Y', 'active'),
(55, 'email', '', 'moes@tmis.go.ug', '22', 'person', '2015-01-31 08:35:59', 'Y', 'active'),
(56, 'telephone', '', '0782342342', '22', 'person', '2015-01-31 08:35:59', 'Y', 'active'),
(57, 'email', '', 'cim@tmis.go.ug', '23', 'person', '2015-01-31 11:23:55', 'Y', 'active'),
(58, 'telephone', '', '0771854213', '23', 'person', '2015-01-31 11:23:55', 'Y', 'active'),
(69, 'email', '', 'tiet@tmis.go.ug', '29', 'person', '2015-02-02 18:24:08', 'Y', 'active'),
(70, 'telephone', '', '0772342342', '29', 'person', '2015-02-02 18:24:08', 'Y', 'active'),
(75, 'email', '', 'mops@tmis.go.ug', '32', 'person', '2015-02-03 22:54:33', 'Y', 'active'),
(76, 'telephone', '', '0772123123', '32', 'person', '2015-02-03 22:54:33', 'Y', 'active'),
(77, 'email', '', 'esc@tmis.go.ug', '33', 'person', '2015-02-04 21:55:36', 'Y', 'active'),
(78, 'telephone', '', '0772342342', '33', 'person', '2015-02-04 21:55:36', 'Y', 'active'),
(82, 'email', '', 'manager@tmis.go.ug', '36', 'person', '2015-02-05 12:06:55', 'Y', 'active'),
(83, 'telephone', '', '0774678234', '36', 'person', '2015-02-05 12:06:55', 'Y', 'active'),
(84, 'email', '', 'cao@tmis.go.ug', '37', 'person', '2015-02-06 12:32:06', 'Y', 'active'),
(85, 'telephone', '', '0773423423', '37', 'person', '2015-02-06 12:32:06', 'Y', 'active'),
(168, 'email', '', 'hrjanette@gmail.com', '90', 'person', '2015-05-19 06:58:59', 'Y', 'active'),
(897, 'email', '', 'valentine.owor14@hotmail.com', '572', 'person', '2018-08-24 13:27:18', 'Y', 'active'),
(898, 'telephone', '', '0774818606', '572', 'person', '2018-08-24 13:27:18', 'Y', 'active'),
(934, 'email', '', 'nabbona21@gmail.com', '598', 'person', '2018-09-19 10:21:01', 'Y', 'active'),
(1657, 'email', '', 'ndyabahikaweb@ymail.com', '975', 'person', '2018-10-12 15:16:22', 'Y', 'active'),
(1658, 'telephone', '', '0772514531', '975', 'person', '2018-10-12 15:16:22', 'Y', 'active'),
(1659, 'email', '', 'deuson@muto.com', '977', 'person', '2021-07-01 16:08:13', 'Y', 'active'),
(1660, 'email', '', 'deuson2@muto.com', '978', 'person', '2021-07-01 16:19:55', 'Y', 'active'),
(1661, 'email', '', 'deuson67@muto.com', '979', 'person', '2021-07-01 16:20:20', 'Y', 'active'),
(1662, 'email', '', 'deuson88@muto.com', '980', 'person', '2021-07-01 16:24:01', 'Y', 'active'),
(1663, 'email', '', 'deuson8@muto.com', '981', 'person', '2021-07-01 16:36:12', 'Y', 'active'),
(1664, 'email', '', 'dbowe@tmis.go.ug', '982', 'person', '2021-07-03 03:02:42', 'Y', 'active'),
(1665, 'email', '', 'dbowe@maverick.com', '983', 'person', '2021-07-03 12:01:34', 'Y', 'active'),
(1666, 'email', '', 'slimdaddy@tmis.go.ug', '984', 'person', '2021-07-03 15:14:53', 'Y', 'active');

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

--
-- Table structure for table `country`
--

CREATE TABLE `country` (
  `id` bigint(20) NOT NULL,
  `name` varchar(200) NOT NULL,
  `region` varchar(100) NOT NULL,
  `display_order` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB AVG_ROW_LENGTH=70 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `country`
--

INSERT INTO `country` (`id`, `name`, `region`, `display_order`) VALUES
(1, 'Afghanistan', 'Asia', 0),
(2, 'Albania', 'Europe', 0),
(3, 'Algeria', 'Africa', 0),
(4, 'American Samoa', 'Australasia', 0),
(5, 'Andorra', 'Europe', 0),
(6, 'Angola', 'Africa', 0),
(7, 'Anguilla', 'Caribbean', 0),
(8, 'Antigua and Barbuda', 'Caribbean', 0),
(9, 'Argentina', 'South America', 0),
(10, 'Armenia', 'Europe', 0),
(11, 'Aruba', 'Caribbean', 0),
(12, 'Australia', 'Australasia', 0),
(13, 'Austria', 'Europe', 0),
(14, 'Azerbaijan', 'Europe', 0),
(15, 'Bahamas', 'Caribbean', 0),
(16, 'Bahrain', 'Middle East', 0),
(17, 'Bangladesh', 'Asia', 0),
(18, 'Barbados', 'Caribbean', 0),
(19, 'Belarus', 'Europe', 0),
(20, 'Belgium', 'Europe', 0),
(21, 'Belize', 'North America', 0),
(22, 'Benin', 'Africa', 0),
(23, 'Bermuda', 'Caribbean', 0),
(24, 'Bhutan', 'Asia', 0),
(25, 'Bolivia', 'South America', 0),
(26, 'Bosnia-Herzegovina', 'Europe', 0),
(27, 'Botswana', 'Africa', 0),
(28, 'Bouvet Island', 'Africa', 0),
(29, 'Brazil', 'South America', 0),
(30, 'Brunei', 'Asia', 0),
(31, 'Bulgaria', 'Europe', 0),
(32, 'Burkina Faso', 'Africa', 0),
(33, 'Burundi', 'Africa', 0),
(34, 'Cambodia', 'Asia', 0),
(35, 'Cameroon', 'Africa', 0),
(36, 'Canada', 'North America', 0),
(37, 'Cape Verde', 'Africa', 0),
(38, 'Cayman Islands', 'Caribbean', 0),
(39, 'Central African Republic', 'Africa', 0),
(40, 'Chad', 'Africa', 0),
(41, 'Chile', 'South America', 0),
(42, 'China', 'Asia', 0),
(43, 'Christmas Island', 'Australasia', 0),
(44, 'Cocos (Keeling) Islands', 'Australasia', 0),
(45, 'Colombia', 'South America', 0),
(46, 'Comoros', 'Africa', 0),
(47, 'Congo, Democratic Republic of the (Zaire)', 'Africa', 1),
(48, 'Congo, Republic of', 'Africa', 0),
(49, 'Cook Islands', 'Australasia', 0),
(50, 'Costa Rica', 'North America', 0),
(51, 'Croatia', 'Europe', 0),
(52, 'Cuba', 'Caribbean', 0),
(53, 'Cyprus', 'Europe', 0),
(54, 'Czech Republic', 'Europe', 0),
(55, 'Denmark', 'Europe', 0),
(56, 'Djibouti', 'Africa', 0),
(57, 'Dominica', 'Caribbean', 0),
(58, 'Dominican Republic', 'Caribbean', 0),
(59, 'Ecuador', 'South America', 0),
(60, 'Egypt', 'Africa', 0),
(61, 'El Salvador', 'North America', 0),
(62, 'Equatorial Guinea', 'Africa', 0),
(63, 'Eritrea', 'Africa', 0),
(64, 'Estonia', 'Europe', 0),
(65, 'Ethiopia', 'Africa', 0),
(66, 'Falkland Islands', 'South America', 0),
(67, 'Faroe Islands', 'Europe', 0),
(68, 'Fiji', 'Australasia', 0),
(69, 'Finland', 'Europe', 0),
(70, 'France', 'Europe', 0),
(71, 'French Guiana', 'South America', 0),
(72, 'Gabon', 'Africa', 0),
(73, 'Gambia', 'Africa', 0),
(74, 'Georgia', 'Europe', 0),
(75, 'Germany', 'Europe', 0),
(76, 'Ghana', 'Africa', 0),
(77, 'Gibraltar', 'Europe', 0),
(78, 'Greece', 'Europe', 0),
(79, 'Greenland', 'Europe', 0),
(80, 'Grenada', 'Caribbean', 0),
(81, 'Guadeloupe (French)', 'Caribbean', 0),
(82, 'Guam (USA)', 'Australasia', 0),
(83, 'Guatemala', 'North America', 0),
(84, 'Guinea', 'Africa', 0),
(85, 'Guinea Bissau', 'Africa', 0),
(86, 'Guyana', 'South America', 0),
(87, 'Haiti', 'Caribbean', 0),
(88, 'Holy See', 'Europe', 0),
(89, 'Honduras', 'North America', 0),
(90, 'Hong Kong', 'Asia', 0),
(91, 'Hungary', 'Europe', 0),
(92, 'Iceland', 'Europe', 0),
(93, 'India', 'Asia', 0),
(94, 'Indonesia', 'Asia', 0),
(95, 'Iran', 'Middle East', 0),
(96, 'Iraq', 'Middle East', 0),
(97, 'Ireland', 'Europe', 0),
(98, 'Israel', 'Middle East', 0),
(99, 'Italy', 'Europe', 0),
(100, 'Ivory Coast (Cote D`Ivoire)', 'Africa', 0),
(101, 'Jamaica', 'Caribbean', 0),
(102, 'Japan', 'Asia', 0),
(103, 'Jordan', 'Middle East', 0),
(104, 'Kazakhstan', 'Asia', 0),
(105, 'Kenya', 'Africa', 2),
(106, 'Kiribati', 'Australasia', 0),
(107, 'Kuwait', 'Middle East', 0),
(108, 'Kyrgyzstan', 'Asia', 0),
(109, 'Laos', 'Asia', 0),
(110, 'Latvia', 'Europe', 0),
(111, 'Lebanon', 'Middle East', 0),
(112, 'Lesotho', 'Africa', 0),
(113, 'Liberia', 'Africa', 0),
(114, 'Libya', 'Africa', 0),
(115, 'Liechtenstein', 'Europe', 0),
(116, 'Lithuania', 'Europe', 0),
(117, 'Luxembourg', 'Europe', 0),
(118, 'Macau', 'Asia', 0),
(119, 'Macedonia', 'Europe', 0),
(120, 'Madagascar', 'Africa', 0),
(121, 'Malawi', 'Africa', 0),
(122, 'Malaysia', 'Asia', 0),
(123, 'Maldives', 'Asia', 0),
(124, 'Mali', 'Africa', 0),
(125, 'Malta', 'Europe', 0),
(126, 'Marshall Islands', 'Australasia', 0),
(127, 'Martinique (French)', 'Caribbean', 0),
(128, 'Mauritania', 'Africa', 0),
(129, 'Mauritius', 'Africa', 0),
(130, 'Mayotte', 'Africa', 0),
(131, 'Mexico', 'North America', 0),
(132, 'Micronesia', 'Australasia', 0),
(133, 'Moldova', 'Europe', 0),
(134, 'Monaco', 'Europe', 0),
(135, 'Mongolia', 'Asia', 0),
(136, 'Montenegro', 'Europe', 0),
(137, 'Montserrat', 'Caribbean', 0),
(138, 'Morocco', 'Africa', 0),
(139, 'Mozambique', 'Africa', 0),
(140, 'Myanmar', 'Asia', 0),
(141, 'Namibia', 'Africa', 0),
(142, 'Nauru', 'Australasia', 0),
(143, 'Nepal', 'Asia', 0),
(144, 'Netherlands', 'Europe', 0),
(145, 'Netherlands Antilles', 'Caribbean', 0),
(146, 'New Caledonia (French)', 'Australasia', 0),
(147, 'New Zealand', 'Australasia', 0),
(148, 'Nicaragua', 'North America', 0),
(149, 'Niger', 'Africa', 0),
(150, 'Nigeria', 'Africa', 0),
(151, 'Niue', 'Australasia', 0),
(152, 'Norfolk Island', 'Australasia', 0),
(153, 'North Korea', 'Asia', 0),
(154, 'Northern Mariana Islands', 'Asia', 0),
(155, 'Norway', 'Europe', 0),
(156, 'Oman', 'Middle East', 0),
(157, 'Pakistan', 'Asia', 0),
(158, 'Palau', 'Australasia', 0),
(159, 'Panama', 'North America', 0),
(160, 'Papua New Guinea', 'Australasia', 0),
(161, 'Paraguay', 'South America', 0),
(162, 'Peru', 'South America', 0),
(163, 'Philippines', 'Asia', 0),
(164, 'Pitcairn Island', 'Australasia', 0),
(165, 'Poland', 'Europe', 0),
(166, 'Polynesia (French)', 'Australasia', 0),
(167, 'Portugal', 'Europe', 0),
(168, 'Puerto Rico', 'Caribbean', 0),
(169, 'Qatar', 'Middle East', 0),
(170, 'Reunion', 'Africa', 0),
(171, 'Romania', 'Europe', 0),
(172, 'Russia', 'Europe', 0),
(173, 'Rwanda', 'Africa', 2),
(174, 'Saint Helena', 'Africa', 0),
(175, 'Saint Kitts and Nevis', 'Caribbean', 0),
(176, 'Saint Lucia', 'Caribbean', 0),
(177, 'Saint Pierre and Miquelon', 'North America', 0),
(178, 'Saint Vincent and Grenadines', 'Caribbean', 0),
(179, 'Samoa', 'Australasia', 0),
(180, 'San Marino', 'Europe', 0),
(181, 'Sao Tome and Principe', 'Africa', 0),
(182, 'Saudi Arabia', 'Middle East', 0),
(183, 'Senegal', 'Africa', 0),
(184, 'Serbia', 'Europe', 0),
(185, 'Seychelles', 'Africa', 0),
(186, 'Sierra Leone', 'Africa', 0),
(187, 'Singapore', 'Asia', 0),
(188, 'Slovakia', 'Europe', 0),
(189, 'Slovenia', 'Europe', 0),
(190, 'Solomon Islands', 'Australasia', 0),
(191, 'Somalia', 'Africa', 0),
(192, 'South Africa', 'Africa', 0),
(193, 'South Georgia and South Sandwich Islands', 'South America', 0),
(194, 'South Korea', 'Asia', 0),
(195, 'South Sudan', 'Africa', 0),
(196, 'Spain', 'Europe', 0),
(197, 'Sri Lanka', 'Asia', 0),
(198, 'Sudan', 'Africa', 1),
(199, 'Suriname', 'South America', 0),
(200, 'Svalbard and Jan Mayen Islands', 'Europe', 0),
(201, 'Swaziland', 'Africa', 0),
(202, 'Sweden', 'Europe', 0),
(203, 'Switzerland', 'Europe', 0),
(204, 'Syria', 'Middle East', 0),
(205, 'Taiwan', 'Asia', 0),
(206, 'Tajikistan', 'Asia', 0),
(207, 'Tanzania', 'Africa', 2),
(208, 'Thailand', 'Asia', 0),
(209, 'Timor-Leste (East Timor)', 'Australasia', 0),
(210, 'Togo', 'Africa', 0),
(211, 'Tokelau', 'Australasia', 0),
(212, 'Tonga', 'Australasia', 0),
(213, 'Trinidad and Tobago', 'Caribbean', 0),
(214, 'Tunisia', 'Africa', 0),
(215, 'Turkey', 'Middle East', 0),
(216, 'Turkmenistan', 'Asia', 0),
(217, 'Turks and Caicos Islands', 'Caribbean', 0),
(218, 'Tuvalu', 'Australasia', 0),
(219, 'Uganda', 'Africa', 5),
(220, 'Ukraine', 'Europe', 0),
(221, 'United Arab Emirates', 'Middle East', 0),
(222, 'United Kingdom', 'Europe', 0),
(223, 'United States', 'North America', 0),
(224, 'Uruguay', 'South America', 0),
(225, 'Uzbekistan', 'Asia', 0),
(226, 'Vanuatu', 'Australasia', 0),
(227, 'Venezuela', 'South America', 0),
(228, 'Vietnam', 'Asia', 0),
(229, 'Virgin Islands', 'Caribbean', 0),
(230, 'Wallis and Futuna Islands', 'Australasia', 0),
(231, 'Yemen', 'Middle East', 0),
(232, 'Zambia', 'Africa', 0),
(233, 'Zimbabwe', 'Africa', 0);

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

--
-- Table structure for table `county`
--

CREATE TABLE `county` (
  `id` bigint(20) NOT NULL,
  `name` varchar(300) NOT NULL,
  `district_id` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=68 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `county`
--

INSERT INTO `county` (`id`, `name`, `district_id`) VALUES
(1, 'Agago', '1'),
(2, 'Kilak', '2'),
(3, 'Gulu M/C', '3'),
(4, 'Aswa', '3'),
(5, 'Omoro', '3'),
(6, 'Chua', '4'),
(7, 'Lamwo', '5'),
(8, 'Nwoya', '6'),
(9, 'Aruu', '7'),
(10, 'Buhweju', '8'),
(11, 'Bushenyi-Ishaka M.C', '9'),
(12, 'Igara West', '9'),
(13, 'Igara East', '9'),
(14, 'Ibanda North', '10'),
(15, 'Ibanda South', '10'),
(16, 'Isingiro South', '11'),
(17, 'Isingiro North', '11'),
(18, 'Bukanga', '11'),
(19, 'Nyabushozi', '12'),
(20, 'Kazo', '12'),
(21, 'Rwampara', '13'),
(22, 'Kashari', '13'),
(23, 'Mbarara M/C', '13'),
(24, 'Ruhinda', '14'),
(25, 'Kajara', '15'),
(26, 'Ruhaama', '15'),
(27, 'Rushenyi', '15'),
(28, 'Ntungamo M.C', '15'),
(29, 'Katerera', '16'),
(30, 'Bunyaruguru', '16'),
(31, 'Sheema South', '17'),
(32, 'Sheema North', '17'),
(33, 'Buikwe South', '18'),
(34, 'Buikwe West', '18'),
(35, 'Buikwe North', '18'),
(36, 'Bukomansimbi', '19'),
(37, 'Gomba', '22'),
(38, 'Kalungu West', '24'),
(39, 'Kampala Central', '25'),
(40, 'Makindye East', '25'),
(41, 'Makindye West', '25'),
(42, 'Ntenjeru North', '26'),
(43, 'Kiboga East', '27'),
(44, 'Kiboga West', '28'),
(45, 'Katikamu South', '29'),
(46, 'Bamunanika', '29'),
(47, 'Katikamu North', '29'),
(48, 'Bukoto South', '30'),
(49, 'Bukoto West', '30'),
(50, 'Bukoto Mid West', '30'),
(51, 'Kabula', '31'),
(52, 'Bukoto Central', '32'),
(53, 'Mityana South', '33'),
(54, 'Busujju', '33'),
(55, 'Mityana North', '33'),
(56, 'Mawokota North', '34'),
(57, 'Kassanda North', '35'),
(58, 'Kasambya ', '35'),
(59, 'Buwekula', '35'),
(60, 'Kassanda South', '35'),
(61, 'Nakifuma', '36'),
(62, 'Mukono North', '36'),
(63, 'Mukono South', '36'),
(64, 'Mukono M.C', '36'),
(65, 'Nakaseke North', '37'),
(66, 'Nakaseke South', '37'),
(67, 'Budyebo', '38'),
(68, 'Nakasongola', '38'),
(69, 'Kakuuto', '39'),
(70, 'Kooki', '39'),
(71, 'Kyotera', '39'),
(72, 'Mawogola', '40'),
(73, 'Lwemiyaga', '40'),
(74, 'Entebbe M/C', '41'),
(75, 'Kyadondo East', '41'),
(76, 'Busiro North', '41'),
(77, 'Busiro South', '41'),
(78, 'Busiro East', '41'),
(79, 'Kyadondo North', '41'),
(80, 'Budaka', '42'),
(81, 'Samia Bugwe South', '43'),
(82, 'Samia Bugwe North', '43'),
(83, 'Busia MC', '43'),
(84, 'Bunyole West', '44'),
(85, 'Bunyole East', '44'),
(86, 'Kibuku', '45'),
(87, 'Agule', '46'),
(88, 'Pallisa', '46'),
(89, 'Butebo', '46'),
(90, 'West Budama South', '47'),
(91, 'Buliisa', '48'),
(92, 'Buhaguzi', '49'),
(93, 'Bugahya', '49'),
(94, 'Hoima Municipality', '49'),
(95, 'Buyaga East', '50'),
(96, 'Buyaga West', '50'),
(97, 'Bugangaizi East', '50'),
(98, 'Bugangaizi West', '50'),
(99, 'Buyanja', '50'),
(100, 'Kibanda', '51'),
(101, 'Masindi M/C', '52'),
(102, 'Bukooli North', '53'),
(103, 'Bukooli Central', '53'),
(104, 'Budiope West', '54'),
(105, 'Budiope East', '54'),
(106, 'Kigulu South', '55'),
(107, 'Kigulu North', '55'),
(108, 'Bugweri', '55'),
(109, 'Iganga M.C', '55'),
(110, 'Kagoma', '56'),
(111, 'Butembe', '56'),
(112, 'Jinja M.C West', '56'),
(113, 'Jinja M.C East', '56'),
(114, 'Bulamogi', '57'),
(115, 'Bugabula South', '58'),
(116, 'Bugabula North', '58'),
(117, 'Buzaaya', '58'),
(118, 'Luuka', '59'),
(119, 'Bunya West', '60'),
(120, 'Bunya South', '60'),
(121, 'Bunya East', '60'),
(122, 'Bukhooli South', '61'),
(123, 'Bukooli Island', '61'),
(124, 'Busiki', '62'),
(125, 'Manjiya', '63'),
(126, 'Kongasis', '64'),
(127, 'Bulambuli', '65'),
(128, 'Tingey', '66'),
(129, 'Kween', '67'),
(130, 'Bubulo East', '68'),
(131, 'Bubulo West', '68'),
(132, 'Bungokho South', '69'),
(133, 'Bungokho North', '69'),
(134, 'Mbale M/C', '69'),
(135, 'Budadiri East', '70'),
(136, 'Budadiri West', '70'),
(137, 'Labwor', '71'),
(138, 'Upe', '72'),
(139, 'Dodoth West', '73'),
(140, 'Dodoth East', '73'),
(141, 'Jie', '74'),
(142, 'Matheniko', '75'),
(143, 'Moroto', '75'),
(144, 'Pian', '76'),
(145, 'Chekwii', '76'),
(146, 'Bokora', '77'),
(147, 'Rubanda West', '78'),
(148, 'Rukiga', '78'),
(149, 'Kabale M/C', '78'),
(150, 'Ndorwa west', '78'),
(151, 'Rubanda East', '78'),
(152, 'Ndorwa East', '78'),
(153, 'Kinkizi West', '79'),
(154, 'Kinkizi East', '79'),
(155, 'Bufumbira East', '80'),
(156, 'Bufumbira North', '80'),
(157, 'Bufumbira South', '80'),
(158, 'Rukungiri MC', '81'),
(159, 'Rujumbura', '81'),
(160, 'Rubabo', '81'),
(161, 'Moroto', '82'),
(162, 'Ajuri', '82'),
(163, 'Kioga', '83'),
(164, 'Maruzi', '84'),
(165, 'Kwania', '84'),
(166, 'Dokolo', '85'),
(167, 'Kole', '86'),
(168, 'Erute South', '87'),
(169, 'Erute North', '87'),
(170, 'Lira M/C', '87'),
(171, 'Otuke', '88'),
(172, 'Oyam South', '89'),
(173, 'Oyam North', '89'),
(174, 'Amuria', '90'),
(175, 'Kapelebyong', '90'),
(176, 'Bukedea', '91'),
(177, 'Kaberamaido', '92'),
(178, 'Kalaki', '92'),
(179, 'Usuk', '93'),
(180, 'Toroma', '93'),
(181, 'Kumi', '94'),
(182, 'Ngora', '95'),
(183, 'Kasilo', '96'),
(184, 'Serere', '96'),
(185, 'Soroti', '97'),
(186, 'Soroti M/C', '97'),
(187, 'Bwamba', '98'),
(188, 'Bughendera', '98'),
(189, 'Bunyangabu', '99'),
(190, 'Burahya', '99'),
(191, 'Fort Portal M/C', '99'),
(192, 'Kitagwenda', '100'),
(193, 'Kibale', '100'),
(194, 'Kasese MC', '101'),
(195, 'Busongora South', '101'),
(196, 'Busongora North', '101'),
(197, 'Bukonzo West', '101'),
(198, 'Bukonzo East', '101'),
(199, 'Kyaka', '102'),
(200, 'Mwenge North', '103'),
(201, 'Mwenge South', '103'),
(202, 'Ntoroko', '104'),
(203, 'East Moyo', '105'),
(204, 'Ayivu', '106'),
(205, 'Arua MC', '106'),
(206, 'Vurra', '106'),
(207, 'Terego', '106'),
(208, 'Madi-Okollo', '106'),
(209, 'Koboko', '107'),
(210, 'Maracha', '108'),
(211, 'West Moyo', '109'),
(212, 'Obongi', '109'),
(213, 'Padyere', '110'),
(214, 'Jonam', '110'),
(215, 'Aringa', '111'),
(216, 'Okoro', '112'),
(217, 'Butambala', '20'),
(218, 'Buvuma Islands', '21'),
(219, 'Bujumba', '23'),
(220, 'Kyamuswa', '23'),
(221, 'Kalungu East', '24'),
(222, 'Nakawa', '25'),
(223, 'Rubaga South', '25'),
(224, 'Rubaga North', '25'),
(225, 'Kawempe North', '25'),
(226, 'Kawempe South', '25'),
(227, 'Bbale', '26'),
(228, 'Ntenjeru South', '26'),
(229, 'Bukoto East', '32'),
(230, 'Masaka M.C', '32'),
(231, 'Mawokota South', '34'),
(232, 'Kyandondo South', '41'),
(233, 'Iki-Iki', '42'),
(234, 'West Budama North', '47'),
(235, 'Tororo', '47'),
(236, 'Tororo M.C', '47'),
(237, 'Bujenje', '52'),
(238, 'Buruli', '52');

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

--
-- Table structure for table `district`
--

CREATE TABLE `district` (
  `id` bigint(20) NOT NULL,
  `name` varchar(200) NOT NULL,
  `region` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=146 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `district`
--

INSERT INTO `district` (`id`, `name`, `region`) VALUES
(1, 'Agago', 'Acholi'),
(2, 'Amuru', 'Acholi'),
(3, 'Gulu', 'Acholi'),
(4, 'Kitgum', 'Acholi'),
(5, 'Lamwo', 'Acholi'),
(6, 'Nwoya', 'Acholi'),
(7, 'Pader', 'Acholi'),
(8, 'Buhweju', 'Ankole'),
(9, 'Bushenyi', 'Ankole'),
(10, 'Ibanda', 'Ankole'),
(11, 'Isingiro', 'Ankole'),
(12, 'Kiruhura', 'Ankole'),
(13, 'Mbarara', 'Ankole'),
(14, 'Mitooma', 'Ankole'),
(15, 'Ntungamo', 'Ankole'),
(16, 'Rubirizi', 'Ankole'),
(17, 'Sheema', 'Ankole'),
(18, 'Buikwe', 'Buganda'),
(19, 'Bukomansimbi', 'Buganda'),
(20, 'Butambala', 'Buganda'),
(21, 'Buvuma', 'Buganda'),
(22, 'Gomba', 'Buganda'),
(23, 'Kalangala', 'Buganda'),
(24, 'Kalungu', 'Buganda'),
(25, 'Kampala', 'Buganda'),
(26, 'Kayunga', 'Buganda'),
(27, 'Kiboga', 'Buganda'),
(28, 'Kyankwanzi', 'Buganda'),
(29, 'Luwero', 'Buganda'),
(30, 'Lwengo', 'Buganda'),
(31, 'Lyantonde', 'Buganda'),
(32, 'Masaka', 'Buganda'),
(33, 'Mityana', 'Buganda'),
(34, 'Mpigi', 'Buganda'),
(35, 'Mubende', 'Buganda'),
(36, 'Mukono', 'Buganda'),
(37, 'Nakaseke', 'Buganda'),
(38, 'Nakasongola', 'Buganda'),
(39, 'Rakai', 'Buganda'),
(40, 'Sembabule', 'Buganda'),
(41, 'Wakiso', 'Buganda'),
(42, 'Budaka', 'Bukedi'),
(43, 'Busia', 'Bukedi'),
(44, 'Butaleja', 'Bukedi'),
(45, 'Kibuku', 'Bukedi'),
(46, 'Pallisa', 'Bukedi'),
(47, 'Tororo', 'Bukedi'),
(48, 'Bulisa', 'Bunyoro'),
(49, 'Hoima', 'Bunyoro'),
(50, 'Kibaale', 'Bunyoro'),
(51, 'Kiryandongo', 'Bunyoro'),
(52, 'Masindi', 'Bunyoro'),
(53, 'Bugiri', 'Busoga'),
(54, 'Buyende', 'Busoga'),
(55, 'Iganga', 'Busoga'),
(56, 'Jinja', 'Busoga'),
(57, 'Kaliro', 'Busoga'),
(58, 'Kamuli', 'Busoga'),
(59, 'Luuka', 'Busoga'),
(60, 'Mayuge', 'Busoga'),
(61, 'Namayingo', 'Busoga'),
(62, 'Namutumba', 'Busoga'),
(63, 'Bududa', 'Elgon'),
(64, 'Bukwo', 'Elgon'),
(65, 'Bulambuli', 'Elgon'),
(66, 'Kapchorwa', 'Elgon'),
(67, 'Kween', 'Elgon'),
(68, 'Manafwa', 'Elgon'),
(69, 'Mbale', 'Elgon'),
(70, 'Sironko', 'Elgon'),
(71, 'Abim', 'Karamoja'),
(72, 'Amudat', 'Karamoja'),
(73, 'Kaabong', 'Karamoja'),
(74, 'Kotido', 'Karamoja'),
(75, 'Moroto', 'Karamoja'),
(76, 'Nakapiripirit', 'Karamoja'),
(77, 'Napak', 'Karamoja'),
(78, 'Kabale', 'Kigezi'),
(79, 'Kanungu', 'Kigezi'),
(80, 'Kisoro', 'Kigezi'),
(81, 'Rukungiri', 'Kigezi'),
(82, 'Alebtong', 'Lango'),
(83, 'Amolatar', 'Lango'),
(84, 'Apac', 'Lango'),
(85, 'Dokolo', 'Lango'),
(86, 'Kole', 'Lango'),
(87, 'Lira', 'Lango'),
(88, 'Otuke', 'Lango'),
(89, 'Oyam', 'Lango'),
(90, 'Amuria', 'Teso'),
(91, 'Bukedea', 'Teso'),
(92, 'Kaberamaido', 'Teso'),
(93, 'Katakwi', 'Teso'),
(94, 'Kumi', 'Teso'),
(95, 'Ngora', 'Teso'),
(96, 'Serere', 'Teso'),
(97, 'Soroti', 'Teso'),
(98, 'Bundibugyo', 'Toro'),
(99, 'Kabarole', 'Toro'),
(100, 'Kamwenge', 'Toro'),
(101, 'Kasese', 'Toro'),
(102, 'Kyegegwa', 'Toro'),
(103, 'Kyenjojo', 'Toro'),
(104, 'Ntoroko', 'Toro'),
(105, 'Adjumani', 'West Nile'),
(106, 'Arua', 'West Nile'),
(107, 'Koboko', 'West Nile'),
(108, 'Maracha', 'West Nile'),
(109, 'Moyo', 'West Nile'),
(110, 'Nebbi', 'West Nile'),
(111, 'Yumbe', 'West Nile'),
(112, 'Zombo', 'West Nile');

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

--
-- Table structure for table `document`
--

CREATE TABLE `document` (
  `id` bigint(20) NOT NULL,
  `url` varchar(300) NOT NULL,
  `document_type` varchar(200) NOT NULL,
  `tracking_number` varchar(200) NOT NULL,
  `description` varchar(300) NOT NULL,
  `is_removable` enum('Y','N') NOT NULL DEFAULT 'N',
  `parent_id` varchar(100) NOT NULL,
  `parent_type` varchar(200) NOT NULL,
  `date_added` datetime NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=142 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `document`
--

INSERT INTO `document` (`id`, `url`, `document_type`, `tracking_number`, `description`, `is_removable`, `parent_id`, `parent_type`, `date_added`) VALUES
(6, 'file_1625262137.jpg', 'qualification_document', '1625262137', 'Codeigniter tutorial', 'N', '981', 'person', '2021-07-03 00:42:17'),
(7, 'file_1625271118.png', 'qualification_document', '1625271118', 'PHD Cert', 'Y', '982', 'person', '2021-07-03 03:11:58'),
(8, 'file_1625303325.png', 'qualification_document', '1625303325', 'Degree Certificate', 'N', '983', 'person', '2021-07-03 12:08:45');

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

--
-- Table structure for table `duty`
--

CREATE TABLE `duty` (
  `id` bigint(20) NOT NULL,
  `name` varchar(300) NOT NULL,
  `salary_scale` varchar(100) NOT NULL,
  `description` text NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=3780 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `duty`
--

INSERT INTO `duty` (`id`, `name`, `salary_scale`, `description`) VALUES
(1, 'Head Teacher', 'U4 LOWER', '<b>General Summary</b>\r\n<br><br>\r\nUnder the direction of the Head Start Director, assists in overseeing and directing the planning, organizing, and implementation of education services for children, in addition to part time classroom teacher duties which include: Developing and implementing individual educational plans for children.\r\n<br><br>\r\nQualifications and Requirements:\r\n<br><br>\r\nThe Head Teacher must have:\r\n<ol>\r\n<li>A degree in early childhood education or child development (Bachelor\'s preferred); or</li>\r\n<li>An age-appropriate CDA or State equivalent credential; or</li>\r\n<li>An Associate Degree in a related field, such as Family & Child studies, elementary education, with at least 18 credit hours in early childhood education; or</li>\r\n<li>A baccalaureate or advanced degree in any field, at least 18 credit hours in early childhood education, and experience teaching children in the age range for which she/he is applying for;</li>\r\n<li>Have knowledge and experience in the philosophy and practices of Head Start (or comparable child development programs), early childhood education, developmentally appropriate practice, and bilingual education;</li>\r\n<li>Experience with migrant farm workers (preferred Spanish-speaking);</li>\r\n<li>Proof of a physical examination within the last six months, which includes a tuberculosis test, and comply with other background checks as required by the Agency and/or DCFS licensing;</li>\r\n<li>Personal qualifications as required in Part 407: Licensing Standards for Day Care Centers, emotional maturity, willingness to cooperate with the aims of the program, respect for children and adults, flexibility, patience, good personal hygiene, and physical and mental health which does not interfere with responsibilities; and</li>\r\n<li>An education or experience in collaborating with parents in the education of their children.</li>\r\n</ol>'),
(2, 'Deputy Head Teacher', 'U5 UPPER', '<b>General Summary</b>\r\n<br><br>\r\nUnder the direction of the Head Start Director, assists in overseeing and directing the planning, organizing, and implementation of education services for children, in addition to part time classroom teacher duties which include: Developing and implementing individual educational plans for children.\r\n<br><br>\r\nQualifications and Requirements:\r\n<br><br>\r\nThe Head Teacher must have:\r\n<ol>\r\n<li>A degree in early childhood education or child development (Bachelor\'s preferred); or</li>\r\n<li>An age-appropriate CDA or State equivalent credential; or</li>\r\n<li>An Associate Degree in a related field, such as Family & Child studies, elementary education, with at least 18 credit hours in early childhood education; or</li>\r\n<li>A baccalaureate or advanced degree in any field, at least 18 credit hours in early childhood education, and experience teaching children in the age range for which she/he is applying for;</li>\r\n<li>Have knowledge and experience in the philosophy and practices of Head Start (or comparable child development programs), early childhood education, developmentally appropriate practice, and bilingual education;</li>\r\n<li>Experience with migrant farm workers (preferred Spanish-speaking);</li>\r\n<li>Proof of a physical examination within the last six months, which includes a tuberculosis test, and comply with other background checks as required by the Agency and/or DCFS licensing;</li>\r\n<li>Personal qualifications as required in Part 407: Licensing Standards for Day Care Centers, emotional maturity, willingness to cooperate with the aims of the program, respect for children and adults, flexibility, patience, good personal hygiene, and physical and mental health which does not interfere with responsibilities; and</li>\r\n<li>An education or experience in collaborating with parents in the education of their children.</li>\r\n</ol>'),
(3, 'Senior Education Assistant', 'U6 LOWER', '<b>General Summary</b>\r\n<br><br>\r\nUnder the direction of the Head Start Director, assists in overseeing and directing the planning, organizing, and implementation of education services for children, in addition to part time classroom teacher duties which include: Developing and implementing individual educational plans for children.\r\n<br><br>\r\nQualifications and Requirements:\r\n<br><br>\r\nThe Head Teacher must have:\r\n<ol>\r\n<li>A degree in early childhood education or child development (Bachelor\'s preferred); or</li>\r\n<li>An age-appropriate CDA or State equivalent credential; or</li>\r\n<li>An Associate Degree in a related field, such as Family & Child studies, elementary education, with at least 18 credit hours in early childhood education; or</li>\r\n<li>A baccalaureate or advanced degree in any field, at least 18 credit hours in early childhood education, and experience teaching children in the age range for which she/he is applying for;</li>\r\n<li>Have knowledge and experience in the philosophy and practices of Head Start (or comparable child development programs), early childhood education, developmentally appropriate practice, and bilingual education;</li>\r\n<li>Experience with migrant farm workers (preferred Spanish-speaking);</li>\r\n<li>Proof of a physical examination within the last six months, which includes a tuberculosis test, and comply with other background checks as required by the Agency and/or DCFS licensing;</li>\r\n<li>Personal qualifications as required in Part 407: Licensing Standards for Day Care Centers, emotional maturity, willingness to cooperate with the aims of the program, respect for children and adults, flexibility, patience, good personal hygiene, and physical and mental health which does not interfere with responsibilities; and</li>\r\n<li>An education or experience in collaborating with parents in the education of their children.</li>\r\n</ol>'),
(4, 'Education Assistant or Grade 3', 'U7 UPPER', '<b>General Summary</b>\r\n<br><br>\r\nUnder the direction of the Head Start Director, assists in overseeing and directing the planning, organizing, and implementation of education services for children, in addition to part time classroom teacher duties which include: Developing and implementing individual educational plans for children.\r\n<br><br>\r\nQualifications and Requirements:\r\n<br><br>\r\nThe Head Teacher must have:\r\n<ol>\r\n<li>A degree in early childhood education or child development (Bachelor\'s preferred); or</li>\r\n<li>An age-appropriate CDA or State equivalent credential; or</li>\r\n<li>An Associate Degree in a related field, such as Family & Child studies, elementary education, with at least 18 credit hours in early childhood education; or</li>\r\n<li>A baccalaureate or advanced degree in any field, at least 18 credit hours in early childhood education, and experience teaching children in the age range for which she/he is applying for;</li>\r\n<li>Have knowledge and experience in the philosophy and practices of Head Start (or comparable child development programs), early childhood education, developmentally appropriate practice, and bilingual education;</li>\r\n<li>Experience with migrant farm workers (preferred Spanish-speaking);</li>\r\n<li>Proof of a physical examination within the last six months, which includes a tuberculosis test, and comply with other background checks as required by the Agency and/or DCFS licensing;</li>\r\n<li>Personal qualifications as required in Part 407: Licensing Standards for Day Care Centers, emotional maturity, willingness to cooperate with the aims of the program, respect for children and adults, flexibility, patience, good personal hygiene, and physical and mental health which does not interfere with responsibilities; and</li>\r\n<li>An education or experience in collaborating with parents in the education of their children.</li>\r\n</ol>'),
(5, 'Teacher on Trial Terms', 'U7 LOWER FIXED', '<b>General Summary</b>\r\n<br><br>\r\nUnder the direction of the Head Start Director, assists in overseeing and directing the planning, organizing, and implementation of education services for children, in addition to part time classroom teacher duties which include: Developing and implementing individual educational plans for children.\r\n<br><br>\r\nQualifications and Requirements:\r\n<br><br>\r\nThe Head Teacher must have:\r\n<ol>\r\n<li>A degree in early childhood education or child development (Bachelor\'s preferred); or</li>\r\n<li>An age-appropriate CDA or State equivalent credential; or</li>\r\n<li>An Associate Degree in a related field, such as Family & Child studies, elementary education, with at least 18 credit hours in early childhood education; or</li>\r\n<li>A baccalaureate or advanced degree in any field, at least 18 credit hours in early childhood education, and experience teaching children in the age range for which she/he is applying for;</li>\r\n<li>Have knowledge and experience in the philosophy and practices of Head Start (or comparable child development programs), early childhood education, developmentally appropriate practice, and bilingual education;</li>\r\n<li>Experience with migrant farm workers (preferred Spanish-speaking);</li>\r\n<li>Proof of a physical examination within the last six months, which includes a tuberculosis test, and comply with other background checks as required by the Agency and/or DCFS licensing;</li>\r\n<li>Personal qualifications as required in Part 407: Licensing Standards for Day Care Centers, emotional maturity, willingness to cooperate with the aims of the program, respect for children and adults, flexibility, patience, good personal hygiene, and physical and mental health which does not interfere with responsibilities; and</li>\r\n<li>An education or experience in collaborating with parents in the education of their children.</li>\r\n</ol>'),
(6, 'Non Formal Education Teachers', 'U8 LOWER FIXED', '<b>General Summary</b>\r\n<br><br>\r\nUnder the direction of the Head Start Director, assists in overseeing and directing the planning, organizing, and implementation of education services for children, in addition to part time classroom teacher duties which include: Developing and implementing individual educational plans for children.\r\n<br><br>\r\nQualifications and Requirements:\r\n<br><br>\r\nThe Head Teacher must have:\r\n<ol>\r\n<li>A degree in early childhood education or child development (Bachelor\'s preferred); or</li>\r\n<li>An age-appropriate CDA or State equivalent credential; or</li>\r\n<li>An Associate Degree in a related field, such as Family & Child studies, elementary education, with at least 18 credit hours in early childhood education; or</li>\r\n<li>A baccalaureate or advanced degree in any field, at least 18 credit hours in early childhood education, and experience teaching children in the age range for which she/he is applying for;</li>\r\n<li>Have knowledge and experience in the philosophy and practices of Head Start (or comparable child development programs), early childhood education, developmentally appropriate practice, and bilingual education;</li>\r\n<li>Experience with migrant farm workers (preferred Spanish-speaking);</li>\r\n<li>Proof of a physical examination within the last six months, which includes a tuberculosis test, and comply with other background checks as required by the Agency and/or DCFS licensing;</li>\r\n<li>Personal qualifications as required in Part 407: Licensing Standards for Day Care Centers, emotional maturity, willingness to cooperate with the aims of the program, respect for children and adults, flexibility, patience, good personal hygiene, and physical and mental health which does not interfere with responsibilities; and</li>\r\n<li>An education or experience in collaborating with parents in the education of their children.</li>\r\n</ol>'),
(7, 'Science Education Officers', 'U4 SC', '<b>General Summary</b>\r\n<br><br>\r\nUnder the direction of the Head Start Director, assists in overseeing and directing the planning, organizing, and implementation of education services for children, in addition to part time classroom teacher duties which include: Developing and implementing individual educational plans for children.\r\n<br><br>\r\nQualifications and Requirements:\r\n<br><br>\r\nThe Head Teacher must have:\r\n<ol>\r\n<li>A degree in early childhood education or child development (Bachelor\'s preferred); or</li>\r\n<li>An age-appropriate CDA or State equivalent credential; or</li>\r\n<li>An Associate Degree in a related field, such as Family & Child studies, elementary education, with at least 18 credit hours in early childhood education; or</li>\r\n<li>A baccalaureate or advanced degree in any field, at least 18 credit hours in early childhood education, and experience teaching children in the age range for which she/he is applying for;</li>\r\n<li>Have knowledge and experience in the philosophy and practices of Head Start (or comparable child development programs), early childhood education, developmentally appropriate practice, and bilingual education;</li>\r\n<li>Experience with migrant farm workers (preferred Spanish-speaking);</li>\r\n<li>Proof of a physical examination within the last six months, which includes a tuberculosis test, and comply with other background checks as required by the Agency and/or DCFS licensing;</li>\r\n<li>Personal qualifications as required in Part 407: Licensing Standards for Day Care Centers, emotional maturity, willingness to cooperate with the aims of the program, respect for children and adults, flexibility, patience, good personal hygiene, and physical and mental health which does not interfere with responsibilities; and</li>\r\n<li>An education or experience in collaborating with parents in the education of their children.</li>\r\n</ol>'),
(8, 'Science Grade 5', 'U5 SC', '<b>General Summary</b>\r\n<br><br>\r\nUnder the direction of the Head Start Director, assists in overseeing and directing the planning, organizing, and implementation of education services for children, in addition to part time classroom teacher duties which include: Developing and implementing individual educational plans for children.\r\n<br><br>\r\nQualifications and Requirements:\r\n<br><br>\r\nThe Head Teacher must have:\r\n<ol>\r\n<li>A degree in early childhood education or child development (Bachelor\'s preferred); or</li>\r\n<li>An age-appropriate CDA or State equivalent credential; or</li>\r\n<li>An Associate Degree in a related field, such as Family & Child studies, elementary education, with at least 18 credit hours in early childhood education; or</li>\r\n<li>A baccalaureate or advanced degree in any field, at least 18 credit hours in early childhood education, and experience teaching children in the age range for which she/he is applying for;</li>\r\n<li>Have knowledge and experience in the philosophy and practices of Head Start (or comparable child development programs), early childhood education, developmentally appropriate practice, and bilingual education;</li>\r\n<li>Experience with migrant farm workers (preferred Spanish-speaking);</li>\r\n<li>Proof of a physical examination within the last six months, which includes a tuberculosis test, and comply with other background checks as required by the Agency and/or DCFS licensing;</li>\r\n<li>Personal qualifications as required in Part 407: Licensing Standards for Day Care Centers, emotional maturity, willingness to cooperate with the aims of the program, respect for children and adults, flexibility, patience, good personal hygiene, and physical and mental health which does not interfere with responsibilities; and</li>\r\n<li>An education or experience in collaborating with parents in the education of their children.</li>\r\n</ol>'),
(9, 'Non Science', 'U4 LOWER', '<b>General Summary</b>\r\n<br><br>\r\nUnder the direction of the Head Start Director, assists in overseeing and directing the planning, organizing, and implementation of education services for children, in addition to part time classroom teacher duties which include: Developing and implementing individual educational plans for children.\r\n<br><br>\r\nQualifications and Requirements:\r\n<br><br>\r\nThe Head Teacher must have:\r\n<ol>\r\n<li>A degree in early childhood education or child development (Bachelor\'s preferred); or</li>\r\n<li>An age-appropriate CDA or State equivalent credential; or</li>\r\n<li>An Associate Degree in a related field, such as Family & Child studies, elementary education, with at least 18 credit hours in early childhood education; or</li>\r\n<li>A baccalaureate or advanced degree in any field, at least 18 credit hours in early childhood education, and experience teaching children in the age range for which she/he is applying for;</li>\r\n<li>Have knowledge and experience in the philosophy and practices of Head Start (or comparable child development programs), early childhood education, developmentally appropriate practice, and bilingual education;</li>\r\n<li>Experience with migrant farm workers (preferred Spanish-speaking);</li>\r\n<li>Proof of a physical examination within the last six months, which includes a tuberculosis test, and comply with other background checks as required by the Agency and/or DCFS licensing;</li>\r\n<li>Personal qualifications as required in Part 407: Licensing Standards for Day Care Centers, emotional maturity, willingness to cooperate with the aims of the program, respect for children and adults, flexibility, patience, good personal hygiene, and physical and mental health which does not interfere with responsibilities; and</li>\r\n<li>An education or experience in collaborating with parents in the education of their children.</li>\r\n</ol>');

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

--
-- Table structure for table `grade`
--

CREATE TABLE `grade` (
  `id` bigint(20) NOT NULL,
  `code` varchar(100) NOT NULL,
  `name` varchar(300) NOT NULL,
  `number` varchar(10) NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `grade_category` bigint(20) DEFAULT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=528 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `grade`
--

INSERT INTO `grade` (`id`, `code`, `name`, `number`, `date_added`, `added_by`, `grade_category`) VALUES
(1, 'CE01', 'Child Education', '1001', '2015-02-02 17:55:14', '1', NULL),
(2, 'PE01', 'Primary Education', '2001', '2015-02-02 17:55:14', '1', NULL),
(3, 'PE02', 'Primary Education - Grade 2', '2002', '2015-02-02 17:55:14', '1', NULL),
(4, 'PE03', 'Primary Education - Grade 3', '2003', '2015-02-02 17:55:14', '1', NULL),
(5, 'PE04', 'Primary Education - Grade 4', '2004', '2015-02-02 17:55:14', '1', NULL),
(6, 'PE05', 'Primary Education - Grade 5', '2005', '2015-02-02 17:55:14', '1', NULL),
(7, 'PE06', 'Primary Education - Graduate Teacher', '2006', '2015-02-02 17:55:14', '1', NULL),
(8, 'SE03', 'Secondary Education - Grade 3', '3003', '2015-02-02 17:55:14', '1', NULL),
(9, 'SE05', 'Secondary Education - Grade 5', '3005', '2015-02-02 17:55:14', '1', NULL),
(10, 'SE06', 'Secondary Education - Diploma', '3006', '2015-02-02 17:55:14', '1', NULL),
(11, 'SE07', 'Secondary Education - Graduate Teacher', '3007', '2015-02-02 17:55:14', '1', NULL),
(12, 'TE03', 'Tertiary Education - Grade 3', '4003', '2015-02-02 17:55:14', '1', NULL),
(13, 'TE05', 'Tertiary Education - Grade 5', '4005', '2015-02-02 17:55:14', '1', NULL),
(14, 'TE06', 'Tertiary Education - Diploma', '4006', '2015-02-02 17:55:14', '1', NULL),
(15, 'TE07', 'Tertiary Education - Graduate Teacher', '4007', '2015-02-02 17:55:14', '1', NULL),
(16, 'UE01', 'University Education', '5001', '2015-02-02 17:55:14', '1', NULL),
(17, 'UE02', 'Masters Education', '5002', '2015-02-02 17:55:14', '1', NULL),
(18, 'UE03', 'Post Doctoral Education', '5003', '2015-02-02 17:55:14', '1', NULL),
(19, 'UE04', 'National Expert', '5004', '2015-02-02 17:55:14', '1', NULL),
(20, 'GT001', 'Graduate Health Tutor', '1', '2015-08-19 00:00:00', '1', 3),
(21, 'GT002', 'Graduate  Teacher', '2', '2015-08-19 00:00:00', '1', 3),
(22, 'ECD001', 'Child Care  Giver', '5', '2015-08-19 00:00:00', '1', 4),
(23, 'ECD002', 'Early Child Development Teacher', '8', '2015-08-19 00:00:00', '1', 4),
(24, 'ECD003', 'Community Child Care Training Programme', '9', '2015-08-19 00:00:00', '1', 4),
(25, 'GV001', 'Vocational Training Instructor__Certificate', '10', '2015-08-19 00:00:00', '1', 2),
(26, 'GV002', 'Vocational Training Instructor__Diploma', '12', '2015-08-19 00:00:00', '1', 2),
(27, 'GV003', 'Clinical Instructor__Higher Diploma', '14', '2015-08-19 00:00:00', '1', 2),
(28, 'GV004', 'Health Tutor__Diploma', '16', '2015-08-19 00:00:00', '1', 2),
(29, 'GV005', 'Grade V Teacher', '17', '2015-08-19 00:00:00', '1', 2),
(30, 'GB001', 'GRADE III', '19', '2015-08-19 00:00:00', '1', 1),
(31, 'GH0078', 'Grade Health Tutor__Post Graduate Diploma', '52', '2015-08-20 00:00:00', '1', 3);

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

--
-- Table structure for table `grade_category`
--

CREATE TABLE `grade_category` (
  `id` bigint(20) NOT NULL,
  `category` varchar(100) NOT NULL,
  `author` bigint(20) NOT NULL,
  `isactive` enum('Y','N') NOT NULL,
  `dateadded` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB AVG_ROW_LENGTH=4096 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `grade_category`
--

INSERT INTO `grade_category` (`id`, `category`, `author`, `isactive`, `dateadded`) VALUES
(1, 'GRADE III', 1, 'Y', '2015-08-19 11:39:54'),
(2, 'GRADE V', 1, 'Y', '2016-09-02 10:55:17'),
(3, 'GRADUATE TEACHER', 1, 'Y', '2015-08-19 11:41:11'),
(4, 'EARLY CHILDHOOD DEVELOPMENT', 1, 'Y', '2015-08-19 11:41:11');

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

--
-- Table structure for table `institution`
--

CREATE TABLE `institution` (
  `id` bigint(20) NOT NULL,
  `name` varchar(500) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `school_type` varchar(100) NOT NULL,
  `status` enum('verified','pending','inactive') NOT NULL DEFAULT 'pending',
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  `last_updated_by` varchar(100) NOT NULL
) ENGINE=MyISAM AVG_ROW_LENGTH=73 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `interview`
--

CREATE TABLE `interview` (
  `id` bigint(20) NOT NULL,
  `application_id` varchar(100) NOT NULL,
  `interviewer_id` varchar(100) NOT NULL,
  `board_id` varchar(100) NOT NULL,
  `planned_date` datetime NOT NULL,
  `interview_date` datetime NOT NULL,
  `interview_duration` int(11) NOT NULL,
  `notes` text NOT NULL,
  `result` enum('pending','failed','inconclusive','passed','awarded') NOT NULL DEFAULT 'pending',
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  `last_updated_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=1170 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `interview_board`
--

CREATE TABLE `interview_board` (
  `id` bigint(20) NOT NULL,
  `name` varchar(300) NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  `last_updated_by` datetime NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=16384 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `interview_board_member`
--

CREATE TABLE `interview_board_member` (
  `id` bigint(20) NOT NULL,
  `board_id` varchar(100) NOT NULL,
  `member_id` varchar(100) NOT NULL,
  `is_chairman` enum('Y','N') NOT NULL DEFAULT 'N',
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=4096 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `leave`
--

CREATE TABLE `leave` (
  `id` bigint(20) NOT NULL,
  `teacher_id` varchar(100) NOT NULL,
  `proposed_start_date` date NOT NULL,
  `actual_start_date` date NOT NULL,
  `proposed_end_date` date NOT NULL,
  `actual_end_date` date NOT NULL,
  `reason` varchar(300) NOT NULL,
  `notes` text NOT NULL,
  `status` enum('pending','districtapproved','confirmed','rejected','archived') NOT NULL DEFAULT 'pending',
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  `last_updated_by` varchar(100) NOT NULL,
  `leavegrounds` varchar(255) DEFAULT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=2730 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `log`
--

CREATE TABLE `log` (
  `id` bigint(20) NOT NULL,
  `log_code` varchar(200) NOT NULL,
  `result` enum('success','fail') NOT NULL DEFAULT 'success',
  `details` text NOT NULL,
  `date_added` datetime NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=403 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `log`
--

INSERT INTO `log` (`id`, `log_code`, `result`, `details`, `date_added`) VALUES
(1, 'user_login', 'success', 'userid=594|username=dsc@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-06-30 23:30:03'),
(2, 'user_login', 'success', 'userid=594|username=dsc@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-06-30 23:41:27'),
(3, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=leave/lists/action/verify|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 01:28:25'),
(4, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=leave/lists/action/verify|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 01:28:37'),
(5, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=leave/lists/action/verify|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 01:28:41'),
(6, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=interview/lists/action/shortlist|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 01:28:50'),
(7, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=interview/lists/action/setdate|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 01:28:54'),
(8, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=interview/lists/action/cancel|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 01:28:58'),
(9, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=interview/lists/action/recommendations|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 01:29:02'),
(10, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=interview/lists/action/addresult|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 01:29:05'),
(11, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=interview/lists/action/addresult|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 01:42:08'),
(12, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=interview/lists/action/addresult|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 01:42:45'),
(13, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=interview/lists/action/addresult|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 01:43:22'),
(14, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 11:52:48'),
(15, 'user_login', 'success', 'userid=594|username=dsc@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 12:33:54'),
(16, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=confirmation/lists/action/verify|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 12:37:32'),
(17, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=leave/lists/action/verify|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 12:37:54'),
(18, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=interview/lists/action/shortlist|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 12:38:07'),
(19, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=interview/lists/action/setdate|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 12:38:11'),
(20, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=interview/lists/action/cancel|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 12:38:15'),
(21, 'system_error', 'fail', 'userid=594|email=nabbona21@gmail.com|msg=ERROR: You do not have access to this feature.|url=interview/lists/action/recommendations|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 12:38:18'),
(22, 'user_logout', 'success', 'userid=594|email=nabbona21@gmail.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 12:38:24'),
(23, 'user_login', 'success', 'userid=594|username=dsc@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 15:10:51'),
(24, 'user_logout', 'success', 'userid=594|email=nabbona21@gmail.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 15:13:23'),
(25, 'system_error', 'fail', 'userid=UNKNOWN|email=UNKNOWN|msg=ERROR: We could not add the document.|url=register/step_three/action/add_document|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 17:32:30'),
(26, 'system_error', 'fail', 'userid=UNKNOWN|email=UNKNOWN|msg=ERROR: We could not add the document.|url=register/step_three/action/add_document|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 17:32:58'),
(27, 'system_error', 'fail', 'userid=UNKNOWN|email=UNKNOWN|msg=ERROR: We could not add the document.|url=register/step_three/action/add_document|ipaddress=::1|browser=Opera--77.0.4054.90--Windows 10', '2021-07-01 17:35:39'),
(28, 'user_login', 'success', 'userid=86|username=hr@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 19:40:13'),
(29, 'user_logout', 'success', 'userid=86|email=hrjanette@gmail.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 19:49:37'),
(30, 'user_login', 'success', 'userid=13|username=admin@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 19:49:46'),
(31, 'system_error', 'fail', 'userid=13|email=admin@tmis.go.ug|msg=ERROR: There are no responsibilities to show.|url=census/add|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 20:29:15'),
(32, 'user_logout', 'success', 'userid=13|email=admin@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 21:12:32'),
(33, 'user_login', 'success', 'userid=19|username=moes@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 21:13:14'),
(34, 'user_logout', 'success', 'userid=19|email=moes@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 22:11:38'),
(35, 'user_login', 'success', 'userid=25|username=tiet@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 22:12:08'),
(36, 'user_logout', 'success', 'userid=25|email=tiet@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 22:30:33'),
(37, 'user_login', 'success', 'userid=28|username=mops@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 22:30:42'),
(38, 'user_logout', 'success', 'userid=28|email=mops@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 22:31:19'),
(39, 'user_login', 'success', 'userid=29|username=esc@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 22:31:37'),
(40, 'system_error', 'fail', 'userid=29|email=esc@tmis.go.ug|msg=ERROR: There are no responsibilities to show.|url=census/add|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 22:32:18'),
(41, 'user_logout', 'success', 'userid=29|email=esc@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 22:33:17'),
(42, 'user_login', 'success', 'userid=32|username=manager@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 22:33:26'),
(43, 'system_error', 'fail', 'userid=32|email=manager@tmis.go.ug|msg=ERROR: No approvers could be found for the next stage.|url=retirement/apply|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 22:44:45'),
(44, 'system_error', 'fail', 'userid=32|email=manager@tmis.go.ug|msg=ERROR: There are no responsibilities to show.|url=census/add|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 22:45:00'),
(45, 'user_logout', 'success', 'userid=32|email=manager@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-01 22:45:23'),
(46, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 00:17:49'),
(47, 'user_logout', 'success', 'userid=974|email=deuson8@muto.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 01:41:43'),
(48, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 01:41:45'),
(49, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 09:30:26'),
(50, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 10:23:08'),
(51, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 11:46:50'),
(52, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 11:46:57'),
(53, 'system_error', 'fail', 'userid=974|email=deuson8@muto.com|msg=ERROR: We could not add the document.|url=register/step_three/action/add_document|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 12:28:16'),
(54, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 12:29:17'),
(55, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 12:29:21'),
(56, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 13:30:10'),
(57, 'user_login', 'success', 'userid=32|username=manager@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 13:30:14'),
(58, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 13:31:12'),
(59, 'user_login', 'success', 'userid=32|username=manager@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 13:31:15'),
(60, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 14:03:47'),
(61, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 14:08:27'),
(62, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 14:13:40'),
(63, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 14:13:43'),
(64, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 14:18:12'),
(65, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 14:18:14'),
(66, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 14:43:40'),
(67, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 14:43:42'),
(68, 'user_logout', 'success', 'userid=974|email=deuson8@muto.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 15:10:12'),
(69, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 15:10:15'),
(70, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 15:28:30'),
(71, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 15:28:54'),
(72, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 15:28:56'),
(73, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 16:08:54'),
(74, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 16:08:57'),
(75, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 21:07:32'),
(76, 'user_login', 'success', 'userid=28|username=mops@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 21:07:38'),
(77, 'user_logout', 'success', 'userid=28|email=mops@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 21:18:36'),
(78, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 21:18:44'),
(79, 'user_logout', 'success', 'userid=974|email=deuson8@muto.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 21:19:24'),
(80, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 21:22:05'),
(81, 'system_error', 'fail', 'userid=974|email=deuson8@muto.com|msg=ERROR: We could not add the document(add docs person model).|url=register/step_three/action/add_document|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 21:24:11'),
(82, 'user_login', 'success', 'userid=13|username=admin@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 21:54:24'),
(83, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 22:28:58'),
(84, 'system_error', 'fail', 'userid=UNKNOWN|email=UNKNOWN|msg=ERROR: You do not have access to this feature.|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 22:28:58'),
(85, 'user_login', 'success', 'userid=13|username=admin@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 22:29:01'),
(86, 'user_logout', 'success', 'userid=13|email=admin@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 22:29:07'),
(87, 'user_login', 'success', 'userid=13|username=admin@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 22:29:10'),
(88, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 23:09:53'),
(89, 'system_error', 'fail', 'userid=UNKNOWN|email=UNKNOWN|msg=ERROR: You do not have access to this feature.|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 23:09:53'),
(90, 'user_login', 'success', 'userid=13|username=admin@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 23:09:57'),
(91, 'system_error', 'fail', 'userid=13|email=admin@tmis.go.ug|msg=ERROR: We could not add the document(add docs person model).|url=teacher/add_document|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 23:10:50'),
(92, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 23:28:36'),
(93, 'system_error', 'fail', 'userid=UNKNOWN|email=UNKNOWN|msg=ERROR: You do not have access to this feature.|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 23:28:36'),
(94, 'user_login', 'success', 'userid=13|username=admin@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-02 23:28:38'),
(95, 'user_logout', 'success', 'userid=13|email=admin@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 00:26:00'),
(96, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 00:26:09'),
(97, 'user_logout', 'success', 'userid=974|email=deuson8@muto.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 00:32:51'),
(98, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 00:34:40'),
(99, 'user_logout', 'success', 'userid=974|email=deuson8@muto.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 00:35:47'),
(100, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 00:36:01'),
(101, 'user_logout', 'success', 'userid=974|email=deuson8@muto.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 00:37:19'),
(102, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 00:37:45'),
(103, 'user_logout', 'success', 'userid=974|email=deuson8@muto.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 00:40:04'),
(104, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 00:40:07'),
(105, 'system_error', 'fail', 'userid=UNKNOWN|email=UNKNOWN|msg=ERROR: We could not verify your data. Your session may have expired. If this problem persists, please contact us.|url=register/step_three|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 00:52:26'),
(106, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 00:52:32'),
(107, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 01:35:29'),
(108, 'user_logout', 'success', 'userid=974|email=deuson8@muto.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 01:38:50'),
(109, 'user_login', 'success', 'userid=974|username=deuson8@muto.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 01:38:54'),
(110, 'user_logout', 'success', 'userid=974|email=deuson8@muto.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 01:40:16'),
(111, 'user_login', 'success', 'userid=86|username=hr@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 01:40:23'),
(112, 'user_logout', 'success', 'userid=86|email=hrjanette@gmail.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 01:48:46'),
(113, 'user_login', 'success', 'userid=86|username=hr@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 01:48:48'),
(114, 'user_logout', 'success', 'userid=86|email=hrjanette@gmail.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 01:54:30'),
(115, 'user_login', 'success', 'userid=86|username=hr@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 01:54:32'),
(116, 'user_logout', 'success', 'userid=86|email=hrjanette@gmail.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 02:01:22'),
(117, 'user_login', 'success', 'userid=86|username=hr@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 02:01:29'),
(118, 'user_logout', 'success', 'userid=86|email=hrjanette@gmail.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 02:07:16'),
(119, 'user_login', 'success', 'userid=86|username=hr@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 02:07:19'),
(120, 'user_logout', 'success', 'userid=86|email=hrjanette@gmail.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 02:34:27'),
(121, 'user_login', 'success', 'userid=86|username=hr@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 02:34:30'),
(122, 'user_logout', 'success', 'userid=86|email=hrjanette@gmail.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 02:40:22'),
(123, 'user_login', 'success', 'userid=86|username=hr@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 02:40:24'),
(124, 'user_logout', 'success', 'userid=86|email=hrjanette@gmail.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 02:43:39'),
(125, 'user_login', 'success', 'userid=86|username=hr@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 02:43:42'),
(126, 'user_logout', 'success', 'userid=86|email=hrjanette@gmail.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 02:56:27'),
(127, 'user_login', 'success', 'userid=86|username=hr@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 03:13:49'),
(128, 'user_login', 'success', 'userid=86|username=hr@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 12:09:26'),
(129, 'user_logout', 'success', 'userid=86|email=hrjanette@gmail.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 12:11:47'),
(130, 'user_login', 'success', 'userid=976|username=dbowe@maverick.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 12:11:56'),
(131, 'user_logout', 'success', 'userid=976|email=dbowe@maverick.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 12:16:45'),
(132, 'user_login', 'success', 'userid=976|username=dbowe@maverick.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 12:16:47'),
(133, 'user_logout', 'success', 'userid=976|email=dbowe@maverick.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 13:28:14'),
(134, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 13:28:19'),
(135, 'user_login', 'success', 'userid=976|username=dbowe@maverick.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 13:28:23'),
(136, 'user_logout', 'success', 'userid=976|email=dbowe@maverick.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 13:47:01'),
(137, 'user_login', 'success', 'userid=976|username=dbowe@maverick.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 13:47:03'),
(138, 'user_logout', 'success', 'userid=976|email=dbowe@maverick.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 13:47:12'),
(139, 'user_login', 'success', 'userid=976|username=dbowe@maverick.com|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 13:50:01'),
(140, 'user_logout', 'success', 'userid=976|email=dbowe@maverick.com|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 13:53:44'),
(141, 'user_login', 'success', 'userid=13|username=admin@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 13:53:54'),
(142, 'system_error', 'fail', 'userid=13|email=admin@tmis.go.ug|msg=ERROR: There are no responsibilities to show.|url=census/add|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 13:54:43'),
(143, 'user_login', 'success', 'userid=13|username=admin@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-03 15:15:14'),
(144, 'user_login', 'success', 'userid=13|username=admin@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-04 20:09:11'),
(145, 'user_logout', 'success', 'userid=13|email=admin@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-04 20:20:48'),
(146, 'user_login', 'success', 'userid=13|username=admin@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-04 20:25:03'),
(147, 'user_logout', 'success', 'userid=13|email=admin@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-04 20:25:08'),
(148, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-04 20:31:57'),
(149, 'user_logout', 'success', 'userid=|email=|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-04 20:31:58'),
(150, 'user_login', 'success', 'userid=13|username=admin@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-04 21:31:53'),
(151, 'user_logout', 'success', 'userid=13|email=admin@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-04 22:15:47'),
(152, 'user_login', 'success', 'userid=25|username=tiet@tmis.go.ug|url=account/login|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-05 11:20:57'),
(153, 'user_logout', 'success', 'userid=25|email=tiet@tmis.go.ug|url=account/logout|ipaddress=::1|browser=Opera--77.0.4054.172--Windows 10', '2021-07-05 11:34:06');

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

--
-- Table structure for table `message`
--

CREATE TABLE `message` (
  `id` bigint(20) NOT NULL,
  `message_type` varchar(300) NOT NULL,
  `subject` varchar(300) NOT NULL,
  `details` text NOT NULL,
  `sms` varchar(300) NOT NULL,
  `copy_admin` enum('Y','N') NOT NULL DEFAULT 'Y',
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  `last_updated_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=3744 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `message`
--

INSERT INTO `message` (`id`, `message_type`, `subject`, `details`, `sms`, `copy_admin`, `date_added`, `added_by`, `last_updated`, `last_updated_by`) VALUES
(1, 'new_teacher_first_step', 'Your Verification Code for TMIS', 'A profile has been created for you at the Teacher Management Information System (TMIS). You will need this code to confirm your account: <br>_VERIFICATION_CODE_ <br> <br>In case you closed the TIMIS website, go to the link below to continue with your registration: <br>_LOGIN_LINK_ <br>You will need the following details to login: <br> Your user name: _EMAILADDRESS_ <br>Your Temporary Password: _PASSWORD_ <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS profile has been created. Confirm your account at _LOGIN_LINK_ with code: _VERIFICATION_CODE_ Login with username: _EMAILADDRESS_ and password: _PASSWORD_', 'N', '2015-01-14 00:00:00', '1', '0000-00-00 00:00:00', ''),
(2, 'teacher_application_submitted', 'Your TMIS Application Has Been Submitted', 'Your TMIS application has been submitted for review. You will be notified by email when it is approved for you to begin enjoying the benefits of a TMIS registered teacher. <br> <br>In case you closed the TMIS website, go to the link below to learn more about TMIS: <br>_LOGIN_LINK_ <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS application has been submitted for review.', 'N', '2015-01-16 00:00:00', '1', '2015-01-16 00:00:00', '1'),
(3, 'notify_next_chain_party', 'Your Approval at TMIS is Required By _ORIGINATOR_NAME_', 'Your approval at TMIS is required by _ORIGINATOR_NAME_ for a _ITEM_TYPE_. This was requested on _ACTION_DATE_. <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS approval is required by _ORIGINATOR_NAME_ for a _ITEM_TYPE_.', 'N', '2015-01-23 00:00:00', '1', '2015-01-23 00:00:00', '1'),
(4, 'notify_previous_chain_parties', 'A _ITEM_TYPE_ has been _VERIFICATION_RESULT_', 'The _ITEM_TYPE_ you acted on at TMIS has been _VERIFICATION_RESULT_. This action was taken on _ACTION_DATE_.  <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'The _ITEM_TYPE_ you acted on at TMIS has been _VERIFICATION_RESULT_ by _APPROVER_NAME_.', 'N', '2015-01-23 00:00:00', '1', '2015-01-23 00:00:00', '1'),
(5, 'document__confirmation_letter', '', '<table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\' style=\'font-family: Georgia, &quot;Times New Roman&quot;, Times, serif;\'>\r\n<tr><td align=\'left\' valign=\'top\'><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\' style=\'border-bottom: solid 3px #000;\'>\r\n  <tr>\r\n    <td valign=\'top\' style=\'padding-top: 20px; padding-bottom: 0px; text-align:left;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'2\' align=\'left\' style=\'font-weight:bold;\'>\r\n      <tr>\r\n        <td>Telephone:</td>\r\n        <td>0412 34451/4</td>\r\n      </tr>\r\n      <tr>\r\n        <td>Fax:</td>\r\n        <td>0412 234920</td>\r\n      </tr>\r\n      <tr>\r\n        <td>Email:</td>\r\n        <td>pro@education.co.ug</td>\r\n      </tr>\r\n      <tr>\r\n        <td>Website:</td>\r\n        <td>www.education.co.ug</td>\r\n      </tr>\r\n    </table></td>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center;\' nowrap><img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\'/><br /><span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 12px; font-weight:bold; text-align:center;\'>REPUBLIC OF UGANDA</span></td>\r\n    <td style=\'padding-top: 20px; padding-bottom: 10px; text-align:right;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'2\' style=\'font-weight:bold;\' align=\'right\'>\r\n      <tr>\r\n        <td nowrap>Ministry of Education, Science, Technology and Sports</td>\r\n        </tr>\r\n      <tr>\r\n        <td>Embassy House</td>\r\n        </tr>\r\n      <tr>\r\n        <td>P.O. Box 7063</td>\r\n        </tr>\r\n      <tr>\r\n        <td>Kampala Uganda</td>\r\n        </tr>\r\n    </table></td>\r\n    </tr>\r\n</table></td></tr>\r\n<tr>\r\n  <td>\r\n  \r\n  <table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr><td><table border=\'0\' cellspacing=\'0\' cellpadding=\'3\' style=\'font-weight:bold;\'>\r\n      <tr>\r\n        <td colspan=\'2\' style=\'height:40px; color:#999; vertical-align:top;\'>_DATE_TODAY_</td>\r\n        </tr>\r\n      <tr>\r\n        <td colspan=\'2\' style=\'font-weight:normal;\'>_TEACHER_NAME_</td>\r\n        </tr>\r\n      <tr>\r\n        <td colspan=\'2\' style=\'height:40px; vertical-align:top;\'>_NEW_POSITION_</td>\r\n        </tr>\r\n      <tr>\r\n        <td valign=\'top\' width=\'1%\'>Thru:</td>\r\n        <td width=\'99%\' style=\'font-weight:normal; line-height:160%;\'>The Head Teacher,<br />\r\n_SCHOOL_NAME_<br />\r\n_SCHOOL_ADDRESS_</td>\r\n      </tr>\r\n    </table></td><td valign=\'top\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'0\' align=\'right\'>\r\n      <tr>\r\n        <td style=\'height:30px; color:#999;\'>&nbsp;</td>\r\n      </tr>\r\n      <tr>\r\n        <td style=\'font-weight:normal;\'>_TRACKING_IMAGE_</td>\r\n      </tr>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Courier New&quot;, Courier, monospace; text-align:center;color:#999;\'>_TRACKING_NUMBER_<br />\r\n          <span style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold;color:#999;\'><br />QUOTE TRACKING NUMBER IN <br />FUTURE CORRESPONDENCE.</span></td>\r\n      </tr>\r\n    </table></td></tr>\r\n  </table>\r\n  \r\n\r\n  </td>\r\n</tr>\r\n\r\n\r\n<tr><td>&nbsp;</td></tr>\r\n\r\n\r\n<tr>\r\n  <td style=\'line-height:160%;\'><span style=\'font-weight:bold\'>RE: CONFIRMATION OF APPOINTMENT</span><br />\r\n    I am pleased to inform you that the Education Service Commission under Minute No. _MINUTE_NUMBER_, directed that you be confirmed in your appointment as <span style=\'font-weight:bold;\'>_NEW_POSITION_</span> and admitted to the permanent and pensionable establishment of the Public Service with effect from the date of appointment on probation.<br />\r\n    <br />\r\n    Your attention is drawn to the Uganda Public Service Standing Orders 2010 Section <span style=\'font-weight:bold;\'>a-e</span> paragraphs <span style=\'font-weight:bold;\'>10-13</span> which explain the effect of confirmation.<br />\r\n    <br />\r\n    Yours faithfully,</td>\r\n</tr>\r\n<tr>\r\n  <td><br /><img src=\'_ASSET_FOLDER_uploads/images/_APPROVER_SIGNATURE_\' border=\'0\' style=\'height:80px;\' />\r\n<br /><br />_APPROVER_NAME_\r\n<br /><span style=\'font-weight:bold;\'>For: PERMANENT SECRETARY</span></td>\r\n</tr>\r\n<tr>\r\n  <td style=\'line-height:160%;\'>C.C: The Auditor General, Audit Commission <br />\r\n    C.C: \r\n    Permanent Secretary, Ministry of Public Service<br />\r\n    C.C: Secretary, Education Service Commission<br />\r\n    C.C: Personal File\r\n  </td>\r\n</tr>\r\n<tr>\r\n  <td style=\'border-top: solid 3px #000;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'0\' width=\'100%\' style=\'font-weight:bold;\'>\r\n    <tr>\r\n      <td style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#999;\'>THIS LETTER HAS AN ELECTRONIC RECORD. MODIFICATION OR FORGERY IS PUNISHABLE BY LAW.</td>\r\n      <td style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; text-align:right;\'>FORM: C-510A &nbsp;&nbsp; 01-DEC-2014</td>\r\n    </tr>\r\n  </table></td>\r\n</tr>\r\n</table>', '', 'Y', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(6, 'issue_file_number', 'You Have Been Issued a Teacher File Number', 'You have been issued a file number: _FILE_NUMBER_. <br> <br>Use it in any of your correspondence with the ministry to allow us to process your case faster. <br> <br>Regards, <br>Your TMIS Admin Team <br> ', 'You have been issued a file number: _FILE_NUMBER_. Use it in any of your correspondence with the Ministry of Education, Science, Technology and Sports.', 'N', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(7, 'send_confirmation_letter', 'Your Confirmation Letter', 'You have been issued a confirmation letter for your application which is attached. You can also access it in the TMIS system using your account. <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your confirmation letter has been sent.', 'N', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(8, 'document__registration_certificate', '', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\'  >\r\n<tr><td valign=\'top\' align=\'left\'><img src=\'_ASSET_FOLDER_images/top_left_corner.png\' border=\'0\'  height=\'50\'/></td><td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'><img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'100\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 20px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 20px; text-align:center; color:#333; \' nowrap>MINISTRY OF EDUCATION, SCIENCE, TECHNOLOGY AND SPORTS</span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'><img src=\'_ASSET_FOLDER_images/top_right_corner.png\' border=\'0\' height=\'50\' /></td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'50\'/><br>\r\n	<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 20px; text-align:center; padding-top:0px;padding-bottom:50px;\'>(Issued under Sections 11, 12 and 13 of the Education Act, 2008)</span></td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:65px; padding-bottom:5px; font-size: 30px; text-align:center; vertical-align:bottom;\'>This is to certify that</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 20px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:100%;\'>Having completed satisfactorily a teacher training course approved by the Ministry\r\n<br />\r\n       has been registered as a <b>_TEACHER_GRADE_</b> with effect from _EFFECTIVE_DATE_ His/Her registration \r\nNo. is <b>_CERTIFICATE_NUMBER_</b>.</td>\r\n  </tr>\r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 20px; text-align:left; color:#999; \'>_DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n</table></td>\r\n  </tr>\r\n<tr><td valign=\'bottom\' align=\'left\' style=\'padding-top:0px;\'><img src=\'_ASSET_FOLDER_images/bottom_left_corner.png\' border=\'0\' height=\'50\' /></td>\r\n  <td style=\'text-align:center;padding-top:0px; padding-bottom:0px;\'>&nbsp;</td>\r\n  <td valign=\'bottom\' align=\'right\' style=\'padding-top:0px;\'><img src=\'_ASSET_FOLDER_images/bottom_right_corner.png\' border=\'0\' height=\'50\' /></td></tr>\r\n</table>\r\n</body>\r\n</html>', '', 'Y', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(9, 'send_registration_certificate', 'Your Registration Certificate', 'You have been issued a registration certificate for your application which is attached. You can also access it in the TMIS system using your account. <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your registration certificate has been sent.', 'N', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(10, 'document__transfer_letter', '', '<table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\' style=\'font-family: Georgia, &quot;Times New Roman&quot;, Times, serif;\'>\n<tr><td align=\'left\' valign=\'top\'><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\' style=\'border-bottom: solid 3px #000;\'>\n  <tr>\n    <td valign=\'top\' style=\'padding-top: 20px; padding-bottom: 0px; text-align:left;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'2\' align=\'left\' style=\'font-weight:bold;\'>\n      <tr>\n        <td>Telephone:</td>\n        <td>0412 34451/4</td>\n      </tr>\n      <tr>\n        <td>Fax:</td>\n        <td>0412 234920</td>\n      </tr>\n      <tr>\n        <td>Email:</td>\n        <td>pro@education.co.ug</td>\n      </tr>\n      <tr>\n        <td>Website:</td>\n        <td>www.education.co.ug</td>\n      </tr>\n    </table></td>\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center;\' nowrap><img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\'/><br /><span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 12px; font-weight:bold; text-align:center;\'>REPUBLIC OF UGANDA</span></td>\n    <td style=\'padding-top: 20px; padding-bottom: 10px; text-align:right;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'2\' style=\'font-weight:bold;\' align=\'right\'>\n      <tr>\n        <td nowrap>Ministry of Education, Science, Technology and Sports</td>\n        </tr>\n      <tr>\n        <td>Embassy House</td>\n        </tr>\n      <tr>\n        <td>P.O. Box 7063</td>\n        </tr>\n      <tr>\n        <td>Kampala Uganda</td>\n        </tr>\n    </table></td>\n    </tr>\n</table></td></tr>\n<tr>\n  <td>\n  \n  <table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\n  <tr><td><table border=\'0\' cellspacing=\'0\' cellpadding=\'3\' style=\'font-weight:bold;\'>\n      <tr>\n        <td colspan=\'2\' style=\'height:40px; color:#999; vertical-align:top;\'>_DATE_TODAY_</td>\n        </tr>\n      <tr>\n        <td colspan=\'2\' style=\'font-weight:normal;\'>_TEACHER_NAME_<br>REG._FILE_NUMBER_</td>\n        </tr>\n      <tr>\n        <td colspan=\'2\' style=\'height:40px; vertical-align:top;\'>_NEW_POSITION_</td>\n        </tr>\n      <tr>\n        <td valign=\'top\' width=\'1%\'>Thru:</td>\n        <td width=\'99%\' style=\'font-weight:normal; line-height:160%;\'>The Head Teacher,<br />\n_SCHOOL_NAME_<br />\n_SCHOOL_ADDRESS_</td>\n      </tr>\n    </table></td><td valign=\'top\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'0\' align=\'right\'>\n      <tr>\n        <td style=\'height:30px; color:#999;\'>&nbsp;</td>\n      </tr>\n      <tr>\n        <td style=\'font-weight:normal;\'>_TRACKING_IMAGE_</td>\n      </tr>\n      <tr>\n        <td style=\'font-family:&quot;Courier New&quot;, Courier, monospace; text-align:center;color:#999;\'>_TRACKING_NUMBER_<br />\n          <span style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold;color:#999;\'><br />QUOTE TRACKING NUMBER IN <br />FUTURE CORRESPONDENCE.</span></td>\n      </tr>\n    </table></td></tr>\n  </table>\n  \n\n  </td>\n</tr>\n\n\n<tr><td>&nbsp;</td></tr>\n\n\n<tr>\n  <td style=\'line-height:160%;\'><span style=\'font-weight:bold\'>RE: CONFIRMATION OF APPOINTMENT</span><br />\n    I am pleased to inform you that the Education Service Commission under Minute No. _MINUTE_NUMBER_, directed that you be confirmed in your appointment as <span style=\'font-weight:bold;\'>_NEW_POSITION_ at _SCHOOL_NAME_</span> and admitted to the permanent and pensionable establishment of the Public Service with effect from the date of appointment on probation.<br />\n    <br />\n    Your attention is drawn to the Uganda Public Service Standing Orders 2010 Section <span style=\'font-weight:bold;\'>a-e</span> paragraphs <span style=\'font-weight:bold;\'>10-13</span> which explain the effect of confirmation.<br />\n    <br />\n    Yours faithfully,</td>\n</tr>\n<tr>\n  <td><br /><img src=\'_ASSET_FOLDER_uploads/images/_APPROVER_SIGNATURE_\' border=\'0\' style=\'height:80px;\' />\n<br /><br />_APPROVER_NAME_\n<br /><span style=\'font-weight:bold;\'>For: PERMANENT SECRETARY</span></td>\n</tr>\n<tr>\n  <td style=\'line-height:160%;\'>C.C: The Auditor General, Audit Commission <br />\n    C.C: \n    Permanent Secretary, Ministry of Public Service<br />\n    C.C: Secretary, Education Service Commission<br />\n    C.C: Personal File\n  </td>\n</tr>\n<tr>\n  <td style=\'border-top: solid 3px #000;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'0\' width=\'100%\' style=\'font-weight:bold;\'>\n    <tr>\n      <td style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#999;\'>THIS LETTER HAS AN ELECTRONIC RECORD. MODIFICATION OR FORGERY IS PUNISHABLE BY LAW.</td>\n      <td style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; text-align:right;\'>FORM: C-530A &nbsp;&nbsp; 01-DEC-2014</td>\n    </tr>\n  </table></td>\n</tr>\n</table>', '', 'N', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(11, 'send_transfer_letter', 'Your Transfer Letter', 'You have been issued a transfer letter for your application which is attached. You can also access it in the TMIS system using your account. <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your transfer letter has been sent.', 'N', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(12, 'document__transfer_pca', '', '<table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\' style=\'font-family: Georgia, &quot;Times New Roman&quot;, Times, serif;\'>\n<tr><td align=\'left\' valign=\'top\'><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\' style=\'border-bottom: solid 3px #000;\'>\n  <tr>\n    <td valign=\'top\' style=\'padding-top: 20px; padding-bottom: 0px; text-align:left;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'2\' align=\'left\' style=\'font-weight:bold;\'>\n      <tr>\n        <td>Telephone:</td>\n        <td>0412 34451/4</td>\n      </tr>\n      <tr>\n        <td>Fax:</td>\n        <td>0412 234920</td>\n      </tr>\n      <tr>\n        <td>Email:</td>\n        <td>pro@education.co.ug</td>\n      </tr>\n      <tr>\n        <td>Website:</td>\n        <td>www.education.co.ug</td>\n      </tr>\n    </table></td>\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center;\' nowrap><img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\'/><br /><span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 12px; font-weight:bold; text-align:center;\'>REPUBLIC OF UGANDA</span></td>\n    <td style=\'padding-top: 20px; padding-bottom: 10px; text-align:right;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'2\' style=\'font-weight:bold;\' align=\'right\'>\n      <tr>\n        <td nowrap>Ministry of Education, Science, Technology and Sports</td>\n        </tr>\n      <tr>\n        <td>Embassy House</td>\n        </tr>\n      <tr>\n        <td>P.O. Box 7063</td>\n        </tr>\n      <tr>\n        <td>Kampala Uganda</td>\n        </tr>\n    </table></td>\n    </tr>\n</table></td></tr>\n<tr>\n  <td>\n  \n  <table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\n  <tr><td><table border=\'0\' cellspacing=\'0\' cellpadding=\'3\' style=\'font-weight:bold;\'>\n      <tr>\n        <td colspan=\'2\' style=\'height:40px; color:#999; vertical-align:top;\'>_DATE_TODAY_</td>\n        </tr>\n      <tr>\n        <td colspan=\'2\' style=\'font-weight:normal;\'>_TEACHER_NAME_<br>REG._FILE_NUMBER_<br><br></td>\n        </tr>\n      <tr>\n        <td valign=\'top\' width=\'1%\'>Thru:</td>\n        <td width=\'99%\' style=\'font-weight:normal; line-height:160%;\'>The Head Teacher,<br />\n_OLD_SCHOOL_NAME_<br><br></td>\n      </tr>\n    </table></td><td valign=\'top\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'0\' align=\'right\'>\n      <tr>\n        <td style=\'height:30px; color:#999;\'>&nbsp;</td>\n      </tr>\n      <tr>\n        <td style=\'font-weight:normal;\'>_TRACKING_IMAGE_</td>\n      </tr>\n      <tr>\n        <td style=\'font-family:&quot;Courier New&quot;, Courier, monospace; text-align:center;color:#999;\'>_TRACKING_NUMBER_<br />\n          <span style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold;color:#999;\'><br />QUOTE TRACKING NUMBER IN <br />FUTURE CORRESPONDENCE.</span></td>\n      </tr>\n    </table></td></tr>\n  </table>\n  \n\n  </td>\n</tr>\n\n\n<tr><td>&nbsp;</td></tr>\n\n\n<tr>\n  <td style=\'line-height:160%;\'><span style=\'font-weight:bold\'>RE: STAFF TRANSFER OF TEACHERS _DATE_YEAR_</span><br />\n    This is to inform you that your transfer from <span style=\'font-weight:bold;\'>_OLD_SCHOOL_NAME_</span> to <span style=\'font-weight:bold;\'>_NEW_SCHOOL_NAME_</span> to teach _SUBJECT_LIST_ has been approved with immediate effect.<br />\n    <br />\n    You are required to make a formal handover at your current station and report to the headteacher of your new station.<br />\n    </td>\n</tr>\n<tr>\n  <td><br /><img src=\'_ASSET_FOLDER_uploads/images/_APPROVER_SIGNATURE_\' border=\'0\' style=\'height:80px;\' />\n<br /><br />_APPROVER_NAME_\n<br /><span style=\'font-weight:bold;\'>For: PERMANENT SECRETARY</span></td>\n</tr>\n<tr>\n  <td style=\'line-height:160%;\'>C.C: The Chief Administrative Officer<br />\n    C.C: The District Education Officer<br />\n    C.C: The Headteacher\n  </td>\n</tr>\n<tr>\n  <td style=\'border-top: solid 3px #000;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'0\' width=\'100%\' style=\'font-weight:bold;\'>\n    <tr>\n      <td style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#999;\'>THIS LETTER HAS AN ELECTRONIC RECORD. MODIFICATION OR FORGERY IS PUNISHABLE BY LAW.</td>\n      <td style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; text-align:right;\'>FORM: C-520A &nbsp;&nbsp; 01-DEC-2014</td>\n    </tr>\n  </table></td>\n</tr>\n</table>', '', 'N', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(13, 'send_transfer_pca', 'Your Transfer PCA', 'You have been issued a transfer PCA for your application which is attached. You can also access it in the TMIS system using your account. <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your transfer PCA has been sent.', 'N', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(14, 'document__verification_letter', '', '<table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\' style=\'font-family: Georgia, &quot;Times New Roman&quot;, Times, serif;\'>\r\n<tr><td align=\'left\' valign=\'top\'><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\' style=\'border-bottom: solid 3px #000;\'>\r\n  <tr>\r\n    <td valign=\'top\' style=\'padding-top: 20px; padding-bottom: 0px; text-align:left;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'2\' align=\'left\' style=\'font-weight:bold;\'>\r\n      <tr>\r\n        <td>Telephone:</td>\r\n        <td>0412 34451/4</td>\r\n      </tr>\r\n      <tr>\r\n        <td>Fax:</td>\r\n        <td>0412 234920</td>\r\n      </tr>\r\n      <tr>\r\n        <td>Email:</td>\r\n        <td>pro@education.co.ug</td>\r\n      </tr>\r\n      <tr>\r\n        <td>Website:</td>\r\n        <td>www.education.co.ug</td>\r\n      </tr>\r\n    </table></td>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center;\' nowrap><img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\'/><br /><span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 12px; font-weight:bold; text-align:center;\'>REPUBLIC OF UGANDA</span></td>\r\n    <td style=\'padding-top: 20px; padding-bottom: 10px; text-align:right;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'2\' style=\'font-weight:bold;\' align=\'right\'>\r\n      <tr>\r\n        <td nowrap>Ministry of Education, Science, Technology and Sports</td>\r\n        </tr>\r\n      <tr>\r\n        <td>Embassy House</td>\r\n        </tr>\r\n      <tr>\r\n        <td>P.O. Box 7063</td>\r\n        </tr>\r\n      <tr>\r\n        <td>Kampala Uganda</td>\r\n        </tr>\r\n    </table></td>\r\n    </tr>\r\n</table></td></tr>\r\n<tr>\r\n  <td>\r\n  \r\n  <table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr><td><table border=\'0\' cellspacing=\'0\' cellpadding=\'3\' style=\'font-weight:bold;\'>\r\n      <tr>\r\n        <td colspan=\'2\' style=\'height:40px; color:#999; vertical-align:top;\'>_DATE_TODAY_</td>\r\n        </tr>\r\n      <tr>\r\n        <td colspan=\'2\' style=\'font-weight:normal;\'>_TEACHER_NAME_</td>\r\n        </tr>\r\n      <tr>\r\n        <td colspan=\'2\' style=\'height:40px; vertical-align:top;\'>_JOB_POSITION_</td>\r\n        </tr>\r\n      <tr>\r\n        <td valign=\'top\' width=\'1%\'>Thru:</td>\r\n        <td width=\'99%\' style=\'font-weight:normal; line-height:160%;\'>The Head Teacher,<br />\r\n_SCHOOL_NAME_<br />\r\n_SCHOOL_ADDRESS_</td>\r\n      </tr>\r\n    </table></td><td valign=\'top\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'0\' align=\'right\'>\r\n      <tr>\r\n        <td style=\'height:30px; color:#999;\'>&nbsp;</td>\r\n      </tr>\r\n      <tr>\r\n        <td style=\'font-weight:normal;\'>_TRACKING_IMAGE_</td>\r\n      </tr>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Courier New&quot;, Courier, monospace; text-align:center;color:#999;\'>_TRACKING_NUMBER_<br />\r\n          <span style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold;color:#999;\'><br />QUOTE TRACKING NUMBER IN <br />FUTURE CORRESPONDENCE.</span></td>\r\n      </tr>\r\n    </table></td></tr>\r\n  </table>\r\n  \r\n\r\n  </td>\r\n</tr>\r\n\r\n\r\n<tr><td>&nbsp;</td></tr>\r\n\r\n\r\n<tr>\r\n  <td style=\'line-height:160%;\'><span style=\'font-weight:bold\'>RE: _LEAVE_TYPE_</span><br />\r\n    This is to inform you that the Education Service Commission under Minute No. _MINUTE_NUMBER_, directed that you be\r\npermitted _LEAVESMALL_TYPE_ from _START_DATE_ to _END_DATE_ for the following reason:\r\n<br>_LEAVE_REASON_\r\n<br /><br />\r\n    You are under obligation in accordance with Uganda Public Service Standing Orders 2010 Section <span style=\'font-weight:bold;\'>1 (c-d)</span> to return to your institution and resume duties immediately after the completion of your leave.<br />\r\n    <br />\r\n    Yours faithfully,</td>\r\n</tr>\r\n<tr>\r\n  <td><br /><img src=\'_ASSET_FOLDER_uploads/images/_APPROVER_SIGNATURE_\' border=\'0\' style=\'height:80px;\' />\r\n<br /><br />_APPROVER_NAME_\r\n<br /><span style=\'font-weight:bold;\'>For: PERMANENT SECRETARY</span></td>\r\n</tr>\r\n<tr>\r\n  <td style=\'height:60px;\'>&nbsp;\r\n  </td>\r\n</tr>\r\n<tr>\r\n  <td style=\'border-top: solid 3px #000;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'0\' width=\'100%\' style=\'font-weight:bold;\'>\r\n    <tr>\r\n      <td style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#999;\'>THIS LETTER HAS AN ELECTRONIC RECORD. MODIFICATION OR FORGERY IS PUNISHABLE BY LAW.</td>\r\n      <td style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; text-align:right;\'>FORM: C-540A &nbsp;&nbsp; 01-DEC-2014</td>\r\n    </tr>\r\n  </table></td>\r\n</tr>\r\n</table>', '', 'N', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(15, 'send_verification_letter', 'Your Verification Letter', 'You have been issued a verification letter for your application which is attached. You can also access it in the TMIS system using your account. <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your verification letter has been sent.', 'N', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(16, 'document__retirement_letter', '', '<table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\' style=\'font-family: Georgia, &quot;Times New Roman&quot;, Times, serif;\'>\r\n<tr><td align=\'left\' valign=\'top\'><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\' style=\'border-bottom: solid 3px #000;\'>\r\n  <tr>\r\n    <td valign=\'top\' style=\'padding-top: 20px; padding-bottom: 0px; text-align:left;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'2\' align=\'left\' style=\'font-weight:bold;\'>\r\n      <tr>\r\n        <td>Telephone:</td>\r\n        <td>0412 34451/4</td>\r\n      </tr>\r\n      <tr>\r\n        <td>Fax:</td>\r\n        <td>0412 234920</td>\r\n      </tr>\r\n      <tr>\r\n        <td>Email:</td>\r\n        <td>pro@education.co.ug</td>\r\n      </tr>\r\n      <tr>\r\n        <td>Website:</td>\r\n        <td>www.education.co.ug</td>\r\n      </tr>\r\n    </table></td>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center;\' nowrap><img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\'/><br /><span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 12px; font-weight:bold; text-align:center;\'>REPUBLIC OF UGANDA</span></td>\r\n    <td style=\'padding-top: 20px; padding-bottom: 10px; text-align:right;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'2\' style=\'font-weight:bold;\' align=\'right\'>\r\n      <tr>\r\n        <td nowrap>Ministry of Education, Science, Technology and Sports</td>\r\n        </tr>\r\n      <tr>\r\n        <td>Embassy House</td>\r\n        </tr>\r\n      <tr>\r\n        <td>P.O. Box 7063</td>\r\n        </tr>\r\n      <tr>\r\n        <td>Kampala Uganda</td>\r\n        </tr>\r\n    </table></td>\r\n    </tr>\r\n</table></td></tr>\r\n<tr>\r\n  <td>\r\n  \r\n  <table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr><td><table border=\'0\' cellspacing=\'0\' cellpadding=\'3\' style=\'font-weight:bold;\'>\r\n      <tr>\r\n        <td colspan=\'2\' style=\'height:40px; color:#999; vertical-align:top;\'>_DATE_TODAY_</td>\r\n        </tr>\r\n      <tr>\r\n        <td colspan=\'2\' style=\'font-weight:normal; line-height:160%;\'>Permanent Secretary\r\n	<br>Ministry of Public Service\r\n	<br>KAMPALA</td>\r\n        </tr>\r\n<tr>\r\n        <td colspan=\'2\' style=\'font-weight:normal; line-height:160%;\'>&nbsp;</td>\r\n        </tr>\r\n        <tr>\r\n        <td colspan=\'2\' style=\'font-weight:normal; line-height:160%;\'>&nbsp;</td>\r\n        </tr>\r\n    </table></td><td valign=\'top\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'0\' align=\'right\'>\r\n      <tr>\r\n        <td style=\'height:30px; color:#999;\'>&nbsp;</td>\r\n      </tr>\r\n      <tr>\r\n        <td style=\'font-weight:normal;\'>_TRACKING_IMAGE_</td>\r\n      </tr>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Courier New&quot;, Courier, monospace; text-align:center;color:#999;\'>_TRACKING_NUMBER_<br />\r\n          <span style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold;color:#999;\'><br />QUOTE TRACKING NUMBER IN <br />FUTURE CORRESPONDENCE.</span></td>\r\n      </tr>\r\n    </table></td></tr>\r\n  </table>\r\n  \r\n\r\n  </td>\r\n</tr>\r\n\r\n\r\n<tr><td>&nbsp;</td></tr>\r\n\r\n\r\n<tr>\r\n  <td style=\'line-height:160%;padding-top:60px;\'><span style=\'font-weight:bold\'>RETIREMENT BENEFITS: _TEACHER_NAME_ - REG. _FILE_NUMBER_ - _JOB_POSITION_</span><br />\r\n    I am forwarding herewith retirement benefit forms duly completed and verified with all the relevant documents in respect of the above mentioned for your necessary action.\r\n<br><br>Additional information: <br>_RETIREMENT_DETAILS_\r\n    <br />\r\n    <br />\r\n    Yours faithfully,</td>\r\n</tr>\r\n<tr>\r\n  <td><br /><img src=\'_ASSET_FOLDER_uploads/images/_APPROVER_SIGNATURE_\' border=\'0\' style=\'height:80px;\' />\r\n<br /><br />_APPROVER_NAME_\r\n<br /><span style=\'font-weight:bold;\'>For: PERMANENT SECRETARY</span></td>\r\n</tr>\r\n<tr>\r\n  <td style=\'height:60px;\'>CC. Personal File\r\n  </td>\r\n</tr>\r\n<tr>\r\n  <td style=\'border-top: solid 3px #000;\'><table border=\'0\' cellspacing=\'0\' cellpadding=\'0\' width=\'100%\' style=\'font-weight:bold;\'>\r\n    <tr>\r\n      <td style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#999;\'>THIS LETTER HAS AN ELECTRONIC RECORD. MODIFICATION OR FORGERY IS PUNISHABLE BY LAW.</td>\r\n      <td style=\'font-size:9px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; text-align:right;\'>FORM: C-550A &nbsp;&nbsp; 01-DEC-2014</td>\r\n    </tr>\r\n  </table></td>\r\n</tr>\r\n</table>', '', 'N', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(17, 'send_retirement_letter', 'Your Retirement Letter', 'You have been issued a retirement letter for your application which is attached. <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your retirement letter has been sent.', 'N', '2015-01-24 00:00:00', '1', '2015-01-24 00:00:00', '1'),
(18, 'introduce_new_user', 'Your New Account Details', 'An account has been created for you at the Teacher Management Information System (TMIS). You will need the following details to login: <br> Your user name: _EMAILADDRESS_ <br>Your Temporary Password: _PASSWORD_ <br>Please note that this password is case sensitive. <br> <br>Use the link below to access the TMIS website: <br>_LOGIN_LINK_ <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS account has been created. Login at _LOGIN_LINK_ with username: _EMAILADDRESS_ and password: _PASSWORD_', 'N', '2015-01-26 00:00:00', '1', '2015-01-26 00:00:00', '1'),
(19, 'notify_change_of_user_status', 'Your TMIS User Status has Been Changed', 'Your TMIS user status is now _STATUS_. <br> <br>If you believe this was made in error, please notify us immediately. <br> <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS user status is now _STATUS_.', 'N', '2015-01-27 00:00:00', '1', '2015-01-27 00:00:00', '1'),
(20, 'reject_user_application', 'Your User Application Has Been Rejected', 'Your TMIS user application has been queried. <br>Reasons given: <br>_REASON_ <br> \r\n<br>1. Please login to your Tmis account at: _LOGIN_LINK_. <br>2. Update your teacher profile. <br>3.Save the changes to re-apply with the reasons fixed. \r\n<br>Regards, <br>TMIS Admin Team <br>', 'Your TMIS user application has been queried. Please see your email for reasons.', 'N', '2015-01-27 00:00:00', '1', '2015-01-27 00:00:00', '1'),
(21, 'reject_permission_group', 'Your Permission Group Addition Has Been Rejected', 'Your TMIS permission group addition has been rejected. <br>Reasons given: <br>_REASON_ <br> <br>Please re-add with the reasons fixed at: <br>_LOGIN_LINK_ <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS permission group addition has been rejected. Please see your email for reasons.', 'N', '2015-01-27 00:00:00', '1', '2015-01-27 00:00:00', '1'),
(22, 'user_defined_message', '_USER_DEFINED_', '_USER_DEFINED_', '_USER_DEFINED_', 'Y', '2015-01-30 00:00:00', '1', '2015-01-30 00:00:00', '1'),
(23, 'notify_change_of_data_status', 'A _ITEM_ status has been changed by _APPROVER_NAME_', 'The status of a _ITEM_ you acted on at TMIS has been changed to _STATUS_ by _APPROVER_NAME_. This action was taken on _ACTION_DATE_. The details of the _ITEM_ are: <br>_DETAILS_ <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'The status of a _ITEM_ you acted on has been changed to _STATUS_ by _APPROVER_NAME_.', 'Y', '2015-01-30 00:00:00', '1', '2015-01-30 00:00:00', '1'),
(24, 'contact_us_message', 'TMIS Message From _USERNAMES_: _SUBJECT_', 'A message was sent by _USERNAMES_ at _SENT_TIME_ from _LOGIN_LINK_ with the following details: <br> <br><b>Your Name:</b> _USERNAMES_ <br><b>Email Address:</b> _USEREMAILADDRESS_ <br><b>Telephone:</b> _TELEPHONE_ <br><b>Reason:</b> _SUBJECT_ <br><b>Message:</b> <br>_DETAILS_ <br> <br>Regards, <br>Your TMIS Admin Team <br>', '', 'Y', '2015-02-02 00:00:00', '1', '2015-02-02 00:00:00', '1'),
(25, 'job_application_sent', 'TMIS Job Application Submitted by _FROM_NAME_', 'A job application has been submitted by _FROM_NAME_. This action was taken on _ACTION_DATE_. The details of the job are: <br>Job Title: _JOB_TITLE_ <br>Role: _JOB_ROLE_ <br>Institution: _INSTITUTION_ <br>Summary: _JOB_SUMMARY_ <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'A job application has been submitted by _FROM_NAME_ at the TMIS website for _JOB_TITLE_.', 'N', '2015-02-04 00:00:00', '1', '2015-02-04 00:00:00', '1'),
(26, 'notice_of_set_interview', 'An Interview Has Been Set for _APPLICANT_', 'An interview has been set for a job application with _INSTITUTION_NAME_ that you submitted at the TMIS website on _SUBMISSION_DATE_. <br>The interview will be carried out on _PLANNED_DATE_ by _INTERVIEWER_. <br> <br>The interviewer would like you to take note of the following: <br>_INTERVIEW_NOTES_ <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'An interview has been set for _APPLICANT_ for the job at _INSTITUTION_NAME_ to be interviewed by _INTERVIEWER_ on _PLANNED_DATE_.', 'N', '2015-02-01 00:00:00', '1', '2015-02-01 00:00:00', '1'),
(27, 'notify_interview_status_change', 'Result of the Interview for _APPLICANT_NAME_ Have Been Posted', 'The interview attended by _APPLICANT_NAME_ on _INTERVIEW_DATE_ for the job [_JOB_NAME_] has been posted as _INTERVIEW_RESULT_. This action was carried out on _ACTION_DATE_. <br> <br>The following note was added regarding this result: <br>_INTERVIEW_NOTES_ <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'The result for the interview attended by _APPLICANT_NAME_ on _INTERVIEW_DATE_ for the job [_JOB_NAME_] has been posted as _INTERVIEW_RESULT_.', 'Y', '2015-02-05 00:00:00', '1', '2015-02-05 00:00:00', '1'),
(28, 'notify_interview_cancellation', 'The Interview With _INTERVIEWER_NAME_ Has Been Cancelled', 'The interview for _APPLICANT_NAME_ for the job [_JOB_NAME_] with _INTERVIEWER_NAME_ which was scheduled for _INTERVIEW_DATE_ has been cancelled. This action was taken on _ACTION_DATE_. <br>Reasons given: <br>_REASON_ <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'The interview for the job [_JOB_NAME_] with _INTERVIEWER_NAME_ which was scheduled for _INTERVIEW_DATE_ has been cancelled.', 'Y', '2015-02-05 00:00:00', '1', '2015-02-05 00:00:00', '1'),
(29, 'request_teacher_posting', 'Your Approval is Required to Post a Teacher', 'A teacher with the name _APPLICANT_NAME_ has passed the final interview and has therefore been awarded the post of _JOB_NAME_. This development was posted by _MADE_BY_ on _ACTION_DATE_. <br> <br>Your approval is required in the TMIS system to post the teacher so that they can begin their probational period of employment at their new job. <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your approval is required to post a teacher _APPLICANT_NAME_ for the job _JOB_NAME_.', 'Y', '2015-02-06 00:00:00', '1', '2015-02-06 00:00:00', '1'),
(30, 'password_recovery_notification', 'Your Temporary Password for TMIS', 'Your TMIS password has been reset.  <br>You will need the following details to login: <br> Your user name: _EMAILADDRESS_ <br>Your Temporary Password: _PASSWORD_ <br>For your security, you are encouraged to change this password the first time you login on your profile page. <br> <br>In case you closed the TMIS website, go to the link below to login: <br>_LOGIN_LINK_ <br> <br>If you did not request this password change, please contact us at security@timis.go.ug <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS temporary Password is _PASSWORD_', 'N', '2015-02-07 00:00:00', '1', '2015-02-07 00:00:00', '1'),
(31, 'notify_permission_change', 'Your TMIS Permissions Have Changed', 'Your permission group has been changed to [_NEW_PERMISSION_GROUP_] by _UPDATED_BY_. This action was taken on _ACTION_DATE_. <br> <br>Use the link below to login with your new permissions: <br>_LOGIN_LINK_ <br> <br>If you believe this was done in error, please contact us immediately. <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS permissions have been changed to [_NEW_PERMISSION_GROUP_] by _UPDATED_BY_. ', 'N', '2015-02-17 00:00:00', '1', '2015-02-17 00:00:00', '1'),
(32, 'notify_interviewer_of_date', 'An interview has been set for _PLANNED_DATE_', 'An interview has been set for _APPLICANT_ who submitted an application for a job at _INSTITUTION_NAME_ using the TMIS website on _SUBMISSION_DATE_.\n <br>The interview will be carried out on _PLANNED_DATE_ by _INTERVIEWER_.\n <br>\n <br>Interview note:\n <br>_INTERVIEW_NOTES_\n <br>\n <br>Regards,\n <br>Your TMIS Admin Team\n <br>', 'An interview has been set for _PLANNED_DATE_ to be interviewed by _INTERVIEWER_', 'Y', '2015-03-04 00:00:00', '1', '2015-03-04 00:00:00', '1'),
(33, 'CHILD_CARE__GIVER', 'CHILD CARE GIVER', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n \r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' class=\"wrapper\" >\r\n<tr><td valign=\'top\' align=\'left\'>&nbsp;</td><td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n   \r\n    <img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap>MINISTRY OF EDUCATION AND SPORTS </span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'>&nbsp;</td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px;\'>\r\n    \r\n    <img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'70\'/><br>\r\n  <span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 20px; text-align:center; padding-top:0px;padding-bottom:50px;\'>(Issued under Part V Sections 11, 12 and 13 of the Education )<br/>\r\n    (Pre-Primary, Primary and Post-Primary) Act, 2008</span></td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; font-weight:bold;\'>This is to certify that</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Having completed  satisfactorily a One Year Child Care Training Programme <br>approved by  the Ministry has been registered <br />\r\n      as a <b>_TEACHER_GRADE_</b> \r\n       with effect from _EFFECTIVE_DATE_ His/Her registration No. is  <b>_CERTIFICATENUMBER_</b>.</td>\r\n  </tr>\r\n \r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Date _DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px; margin-top: 62px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n  \r\n  <!-- Endorsment -->\r\n  <tr>\r\n  <td>Endorsement  ------------------------------------------------------------------------------------------------------------------------------------ \r\n  </td>\r\n  </tr>\r\n  \r\n \r\n \r\n</table></td>\r\n  </tr>\r\n\r\n</table>\r\n</body>\r\n</html>', '--', 'N', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1'),
(34, 'EARLY_CHILD_DEVELOPMENT_TEACHER', 'EARLY CHILD DEVELOPMENT TEACHER', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n\r\n<head>\r\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n    <title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\">\r\n\r\n    <table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' class=\"wrapper\">\r\n        <tr>\r\n            <td valign=\'top\' align=\'left\'>&nbsp;</td>\r\n            <td>\r\n                <table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n                    <tr>\r\n                        <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n\r\n\r\n                            <img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\' /> <br />\r\n                            <span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n                            <span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap> MINISTRY OF EDUCATION AND SPORTS </span></td>\r\n                    </tr>\r\n                </table>\r\n            </td>\r\n            <td valign=\'top\' align=\'right\'>&nbsp;</td>\r\n        </tr>\r\n        <tr>\r\n            <td colspan=\'3\' align=\'center\'>\r\n                <table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n                    <tr>\r\n                        <td style=\'text-align:center;padding-bottom:0px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'70\' /><br>\r\n                            <span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 20px; text-align:center; padding-top:0px;padding-bottom:50px;\'>(Issued under Part V Sections 11, 12 and 13 of the Education )<br />\r\n                                (Pre-Primary, Primary and Post-Primary) Act, 2008</span></td>\r\n                    </tr>\r\n                    <tr>\r\n                        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; font-weight:bold;\'>This is to certify that</td>\r\n                    </tr>\r\n                    <tr>\r\n                        <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n                    </tr>\r\n                    <tr>\r\n                        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Having completed satisfactorily a Two Year ECD Teacher Training Course <br>\r\n                            approved by the Ministry has been registered <br />\r\n                            as an <b>_TEACHER_GRADE_</b>\r\n                            with effect from _EFFECTIVE_DATE_ His/Her registration No. is <b>_CERTIFICATENUMBER_</b>.</td>\r\n                    </tr>\r\n\r\n                    <tr>\r\n                        <td>\r\n                            <table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n                                <tr>\r\n                                    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;margin-top: 62px;\'>Date _DATE_TODAY_</td>\r\n                                    <td style=\'width:400px;\'>For\r\n                                        <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px;margin-top: 62px;\' /></div>\r\n                                        <br />\r\n                                        <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n                                </tr>\r\n                            </table>\r\n                        </td>\r\n                    </tr>\r\n\r\n\r\n\r\n\r\n                </table>\r\n            </td>\r\n        </tr>\r\n\r\n    </table>\r\n</body>\r\n\r\n</html>', '', 'N', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1');
INSERT INTO `message` (`id`, `message_type`, `subject`, `details`, `sms`, `copy_admin`, `date_added`, `added_by`, `last_updated`, `last_updated_by`) VALUES
(35, 'GRADE_III', 'GRADE III', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n \r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' class=\"wrapper\" >\r\n<tr><td valign=\'top\' align=\'left\'>&nbsp;</td><td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n    \r\n    <img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap> MINISTRY OF EDUCATION AND SPORTS </span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'>&nbsp;</td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'70\'/><br>\r\n	<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 20px; text-align:center; padding-top:0px;padding-bottom:50px;\'>(Issued under Sections 11, 12 and 13 of the Education Act 2008 )</span></td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; font-weight:bold;\'>This is to certify that</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Having completed  satisfactorily a course\r\n      approved by  the Ministry <br/> has been registered \r\n      as a <b>_TEACHER_GRADE_</b> \r\n       with effect from _EFFECTIVE_DATE_ His/Her registration No. is  <b>_CERTIFICATENUMBER_</b>.</td>\r\n  </tr>\r\n \r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Date _DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px; margin-top: 62px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n  \r\n \r\n \r\n \r\n</table></td>\r\n  </tr>\r\n \r\n</table>\r\n</body>\r\n</html>', '', 'N', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1'),
(36, 'GRADUATE__TEACHER', 'GRADUATE HEALTH TUTOR', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n \r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' class=\"wrapper\" >\r\n<tr><td valign=\'top\' align=\'left\'>&nbsp;</td><td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n   \r\n<img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap> MINISTRY OF EDUCATION AND SPORTS </span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'>&nbsp;</td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'70\'/><br>\r\n	<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 20px; text-align:center; padding-top:0px;padding-bottom:50px;\'>(Issued under Sections 11, 12 and 13 of the Education Act 2008 )</span></td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; font-weight:bold;\'>This is to certify that</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Having completed  satisfactorily a teacher training  course\r\n      approved by  the Ministry <br/> has been registered \r\n      as a <b>_TEACHER_GRADE_</b> \r\n       with effect from _EFFECTIVE_DATE_ His/Her registration No. is  <b>_CERTIFICATENUMBER_</b>.</td>\r\n  </tr>\r\n \r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Date _DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px;margin-top: 62px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n  \r\n \r\n \r\n \r\n</table></td>\r\n  </tr>\r\n</table>\r\n</body>\r\n</html>', '', 'N', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1'),
(37, 'GRADUATE_HEALTH_TUTOR', 'GRADUATE HEALTH TUTOR', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n \r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' class=\"wrapper\" >\r\n<tr><td valign=\'top\' align=\'left\'>&nbsp;</td><td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n  \r\n  \r\n\r\n    <img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap>MINISTRY OF EDUCATION AND SPORTS</span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'>&nbsp;</td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'70\'/><br>\r\n	<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-top:0px;padding-bottom:50px; font-weight:bold;\'>(Issued under Sections 11, 12 and 13 of the Education)<br/>\r\n    (Pre-Primary,Primary and Post-Primary) Act, 2008</span></td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; font-weight:bold;\'>This is to certify that</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Having completed  satisfactorily a Bachelor of Medical Education <br/>   approved by  the Ministry  has been registered <br/>\r\n      as a <b>_TEACHER_GRADE_</b> \r\n       with effect from _EFFECTIVE_DATE_ His/Her registration No. is  <b>_CERTIFICATENUMBER_</b>.</td>\r\n  </tr>\r\n \r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Date _DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px;margin-top: 62px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n  \r\n \r\n \r\n \r\n</table></td>\r\n  </tr>\r\n</table>\r\n</body>\r\n</html>', '', 'N', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1'),
(38, 'VOCATIONAL_TRAINING_INSTRUCTOR__CERTIFICATE', 'VOCATIONAL TRAINING INSTRUCTOR', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n \r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' class=\"wrapper\" >\r\n<tr><td valign=\'top\' align=\'left\'>&nbsp;</td><td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n   \r\n<img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap>MINISTRY OF EDUCATION AND SPORTS</span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'>&nbsp;</td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'70\'/><br>\r\n	<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-top:0px;padding-bottom:50px; font-weight:bold;\'>(Issued under Sections 11, 12 and 13 of the Education Act, 2008)\r\n </span></td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; font-weight:bold;\'>This is to certify that</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Having completed  a Certificate in Vocational Training Instruction <br/>   approved by  the Ministry  of Education and Sports <br/>\r\n    has been registered as a <b>_TEACHER_GRADE_</b> \r\n       with effect from _EFFECTIVE_DATE_ His/Her registration No. is  <b>_CERTIFICATENUMBER_</b>.</td>\r\n  </tr>\r\n \r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Date _DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px;margin-top: 62px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n  \r\n \r\n \r\n \r\n</table></td>\r\n  </tr> \r\n</table>\r\n</body>\r\n</html>', '', 'N', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1'),
(39, 'VOCATIONAL_TRAINING_INSTRUCTOR__DIPLOMA', 'VOCATIONAL TRAINING INSTRUCTOR ', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n \r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' class=\"wrapper\" >\r\n<tr><td valign=\'top\' align=\'left\'>&nbsp;</td><td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n    \r\n   \r\n<img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap>MINISTRY OF EDUCATION AND SPORTS</span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'>&nbsp;</td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'70\'/><br>\r\n	<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-top:0px;padding-bottom:50px; font-weight:bold;\'>(Issued under Sections 11, 12 and 13 of the Education Act, 2008)\r\n </span></td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; font-weight:bold;\'>This is to certify that</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Having completed  a Diploma in Vocational Training Instruction, <br/>\r\n         approved by  the Ministry  of Education and Sports <br/>\r\n    has been registered as a <b>_TEACHER_GRADE_</b> \r\n       with effect from _EFFECTIVE_DATE_ His/Her registration No. is  <b>_CERTIFICATENUMBER_</b>.</td>\r\n  </tr>\r\n \r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Date _DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px;margin-top: 62px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n  \r\n \r\n \r\n \r\n</table></td>\r\n  </tr> \r\n</table>\r\n</body>\r\n</html>', '', 'N', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1'),
(40, 'CLINICAL_INSTRUCTOR__HIGHER_DIPLOMA', 'CLINICAL INSTRUCTOR HIGHER DIPLOMA', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n \r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' class=\"wrapper\" >\r\n<tr><td valign=\'top\' align=\'left\'>&nbsp;</td><td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n   \r\n\r\n<img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap>MINISTRY OF EDUCATION AND SPORTS</span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'>&nbsp;</td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'70\'/><br>\r\n	<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-top:0px;padding-bottom:50px; font-weight:bold;\'>(Issued under Sections 11, 12 and 13 of the Education<br/>\r\n    (Pre-Primary, Primary and Post Primary), Act 2008\r\n </span></td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; font-weight:bold;\'>This is to certify that</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Having completed  satisfactorily a Higher Diploma in Clinical Instruction, <br/>\r\n         approved by  the Ministry    has been registered <br/> as a <b>_TEACHER_GRADE_</b> \r\n       with effect from _EFFECTIVE_DATE_ His/Her registration No. is  <b>_CERTIFICATENUMBER_</b>.</td>\r\n  </tr>\r\n \r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Date _DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px;margin-top: 62px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n  \r\n \r\n \r\n \r\n</table></td>\r\n  </tr> \r\n</table>\r\n</body>\r\n</html>', '', 'N', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1'),
(41, 'HEALTH_TUTOR__DIPLOMA', 'HEALTH TUTOR DIPLOMA', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n \r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' class=\"wrapper\" >\r\n<tr><td valign=\'top\' align=\'left\'>&nbsp;</td><td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n  \r\n<img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap>MINISTRY OF EDUCATION AND SPORTS </span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'>&nbsp;</td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'70\'/><br>\r\n	<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-top:0px;padding-bottom:50px; font-weight:bold;\'>(Issued under Sections 11, 12 and 13 of the Education<br/>\r\n    (Pre-Primary, Primary and Post Primary), Act 2008\r\n </span></td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; font-weight:bold;\'>This is to certify that</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Having completed  satisfactorily a Health Tutor  Diploma <br/>\r\n         approved by  the Ministry    has been registered <br/> as a <b>_TEACHER_GRADE_</b> \r\n       with effect from _EFFECTIVE_DATE_ His/Her registration No. is  <b>_CERTIFICATENUMBER_</b>.</td>\r\n  </tr>\r\n \r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Date _DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px;margin-top: 62px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n  \r\n \r\n \r\n \r\n</table></td>\r\n  </tr> \r\n</table>\r\n</body>\r\n</html>', '', 'N', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1'),
(42, 'GRADE_V_TEACHER', 'GRADE V TEACHER', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n \r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' class=\"wrapper\" >\r\n<tr><td valign=\'top\' align=\'left\'>&nbsp;</td><td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n   \r\n<img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap>MINISTRY OF EDUCATION AND SPORTS</span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'>&nbsp;</td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'70\'/><br>\r\n	<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-top:0px;padding-bottom:50px; font-weight:bold;\'>(Issued under Sections 11, 12 and 13 of the Education Act 2008\r\n </span></td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; font-weight:bold;\'>This is to certify that</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Having completed  satisfactorily a teacher training course  approved by  the Ministry   <br/> has been registered  as a <b>_TEACHER_GRADE_</b> \r\n       with effect from _EFFECTIVE_DATE_ His/Her registration No. is  <b>_CERTIFICATENUMBER_</b>.</td>\r\n  </tr>\r\n \r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Date _DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px;margin-top: 62px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n  \r\n \r\n \r\n \r\n</table></td>\r\n  </tr> \r\n</table>\r\n</body>\r\n</html>', '', 'N', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1'),
(43, 'GRADE_HEALTH_TUTOR__POST_GRADUATE_DIPLOMA', 'GRADE HEALTH TUTOR POST GRADUATE DIPLOMA', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n \r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' class=\"wrapper\" >\r\n<tr><td valign=\'top\' align=\'left\'>&nbsp;</td><td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n    \r\n    \r\n\r\n<img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap>MINISTRY OF EDUCATION AND SPORTS </span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'>&nbsp;</td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'70\'/><br>\r\n	<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-top:0px;padding-bottom:50px; font-weight:bold;\'>(Issued under  Part V Sections 11, 12 and 13 of the Education  <br/>\r\n    (Pre-Primary, Primary and Post-Primary )Act, 2008\r\n </span></td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; font-weight:bold;\'>This is to certify that</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Having completed  satisfactorily a Post Graduate Diploma in Medical Education <br/>  approved by  the Ministry     has been registered <br/>  as a <b>_TEACHER_GRADE_</b> \r\n       with effect from _EFFECTIVE_DATE_ His/Her registration No. is  <b>_CERTIFICATENUMBER_</b>.</td>\r\n  </tr>\r\n \r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Date _DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px;margin-top: 62px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n  \r\n \r\n \r\n \r\n</table></td>\r\n  </tr> \r\n</table>\r\n</body>\r\n</html>', '', 'N', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1'),
(44, 'COMMUNITY_CHILD_CARE_TRAINING_PROGRAMME', 'COMMUNITY CHILD CARE TRAINING PROGRAMME\r\nCERTIFICATE', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n \r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\'  >\r\n<tr><td valign=\'top\' align=\'left\'>&nbsp;</td><td><table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n    \r\n    \r\n\r\n<img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap>MINISTRY OF EDUCATION AND SPORTS</span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'>&nbsp;</td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px; padding:2px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading_archievement.png\' height=\'70\'/>\r\n   \r\n	</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; padding:0px;  font-weight:bold;\'>This is to certify that   \r\n    </td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Has been awarded a  <b>Certificate of Achievement</b> <br />\r\n       for havingcompleted satisfactorily a 12 weeks <b>_TEACHER_GRADE_</b> approved by the Ministry of Education and Sports\r\n     </td>\r\n  </tr>\r\n \r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Date _DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px;margin-top: 62px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px; font-weight:bold\'>DIRECTOR FOR HIGHER ,\r\n          TECHNICAL,VOCATIONAL \r\nEDUCATIONAL AND TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n  \r\n  <!-- Endorsment -->\r\n  <tr>\r\n  <td>\r\n  <pre>Registration Number : _CERTIFICATENUMBER_ \r\n  Effective _EFFECTIVE_DATE_\r\n  </pre> </td>\r\n  </tr>\r\n  \r\n \r\n \r\n</table></td>\r\n  </tr> \r\n</table>\r\n</body>\r\n</html>', 'A CERTIFICATE HAS BEEN CREATED UNDER \"COMMUNITY CHILD CARE TRAINING PROGRAMME\"', 'Y', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1'),
(45, 'GRADE_HEALTH_TUTOR__POST_GRADUATE_DIPLOMA', 'GRADE HEALTH TUTOR POST GRADUATE DIPLOMA', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Untitled Document</title>\r\n</head>\r\n\r\n<body style=\"background:url(http://tmis.nwtdemos.com/assets/images/coatofarmsbg.png) center no-repeat;\" >\r\n \r\n<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' class=\"wrapper\" >\r\n<tr><td valign=\'top\' align=\'left\'>&nbsp;</td><td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n  <tr>\r\n    <td style=\'padding-top: 0px; padding-bottom: 0px; text-align:center; line-height:160%;\'>\r\n    \r\n    \r\n<img src=\'_ASSET_FOLDER_images/coat_of_arms.png\' border=\'0\' height=\'90\'/> <br />\r\n      <span  style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 14px; text-align:center;\'>REPUBLIC OF UGANDA</span><br>\r\n<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 16px; font-weight:bold; text-align:center; color:#000; width: 200px;\' nowrap>MINISTRY OF EDUCATION AND SPORTS</span></td>\r\n  </tr>\r\n</table></td><td valign=\'top\' align=\'right\'>&nbsp;</td></tr>\r\n<tr><td colspan=\'3\' align=\'center\'><table width=\'90%\' cellpadding=\'5\' cellspacing=\'0\' align=\'center\'>\r\n\r\n  <tr>\r\n    <td style=\'text-align:center;padding-bottom:0px;\'><img src=\'_ASSET_FOLDER_images/certificate_heading.png\' height=\'70\'/><br>\r\n	<span style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-top:0px;padding-bottom:50px; font-weight:bold;\'>(Issued under  Part V Sections 11, 12 and 13 of the Education  <br/>\r\n    (Pre-Primary, Primary and Post-Primary )Act, 2008\r\n </span></td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; height:75px; padding-bottom:10px; font-size: 40px; text-align:center; vertical-align:bottom; font-weight:bold;\'>This is to certify that</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:Arial, Helvetica, sans-serif; padding-bottom:10px; font-size: 30px; text-align:center; border-bottom: solid 2px #333;\'>_TEACHER_NAME_</td>\r\n  </tr>\r\n  <tr>\r\n    <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Having completed  satisfactorily a Post Graduate Diploma in Medical Education <br/>  approved by  the Ministry     has been registered <br/>  as a <b>_TEACHER_GRADE_</b> \r\n       with effect from _EFFECTIVE_DATE_ His/Her registration No. is  <b>_CERTIFICATENUMBER_</b>.</td>\r\n  </tr>\r\n \r\n  <tr>\r\n    <td><table width=\'100%\' cellpadding=\'5\' cellspacing=\'0\'>\r\n      <tr>\r\n        <td style=\'font-family:&quot;Times New Roman&quot;, Times, serif; font-size: 18px; text-align:center; padding-bottom:0px; line-height:160%;\'>Date _DATE_TODAY_</td>\r\n        <td style=\'width:400px;\'>For\r\n          <div style=\'border-bottom: 1px solid #000; padding-bottom: 2px; width: 95%; margin-left:10px; display:inline-block;\'><img src=\'_ASSET_FOLDER_uploads/images/_SIGNATURE_URL_\' border=\'0\' style=\'height:80px;margin-top: 62px;\' /></div>\r\n          <br />\r\n          <span style=\'&quot;Times New Roman&quot;, Times, serif; font-size: 12px;\'>DIRECTOR FOR HIGHER TECHNICAL, VOCATIONAL AND EDUCATIONAL TRAINING.</span></td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n  \r\n \r\n \r\n \r\n</table></td>\r\n  </tr> \r\n</table>\r\n</body>\r\n</html>', '', 'N', '2015-08-20 00:00:00', '1', '2015-08-20 00:00:00', '1'),
(46, 'upgrade_application_submitted', 'Your Certificate Upgrade Application Has Been Submitted.', 'Your TMIS Certificate Upgrade Application has been submitted for review. You will be notified by email when it is approved. \r\n<br> <br>In case you closed the TMIS website, go to the link below to learn more about TMIS: \r\n<br>_LOGIN_LINK_ <br> <br>Regards, <br>TMIS Admin Team <br>', 'Your TMIS Certificate Upgrade Application has been submitted for review.', 'N', '2019-03-26 06:27:12', '13', '0000-00-00 00:00:00', '');

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

--
-- Table structure for table `message_exchange`
--

CREATE TABLE `message_exchange` (
  `id` bigint(20) NOT NULL,
  `message_id` varchar(100) NOT NULL,
  `send_format` varchar(100) NOT NULL,
  `details` text NOT NULL,
  `subject` varchar(300) NOT NULL,
  `attachment` varchar(500) NOT NULL,
  `date_added` datetime NOT NULL,
  `sender` varchar(100) NOT NULL,
  `recipient_id` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=377 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `message_exchange`
--

INSERT INTO `message_exchange` (`id`, `message_id`, `send_format`, `details`, `subject`, `attachment`, `date_added`, `sender`, `recipient_id`) VALUES
(1, '1', 'system', 'A profile has been created for you at the Teacher Management Information System (TMIS). You will need this code to confirm your account: <br>5D352 <br> <br>In case you closed the TIMIS website, go to the link below to continue with your registration: <br>http://localhost/tmis2021/public <br>You will need the following details to login: <br> Your user name: deuson8@muto.com <br>Your Temporary Password: ls1.Zy <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your Verification Code for TMIS', '', '2021-07-01 16:36:15', '', '974'),
(2, '2', 'system', 'Your TMIS application has been submitted for review. You will be notified by email when it is approved for you to begin enjoying the benefits of a TMIS registered teacher. <br> <br>In case you closed the TMIS website, go to the link below to learn more about TMIS: <br>http://localhost/tmis2021/public <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS Application Has Been Submitted', '', '2021-07-03 01:35:12', 'deuson8@muto.com', '974'),
(3, '6', 'system', 'You have been issued a file number: UTS0000981\n. <br> <br>Use it in any of your correspondence with the ministry to allow us to process your case faster. <br> <br>Regards, <br>Your TMIS Admin Team <br> ', 'You Have Been Issued a Teacher File Number', '', '2021-07-03 02:54:57', 'hrjanette@gmail.com', '974'),
(4, '19', 'system', 'Your TMIS user status is now APPROVED. <br> <br>If you believe this was made in error, please notify us immediately. <br> <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS User Status has Been Changed', '', '2021-07-03 02:54:59', 'hrjanette@gmail.com', '974'),
(5, '1', 'system', 'A profile has been created for you at the Teacher Management Information System (TMIS). You will need this code to confirm your account: <br>6D386 <br> <br>In case you closed the TIMIS website, go to the link below to continue with your registration: <br>http://localhost/tmis2021/public <br>You will need the following details to login: <br> Your user name: dbowe@tmis.go.ug <br>Your Temporary Password: lr3*Ip <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your Verification Code for TMIS', '', '2021-07-03 03:02:44', '', '975'),
(6, '2', 'system', 'Your TMIS application has been submitted for review. You will be notified by email when it is approved for you to begin enjoying the benefits of a TMIS registered teacher. <br> <br>In case you closed the TMIS website, go to the link below to learn more about TMIS: <br>http://localhost/tmis2021/public <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS Application Has Been Submitted', '', '2021-07-03 03:13:44', '', '975'),
(7, '1', 'system', 'A profile has been created for you at the Teacher Management Information System (TMIS). You will need this code to confirm your account: <br>7D336 <br> <br>In case you closed the TIMIS website, go to the link below to continue with your registration: <br>http://localhost/tmis2021/public <br>You will need the following details to login: <br> Your user name: dbowe@maverick.com <br>Your Temporary Password: lv6*Bb <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your Verification Code for TMIS', '', '2021-07-03 12:01:39', '', '976'),
(8, '3', 'system', 'Your approval at TMIS is required by Dante, Bowe for a registration. This was requested on 03-Jul-2021 12:09:12PMEAT. <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your Approval at TMIS is Required By Dante, Bowe', '', '2021-07-03 12:09:14', '', '20'),
(9, '3', 'system', 'Your approval at TMIS is required by Dante, Bowe for a registration. This was requested on 03-Jul-2021 12:09:14PMEAT. <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your Approval at TMIS is Required By Dante, Bowe', '', '2021-07-03 12:09:17', '', '86'),
(10, '2', 'system', 'Your TMIS application has been submitted for review. You will be notified by email when it is approved for you to begin enjoying the benefits of a TMIS registered teacher. <br> <br>In case you closed the TMIS website, go to the link below to learn more about TMIS: <br>http://localhost/tmis2021/public <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS Application Has Been Submitted', '', '2021-07-03 12:09:19', '', '976'),
(11, '6', 'system', 'You have been issued a file number: UTS0000983\n. <br> <br>Use it in any of your correspondence with the ministry to allow us to process your case faster. <br> <br>Regards, <br>Your TMIS Admin Team <br> ', 'You Have Been Issued a Teacher File Number', '', '2021-07-03 12:10:05', 'hrjanette@gmail.com', '976'),
(12, '19', 'system', 'Your TMIS user status is now APPROVED. <br> <br>If you believe this was made in error, please notify us immediately. <br> <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your TMIS User Status has Been Changed', '', '2021-07-03 12:10:08', 'hrjanette@gmail.com', '976'),
(13, '18', 'system', 'An account has been created for you at the Teacher Management Information System (TMIS). You will need the following details to login: <br> Your user name: slimdaddy@tmis.go.ug <br>Your Temporary Password: jb7!Wj<br>This password will not be active until your application has been approved.<br>We will notify you by this same email when your account has been approved. <br>Please note that this password is case sensitive. <br> <br>Use the link below to access the TMIS website: <br>http://localhost/tmis2021/public <br> <br>Regards, <br>Your TMIS Admin Team <br>', 'Your New Account Details', '', '2021-07-03 15:14:56', '', '977');

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

--
-- Table structure for table `message_status`
--

CREATE TABLE `message_status` (
  `id` bigint(20) NOT NULL,
  `message_exchange_id` varchar(100) NOT NULL,
  `user_id` varchar(100) NOT NULL,
  `status` enum('received','read','replied','archived') NOT NULL DEFAULT 'received',
  `date_added` datetime NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=564 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `message_status`
--

INSERT INTO `message_status` (`id`, `message_exchange_id`, `user_id`, `status`, `date_added`) VALUES
(1, '2', '974', 'read', '2021-07-03 01:39:05'),
(2, '11', '976', 'read', '2021-07-03 13:50:40'),
(3, '12', '976', 'read', '2021-07-03 13:50:45');

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

--
-- Table structure for table `note`
--

CREATE TABLE `note` (
  `id` bigint(20) NOT NULL,
  `parent_id` varchar(100) NOT NULL,
  `parent_type` varchar(100) NOT NULL,
  `details` text NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=682 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `note`
--

INSERT INTO `note` (`id`, `parent_id`, `parent_type`, `details`, `date_added`, `added_by`) VALUES
(1, '1', 'interview', 'The applicant was well dressed and ready for the interview.', '2015-02-05 17:08:39', '29'),
(2, '1', 'interview', 'I forgot to note that he kept on touching his wrist when asked about his previous job.', '2015-02-05 17:09:07', '29'),
(3, '1', 'interview', '-- The Candidate TEST2 TEACHER 2 has PASSED because: --&lt;br&gt;&lt;br&gt;This was a great candidate and he is encouraged to come to the next interview when called.', '2015-02-05 21:13:41', '29'),
(4, '3', 'interview', '-- The Candidate TEACHER MUSA has AWARDED because: --&lt;br&gt;&lt;br&gt;This is an exceptional teacher and should be awarded the position.', '2015-02-06 13:23:36', '29'),
(5, '3', 'interview', '-- The Candidate TEACHER MUSA has AWARDED because: --&lt;br&gt;&lt;br&gt;This teacher deserves the position', '2015-02-06 20:28:27', '29'),
(6, '3', 'interview', '-- The Candidate TEACHER MUSA has AWARDED because: --&lt;br&gt;&lt;br&gt;This teacher deserves it.', '2015-02-06 20:38:51', '29'),
(7, '3', 'interview', '-- The Candidate TEACHER MUSA has AWARDED because: --&lt;br&gt;&lt;br&gt;This was an easy decision.', '2015-02-06 20:45:35', '29'),
(8, '3', 'interview', '-- The Candidate TEACHER MUSA has AWARDED because: --&lt;br&gt;&lt;br&gt;He was a great teacher.', '2015-02-06 20:51:58', '29'),
(9, '3', 'interview', '-- The Candidate TEACHER MUSA has AWARDED because: --&lt;br&gt;&lt;br&gt;THis was an easy decision', '2015-02-06 21:31:28', '29'),
(10, '3', 'interview', '-- The Candidate TEACHER MUSA has AWARDED because: --&lt;br&gt;&lt;br&gt;This is a good decision.', '2015-02-06 21:43:58', '29'),
(11, '7', 'interview', '-- The Candidate DAVID BUWEMBO has PASSED because: --&lt;br&gt;&lt;br&gt;None for now', '2015-02-19 15:23:12', '29'),
(12, '7', 'interview', '-- The Candidate DAVID BUWEMBO has AWARDED because: --&lt;br&gt;&lt;br&gt;Awarded from the past', '2015-02-19 15:31:21', '29'),
(13, '9', 'interview', '-- The Candidate MUINDA PATRICK has AWARDED because: --&lt;br&gt;&lt;br&gt;Patrick&#039;s performance was outstanding.', '2015-02-24 07:59:37', '29'),
(14, '1', 'interview', '-- The Candidate TEST2 TEACHER 2 has FAILED because: --&lt;br&gt;&lt;br&gt;No Notes', '2015-02-24 16:29:57', '29'),
(15, '1', 'interview', '-- The Candidate TEST2 TEACHER 2 has AWARDED because: --&lt;br&gt;&lt;br&gt;no notes', '2015-02-24 16:30:34', '29'),
(16, '10', 'interview', '-- The Candidate TEACHER, MUSA has PASSED because: --&lt;br&gt;&lt;br&gt;The applicant was a great teacher.', '2015-02-25 07:10:24', '29'),
(17, '20', 'interview', '-- The Candidate NABOSA, JANETTE has AWARDED because: --&lt;br&gt;&lt;br&gt;She is competent and keeps time. ', '2015-03-06 09:42:53', '69'),
(18, '19', 'interview', '-- The Candidate TEACHER, MUSA has AWARDED because: --&lt;br&gt;&lt;br&gt;Just Okay.', '2015-03-06 10:21:42', '69'),
(19, '18', 'interview', 'Time Sensitive ', '2015-03-06 10:23:08', '69'),
(20, '11', 'interview', '-- The Candidate TEACHER, MUSA has PASSED because: --&lt;br&gt;&lt;br&gt;Good', '2015-03-06 10:50:37', '69'),
(21, '10', 'interview', '-- The Candidate TEACHER, MUSA has PASSED because: --&lt;br&gt;&lt;br&gt;Excellent.', '2015-03-06 10:51:48', '69'),
(22, '13', 'interview', '-- The Candidate TEST2, TEACHER 2 has PASSED because: --&lt;br&gt;&lt;br&gt;Promising.', '2015-03-06 10:52:30', '69'),
(23, '22', 'interview', '-- The Candidate TEACHER, JANETTE has AWARDED because: --&lt;br&gt;&lt;br&gt;brave teacher', '2015-05-15 04:24:46', '79'),
(24, '23', 'interview', '-- The Candidate NABOSA, JANETTE has AWARDED because: --&lt;br&gt;&lt;br&gt;Appointed', '2015-05-20 10:39:40', '79');

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

--
-- Table structure for table `other_user_id`
--

CREATE TABLE `other_user_id` (
  `id` bigint(20) NOT NULL,
  `parent_id` varchar(100) NOT NULL,
  `parent_type` varchar(100) NOT NULL,
  `id_type` varchar(100) NOT NULL,
  `id_value` varchar(300) NOT NULL,
  `status` enum('active','pending','inactive') NOT NULL DEFAULT 'pending',
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=99 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `permission`
--

CREATE TABLE `permission` (
  `id` bigint(20) NOT NULL,
  `code` varchar(200) NOT NULL,
  `display` varchar(300) NOT NULL,
  `details` varchar(300) NOT NULL,
  `category` varchar(200) NOT NULL,
  `url` varchar(300) NOT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active'
) ENGINE=InnoDB AVG_ROW_LENGTH=195 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `permission`
--

INSERT INTO `permission` (`id`, `code`, `display`, `details`, `category`, `url`, `status`) VALUES
(1, 'view_relevant_jobs', 'Relevant Jobs', '', 'job_notices', 'job/lists/action/view', 'active'),
(2, 'apply_for_job', 'Apply for a Job', '', 'job_notices', 'job/lists/action/apply', 'active'),
(3, 'view_my_saved_jobs', 'My Saved Jobs', '', 'job_notices', 'job/lists/action/saved', 'active'),
(4, 'view_job_application_status', 'Job Application Status', '', 'job_notices', 'job/lists/action/status', 'active'),
(5, 'add_new_job', 'New Job', '', 'job_notices', 'vacancy/add', 'active'),
(6, 'set_vacancy_shortlist', 'Job Shortlists', '', 'interviews', 'interview/lists/action/shortlist', 'active'),
(7, 'set_interview_date', 'Set Interview Date', '', 'interviews', 'interview/lists/action/setdate', 'active'),
(8, 'cancel_interview', 'Cancel Interview', '', 'interviews', 'interview/lists/action/cancel', 'active'),
(9, 'submit_recommendation_for_job', 'Submit Recommendation', '', 'interviews', 'interview/lists/action/recommend', 'active'),
(10, 'view_recommendation_list', 'View Recommendations', 'Teacher or Manager only views their application recommendations', 'interviews', 'interview/lists/action/recommendations', 'active'),
(11, 'add_interview_results', 'Add Interview Results', 'May include setting a date for the next interview OR marking this as final interview', 'interviews', 'interview/lists/action/addresult', 'active'),
(12, 'view_interview_results', 'View Interview Results', '', 'interviews', 'interview/lists/action/result', 'active'),
(13, 'publish_job_notices', 'Job Adverts', '', 'approvals', 'vacancy/lists/action/publish', 'active'),
(14, 'verify_job_notices', 'Verify Jobs', '', 'approvals', 'vacancy/lists/action/verify', 'active'),
(15, 'archive_job_notices', 'Archive Jobs', '', 'approvals', 'vacancy/lists/action/archive', 'active'),
(17, 'verify_teacher_application_at_hr_level', 'CIM Teacher Application Verification', '', 'approvals', 'teacher/lists/action/verify', 'active'),
(18, 'verify_teacher_application_at_instructor_level', 'Instructor Teacher Application Verification', '', 'approvals', 'teacher/lists/action/approve', 'active'),
(21, 'view_school_data_changes', 'View School Changes', '', 'approvals', 'school/lists', 'active'),
(22, 'verify_school_data_updates', 'Verify School Changes', '', 'approvals', 'school/lists/action/verify', 'active'),
(23, 'view_teacher_data_changes', 'View Teacher Changes', '', 'approvals', 'teacher/lists/action/view', 'active'),
(28, 'view_job_confirmation_applications', 'View Confirmation Applications', 'cao users only see applications for their county.', 'approvals', 'confirmation/lists/action/view', 'active'),
(29, 'issue_job_confirmation_letter', 'Issue Job Confirmation', '', 'approvals', 'confirmation/lists/action/approve', 'active'),
(30, 'verify_job_confirmation_letter', 'Verify Job Confirmation', '', 'approvals', 'confirmation/lists/action/verify', 'active'),
(31, 'post_to_new_position', 'Confirm Assumption of Duty', '', 'approvals', 'confirmation/lists/action/post', 'active'),
(32, 'view_transfer_applications', 'View Transfer Applications', 'manager only views applications for their institution', 'approvals', 'transfer/lists/action/view', 'active'),
(33, 'cancel_transfer_application', 'Cancel Transfer Application', 'teacher,manager users can only cancel their own applications', 'approvals', 'transfer/cancel', 'active'),
(34, 'verify_transfer_at_institution_level', 'Institution Transfer Verification', '', 'approvals', 'transfer/lists/action/institutionapprove', 'active'),
(35, 'verify_transfer_at_county_level', 'County Transfer Verification', '', 'approvals', 'transfer/lists/action/countyapprove', 'active'),
(36, 'submit_transfer_pca', 'Submit Transfer PCA', '', 'approvals', 'transfer/lists/action/pca', 'active'),
(37, 'verify_transfer_at_ministry_level', 'Ministry Transfer Verification', '', 'approvals', 'transfer/lists/action/ministryapprove', 'active'),
(38, 'view_leave_applications', 'View Leave Applications', '', 'approvals', 'leave/lists/action/view', 'active'),
(39, 'cancel_leave_application', 'Cancel Leave Application', '', 'approvals', 'leave/cancel', 'active'),
(40, 'verify_leave_at_county_level', 'County Leave Verification', '', 'approvals', 'leave/lists/action/approve', 'active'),
(41, 'verify_leave_at_ministry_level', 'Ministry Leave Verification', '', 'approvals', 'leave/lists/action/verify', 'active'),
(42, 'prepare_leave_verification_letter', 'Send Leave Letter', '', 'approvals', 'leave/lists/action/send', 'active'),
(43, 'view_retirement_applications', 'View Retirement Applications', '', 'approvals', 'retirement/lists/action/view', 'active'),
(44, 'cancel_retirement_application', 'Cancel Retirement Application', '', 'approvals', 'retirement/cancel', 'active'),
(45, 'verify_retirement_application', 'Verify Retirement Application', '', 'approvals', 'retirement/lists/action/approve', 'active'),
(46, 'verify_teacher_census_submissions', 'Verify Teacher Census', '', 'approvals', 'census/lists/action/verify', 'active'),
(47, 'view_teacher_census_report', 'View Teacher Census', '', 'approvals', 'census/lists', 'active'),
(48, 'complete_teacher_application', 'Complete My Teacher Application', '', 'forms', 'register/step_one/action/prefill', 'active'),
(49, 'update_my_teacher_profile', 'Update My Teacher Profile', '', 'forms', 'profile/teacher_data', 'active'),
(50, 'apply_for_leave', 'Apply For Leave', '', 'forms', 'leave/apply', 'active'),
(51, 'apply_for_transfer', 'Apply For Transfer', '', 'forms', 'transfer/apply', 'active'),
(52, 'request_job_confirmation', 'Request Job Confirmation', '', 'forms', 'job/request_confirmation', 'active'),
(53, 'apply_for_promotion', 'Apply For Promotion', '', 'forms', 'job/apply_for_promotion', 'active'),
(54, 'apply_to_retire', 'Apply To Retire', '', 'forms', 'retirement/apply', 'active'),
(56, 'add_new_teacher', 'New Teacher', '', 'forms', 'teacher/add', 'active'),
(57, 'submit_teacher_census_data', 'Teacher Census', '', 'forms', 'census/add', 'active'),
(58, 'add_new_school', 'New School', '', 'forms', 'school/add', 'active'),
(59, 'add_new_user', 'New User', '', 'users', 'user/add', 'active'),
(60, 'set_user_permissions', 'Set User Permissions', '', 'users', 'user/set_permissions', 'active'),
(61, 'change_user_status', 'Update User Status', '', 'users', 'user/update_status', 'active'),
(62, 'change_other_user_passwords', 'Update User Password', '', 'users', 'user/change_password', 'active'),
(63, 'send_system_message', 'New Message', '', 'my_messages', 'message/send_new_system', 'active'),
(64, 'send_email_message', 'New Email', '', 'my_messages', 'message/send_new_email', 'active'),
(65, 'send_sms_message', 'New SMS', '', 'my_messages', 'message/send_new_sms', 'active'),
(66, 'view_message_inbox', 'Inbox', '', 'my_messages', 'message/inbox', 'active'),
(67, 'view_archived_messages', 'Archived Messages', '', 'my_messages', 'message/archive', 'active'),
(68, 'view_sent_messages', 'Sent Messages', '', 'my_messages', 'message/sent', 'active'),
(69, 'view_permission_list', 'Permissions', '', 'permissions', 'permission/lists', 'active'),
(70, 'view_permission_group_list', 'Permission Groups', '', 'permissions', 'permission/group_list', 'active'),
(71, 'view_user_permissions', 'User Permissions', '', 'permissions', 'permission/user_list', 'active'),
(72, 'add_new_permission_group', 'New Permission Group', '', 'permissions', 'permission/add_group', 'active'),
(73, 'change_group_permissions', 'Update Permissions', '', 'permissions', 'permission/update_group', 'active'),
(74, 'view_user_log', 'User Activity Log', '', 'reports', 'report/lists/action/user', 'active'),
(75, 'view_system_log', 'System Log', '', 'reports', 'report/lists/action/system', 'active'),
(76, 'view_users', 'Users', '', 'reports', 'user/lists/action/report', 'active'),
(77, 'view_schools', 'Schools', '', 'reports', 'school/lists/action/report', 'active'),
(78, 'view_teachers', 'Teachers', '', 'reports', 'teacher/lists/action/report', 'active'),
(79, 'view_job_applications', 'Job Applications', '', 'reports', 'job/lists/action/report', 'active'),
(80, 'view_jobs', 'Jobs', '', 'reports', 'vacancy/lists/action/report', 'active'),
(81, 'view_retirements', 'Retirements', 'Manager only sees retirements at their school. Deo only sees retirements in their district', 'reports', 'retirement/lists/action/report', 'active'),
(82, 'view_current_job', 'Current Job', '', 'job_description', 'job/view_current', 'active'),
(83, 'view_previous_jobs', 'Previous Jobs', '', 'job_description', 'job/view_previous', 'active'),
(84, 'view_current_school', 'Current School', '', 'school_profile', 'school/view_current', 'active'),
(85, 'view_previous_schools', 'Previous Schools', '', 'school_profile', 'school/view_previous', 'active'),
(86, 'log_out', 'Log Out', '', 'log_out', 'account/logout', 'active'),
(87, 'view_approval_chain', 'View Approval Chain', '', 'reports', 'approval/lists/action/report', 'active'),
(88, 'view_payroll_report', 'View Payroll Report', '', 'reports', 'teacher/lists/action/payrollreport', 'active'),
(89, 'view_cim_report', 'View CIM Teacher Report', '', 'reports', 'teacher/lists/action/cimreport', 'active'),
(90, 'view_custom_teacher_report', 'Custom Teacher Report', '', 'reports', 'teacher/custom_report', 'active'),
(91, 'confirm_teacher_application_at_tiet_officer_level', 'Confirm Teacher Documents', '', 'approvals', 'teacher/lists/action/confirm', 'active'),
(92, 'certify_teacher_application_at_instructor_level', 'Instructor Teacher Application  Certification', '', 'approvals', 'teacher/lists/action/certify', 'active'),
(93, 'view_reject_report', 'View Rejected Applicants Report', '', 'reports', 'teacher/lists/action/rejectreport', 'active'),
(94, 'view_approved_report', 'Approval Chain Trail', '', 'reports', 'teacher/lists/action/approvedreport', 'active'),
(95, 'upgrade_my_teacher_certificate', 'Request Certificate Upgrade', '', 'forms', 'profile/upgrade_certificate', 'active');

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

--
-- Table structure for table `permission_group`
--

CREATE TABLE `permission_group` (
  `id` bigint(20) NOT NULL,
  `name` varchar(300) NOT NULL,
  `notes` text NOT NULL,
  `default_permission` varchar(100) NOT NULL,
  `is_removable` enum('Y','N') NOT NULL DEFAULT 'Y',
  `is_system_only` enum('Y','N') NOT NULL DEFAULT 'N',
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  `last_updated_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=1092 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `permission_group`
--

INSERT INTO `permission_group` (`id`, `name`, `notes`, `default_permission`, `is_removable`, `is_system_only`, `date_added`, `added_by`, `last_updated`, `last_updated_by`) VALUES
(1, 'applicant', 'Teacher Applicant', '48', 'N', 'Y', '2015-01-01 00:00:00', '1', '0000-00-00 00:00:00', ''),
(2, 'teacher', 'Teacher', '66', 'N', 'N', '2015-01-01 00:00:00', '1', '2015-03-01 03:25:17', '13'),
(3, 'manager', 'Institution Manager', '66', 'N', 'N', '2015-01-01 00:00:00', '1', '2015-03-01 03:25:28', '13'),
(4, 'admin', 'Administrator', '66', 'N', 'Y', '2015-01-01 00:00:00', '1', '2019-04-26 11:13:22', '438'),
(5, 'moes', 'Ministry of Education and Sports', '66', 'N', 'N', '2015-01-01 00:00:00', '1', '2019-05-22 09:34:50', '438'),
(6, 'deo', 'District Education Officer', '35', 'N', 'N', '2015-01-01 00:00:00', '1', '2015-06-12 10:33:21', '13'),
(7, 'esc', 'Education Service Commission', '66', 'N', 'N', '2015-01-01 00:00:00', '1', '2019-04-05 13:51:38', '438'),
(8, 'dsc', 'District Service Commission', '66', 'N', 'N', '2015-01-01 00:00:00', '1', '2015-02-10 08:07:55', '13'),
(9, 'mops', 'Ministry of Public Service', '14', 'N', 'N', '2015-01-01 00:00:00', '1', '2015-05-21 06:36:58', '13'),
(10, 'hr', 'Human Resource', '66', 'N', 'N', '2015-01-01 00:00:00', '1', '2019-03-20 14:12:45', '438'),
(11, 'tiet', 'Teacher Instructor Education and Training', '66', 'N', 'N', '2015-01-01 00:00:00', '1', '2015-11-16 12:34:43', '13'),
(12, 'cao', 'Chief Administrative Officer', '66', 'N', 'N', '2015-01-01 00:00:00', '1', '2015-02-10 08:07:23', '13'),
(13, 'psc', 'Public Service Commission', '66', 'N', 'N', '2015-01-01 00:00:00', '1', '2015-02-10 08:09:22', '13'),
(17, 'tiet_officer', 'Teacher Instructor Education and Training Officer', '66', 'Y', 'N', '2015-12-10 12:54:33', '13', '0000-00-00 00:00:00', ''),
(18, 'tiet_commissioner', 'Teacher Instructor Education and Training Commissioner', '66', 'Y', 'N', '2015-12-10 13:23:43', '13', '2020-08-25 16:16:33', '438'),
(19, 'systems_admin_and_support', 'Systems Admin and Support', '66', 'Y', 'N', '2019-03-28 18:37:08', '13', '2019-05-21 10:53:44', '438'),
(20, 'job_verification_and_checking', 'Job Verification and Checking', '13', 'Y', 'N', '2019-11-07 08:35:25', '13', '0000-00-00 00:00:00', '');

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

--
-- Table structure for table `permission_group_mapping`
--

CREATE TABLE `permission_group_mapping` (
  `id` bigint(20) NOT NULL,
  `group_id` varchar(100) NOT NULL,
  `permission_id` varchar(100) NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=72 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `permission_group_mapping`
--

INSERT INTO `permission_group_mapping` (`id`, `group_id`, `permission_id`, `date_added`, `added_by`) VALUES
(116, '1', '48', '2015-01-20 09:46:11', ''),
(145, '1', '63', '2015-01-20 09:46:12', ''),
(162, '1', '66', '2015-01-20 09:46:12', ''),
(177, '1', '67', '2015-01-20 09:46:12', ''),
(192, '1', '68', '2015-01-20 09:46:12', ''),
(250, '1', '86', '2015-01-20 09:46:12', ''),
(353, '', '14', '2015-01-29 13:52:43', '13'),
(354, '', '15', '2015-01-29 13:52:43', '13'),
(509, '12', '28', '2015-02-10 08:07:23', '13'),
(510, '12', '29', '2015-02-10 08:07:23', '13'),
(511, '12', '31', '2015-02-10 08:07:23', '13'),
(512, '12', '35', '2015-02-10 08:07:23', '13'),
(513, '12', '40', '2015-02-10 08:07:23', '13'),
(514, '12', '42', '2015-02-10 08:07:23', '13'),
(515, '12', '46', '2015-02-10 08:07:23', '13'),
(516, '12', '47', '2015-02-10 08:07:23', '13'),
(517, '12', '63', '2015-02-10 08:07:23', '13'),
(518, '12', '66', '2015-02-10 08:07:23', '13'),
(519, '12', '67', '2015-02-10 08:07:23', '13'),
(520, '12', '68', '2015-02-10 08:07:23', '13'),
(521, '12', '86', '2015-02-10 08:07:23', '13'),
(539, '8', '6', '2015-02-10 08:07:55', '13'),
(540, '8', '7', '2015-02-10 08:07:55', '13'),
(541, '8', '8', '2015-02-10 08:07:55', '13'),
(542, '8', '10', '2015-02-10 08:07:55', '13'),
(543, '8', '11', '2015-02-10 08:07:55', '13'),
(544, '8', '12', '2015-02-10 08:07:55', '13'),
(545, '8', '30', '2015-02-10 08:07:55', '13'),
(546, '8', '41', '2015-02-10 08:07:55', '13'),
(547, '8', '63', '2015-02-10 08:07:55', '13'),
(548, '8', '66', '2015-02-10 08:07:55', '13'),
(549, '8', '67', '2015-02-10 08:07:55', '13'),
(550, '8', '68', '2015-02-10 08:07:55', '13'),
(551, '8', '86', '2015-02-10 08:07:55', '13'),
(653, '13', '37', '2015-02-10 08:09:22', '13'),
(654, '13', '63', '2015-02-10 08:09:22', '13'),
(655, '13', '66', '2015-02-10 08:09:22', '13'),
(656, '13', '67', '2015-02-10 08:09:22', '13'),
(657, '13', '68', '2015-02-10 08:09:22', '13'),
(658, '13', '86', '2015-02-10 08:09:22', '13'),
(811, '2', '2', '2015-03-01 03:25:17', '13'),
(812, '2', '50', '2015-03-01 03:25:17', '13'),
(813, '2', '53', '2015-03-01 03:25:17', '13'),
(814, '2', '51', '2015-03-01 03:25:17', '13'),
(815, '2', '54', '2015-03-01 03:25:17', '13'),
(816, '2', '8', '2015-03-01 03:25:17', '13'),
(817, '2', '39', '2015-03-01 03:25:17', '13'),
(818, '2', '44', '2015-03-01 03:25:17', '13'),
(819, '2', '33', '2015-03-01 03:25:17', '13'),
(820, '2', '86', '2015-03-01 03:25:17', '13'),
(821, '2', '52', '2015-03-01 03:25:17', '13'),
(822, '2', '63', '2015-03-01 03:25:17', '13'),
(823, '2', '49', '2015-03-01 03:25:17', '13'),
(824, '2', '67', '2015-03-01 03:25:17', '13'),
(825, '2', '82', '2015-03-01 03:25:17', '13'),
(826, '2', '84', '2015-03-01 03:25:17', '13'),
(827, '2', '4', '2015-03-01 03:25:17', '13'),
(828, '2', '66', '2015-03-01 03:25:17', '13'),
(829, '2', '3', '2015-03-01 03:25:17', '13'),
(830, '2', '83', '2015-03-01 03:25:17', '13'),
(831, '2', '85', '2015-03-01 03:25:17', '13'),
(832, '2', '10', '2015-03-01 03:25:17', '13'),
(833, '2', '1', '2015-03-01 03:25:17', '13'),
(834, '2', '68', '2015-03-01 03:25:17', '13'),
(842, '3', '2', '2015-03-01 03:25:28', '13'),
(843, '3', '50', '2015-03-01 03:25:28', '13'),
(844, '3', '53', '2015-03-01 03:25:28', '13'),
(845, '3', '51', '2015-03-01 03:25:28', '13'),
(846, '3', '54', '2015-03-01 03:25:28', '13'),
(847, '3', '8', '2015-03-01 03:25:28', '13'),
(848, '3', '39', '2015-03-01 03:25:28', '13'),
(849, '3', '44', '2015-03-01 03:25:28', '13'),
(850, '3', '33', '2015-03-01 03:25:28', '13'),
(851, '3', '86', '2015-03-01 03:25:28', '13'),
(852, '3', '31', '2015-03-01 03:25:28', '13'),
(853, '3', '52', '2015-03-01 03:25:28', '13'),
(854, '3', '63', '2015-03-01 03:25:28', '13'),
(855, '3', '9', '2015-03-01 03:25:28', '13'),
(856, '3', '57', '2015-03-01 03:25:28', '13'),
(857, '3', '36', '2015-03-01 03:25:28', '13'),
(858, '3', '45', '2015-03-01 03:25:28', '13'),
(859, '3', '34', '2015-03-01 03:25:28', '13'),
(860, '3', '67', '2015-03-01 03:25:28', '13'),
(861, '3', '82', '2015-03-01 03:25:28', '13'),
(862, '3', '84', '2015-03-01 03:25:28', '13'),
(863, '3', '4', '2015-03-01 03:25:28', '13'),
(864, '3', '66', '2015-03-01 03:25:28', '13'),
(865, '3', '3', '2015-03-01 03:25:28', '13'),
(866, '3', '83', '2015-03-01 03:25:28', '13'),
(867, '3', '85', '2015-03-01 03:25:28', '13'),
(868, '3', '10', '2015-03-01 03:25:28', '13'),
(869, '3', '1', '2015-03-01 03:25:28', '13'),
(870, '3', '81', '2015-03-01 03:25:28', '13'),
(871, '3', '68', '2015-03-01 03:25:28', '13'),
(872, '3', '32', '2015-03-01 03:25:28', '13'),
(1230, '9', '14', '2015-05-21 06:36:58', '13'),
(1231, '9', '63', '2015-05-21 06:36:58', '13'),
(1232, '9', '66', '2015-05-21 06:36:58', '13'),
(1233, '9', '67', '2015-05-21 06:36:58', '13'),
(1234, '9', '68', '2015-05-21 06:36:58', '13'),
(1235, '9', '77', '2015-05-21 06:36:58', '13'),
(1236, '9', '78', '2015-05-21 06:36:58', '13'),
(1237, '9', '81', '2015-05-21 06:36:58', '13'),
(1238, '9', '86', '2015-05-21 06:36:58', '13'),
(1239, '9', '88', '2015-05-21 06:36:58', '13'),
(1245, '6', '5', '2015-06-12 10:33:21', '13'),
(1246, '6', '15', '2015-06-12 10:33:21', '13'),
(1247, '6', '21', '2015-06-12 10:33:21', '13'),
(1248, '6', '23', '2015-06-12 10:33:21', '13'),
(1249, '6', '32', '2015-06-12 10:33:21', '13'),
(1250, '6', '33', '2015-06-12 10:33:21', '13'),
(1251, '6', '35', '2015-06-12 10:33:21', '13'),
(1252, '6', '63', '2015-06-12 10:33:21', '13'),
(1253, '6', '66', '2015-06-12 10:33:21', '13'),
(1254, '6', '67', '2015-06-12 10:33:21', '13'),
(1255, '6', '68', '2015-06-12 10:33:21', '13'),
(1256, '6', '77', '2015-06-12 10:33:21', '13'),
(1257, '6', '78', '2015-06-12 10:33:21', '13'),
(1258, '6', '80', '2015-06-12 10:33:21', '13'),
(1259, '6', '81', '2015-06-12 10:33:21', '13'),
(1260, '6', '86', '2015-06-12 10:33:21', '13'),
(1283, '11', '18', '2015-11-16 12:34:43', '13'),
(1284, '11', '63', '2015-11-16 12:34:43', '13'),
(1285, '11', '66', '2015-11-16 12:34:43', '13'),
(1286, '11', '67', '2015-11-16 12:34:43', '13'),
(1287, '11', '68', '2015-11-16 12:34:43', '13'),
(1288, '11', '86', '2015-11-16 12:34:43', '13'),
(1290, '17', '63', '2015-12-10 12:54:33', '13'),
(1291, '17', '66', '2015-12-10 12:54:33', '13'),
(1292, '17', '67', '2015-12-10 12:54:33', '13'),
(1293, '17', '68', '2015-12-10 12:54:33', '13'),
(1294, '17', '91', '2015-12-10 12:54:33', '13'),
(2024, '10', '17', '2019-03-20 14:12:45', '438'),
(2025, '10', '63', '2019-03-20 14:12:45', '438'),
(2026, '10', '64', '2019-03-20 14:12:45', '438'),
(2027, '10', '66', '2019-03-20 14:12:45', '438'),
(2028, '10', '67', '2019-03-20 14:12:45', '438'),
(2029, '10', '68', '2019-03-20 14:12:45', '438'),
(2030, '10', '79', '2019-03-20 14:12:45', '438'),
(2031, '10', '86', '2019-03-20 14:12:45', '438'),
(2032, '10', '89', '2019-03-20 14:12:45', '438'),
(2076, '2', '95', '2019-03-06 09:28:31', '13'),
(2705, '7', '11', '2019-04-05 13:51:38', '438'),
(2706, '7', '5', '2019-04-05 13:51:38', '438'),
(2707, '7', '15', '2019-04-05 13:51:38', '438'),
(2708, '7', '8', '2019-04-05 13:51:38', '438'),
(2709, '7', '29', '2019-04-05 13:51:38', '438'),
(2710, '7', '86', '2019-04-05 13:51:38', '438'),
(2711, '7', '13', '2019-04-05 13:51:38', '438'),
(2712, '7', '64', '2019-04-05 13:51:38', '438'),
(2713, '7', '63', '2019-04-05 13:51:38', '438'),
(2714, '7', '7', '2019-04-05 13:51:38', '438'),
(2715, '7', '6', '2019-04-05 13:51:38', '438'),
(2716, '7', '57', '2019-04-05 13:51:38', '438'),
(2717, '7', '30', '2019-04-05 13:51:38', '438'),
(2718, '7', '14', '2019-04-05 13:51:38', '438'),
(2719, '7', '67', '2019-04-05 13:51:38', '438'),
(2720, '7', '12', '2019-04-05 13:51:38', '438'),
(2721, '7', '80', '2019-04-05 13:51:38', '438'),
(2722, '7', '28', '2019-04-05 13:51:38', '438'),
(2723, '7', '66', '2019-04-05 13:51:38', '438'),
(2724, '7', '10', '2019-04-05 13:51:38', '438'),
(2725, '7', '77', '2019-04-05 13:51:38', '438'),
(2726, '7', '68', '2019-04-05 13:51:38', '438'),
(2727, '7', '78', '2019-04-05 13:51:38', '438'),
(2877, '4', '72', '2019-04-26 11:13:22', '438'),
(2878, '4', '56', '2019-04-26 11:13:22', '438'),
(2879, '4', '59', '2019-04-26 11:13:22', '438'),
(2880, '4', '50', '2019-04-26 11:13:22', '438'),
(2881, '4', '53', '2019-04-26 11:13:22', '438'),
(2882, '4', '51', '2019-04-26 11:13:22', '438'),
(2883, '4', '54', '2019-04-26 11:13:22', '438'),
(2884, '4', '92', '2019-04-26 11:13:22', '438'),
(2885, '4', '73', '2019-04-26 11:13:22', '438'),
(2886, '4', '62', '2019-04-26 11:13:22', '438'),
(2887, '4', '61', '2019-04-26 11:13:22', '438'),
(2888, '4', '48', '2019-04-26 11:13:22', '438'),
(2889, '4', '91', '2019-04-26 11:13:22', '438'),
(2890, '4', '86', '2019-04-26 11:13:22', '438'),
(2891, '4', '31', '2019-04-26 11:13:22', '438'),
(2892, '4', '52', '2019-04-26 11:13:22', '438'),
(2893, '4', '64', '2019-04-26 11:13:22', '438'),
(2894, '4', '65', '2019-04-26 11:13:22', '438'),
(2895, '4', '63', '2019-04-26 11:13:22', '438'),
(2896, '4', '60', '2019-04-26 11:13:22', '438'),
(2897, '4', '6', '2019-04-26 11:13:22', '438'),
(2898, '4', '57', '2019-04-26 11:13:22', '438'),
(2899, '4', '49', '2019-04-26 11:13:22', '438'),
(2900, '4', '95', '2019-04-26 11:13:22', '438'),
(2901, '4', '17', '2019-04-26 11:13:22', '438'),
(2902, '4', '18', '2019-04-26 11:13:22', '438'),
(2903, '4', '87', '2019-04-26 11:13:22', '438'),
(2904, '4', '94', '2019-04-26 11:13:22', '438'),
(2905, '4', '67', '2019-04-26 11:13:22', '438'),
(2906, '4', '89', '2019-04-26 11:13:22', '438'),
(2907, '4', '90', '2019-04-26 11:13:22', '438'),
(2908, '4', '12', '2019-04-26 11:13:22', '438'),
(2909, '4', '66', '2019-04-26 11:13:22', '438'),
(2910, '4', '70', '2019-04-26 11:13:22', '438'),
(2911, '4', '69', '2019-04-26 11:13:22', '438'),
(2912, '4', '93', '2019-04-26 11:13:22', '438'),
(2913, '4', '77', '2019-04-26 11:13:22', '438'),
(2914, '4', '68', '2019-04-26 11:13:22', '438'),
(2915, '4', '75', '2019-04-26 11:13:22', '438'),
(2916, '4', '78', '2019-04-26 11:13:22', '438'),
(2917, '4', '23', '2019-04-26 11:13:22', '438'),
(2918, '4', '32', '2019-04-26 11:13:22', '438'),
(2919, '4', '76', '2019-04-26 11:13:22', '438'),
(2920, '4', '74', '2019-04-26 11:13:22', '438'),
(2921, '4', '71', '2019-04-26 11:13:22', '438'),
(2985, '19', '59', '2019-05-21 10:53:44', '438'),
(2986, '19', '62', '2019-05-21 10:53:44', '438'),
(2987, '19', '66', '2019-05-21 10:53:44', '438'),
(2988, '19', '69', '2019-05-21 10:53:44', '438'),
(2989, '19', '74', '2019-05-21 10:53:44', '438'),
(2990, '19', '75', '2019-05-21 10:53:44', '438'),
(2991, '19', '78', '2019-05-21 10:53:44', '438'),
(2992, '19', '86', '2019-05-21 10:53:44', '438'),
(2993, '19', '93', '2019-05-21 10:53:44', '438'),
(2994, '19', '94', '2019-05-21 10:53:44', '438'),
(3031, '5', '58', '2019-05-22 09:34:50', '438'),
(3032, '5', '2', '2019-05-22 09:34:50', '438'),
(3033, '5', '86', '2019-05-22 09:34:50', '438'),
(3034, '5', '63', '2019-05-22 09:34:50', '438'),
(3035, '5', '6', '2019-05-22 09:34:50', '438'),
(3036, '5', '41', '2019-05-22 09:34:50', '438'),
(3037, '5', '22', '2019-05-22 09:34:50', '438'),
(3038, '5', '34', '2019-05-22 09:34:50', '438'),
(3039, '5', '37', '2019-05-22 09:34:50', '438'),
(3040, '5', '67', '2019-05-22 09:34:50', '438'),
(3041, '5', '84', '2019-05-22 09:34:50', '438'),
(3042, '5', '12', '2019-05-22 09:34:50', '438'),
(3043, '5', '80', '2019-05-22 09:34:50', '438'),
(3044, '5', '79', '2019-05-22 09:34:50', '438'),
(3045, '5', '4', '2019-05-22 09:34:50', '438'),
(3046, '5', '38', '2019-05-22 09:34:50', '438'),
(3047, '5', '66', '2019-05-22 09:34:50', '438'),
(3048, '5', '85', '2019-05-22 09:34:50', '438'),
(3049, '5', '1', '2019-05-22 09:34:50', '438'),
(3050, '5', '81', '2019-05-22 09:34:50', '438'),
(3051, '5', '77', '2019-05-22 09:34:50', '438'),
(3052, '5', '21', '2019-05-22 09:34:50', '438'),
(3053, '5', '68', '2019-05-22 09:34:50', '438'),
(3054, '5', '78', '2019-05-22 09:34:50', '438'),
(3055, '5', '32', '2019-05-22 09:34:50', '438'),
(3056, '20', '1', '2019-11-07 08:35:25', '13'),
(3057, '20', '2', '2019-11-07 08:35:25', '13'),
(3058, '20', '3', '2019-11-07 08:35:25', '13'),
(3059, '20', '4', '2019-11-07 08:35:25', '13'),
(3060, '20', '5', '2019-11-07 08:35:25', '13'),
(3061, '20', '6', '2019-11-07 08:35:25', '13'),
(3062, '20', '13', '2019-11-07 08:35:25', '13'),
(3063, '20', '14', '2019-11-07 08:35:25', '13'),
(3064, '20', '79', '2019-11-07 08:35:25', '13'),
(3065, '20', '80', '2019-11-07 08:35:25', '13'),
(3066, '20', '82', '2019-11-07 08:35:25', '13'),
(3067, '20', '83', '2019-11-07 08:35:25', '13'),
(3094, '18', '39', '2020-08-25 16:16:33', '438'),
(3095, '18', '92', '2020-08-25 16:16:33', '438'),
(3096, '18', '86', '2020-08-25 16:16:33', '438'),
(3097, '18', '31', '2020-08-25 16:16:33', '438'),
(3098, '18', '42', '2020-08-25 16:16:33', '438'),
(3099, '18', '64', '2020-08-25 16:16:33', '438'),
(3100, '18', '65', '2020-08-25 16:16:33', '438'),
(3101, '18', '63', '2020-08-25 16:16:33', '438'),
(3102, '18', '40', '2020-08-25 16:16:33', '438'),
(3103, '18', '17', '2020-08-25 16:16:33', '438'),
(3104, '18', '87', '2020-08-25 16:16:33', '438'),
(3105, '18', '94', '2020-08-25 16:16:33', '438'),
(3106, '18', '67', '2020-08-25 16:16:33', '438'),
(3107, '18', '89', '2020-08-25 16:16:33', '438'),
(3108, '18', '82', '2020-08-25 16:16:33', '438'),
(3109, '18', '84', '2020-08-25 16:16:33', '438'),
(3110, '18', '12', '2020-08-25 16:16:33', '438'),
(3111, '18', '79', '2020-08-25 16:16:33', '438'),
(3112, '18', '38', '2020-08-25 16:16:33', '438'),
(3113, '18', '66', '2020-08-25 16:16:33', '438'),
(3114, '18', '83', '2020-08-25 16:16:33', '438'),
(3115, '18', '43', '2020-08-25 16:16:33', '438'),
(3116, '18', '77', '2020-08-25 16:16:33', '438'),
(3117, '18', '68', '2020-08-25 16:16:33', '438'),
(3118, '18', '78', '2020-08-25 16:16:33', '438');

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

--
-- Table structure for table `person`
--

CREATE TABLE `person` (
  `id` bigint(20) NOT NULL,
  `prefix` varchar(10) DEFAULT NULL,
  `first_name` varchar(300) NOT NULL,
  `middle_name` varchar(100) DEFAULT NULL,
  `last_name` varchar(300) NOT NULL,
  `suffix` varchar(10) DEFAULT NULL,
  `gender` enum('male','female','unknown') NOT NULL DEFAULT 'unknown',
  `marital_status` enum('married','single','unknown') NOT NULL DEFAULT 'unknown',
  `date_of_birth` date NOT NULL,
  `citizenship_id` varchar(100) NOT NULL,
  `citizenship_type` varchar(100) NOT NULL,
  `file_number` varchar(200) DEFAULT NULL,
  `is_visible` enum('Y','N') NOT NULL DEFAULT 'Y',
  `signature` varchar(300) DEFAULT NULL,
  `photo` varchar(300) DEFAULT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime NOT NULL,
  `last_updated_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=485 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `person`
--

INSERT INTO `person` (`id`, `prefix`, `first_name`, `middle_name`, `last_name`, `suffix`, `gender`, `marital_status`, `date_of_birth`, `citizenship_id`, `citizenship_type`, `file_number`, `is_visible`, `signature`, `photo`, `date_added`, `added_by`, `last_updated`, `last_updated_by`) VALUES
(17, '', 'Patrick', '', 'Muinda', '', 'male', 'married', '1978-01-11', '219', 'By Birth', 'TM1424835160HN', 'Y', 'file_1539874312.png', 'file_1539874387.png', '2015-01-19 08:47:37', '', '0000-00-00 00:00:00', ''),
(22, '', 'Musa', '', 'MOES', '', 'male', 'married', '0000-00-00', '219', 'By Birth', '', 'Y', 'file_1423590904.jpg', 'file_1555568050.jpg', '2015-01-31 08:35:58', '', '0000-00-00 00:00:00', ''),
(23, '', 'Musa', '', 'CIM', '', 'unknown', 'unknown', '0000-00-00', '219', 'By Birth', 'TM1424347435AR', 'Y', 'file_1499956213.png', 'file_1555751076.jpg', '2015-01-31 11:23:55', '', '0000-00-00 00:00:00', ''),
(29, '', 'Musa', '', 'TIET', '', 'male', 'married', '0000-00-00', '219', 'By Birth', '', 'Y', 'file_1424346077.png', 'file_1559826727.jpg', '2015-02-02 18:24:08', '', '0000-00-00 00:00:00', ''),
(32, '', 'MOPS', '', 'Musa', '', 'male', '', '0000-00-00', '219', 'By Birth', '', 'Y', 'file_1577686788.png', 'file_1424350221.jpg', '2015-02-03 22:54:33', '', '0000-00-00 00:00:00', ''),
(33, '', 'Musa', '', 'ESC', '', 'male', '', '0000-00-00', '219', 'By Birth', '', 'Y', 'file_1577686788.png', 'file_1424350221.jpg', '2015-02-04 21:55:36', '', '0000-00-00 00:00:00', ''),
(36, '', 'David', '', 'Buwembo', '', 'male', '', '1950-08-21', '219', 'By Birth', '', 'Y', 'file_1423633870.png', 'file_1424350221.jpg', '2015-02-05 12:06:55', '', '0000-00-00 00:00:00', ''),
(37, '', 'Musa', '', 'CAO', '', 'unknown', '', '0000-00-00', '', '', '', 'Y', 'file_1558508407.png', 'file_1553073998.jpg', '2015-02-06 12:32:06', '', '0000-00-00 00:00:00', ''),
(90, '', 'MoES', '', 'HR', '', 'male', '', '0000-00-00', '219', 'By Birth', '', 'Y', 'file_1577686788.png', 'file_1539779797.jpg', '2015-05-19 06:58:59', '', '0000-00-00 00:00:00', ''),
(572, NULL, 'James', NULL, 'Dunda', NULL, 'male', 'married', '1990-08-07', '219', 'By Birth', NULL, 'Y', 'file_1577686788.png', 'file_1553058494.jpg', '2018-08-24 13:27:18', '', '0000-00-00 00:00:00', ''),
(598, NULL, 'Nina', NULL, 'Nabona', NULL, 'female', 'single', '1994-07-05', '219', 'By Birth', NULL, 'Y', 'file_1577686788.png', 'file_1556790906.jpg', '2018-09-19 10:21:01', '', '0000-00-00 00:00:00', ''),
(975, NULL, 'Elicard Web', NULL, 'Ndyabahika', NULL, 'male', '', '0000-00-00', '219', 'By Birth', NULL, 'Y', 'file_1583570837.png', 'file_1539837670.jpg', '2018-10-12 15:16:22', '', '0000-00-00 00:00:00', ''),
(981, NULL, 'Muto', NULL, 'Deuson', NULL, 'male', 'single', '1991-07-25', '219', 'By Birth', 'UTS0000981\n', 'Y', 'file_1625261381.png', 'file_1625261827.jpg', '2021-07-01 16:36:12', '', '0000-00-00 00:00:00', ''),
(982, NULL, 'Bowe', NULL, 'Dante', NULL, 'male', 'married', '1991-07-10', '219', 'By Birth', NULL, 'Y', NULL, NULL, '2021-07-03 03:02:42', '', '0000-00-00 00:00:00', ''),
(983, NULL, 'Bowe', NULL, 'Dante', NULL, 'male', 'married', '1991-07-10', '219', 'By Birth', 'UTS0000983\n', 'Y', 'file_1625307665.png', 'file_1625309214.jpg', '2021-07-03 12:01:34', '', '0000-00-00 00:00:00', ''),
(984, NULL, 'Francis', NULL, 'Kiryowa', NULL, 'unknown', '', '0000-00-00', '', '', NULL, 'Y', NULL, NULL, '2021-07-03 15:14:53', '', '0000-00-00 00:00:00', '');

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

--
-- Table structure for table `posting`
--

CREATE TABLE `posting` (
  `id` bigint(20) NOT NULL,
  `postee_id` varchar(100) NOT NULL,
  `institution_id` varchar(100) NOT NULL,
  `posting_start_date` date NOT NULL,
  `posting_end_date` date NOT NULL,
  `notes` text NOT NULL,
  `role_id` varchar(100) NOT NULL,
  `status` enum('saved','reversed','pending','confirmed','verified') NOT NULL DEFAULT 'pending',
  `final_interview_id` varchar(100) NOT NULL,
  `applied_for_confirmation` enum('Y','N') NOT NULL DEFAULT 'N',
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  `last_updated_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=910 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `promotion`
--

CREATE TABLE `promotion` (
  `id` bigint(20) NOT NULL,
  `vacancy_id` varchar(100) NOT NULL,
  `current_posting_id` varchar(100) NOT NULL,
  `reason` text NOT NULL,
  `proposed_promotion_date` date NOT NULL,
  `actual_promotion_date` date NOT NULL,
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `added_by` varchar(100) NOT NULL,
  `added_on` datetime NOT NULL,
  `last_updated_by` varchar(100) NOT NULL,
  `last_updated_on` datetime NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=1820 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `qualification`
--

CREATE TABLE `qualification` (
  `id` bigint(20) NOT NULL,
  `parent_id` varchar(100) NOT NULL,
  `parent_type` varchar(100) NOT NULL,
  `qualification_type` varchar(100) NOT NULL,
  `qualification_number` varchar(200) NOT NULL,
  `details` varchar(500) NOT NULL,
  `issued_by_id` varchar(100) NOT NULL,
  `document_id` varchar(100) NOT NULL,
  `grade_id` varchar(100) NOT NULL,
  `status` enum('reversed','awarded','inprogress') NOT NULL DEFAULT 'awarded',
  `date_achieved` date NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  `last_updated_by` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `query`
--

CREATE TABLE `query` (
  `id` bigint(20) NOT NULL,
  `code` varchar(300) NOT NULL,
  `details` text NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=488 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `query`
--

INSERT INTO `query` (`id`, `code`, `details`) VALUES
(1, 'get_list_of_districts', 'SELECT *, name AS value, name AS display FROM district ORDER BY name'),
(2, 'get_list_of_countries', 'SELECT *, name AS value, name AS display FROM country ORDER BY display_order DESC, name ASC'),
(3, 'add_person_data', 'INSERT INTO person (first_name, last_name, gender, marital_status, date_of_birth, date_added, citizenship_id, citizenship_type) \n\n(SELECT \'_FIRST_NAME_\' AS first_name, \'_LAST_NAME_\' AS last_name, \'_GENDER_\' AS gender, \'_MARITAL_STATUS_\' AS marital_status, \'_DATE_OF_BIRTH_\' AS date_of_birth, NOW() AS date_added, (SELECT id FROM country WHERE name=\'_CITIZENSHIP_COUNTRY_\' LIMIT 1) AS citizenship_id, \'_CITIZENSHIP_TYPE_\' AS citizenship_type)'),
(4, 'add_contact_data', 'INSERT INTO contact (contact_type, carrier_id, details, parent_id, parent_type, date_added) VALUES (\'_CONTACT_TYPE_\', \'_CARRIER_ID_\', \'_DETAILS_\', \'_PARENT_ID_\', \'_PARENT_TYPE_\', NOW())'),
(5, 'add_new_address', 'INSERT IGNORE INTO address (parent_id, parent_type, address_type, importance, details, county, district_id, country_id, date_added)\n\n(SELECT \'_PARENT_ID_\' AS parent_id, \n\'_PARENT_TYPE_\' AS parent_type, \n\'_ADDRESS_TYPE_\' AS address_type, \n\'_IMPORTANCE_\' AS importance, \n\'_DETAILS_\' AS details, \n \'_COUNTY_\' AS county,\nIF((SELECT id FROM district WHERE name=\'_DISTRICT_\' LIMIT 1) IS NOT NULL, (SELECT id FROM district WHERE name=\'_DISTRICT_\' LIMIT 1), \'_DISTRICT_\') AS district_id, \nIF((SELECT id FROM country WHERE name=\'_COUNTRY_\' LIMIT 1) IS NOT NULL, (SELECT id FROM country WHERE name=\'_COUNTRY_\' LIMIT 1), \'_COUNTRY_\') AS country_id,\nNOW() AS date_added\n)'),
(6, 'add_user_data', 'INSERT INTO user (person_id, 	login_name, login_password, permission_group_id, status, date_added, last_updated) \r\n\r\n(SELECT \'_PERSON_ID_\' AS person_id, \'_LOGIN_NAME_\' AS login_name, \'_LOGIN_PASSWORD_\' AS login_password, IF(\'_PERMISSION_GROUP_\'<>\'\', (SELECT id FROM permission_group WHERE notes=\'_PERMISSION_GROUP_\' LIMIT 1), \'\') AS permission_group_id, \'_STATUS_\' AS status, NOW() AS date_added, NOW() AS last_updated)'),
(7, 'get_message_template', 'SELECT * FROM message WHERE message_type=\'_MESSAGE_TYPE_\''),
(8, 'add_event_log', 'INSERT INTO log (log_code, result, details, date_added) VALUES (\'_LOG_CODE_\', \'_RESULT_\', \'_DETAILS_\', NOW())'),
(9, 'update_person_profile_part', 'UPDATE person SET _QUERY_PART_ WHERE id=\'_PERSON_ID_\''),
(10, 'update_person_citizenship', 'UPDATE person P LEFT JOIN country C ON (C.name=\'_CITIZEN_COUNTRY_\') \r\nSET P.citizenship_id=C.id, P.citizenship_type=\'_CITIZENSHIP_TYPE_\' WHERE P.id=\'_PERSON_ID_\''),
(11, 'add_another_id', 'INSERT INTO other_user_id (parent_id, parent_type, id_type, id_value, date_added) \r\nVALUES \r\n(\'_PARENT_ID_\', \'_PARENT_TYPE_\', \'_ID_TYPE_\', \'_ID_VALUE_\', NOW())\r\n\r\nON DUPLICATE KEY UPDATE \r\nid_value=VALUES(id_value),\r\ndate_added=VALUES(date_added)'),
(12, 'add_academic_history', 'INSERT IGNORE INTO academic_history (person_id, institution, institution_type, start_date, end_date, certificate_name, certificate_number, is_highest, date_added, added_by) VALUES (\'_PERSON_ID_\', \'_INSTITUTION_\', \'_INSTITUTION_TYPE_\', \'_START_DATE_\', \'_END_DATE_\', \'_CERTIFICATE_NAME_\', \'_CERTIFICATE_NUMBER_\', \'_IS_HIGHEST_\', NOW(), \'_ADDED_BY_\')'),
(13, 'add_subject_data', 'INSERT INTO subject (details, study_category, parent_id, parent_type) VALUES (\'_DETAILS_\', \'_STUDY_CATEGORY_\', \'_PARENT_ID_\', \'_PARENT_TYPE_\')'),
(14, 'remove_academic_history', 'DELETE FROM academic_history WHERE person_id=\'_PERSON_ID_\''),
(15, 'remove_subject_data', 'DELETE FROM subject WHERE parent_id=\'_PARENT_ID_\' AND parent_type=\'_PARENT_TYPE_\''),
(16, 'update_person_data', 'UPDATE person SET first_name=\'_FIRST_NAME_\', last_name=\'_LAST_NAME_\', gender=\'_GENDER_\', \r\nmarital_status=\'_MARITAL_STATUS_\', date_of_birth=\'_DATE_OF_BIRTH_\',\r\ncitizenship_id=(SELECT id FROM country WHERE name=\'_CITIZENSHIP_COUNTRY_\' LIMIT 1),\r\ncitizenship_type=\'_CITIZENSHIP_TYPE_\' \r\n\r\nWHERE id=\'_PERSON_ID_\''),
(17, 'update_contact_data', 'UPDATE contact SET details=\'_DETAILS_\', carrier_id=\'_CARRIER_ID_\'  WHERE contact_type=\'_CONTACT_TYPE_\' AND parent_id=\'_PARENT_ID_\' AND parent_type=\'_PARENT_TYPE_\''),
(18, 'update_address_data', 'INSERT INTO address (parent_id, parent_type, address_type, importance, details, county, district_id, country_id, date_added)\r\n\r\n(SELECT \'_PARENT_ID_\' AS parent_id, \r\n\'_PARENT_TYPE_\' AS parent_type, \r\n\'_ADDRESS_TYPE_\' AS address_type, \r\n\'_IMPORTANCE_\' AS importance, \r\n\'_DETAILS_\' AS details, \r\n \'_COUNTY_\' AS county,\r\nIF((SELECT id FROM district WHERE name=\'_DISTRICT_\' LIMIT 1) IS NOT NULL, (SELECT id FROM district WHERE name=\'_DISTRICT_\' LIMIT 1), \'_DISTRICT_\') AS district_id, \r\nIF((SELECT id FROM country WHERE name=\'_COUNTRY_\' LIMIT 1) IS NOT NULL, (SELECT id FROM country WHERE name=\'_COUNTRY_\' LIMIT 1), \'_COUNTRY_\') AS country_id,\r\nNOW() AS date_added\r\n)\r\n\r\nON DUPLICATE KEY UPDATE\r\n\r\ndetails=VALUES(details), \r\naddress_type=VALUES(address_type),\r\ncounty=VALUES(county),\r\ndistrict_id=VALUES(district_id), \r\ncountry_id=VALUES(country_id)'),
(19, 'update_another_id', 'UPDATE other_user_id SET id_value=\'_ID_VALUE_\' WHERE parent_id=\'_PARENT_ID_\' AND parent_type=\'_PARENT_TYPE_\' AND id_type=\'_ID_TYPE_\''),
(20, 'record_message_exchange', 'INSERT INTO message_exchange (message_id, send_format, details, subject, attachment, date_added, sender, recipient_id)\r\n\r\n(SELECT M.id AS message_id, \'_SEND_FORMAT_\' AS send_format, \'_DETAILS_\' AS details, \'_SUBJECT_\' AS subject, \'_ATTACHMENT_\' AS attachment, NOW() AS date_added, \'_SENDER_\' AS sender, U.id AS recipient_id FROM message M LEFT JOIN user U ON (U.id IN (\'_RECIPIENT_ID_\')) WHERE M.message_type=\'_CODE_\')'),
(21, 'get_user_by_name_and_pass', 'SELECT U.*, P.first_name, P.last_name, P.gender, P.date_of_birth, P.signature, P.photo, PS.institution_id AS user_posting, PG.notes AS permission_group_name,\n\n(SELECT P.code FROM permission_group G LEFT JOIN permission P ON (G.default_permission=P.id) WHERE G.id=U.permission_group_id LIMIT 1) AS default_permission_code,\n\n(SELECT details FROM contact WHERE contact_type=\'email\' AND parent_id=P.id AND parent_type=\'person\' AND status=\'active\' LIMIT 1) AS email_address,\n\nIF((SELECT details FROM contact WHERE contact_type=\'telephone\' AND parent_id=P.id AND parent_type=\'person\' AND status=\'active\' LIMIT 1) IS NOT NULL, (SELECT details FROM contact WHERE contact_type=\'telephone\' AND parent_id=P.id AND parent_type=\'person\' AND status=\'active\' LIMIT 1), \'\') AS telephone \n\nFROM user U \nLEFT JOIN person P ON (U.person_id=P.id) \nLEFT JOIN permission_group PG ON (U.permission_group_id=PG.id) \nLEFT JOIN posting PS ON (PS.postee_id=U.id)\nWHERE login_name=\'_LOGIN_NAME_\' AND login_password=\'_LOGIN_PASSWORD_\' AND U.status=\'active\''),
(22, 'get_user_by_email', 'SELECT U.id AS user_id, P.first_name, P.last_name \r\nFROM contact C LEFT JOIN person P ON (C.parent_id=P.id AND C.contact_type=\'email\' AND C.parent_type=\'person\') LEFT JOIN user U ON (U.person_id=P.id) \r\nWHERE C.details=\'_EMAIL_ADDRESS_\''),
(23, 'get_group_permissions', 'SELECT P.code \r\nFROM permission_group_mapping M LEFT JOIN permission P ON (M.permission_id=P.id) \r\nWHERE M.group_id=\'_GROUP_ID_\''),
(24, 'activate_teacher_applicant_user', 'UPDATE user SET status=\'active\', last_updated=NOW(), permission_group_id=(SELECT id FROM permission_group WHERE name=\'applicant\' LIMIT 1) WHERE person_id=\'_PERSON_ID_\' AND permission_group_id=\'\''),
(25, 'get_user_by_id', 'SELECT *, id AS user_id FROM user WHERE id=\'_USER_ID_\''),
(26, 'get_group_by_id', 'SELECT * FROM permission_group WHERE id=\'_GROUP_ID_\''),
(27, 'get_group_default_permission', 'SELECT P.code, P.url AS page FROM permission_group G LEFT JOIN permission P ON (G.default_permission=P.id) WHERE G.id = \'_GROUP_ID_\' LIMIT 1'),
(28, 'get_permission_by_code', 'SELECT * FROM permission WHERE code=\'_CODE_\''),
(29, 'get_permission_details', 'SELECT * FROM permission WHERE code IN (_PERMISSIONS_) AND status=\'active\''),
(30, 'get_user_profile', 'SELECT U.id AS user_id, U.person_id, U.login_name, U.date_added, P.first_name, P.last_name, P.signature, P.photo,  \r\n\r\n(SELECT notes FROM permission_group WHERE id=U.permission_group_id LIMIT 1) AS user_role, \r\n \r\n(SELECT details FROM contact WHERE parent_id=U.person_id AND parent_type=\'person\' AND contact_type=\'email\' AND status=\'active\' LIMIT 1) AS email_address, \r\n\r\n(SELECT details FROM contact WHERE parent_id=U.person_id AND parent_type=\'person\' AND contact_type=\'telephone\' AND status=\'active\' LIMIT 1) AS telephone \r\n\r\nFROM user U LEFT JOIN person P ON (P.id=U.person_id) \r\nWHERE U.id=\'_USER_ID_\''),
(31, 'update_user_password', 'UPDATE user SET login_password=\'_NEW_PASSWORD_\', previous_password=\'_OLD_PASSWORD_\', last_updated=NOW(), last_updated_by=\'_UPDATED_BY_\' WHERE id=\'_USER_ID_\''),
(32, 'get_list_of_institutions', 'SELECT *, name AS value, name AS display FROM institution WHERE _SEARCH_QUERY_ ORDER BY name LIMIT 100'),
(33, 'get_permission_groups', 'SELECT *, notes AS value, notes AS display FROM permission_group WHERE is_system_only IN (_SYSTEM_ONLY_) AND name NOT IN (\'applicant\',\'teacher\') ORDER BY notes'),
(34, 'add_vacancy_data', 'INSERT INTO vacancy (school_id, start_date, end_date, topic, summary, details, role_id, date_added, added_by, last_updated, last_updated_by)\r\n\r\n(SELECT \r\n(SELECT id FROM institution WHERE name=\'_INSTITUTION_\' LIMIT 1) AS school_id, \r\n\r\n\'_START_DATE_\' AS start_date, \'_END_DATE_\' AS end_date, \'_TOPIC_\' AS topic, \'_SUMMARY_\' AS summary, \'_DETAILS_\', \r\n\r\n(SELECT id FROM duty WHERE name=\'_ROLE_\' LIMIT 1) AS role_id, \r\n\r\nNOW() AS date_added, \'_ADDED_BY_\' AS added_by, NOW() AS last_updated, \'_ADDED_BY_\' AS last_updated_by\r\n)'),
(35, 'update_vacancy_data', 'UPDATE vacancy SET topic=\'_TOPIC_\', summary=\'_SUMMARY_\', details=\'_DETAILS_\', start_date=\'_START_DATE_\', end_date=\'_END_DATE_\', last_updated=NOW(), last_updated_by=\'_UPDATED_BY_\' WHERE id=\'_VACANCY_ID_\''),
(36, 'get_vacancy_list_data', 'SELECT V.id, V.start_date, V.end_date, V.topic, V.summary, V.status, I.name AS institution_name, D.name AS role_name \r\nFROM vacancy V LEFT JOIN institution I ON (V.school_id=I.id) LEFT JOIN duty D ON (V.role_id=D.id) \r\nWHERE _SEARCH_QUERY_ ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_;'),
(37, 'get_vacancy_by_id', 'SELECT V.*, I.name AS institution_name, D.name AS role_name \r\nFROM vacancy V LEFT JOIN institution I ON (V.school_id=I.id) LEFT JOIN duty D ON (V.role_id=D.id) \r\nWHERE V.id=\'_VACANCY_ID_\';'),
(38, 'add_approval_chain', 'INSERT IGNORE INTO approval_chain (chain_type, step_number, subject_id, originator_id, approver_id, comment, actual_approver, status, date_created, max_steps) \n\n(SELECT \'_CHAIN_TYPE_\' AS chain_type, \'_STEP_NUMBER_\' AS step_number, \'_SUBJECT_ID_\' AS subject_id, \'_ORIGINATOR_ID_\' AS originator_id, \'_APPROVER_ID_\' AS approver_id, \'_COMMENT_\' AS comment, \'_ACTUAL_APPROVER_\' AS actual_approver, \'_STATUS_\' AS status, NOW() AS date_created, S.max_steps AS max_steps FROM approval_chain_setting S WHERE S.chain_type=\'_CHAIN_TYPE_\' AND S.step_number=\'_STEP_NUMBER_\' LIMIT 1)'),
(39, 'get_approval_chain_setting', 'SELECT * FROM approval_chain_setting WHERE chain_type=\'_CHAIN_TYPE_\' AND step_number=\'_STEP_NUMBER_\''),
(40, 'get_approval_chain_by_id', 'SELECT C.*, \n(SELECT CONCAT(P1.last_name, \', \', P1.first_name) FROM approval_chain C1 LEFT JOIN user U1 ON (C1.step_number =\'1\' AND C1.actual_approver = U1.id) LEFT JOIN person P1 ON (P1.id=U1.person_id) WHERE  C1.subject_id=C.subject_id AND C1.chain_type=C.chain_type LIMIT 1) AS originator_name, \n\nIF(C.actual_approver <> \'\', (SELECT CONCAT(P2.last_name, \', \', P2.first_name) FROM user U2 LEFT JOIN person P2 ON (P2.id=U2.person_id) WHERE U2.id=C.actual_approver LIMIT 1), \'\') AS approver_name \n\nFROM approval_chain C WHERE C.id=\'_CHAIN_ID_\''),
(41, 'get_parties_in_chain', 'SELECT DISTINCT actual_approver	FROM approval_chain WHERE subject_id=\'_SUBJECT_ID_\' AND chain_type=\'_CHAIN_TYPE_\' AND status=\'approved\''),
(42, 'get_originator_of_chain', 'SELECT actual_approver AS originator FROM approval_chain WHERE subject_id=\'_SUBJECT_ID_\' AND step_number=\'1\' AND chain_type=\'_CHAIN_TYPE_\' ORDER BY date_created DESC LIMIT 1'),
(43, 'update_vacancy_status', 'UPDATE vacancy SET status=\'_STATUS_\', last_updated=NOW(),last_updated_by=\'_UPDATED_BY_\' WHERE id=\'_VACANCY_ID_\''),
(44, 'deactivate_user_profile', 'UPDATE user SET status=\'archived\', teacher_status=\'archived\' WHERE id=\'_USER_ID_\''),
(45, 'update_profile_visibility', 'UPDATE person SET is_visible=\'_IS_VISIBLE_\' WHERE id=\'_PERSON_ID_\''),
(46, 'activate_teacher_data', 'UPDATE user SET \r\n\r\npermission_group_id = (SELECT id FROM permission_group WHERE name=\'teacher\' LIMIT 1), \r\nstatus=\'active\', \r\nlast_updated=NOW(), last_updated_by=\'_UPDATED_BY_\' \r\n\r\nWHERE id IN (_ID_LIST_)'),
(47, 'get_approver_scope', 'SELECT * FROM approval_chain_scope WHERE approver IN (_GROUP_LIST_)'),
(48, 'get_users_in_group', 'SELECT U.id, U.id AS user_id \r\nFROM user U \r\nLEFT JOIN permission_group G ON (G.id=U.permission_group_id) \r\nLEFT JOIN posting PT ON (U.id=PT.postee_id AND PT.status=\'confirmed\' AND (posting_end_date=\'0000-00-00\' OR posting_end_date > NOW())) \r\nLEFT JOIN institution I ON (PT.institution_id=I.id)\r\nLEFT JOIN address A ON (A.parent_type=\'institution\' AND A.parent_id=I.id AND A.status IN (\'active\',\'verified\'))\r\n\r\nWHERE G.name=\'_GROUP_\' _CONDITION_'),
(49, 'get_originator_scope', 'SELECT U.id AS originator_id,\r\n\r\n(SELECT GROUP_CONCAT(PT.institution_id) FROM posting PT WHERE U.id=PT.postee_id AND PT.status IN (\'pending\',\'confirmed\',\'verified\') AND PT.posting_end_date=\'0000-00-00\') AS institutions,\r\n\r\n(SELECT IF(A.county <> \'\' AND A.county IS NOT NULL, GROUP_CONCAT(A.county), IF(A.district_id <>\'\', (SELECT GROUP_CONCAT(C.name) FROM county C WHERE C.district_id=A.district_id), \'\')) \r\nFROM posting PT \r\nLEFT JOIN address A ON (A.parent_type=\'institution\' AND A.parent_id=PT.institution_id AND A.status IN (\'active\',\'verified\')) WHERE U.id=PT.postee_id AND PT.status IN (\'pending\',\'confirmed\',\'verified\') AND PT.posting_end_date=\'0000-00-00\') AS counties,\r\n\r\n(SELECT GROUP_CONCAT(A.district_id) FROM posting PT \r\nLEFT JOIN address A ON (A.parent_type=\'institution\' AND A.parent_id=PT.institution_id AND A.status IN (\'active\',\'verified\')) WHERE U.id=PT.postee_id AND PT.status IN (\'pending\',\'confirmed\',\'verified\') AND PT.posting_end_date=\'0000-00-00\') AS districts\r\n \r\nFROM user U \r\nWHERE U.id=\'_ORIGINATOR_ID_\''),
(50, 'get_carrier_email_domain', 'SELECT IF(mms_email_domain <>\'\', mms_email_domain, sms_email_domain) AS email_domain FROM carrier WHERE number_stubs LIKE \'_NUMBER_STUB_\' OR number_stubs LIKE \'_NUMBER_STUB_,%\' OR number_stubs LIKE \'%,_NUMBER_STUB_,%\' OR number_stubs LIKE \'%,_NUMBER_STUB_\''),
(51, 'get_step_chain', 'SELECT * FROM approval_chain WHERE chain_type=\'_CHAIN_TYPE_\' AND step_number=\'_STEP_NUMBER_\' AND subject_id=\'_SUBJECT_ID_\''),
(52, 'get_user_list_data', 'SELECT U.*, P.first_name, P.last_name, CONCAT(P.last_name, \', \', P.first_name) AS display, CONCAT(P.last_name, \', \', P.first_name) AS value,\n\n(SELECT notes FROM permission_group WHERE id=U.permission_group_id LIMIT 1) AS user_role, \n \n(SELECT details FROM contact WHERE parent_id=U.person_id AND parent_type=\'person\' AND contact_type=\'email\' AND status=\'active\' LIMIT 1) AS email_address, \n\n(SELECT details FROM contact WHERE parent_id=U.person_id AND parent_type=\'person\' AND contact_type=\'telephone\' AND status=\'active\' LIMIT 1) AS telephone \n\nFROM user U \nJOIN person P ON (P.id=U.person_id) \nLEFT JOIN posting PS ON (PS.postee_id=U.id AND PS.posting_end_date=\'0000-00-00\' AND PS.status=\'verified\')\nWHERE _SEARCH_QUERY_ _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(53, 'update_user_status', 'UPDATE user SET status=\'_STATUS_\', last_updated_by=\'_UPDATED_BY_\', last_updated=NOW() WHERE id=\'_USER_ID_\''),
(54, 'delete_user_data', 'DELETE U, P, A, C, M, S  \nFROM user U \nJOIN person P ON (U.person_id=P.id) \nLEFT JOIN address A ON (A.parent_type=\'person\' AND A.parent_id=P.id) \nLEFT JOIN contact C ON (C.parent_type=\'person\' AND C.parent_id=P.id) \nLEFT JOIN message_exchange M ON (M.recipient_id=U.id)\nLEFT JOIN message_status S ON (M.id=S.message_exchange_id) \n\nWHERE U.id=\'_USER_ID_\''),
(55, 'update_user_permission_group', 'UPDATE user SET permission_group_id=(SELECT id  FROM permission_group WHERE notes=\'_PERMISSION_GROUP_\' LIMIT 1), last_updated_by=\'_UPDATED_BY_\', last_updated=NOW() WHERE id=\'_USER_ID_\''),
(56, 'get_permission_list', 'SELECT *, display AS permission FROM permission WHERE _SEARCH_QUERY_ _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(57, 'get_permission_group_list', 'SELECT G.*, P.display, \nIF(G.is_system_only=\'Y\', \'YES\', \'NO\') AS for_system, IF(last_updated <> \'0000-00-00 00:00:00\', last_updated, \'\') AS last_update_date, \nIF(G.last_updated_by <> \'\', (SELECT CONCAT(P.last_name,\', \',P.first_name) FROM user U LEFT JOIN person P ON (U.person_id=P.id) WHERE U.id=G.last_updated_by LIMIT 1), \'\') AS last_updated_user\n\nFROM permission_group G LEFT JOIN permission P ON (P.id=G.default_permission) WHERE _SEARCH_QUERY_ _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(58, 'get_user_permission_list', 'SELECT CONCAT(P.last_name, \', \', P.first_name) AS user_name, G.id AS group_id, G.notes AS group_name, PM.display AS default_permission, IF(G.last_updated <> \'0000-00-00 00:00:00\', G.last_updated, \'\') AS last_update_date \n\nFROM user U \nLEFT JOIN person P ON (U.person_id = P.id) \nLEFT JOIN permission_group G ON (G.id = U.permission_group_id) \nLEFT JOIN permission PM ON (G.default_permission = PM.id)\nWHERE U.status=\'active\' AND _SEARCH_QUERY_ _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(59, 'get_group_permission_list', 'SELECT M.permission_id, P.category, P.display FROM permission_group_mapping M LEFT JOIN permission P ON (M.permission_id=P.id) WHERE M.group_id=\'_GROUP_ID_\' ORDER BY P.category ASC '),
(60, 'add_permission_group', 'INSERT INTO permission_group (name, notes, default_permission, is_removable, is_system_only, date_added, added_by) VALUES (\'_NAME_CODE_\', \'_GROUP_NAME_\', \'_DEFAULT_PERMISSION_\', \'Y\', \'_IS_SYSTEM_ONLY_\', NOW(), \'_ADDED_BY_\')'),
(61, 'add_group_permissions', 'INSERT INTO permission_group_mapping (group_id, permission_id, date_added, added_by) \r\n(SELECT \'_GROUP_ID_\' AS group_id, P.id AS permission_id, NOW() AS date_added, \'_ADDED_BY_\' AS added_by FROM permission P WHERE P.id IN (_PERMISSION_IDS_))'),
(62, 'remove_group_permissions', 'DELETE FROM permission_group_mapping WHERE group_id=\'_GROUP_ID_\''),
(63, 'update_permission_group', 'UPDATE permission_group SET default_permission=\'_DEFAULT_PERMISSION_\', last_updated=NOW(), last_updated_by=\'_UPDATED_BY_\' WHERE id=\'_GROUP_ID_\''),
(64, 'delete_permission_group_data', 'DELETE G, M FROM permission_group G LEFT JOIN permission_group_mapping M ON ( M.group_id = G.id ) WHERE G.id=\'_GROUP_ID_\''),
(65, 'get_active_users', 'SELECT * FROM user WHERE status=\'active\''),
(66, 'get_user_names_by_list', 'SELECT CONCAT(P.last_name,\', \', P.first_name) AS name FROM user U LEFT JOIN person P ON (U.person_id=P.id) WHERE U.id IN (_USER_IDS_) _LIMIT_FULL_TEXT_'),
(67, 'get_message_list', 'SELECT M.id, CONCAT(P.last_name, \', \', P.first_name) AS name, M.attachment, M.send_format, M.subject, M.recipient_id, \r\n\r\nIF((SELECT status FROM message_status WHERE message_exchange_id=M.id AND user_id=M.recipient_id ORDER BY date_added DESC LIMIT 1) IS NOT NULL,\r\n (SELECT status FROM message_status WHERE message_exchange_id=M.id AND user_id=M.recipient_id ORDER BY date_added DESC LIMIT 1), \'received\') AS status,\r\n\r\nM.date_added AS date_sent \r\n\r\nFROM message_exchange M \r\nLEFT JOIN contact C ON (C.contact_type=\'email\' AND C.details=M.sender AND C.parent_type=\'person\') \r\nLEFT JOIN person P ON (C.parent_id=P.id)\r\nWHERE M.recipient_id=\'_RECIPIENT_ID_\' _SEARCH_QUERY_ _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(68, 'get_sent_message_list', 'SELECT M.id, M.attachment, M.send_format, M.subject, M.recipient_id,\r\nCONCAT(P.last_name, \', \', P.first_name) AS name,\r\nIF((SELECT status FROM message_status WHERE message_exchange_id=M.id AND user_id=M.recipient_id ORDER BY date_added DESC LIMIT 1) IS NOT NULL,\r\n (SELECT status FROM message_status WHERE message_exchange_id=M.id AND user_id=M.recipient_id ORDER BY date_added DESC LIMIT 1), \'received\') AS status,\r\n\r\nM.date_added AS date_sent \r\n\r\nFROM message_exchange M \r\nLEFT JOIN user U ON (U.id=M.recipient_id)\r\nLEFT JOIN person P ON (U.person_id=P.id) \r\n\r\nWHERE M.sender=\'_SENDER_EMAIL_\' _SEARCH_QUERY_ _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(69, 'add_message_status', 'INSERT INTO message_status \r\n(message_exchange_id, user_id, status, date_added) VALUES \r\n(\'_MESSAGE_EXCHANGE_ID_\', \'_USER_ID_\', \'_STATUS_\', NOW()) ON DUPLICATE KEY UPDATE date_added=VALUES(date_added)'),
(70, 'get_message_by_id', 'SELECT M.*, \nCONCAT(P.last_name, \', \', P.first_name) AS sender_name,\n\n(SELECT CONCAT(P1.last_name,\' \', P1.first_name) FROM user U1 LEFT JOIN person P1 ON (U1.person_id=P1.id) WHERE U1.id=M.recipient_id) AS recipient_name,\n\nIF((SELECT status FROM message_status WHERE message_exchange_id=M.id ORDER BY date_added DESC LIMIT 1) IS NOT NULL, (SELECT status FROM message_status WHERE message_exchange_id=M.id ORDER BY date_added DESC LIMIT 1), \'received\') AS status,\n\nM.date_added AS date_sent,\nU.id AS sender_id\n\nFROM message_exchange M \nLEFT JOIN contact C ON (C.contact_type=\'email\' AND C.details=M.sender AND C.parent_type=\'person\') \nLEFT JOIN person P ON (C.parent_id=P.id)\nLEFT JOIN user U ON (U.person_id=C.parent_id AND U.login_name=M.sender)\n\nWHERE M.id=\'_MESSAGE_ID_\''),
(71, 'activate_school_data', 'UPDATE institution SET \r\n\r\nstatus=\'verified\', \r\nlast_updated=NOW(), last_updated_by=\'_UPDATED_BY_\' \r\n\r\nWHERE id IN (_ID_LIST_)'),
(72, 'activate_census_data', 'UPDATE census SET \r\nstatus=\'active\', \r\nlast_updated=NOW(), last_updated_by=\'_UPDATED_BY_\' \r\nWHERE id IN (_ID_LIST_)'),
(73, 'get_school_by_id', 'SELECT S.*, \nS.start_date AS date_registered, \nA.details AS addressline, \nA.county AS county,\n\nIF((SELECT name FROM district WHERE id=A.district_id LIMIT 1) IS NOT NULL, (SELECT name FROM district WHERE id=A.district_id LIMIT 1), A.district_id) AS district,\n\nIF((SELECT name FROM country WHERE id=A.country_id LIMIT 1) IS NOT NULL, (SELECT name FROM country WHERE id=A.country_id LIMIT 1), A.country_id) AS country,\n\nC1.details AS email_address, \nC2.details AS telephone\n\nFROM institution S \nLEFT JOIN address A ON (A.parent_id=S.id AND A.parent_type=\'school\' AND A.is_primary=\'Y\') \nLEFT JOIN contact C1 ON (C1.parent_id=S.id AND C1.parent_type=\'school\' AND C1.is_primary=\'Y\' AND C1.contact_type=\'email\') \nLEFT JOIN contact C2 ON (C2.parent_id=S.id AND C2.parent_type=\'school\' AND C2.is_primary=\'Y\' AND C2.contact_type=\'telephone\') \nWHERE S.id=\'_SCHOOL_ID_\''),
(74, 'get_school_list_data', 'SELECT S.*, \nS.start_date AS date_registered, \nA.details AS addressline, \nA.county AS county,\n\nIF((SELECT name FROM district WHERE id=A.district_id LIMIT 1) IS NOT NULL, (SELECT name FROM district WHERE id=A.district_id LIMIT 1), A.district_id) AS district,\n\nIF((SELECT name FROM country WHERE id=A.country_id LIMIT 1) IS NOT NULL, (SELECT name FROM country WHERE id=A.country_id LIMIT 1), A.country_id) AS country,\n\n(SELECT C1.details FROM contact C1 WHERE C1.parent_id = S.id AND C1.parent_type = \'school\' AND C1.is_primary = \'Y\' AND C1.contact_type = \'email\' LIMIT 1) AS email_address,\n\n(SELECT C2.details FROM contact C2 WHERE C2.parent_id = S.id AND C2.parent_type = \'school\' AND C2.is_primary = \'Y\' AND C2.contact_type = \'telephone\' LIMIT 1) AS telephone\n\nFROM institution S \nJOIN address A ON (A.parent_id=S.id AND A.parent_type=\'school\' AND A.is_primary=\'Y\')  \nWHERE _SEARCH_QUERY_ ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(75, 'add_school_data', 'INSERT INTO institution (name, start_date, end_date, school_type, date_added, added_by, last_updated, last_updated_by) VALUES (\'_NAME_\', \'_START_DATE_\', \'0000-00-00\', \'_SCHOOL_TYPE_\', NOW(), \'_ADDED_BY_\', NOW(), \'_ADDED_BY_\')'),
(76, 'update_item_status', 'UPDATE _TABLE_NAME_ SET status=\'_STATUS_\', last_updated_by=\'_UPDATED_BY_\', last_updated=NOW() WHERE id=\'_ITEM_ID_\''),
(77, 'delete_school_data', 'DELETE S, A, C FROM institution S LEFT JOIN address A ON (A.parent_id=S.id AND A.parent_type=\'school\') LEFT JOIN contact C ON (C.parent_id=S.id AND C.parent_type=\'school\') WHERE S.id=\'_SCHOOL_ID_\' '),
(78, 'get_responsibility_list', 'SELECT *, notes AS responsibility FROM responsibility ORDER BY notes ASC'),
(79, 'get_training_list', 'SELECT *, notes AS training FROM training ORDER BY type ASC, notes ASC'),
(80, 'get_census_list', 'SELECT C.*, CONCAT(P.last_name, \', \', P.first_name) AS teacher_name FROM census C LEFT JOIN user U ON (U.id=C.teacher_id) LEFT JOIN person P ON (P.id=U.person_id) \nWHERE _SEARCH_QUERY_ ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(81, 'add_census_data', 'INSERT INTO census (teacher_id, start_date, end_date, weekly_workload_average, added_by, date_added) VALUES (\'_TEACHER_ID_\', \'_START_DATE_\', \'_END_DATE_\', \'_WEEKLY_WORKLOAD_AVERAGE_\', \'_ADDED_BY_\', NOW())'),
(82, 'add_census_responsibility', 'INSERT INTO census_responsibility (census_id, responsibility_id) \r\n(SELECT \'_CENSUS_ID_\' AS census_id, R.id AS responsibility_id FROM responsibility R WHERE R.id IN (_RESPONSIBILITY_IDS_))'),
(83, 'add_census_training', 'INSERT INTO census_training (census_id, training_id) \r\n(SELECT \'_CENSUS_ID_\' AS census_id, T.id AS training_id FROM training T WHERE T.id IN (_TRAINING_IDS_))'),
(84, 'remove_census_responsibility', 'DELETE FROM census_responsibility WHERE census_id=\'_CENSUS_ID_\''),
(85, 'remove_census_training', 'DELETE FROM census_training WHERE census_id=\'_CENSUS_ID_\''),
(86, 'get_census_responsibility_list', 'SELECT responsibility_id FROM census_responsibility WHERE census_id=\'_CENSUS_ID_\''),
(87, 'get_census_training_list', 'SELECT training_id FROM census_training WHERE census_id=\'_CENSUS_ID_\''),
(88, 'delete_census_data', 'DELETE C, R, T FROM \r\ncensus C \r\nLEFT JOIN census_responsibility R ON (R.census_id=C.id) \r\nLEFT JOIN census_training T ON (T.census_id=C.id) \r\nWHERE C.id = \'_CENSUS_ID_\''),
(89, 'get_census_training', 'SELECT C.*, T.code, T.notes AS training, T.type FROM census_training C LEFT JOIN training T ON (C.training_id=T.id) WHERE C.census_id=\'_CENSUS_ID_\''),
(90, 'get_census_responsibility', 'SELECT C.*, R.code, R.notes AS responsibility FROM census_responsibility C LEFT JOIN responsibility R ON (C.responsibility_id=R.id) WHERE C.census_id=\'_CENSUS_ID_\''),
(91, 'update_teacher_status', 'UPDATE user SET teacher_status=\'_STATUS_\', last_updated=NOW(), last_updated_by=\'_UPDATED_BY_\' WHERE id=\'_USER_ID_\''),
(92, 'get_teacher_list_data', 'SELECT U.*, P.first_name, P.last_name, CONCAT(P.last_name, \', \', P.first_name) AS name, \n\nIF(P.date_of_birth <> \'0000-00-00\', TIMESTAMPDIFF(YEAR, P.date_of_birth, CURDATE()), \'Unknown\') AS age, \n\n(SELECT I.name FROM posting P LEFT JOIN institution I ON (P.institution_id=I.id) WHERE P.postee_id=U.id ORDER BY P.posting_start_date DESC LIMIT 1) AS school,\n\n(SELECT CONCAT(A.details, \' \', A.county, \' \', (SELECT name FROM district WHERE id=A.district_id LIMIT 1), \', \', (SELECT name FROM country WHERE id=A.country_id LIMIT 1)) FROM posting P LEFT JOIN institution I ON (P.institution_id=I.id) LEFT JOIN address A ON (A.parent_id=I.id AND A.parent_type=\'school\') WHERE P.postee_id=U.id ORDER BY P.posting_start_date DESC LIMIT 1) AS school_address, \n \n(SELECT details FROM contact WHERE parent_id=U.person_id AND parent_type=\'person\' AND contact_type=\'email\' AND is_primary=\'Y\' LIMIT 1) AS email_address, \n\n(SELECT details FROM contact WHERE parent_id=U.person_id AND parent_type=\'person\' AND contact_type=\'telephone\' AND is_primary=\'Y\' LIMIT 1) AS telephone \n\nFROM user U LEFT JOIN person P ON (P.id=U.person_id) WHERE (U.permission_group_id=\'2\' OR U.permission_group_id = \'1\') AND _SEARCH_QUERY_ _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(93, 'get_teacher_education', 'SELECT id AS education_id, institution_type AS institution__institutiontype, institution AS institutionname, certificate_name AS certificatename, MONTHNAME(start_date) AS from__month, YEAR(start_date) AS from__pastyear, MONTHNAME(end_date) AS to__month, YEAR(end_date) AS to__pastyear, certificate_number AS certificatenumber, is_highest AS highestcertificate FROM academic_history WHERE person_id=\'_PERSON_ID_\''),
(94, 'get_teacher_subjects', 'SELECT id AS subject_id, details AS subjectname, study_category AS subject__subjecttype  FROM subject WHERE parent_id=\'_PERSON_ID_\' AND parent_type=\'person\''),
(95, 'get_teacher_profile', 'SELECT U.id AS teacher_id,  U.person_id, U.teacher_status, P.first_name, P.last_name, CONCAT(P.last_name, \', \', P.first_name) AS name, \r\n\r\n(SELECT details FROM contact WHERE parent_id=U.person_id AND parent_type=\'person\' AND contact_type=\'telephone\' AND \r\n\r\nis_primary=\'Y\' LIMIT 1) AS telephone, \r\n\r\n(SELECT details FROM contact WHERE parent_id=U.person_id AND parent_type=\'person\' AND contact_type=\'email\' AND is_primary=\'Y\' LIMIT 1) AS email_address, \r\n\r\nP.gender, P.marital_status, P.date_of_birth, P.photo, \r\n\r\nA1.details AS birthplace__addressline, \r\nA1.county AS birthplace__county, \r\n(SELECT name FROM district WHERE id=A1.district_id LIMIT 1) AS birthplace__district, \r\n(SELECT name FROM country WHERE id=A1.country_id LIMIT 1) AS birthplace__country, \r\nA1.address_type AS birthplace__addresstype, \r\n\r\n(SELECT id_value FROM other_user_id WHERE parent_id=U.person_id AND parent_type=\'person\' AND id_type=\'teacher_id\' LIMIT 1) AS teacher_id,\r\n\r\nA2.details AS permanentaddress__addressline, \r\nA2.county AS permanentaddress__county, \r\n(SELECT name FROM district WHERE id=A2.district_id LIMIT 1) AS permanentaddress__district, \r\n(SELECT name FROM country WHERE id=A2.country_id LIMIT 1) AS permanentaddress__country, \r\nA2.address_type AS permanentaddress__addresstype, \r\n\r\nA3.details AS contactaddress__addressline, \r\nA3.county AS contactaddress__county, \r\n(SELECT name FROM district WHERE id=A3.district_id LIMIT 1) AS contactaddress__district, \r\n(SELECT name FROM country WHERE id=A3.country_id LIMIT 1) AS contactaddress__country, \r\nA3.address_type AS contactaddress__addresstype, \r\n\r\n(SELECT name FROM country WHERE id=P.citizenship_id LIMIT 1) AS citizenship__country,\r\nP.citizenship_type AS citizenship__type\r\n\r\nFROM user U \r\nLEFT JOIN person P ON (P.id=U.person_id) \r\nLEFT JOIN address A1 ON (A1.parent_id=U.person_id AND A1.parent_type=\'person\' AND A1.importance=\'birthplace\')\r\nLEFT JOIN address A2 ON (A2.parent_id=U.person_id AND A2.parent_type=\'person\' AND A2.importance=\'permanent\')\r\nLEFT JOIN address A3 ON (A3.parent_id=U.person_id AND A3.parent_type=\'person\' AND A3.importance=\'contact\')\r\n\r\nWHERE U.id=\'_TEACHER_ID_\''),
(96, 'get_teacher_grades', 'SELECT name AS value, name AS display FROM grade  WHERE 1=1 _SEARCHSTRING_ ORDER BY number'),
(97, 'get_grade_details_by_name', 'SELECT * FROM grade WHERE name=\'_GRADE_NAME_\''),
(98, 'add_job_application', 'INSERT IGNORE INTO application (vacancy_id, status, user_id, date_added, added_by, 	last_updated, last_updated_by) VALUES \r\n(\'_VACANCY_ID_\', \'_STATUS_\', \'_USER_ID_\', NOW(), \'_ADDED_BY_\', NOW(), \'_ADDED_BY_\')'),
(99, 'get_job_parties', '(SELECT \'_APPLICANT_\' AS user_id) \r\nUNION \r\n(SELECT id AS user_id FROM user WHERE permission_group_id=\'10\') \r\nUNION \r\n(SELECT U.id AS user_id FROM user U LEFT JOIN vacancy V ON (V.added_by=U.id OR V.last_updated_by=U.id) WHERE V.id=\'_VACANCY_ID_\')'),
(100, 'get_job_applications', 'SELECT DISTINCT \nA.id AS application_id, \nA.status AS application_status, \nA.date_added AS submission_date, \nA.user_id AS applicant_id, \n\n(SELECT CONCAT(P.last_name, \', \', P.first_name) FROM user U LEFT JOIN person P ON (U.person_id=P.id) WHERE U.id=A.user_id LIMIT 1) AS applicant_name, \n\nIF((SELECT id FROM recommendation WHERE recommended_by=\'_VIEWED_BY_\' AND change_application_id=A.id AND application_type=\'job\' LIMIT 1) IS NOT NULL, \'Y\', \'N\') AS has_recommended, \n\n(SELECT COUNT(id) FROM recommendation WHERE change_application_id=A.id AND application_type=\'job\') AS recommendation_count,\n\nV.id, V.start_date, V.end_date, V.topic, V.summary, V.status, \nI.name AS institution_name, \nD.name AS role_name \n\nFROM application A \nLEFT JOIN vacancy V ON (A.vacancy_id=V.id) \nLEFT JOIN institution I ON (V.school_id=I.id) \nLEFT JOIN duty D ON (V.role_id=D.id) \nLEFT JOIN posting PS ON (PS.postee_id=A.user_id)\n\nWHERE _SEARCH_QUERY_ \nORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_;'),
(101, 'save_user_job', 'INSERT IGNORE INTO saved_vacancies (user_id, vacancy_id, date_added) VALUES (\'_USER_ID_\', \'_VACANCY_ID_\', NOW())'),
(102, 'remove_user_job', 'DELETE FROM saved_vacancies WHERE user_id=\'_USER_ID_\' AND vacancy_id=\'_VACANCY_ID_\''),
(103, 'get_saved_jobs', 'SELECT * FROM saved_vacancies WHERE user_id=\'_USER_ID_\''),
(104, 'get_interview_vacancies', 'SELECT \nI2.id,\nV.topic AS job, \nV.id AS job_id, \n(SELECT COUNT(id) FROM note WHERE parent_id=I2.id AND parent_type=\'interview\') AS note_count, \nCONCAT(P.last_name, \', \', P.first_name) AS applicant,\n(SELECT CONCAT(P2.last_name, \' \', P2.first_name) FROM user U2 LEFT JOIN person P2 ON (P2.id=U2.person_id) WHERE U2.id=I2.interviewer_id) AS interviewer, \nI2.board_id,\nI2.interview_date,\nI2.interview_duration,\nI2.result,\nI2.notes, \nA.user_id AS applicant_id\n\nFROM interview I2 \nLEFT JOIN application A ON (I2.application_id=A.id) \nLEFT JOIN vacancy V ON (A.vacancy_id=V.id) \nLEFT JOIN institution I ON (I.id=V.school_id)\n\nLEFT JOIN user U ON (U.id=A.user_id)\nLEFT JOIN person P ON (U.person_id=P.id)\n\nWHERE _SEARCH_QUERY_ ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(105, 'add_recommendation', 'INSERT IGNORE INTO recommendation (change_application_id, application_type, recommended_by, notes, date_added, added_by) VALUES (\'_CHANGE_APPLICATION_ID_\', \'_APPLICATION_TYPE_\', \'_RECOMMENDED_BY_\', \'_NOTES_\', NOW(), \'_ADDED_BY_\')'),
(106, 'get_application_recommendations', 'SELECT R.*, CONCAT(P.last_name, \', \', P.first_name) AS recommender, (SELECT name FROM institution WHERE id=PS.institution_id LIMIT 1) AS recommender_school, (SELECT name FROM duty WHERE id=PS.role_id LIMIT 1) AS recommender_role FROM recommendation R LEFT JOIN user U ON (R.recommended_by=U.id) LEFT JOIN person P ON (U.person_id=P.id) LEFT JOIN posting PS ON (PS.postee_id=R.recommended_by AND PS.posting_end_date=\'0000-00-00\') WHERE R.change_application_id=\'_APPLICATION_ID_\' AND application_type=\'_APPLICATION_TYPE_\' ORDER BY R.date_added DESC'),
(107, 'get_user_posting', 'SELECT institution_id FROM posting WHERE postee_id=\'_USER_ID_\' AND status <> \'reversed\''),
(108, 'add_interview', 'INSERT INTO interview (application_id, interviewer_id, planned_date, interview_date, notes, date_added, added_by, last_updated, last_updated_by) VALUES \r\n\r\n(\'_APPLICATION_ID_\', \'_INTERVIEWER_ID_\', \'_PLANNED_DATE_\', \'_PLANNED_DATE_\', \'_NOTES_\', NOW(), \'_ADDED_BY_\', NOW(), \'_ADDED_BY_\')'),
(109, 'get_simple_application_details', 'SELECT * FROM application WHERE id=\'_APPLICATION_ID_\''),
(110, 'add_note', 'INSERT INTO note (parent_id, parent_type, details, date_added, added_by) VALUES \r\n(\'_PARENT_ID_\', \'_PARENT_TYPE_\', \'_DETAILS_\', NOW(), \'_ADDED_BY_\')'),
(111, 'get_item_notes', 'SELECT N.id, CONCAT(P.last_name, \', \', P.first_name) AS added_by, N.details, N.date_added FROM note N LEFT JOIN user U ON (N.added_by=U.id) LEFT JOIN person P ON (U.person_id=P.id) \n\nWHERE N.parent_id=\'_ITEM_ID_\' AND N.parent_type=\'_ITEM_TYPE_\' \nORDER BY N.date_added DESC'),
(112, 'get_shortlist_data', 'SELECT DISTINCT shortlist_name AS value, shortlist_name AS display FROM shortlist WHERE _SEARCH_QUERY_ _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(113, 'update_interview_data', 'UPDATE interview SET interview_date=\'_INTERVIEW_DATE_\', interview_duration=\'_INTERVIEW_DURATION_\', result=\'_RESULT_\', last_updated=NOW(), last_updated_by=\'_UPDATED_BY_\' WHERE id=\'_INTERVIEW_ID_\''),
(114, 'add_user_to_shortlist', 'INSERT IGNORE INTO shortlist (shortlist_name, vacancy_id, applicant_id, date_added, added_by) VALUES \r\n(\'_SHORTLIST_NAME_\', \'_VACANCY_ID_\', \'_APPLICANT_ID_\', NOW(), \'_ADDED_BY_\')'),
(115, 'remove_interview_details', 'DELETE I, N FROM interview I LEFT JOIN note N ON (N.parent_id=I.id AND N.parent_type=\'interview\') WHERE I.id=\'_INTERVIEW_ID_\''),
(116, 'get_interview_shortlists', 'SELECT  DISTINCT S.vacancy_id,  S.vacancy_id AS id, S.shortlist_name, V.topic AS job, I.name AS institution_name \nFROM shortlist S \nLEFT JOIN vacancy V ON (V.id=S.vacancy_id) \nLEFT JOIN institution I ON (I.id=V.school_id) \nLEFT JOIN user U ON (U.id=S.applicant_id) \nLEFT JOIN person P ON (U.person_id=P.id)\n\nWHERE _SEARCH_QUERY_ ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(117, 'get_shortlist_details', 'SELECT S.id AS shortlist_id, S.date_added, \n\n(SELECT CONCAT(P.last_name, \', \', P.first_name) \nFROM user U JOIN person P ON (P.id=U.person_id) \nWHERE U.id=S.applicant_id LIMIT 1) AS name, \n\n(SELECT P.file_number FROM user U JOIN person P ON (P.id=U.person_id) \nWHERE U.id=S.applicant_id LIMIT 1) AS number, \n\n(SELECT CONCAT(A.details, \' \', A.county, \' \', (SELECT name FROM district WHERE id=A.district_id LIMIT 1), \', \', (SELECT name FROM country WHERE id=A.country_id LIMIT 1)) FROM user U LEFT JOIN address A ON (A.parent_id=U.person_id AND A.parent_type=\'person\' AND A.importance=\'contact\') WHERE U.id=S.applicant_id LIMIT 1) AS address, \n\n(SELECT CONCAT(V.topic, \' AT \', (SELECT name FROM institution WHERE id=V.school_id)) FROM vacancy V WHERE V.id=S.vacancy_id) AS post_applied\n\nFROM shortlist S \nWHERE S.vacancy_id=\'_VACANCY_ID_\' AND S.shortlist_name=\'_SHORTLIST_NAME_\' \nORDER BY name ASC'),
(118, 'get_duties', 'SELECT *, name AS value, name AS display FROM duty ORDER BY name ASC'),
(119, 'get_managers_for_user', 'SELECT U2.id AS user_id \r\nFROM user U1 \r\nLEFT JOIN posting P1 ON (P1.postee_id=U1.id)\r\nLEFT JOIN posting P2 ON (P2.institution_id=P1.institution_id)\r\nLEFT JOIN user U2 ON (P2.postee_id=U2.id AND U2.permission_group_id=\'3\')\r\n\r\nWHERE U2.id IS NOT NULL AND U1.id=\'_TEACHER_ID_\''),
(120, 'get_caos_for_user', 'SELECT U2.id AS user_id \r\n\r\nFROM user U1 \r\nLEFT JOIN address A1 ON (U1.person_id=A1.parent_id AND A1.parent_type=\'person\' AND A1.importance=\'contact\') \r\nLEFT JOIN address A2 ON (((A2.county <> \'\' AND A2.county=A1.county) OR (A2.county = \'\' AND A2.district_id=A1.district_id)) AND A2.importance=\'contact\') \r\nLEFT JOIN user U2 ON (U2.person_id=A2.parent_id AND A2.parent_type=\'person\' AND U2.permission_group_id=\'12\') \r\n\r\nWHERE U2.id IS NOT NULL AND U1.id=\'_TEACHER_ID_\''),
(121, 'add_posting_data', 'INSERT INTO posting (postee_id, institution_id, posting_start_date, posting_end_date, notes, role_id, final_interview_id, status, date_added, added_by, last_updated, last_updated_by)\r\n\r\n(SELECT \'_POSTEE_ID_\' AS postee_id, school_id AS institution_id, NOW() AS posting_start_date, \'0000-00-00\' AS posting_end_date, \'_NOTES_\' AS notes, role_id AS role_id, \'_FINAL_INTERVIEW_ID_\' AS final_interview_id, \'_STATUS_\' AS status, NOW() AS date_added, \'_ADDED_BY_\' AS added_by, NOW() AS last_updated, \'_ADDED_BY_\' AS last_updated_by FROM vacancy WHERE id=\'_VACANCY_ID_\')'),
(122, 'get_user_address', 'SELECT A.*, A.details AS addressline, \r\nA.county, \r\n\r\nIF((SELECT name FROM district WHERE id=A.district_id LIMIT 1) IS NOT NULL, (SELECT name FROM district WHERE id=A.district_id LIMIT 1), A.district_id) AS district, \r\n\r\n(SELECT name FROM country WHERE id=A.country_id) AS country \r\n\r\nFROM user U \r\nLEFT JOIN address A ON (A.parent_id=U.person_id AND A.parent_type=\'person\' AND importance=\'_ADDRESS_TYPE_\')\r\nWHERE A.id IS NOT NULL AND U.id=\'_USER_ID_\''),
(123, 'get_job_postings', 'SELECT DISTINCT P.id, P.postee_id, P.final_interview_id, P1.file_number,  P.applied_for_confirmation, P.role_id, P.final_interview_id, P.last_updated_by, \nCONCAT(P1.last_name, \', \', P1.first_name) AS teacher_name, \nD.name AS job, D.description AS job_description, I.name AS institution_name, P.date_added AS award_date, P.posting_start_date AS start_date, P.status AS confirmation_status\n\nFROM posting P \nLEFT JOIN user U ON (U.id = P.postee_id) \nLEFT JOIN person P1 ON (P1.id = U.person_id) \nLEFT JOIN duty D ON (D.id = P.role_id) \nLEFT JOIN institution I ON (I.id = P.institution_id) \nLEFT JOIN address A ON (A.parent_id=I.id AND A.parent_type=\'school\')\n\nWHERE _SEARCH_QUERY_ ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_\n'),
(124, 'change_posting_field', 'UPDATE posting SET _FIELD_NAME_=\'_FIELD_VALUE_\', last_updated=NOW(), last_updated_by=\'_UPDATED_BY_\' WHERE id=\'_POSTING_ID_\''),
(125, 'remove_posting_data', 'DELETE FROM posting WHERE id=\'_POSTING_ID_\''),
(126, 'update_interview_part', 'UPDATE interview SET _FIELD_NAME_=\'_FIELD_VALUE_\', last_updated=NOW(), last_updated_by=\'_UPDATED_BY_\' WHERE id=\'_INTERVIEW_ID_\''),
(127, 'submit_confirmation_request', 'UPDATE posting SET applied_for_confirmation=\'Y\' WHERE id=\'_POSTING_ID_\''),
(128, 'get_teacher_jobs', 'SELECT (SELECT name FROM duty WHERE id=P.role_id LIMIT 1) AS job, \r\nI.name AS school, \r\nP.institution_id, \r\nA.details AS addressline, \r\nA.county, \r\n\r\nIF((SELECT name FROM district WHERE id=A.district_id LIMIT 1) IS NOT NULL, (SELECT name FROM district WHERE id=A.district_id LIMIT 1), A.district_id) AS district, \r\n\r\n(SELECT name FROM country WHERE id=A.country_id) AS country, \r\n\r\nP.posting_start_date AS startdate,\r\nP.posting_end_date AS enddate\r\n\r\nFROM posting P \r\nLEFT JOIN institution I ON (I.id=P.institution_id)\r\nLEFT JOIN address A ON (A.parent_id=I.id AND A.parent_type=\'school\')\r\n\r\nWHERE P.postee_id=\'_USER_ID_\' _SEARCH_CONDITION_'),
(129, 'get_previous_schools', 'SELECT DISTINCT \nI.name AS school, \nA.details AS addressline, \nA.county, \n\nIF((SELECT name FROM district WHERE id=A.district_id LIMIT 1) IS NOT NULL, (SELECT name FROM district WHERE id=A.district_id LIMIT 1), A.district_id) AS district, \n\n(SELECT name FROM country WHERE id=A.country_id) AS country, \n\n(SELECT GROUP_CONCAT(D.name SEPARATOR \', \') FROM duty D WHERE D.id IN (SELECT role_id FROM posting WHERE institution_id=P.institution_id AND postee_id=\'_USER_ID_\')) AS jobs, \n\n(SELECT MIN(P1.posting_start_date) FROM posting P1 WHERE P1.institution_id=P.institution_id AND P1.status NOT IN (\'saved\', \'reversed\') AND P1.postee_id=\'_USER_ID_\') AS startdate,\n\n(SELECT MIN(P2.posting_end_date) FROM posting P2 WHERE P2.institution_id=P.institution_id AND P2.status NOT IN (\'saved\', \'reversed\') AND P2.postee_id=\'_USER_ID_\') AS enddate\n\nFROM posting P \nLEFT JOIN institution I ON (I.id=P.institution_id)\nLEFT JOIN address A ON (A.parent_id=I.id AND A.parent_type=\'school\')\n\nWHERE P.postee_id=\'_USER_ID_\' AND P.posting_end_date <> \'0000-00-00\''),
(130, 'add_retirement_application', 'INSERT INTO retirement (retiree_id, retiree_reason, proposed_date, date_added, added_by, last_updated, last_updated_by) VALUES \r\n(\'_RETIREE_ID_\', \'_RETIREE_REASON_\', \'_PROPOSED_DATE_\', NOW(), \'_ADDED_BY_\', NOW(), \'_ADDED_BY_\')'),
(131, 'get_retirement_application', 'SELECT R.*, CONCAT(P.last_name, \', \', P.first_name) AS retiree_name \nFROM retirement R \nLEFT JOIN user U ON (U.id=R.retiree_id) \nLEFT JOIN person P ON (P.id=U.person_id)\n\nWHERE R.id=\'_APPLICATION_ID_\''),
(132, 'add_promotion_application', 'INSERT INTO promotion (vacancy_id, current_posting_id, reason, proposed_promotion_date, added_by, added_on, last_updated_by, last_updated_on)  \r\n\r\n(SELECT \'_VACANCY_ID_\' AS vacancy_id, id AS current_posting_id, \'_REASON_\' AS reason, \'_PROPOSED_PROMOTION_DATE_\' AS proposed_promotion_date, \'_ADDED_BY_\' AS added_by, NOW() AS added_on, \'_ADDED_BY_\' AS last_updated_by, NOW() AS last_updated_on \r\nFROM posting \r\nWHERE postee_id=\'_APPLICANT_ID_\' AND posting_end_date=\'0000-00-00\' LIMIT 1)'),
(133, 'get_school_jobs', 'SELECT V.id, V.topic AS value, V.topic AS display \r\nFROM vacancy V \r\nLEFT JOIN posting P ON (P.postee_id=\'_USER_ID_\' AND V.school_id=P.institution_id AND P.posting_end_date=\'0000-00-00\') \r\n\r\nWHERE P.institution_id IS NOT NULL AND V.status=\'published\' AND _SEARCH_QUERY_ LIMIT 100'),
(134, 'get_institution_data', 'SELECT CONCAT(I.name, \' (\', I.district, \', \', I.county, \' \', I.country, \')\') AS display, CONCAT(I.name, \' (\', I.district, \', \', I.county, \' \', I.country, \')\') AS value, I.id \r\n\r\nFROM \r\n(SELECT INS.id, INS.name, \r\n\r\nIF((SELECT name FROM district WHERE id=A.district_id LIMIT 1) IS NOT NULL, (SELECT name FROM district WHERE id=A.district_id LIMIT 1), A.district_id) AS district, \r\n\r\nA.county,\r\n\r\n(SELECT name FROM country WHERE id=A.country_id) AS country\r\n\r\nFROM institution INS \r\nLEFT JOIN address A ON (A.parent_id=INS.id AND A.parent_type=\'school\') \r\nWHERE INS.status=\'verified\' AND _SEARCH_QUERY_  LIMIT _LIMIT_TEXT_\r\n) I \r\n_ORDER_BY_'),
(135, 'add_transfer_application', 'INSERT INTO transfer (teacher_id, old_school_id, new_school_id, reason, proposed_date, date_added, added_by, last_updated, last_updated_by) \n\n(SELECT \'_TEACHER_ID_\' AS teacher_id, institution_id AS old_school_id, \'_NEW_SCHOOL_ID_\' AS new_school_id, \'_REASON_\' AS reason, \'_PROPOSED_DATE_\' AS proposed_date, NOW() AS date_added, \'_ADDED_BY_\' AS added_by, NOW() AS last_updated, \'_ADDED_BY_\' AS last_updated_by FROM posting WHERE postee_id=\'_TEACHER_ID_\' AND posting_end_date = \'0000-00-00\' LIMIT 1)'),
(136, 'add_leave_application', '\r\nINSERT INTO `leave` \r\n  \r\n (teacher_id, \r\n  proposed_start_date,\r\n  proposed_end_date,\r\n  reason,\r\n  date_added,\r\n  added_by,\r\n  last_updated, \r\n  last_updated_by,\r\n  leavegrounds\r\n  ) VALUES \r\n\r\n (\'_TEACHER_ID_\'\r\n  , \'_PROPOSED_START_DATE_\'\r\n  , \'_PROPOSED_END_DATE_\'\r\n  , \'_REASON_\'\r\n  , NOW()\r\n  , \'_ADDED_BY_\'\r\n  , NOW()\r\n  , \'_ADDED_BY_\'\r\n  ,\'_LEAVEGROUNDS_\'\r\n  )\r\n'),
(137, 'get_retirement_list_data', 'SELECT R.*, CONCAT(P.last_name, \', \', P.first_name) AS teacher_name, P.file_number, \nIF(P.date_of_birth <> \'0000-00-00\', TIMESTAMPDIFF(YEAR, P.date_of_birth, CURDATE()), \'Unknown\') AS age,\n(SELECT D.name FROM duty D WHERE D.id = PS.role_id LIMIT 1) AS job\n \nFROM retirement R \nLEFT JOIN user U ON (R.retiree_id=U.id) \nLEFT JOIN person P ON (P.id=U.person_id) \nLEFT JOIN posting PS ON (PS.postee_id=R.retiree_id AND PS.posting_end_date=\'0000-00-00\') \n\nWHERE _SEARCH_QUERY_ AND P.id IS NOT NULL ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(138, 'get_leave_list_data', 'SELECT L.*, \nCONCAT(P.last_name, \', \', P.first_name) AS teacher_name, \nI.name AS school_name,\n(SELECT D.name FROM duty D WHERE D.id = PS.role_id LIMIT 1) AS job,\nA.details AS addressline, \nA.county AS county,\n\nIF((SELECT name FROM district WHERE id=A.district_id LIMIT 1) IS NOT NULL, (SELECT name FROM district WHERE id=A.district_id LIMIT 1), A.district_id) AS district,\n\nIF((SELECT name FROM country WHERE id=A.country_id LIMIT 1) IS NOT NULL, (SELECT name FROM country WHERE id=A.country_id LIMIT 1), A.country_id) AS country  \n\nFROM `leave` L \nLEFT JOIN user U ON (U.id=L.teacher_id) \nLEFT JOIN person P ON (P.id=U.person_id) \nLEFT JOIN posting PS ON (PS.postee_id=L.teacher_id AND PS.posting_end_date=\'0000-00-00\') \nLEFT JOIN institution I ON (I.id=PS.institution_id)\nLEFT JOIN address A ON (A.parent_id=I.id AND A.parent_type=\'school\')\n\nWHERE _SEARCH_QUERY_ ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(139, 'get_transfer_list_data', 'SELECT T.*, \nCONCAT(P.last_name, \', \', P.first_name) AS teacher_name, \n\n(SELECT name FROM institution WHERE id=T.old_school_id LIMIT 1) AS current_school_name, \n\nI.name AS desired_school_name, \nA.details AS addressline, \nA.county AS county, \n(SELECT D.name FROM duty D JOIN posting PS ON (D.id=PS.role_id) WHERE PS.postee_id=T.teacher_id AND PS.institution_id=T.old_school_id ORDER BY PS.id DESC LIMIT 1) AS old_job, \n\nIF((SELECT name FROM district WHERE id=A.district_id LIMIT 1) IS NOT NULL, (SELECT name FROM district WHERE id=A.district_id LIMIT 1), A.district_id) AS district,\n\nIF((SELECT name FROM country WHERE id=A.country_id LIMIT 1) IS NOT NULL, (SELECT name FROM country WHERE id=A.country_id LIMIT 1), A.country_id) AS country   \n\nFROM transfer T \nLEFT JOIN user U ON (U.id=T.teacher_id) \nLEFT JOIN person P ON (P.id=U.person_id) \nLEFT JOIN institution I ON (T.new_school_id=I.id)\nLEFT JOIN address A ON (A.parent_id=I.id AND A.parent_type=\'school\') \n\nWHERE _SEARCH_QUERY_ ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(140, 'get_log_list_data', 'SELECT L.*, CONCAT(P.last_name, \', \', P.first_name) AS user_name \n\nFROM `log` L \nLEFT JOIN user U ON (L.details LIKE CONCAT(\'%userid=\',U.id,\'|%\')) \nLEFT JOIN person P ON (P.id=U.person_id) \nWHERE _SEARCH_QUERY_ ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(141, 'change_transfer_field', 'UPDATE transfer SET _FIELD_NAME_=\'_FIELD_VALUE_\', last_updated_by=\'_UPDATED_BY_\', last_updated=NOW() WHERE id=\'_TRANSFER_ID_\'');
INSERT INTO `query` (`id`, `code`, `details`) VALUES
(142, 'terminate_teacher_posting', 'UPDATE posting \r\nSET posting_end_date=NOW(), last_updated=NOW(), last_updated_by=\'_UPDATED_BY_\' \r\nWHERE id=\'_POSTING_ID_\''),
(143, 'add_plain_posting', 'INSERT INTO posting (postee_id, institution_id, posting_start_date, posting_end_date, notes, role_id, status, final_interview_id, applied_for_confirmation, date_added, added_by, last_updated, last_updated_by) VALUES \n\n(\'_POSTEE_ID_\', \'_INSTITUTION_ID_\', NOW(), \'0000-00-00\', \'_NOTES_\', \'_ROLE_ID_\', \'_STATUS_\', \'_FINAL_INTERVIEW_ID_\', \'N\', NOW(), \'_ADDED_BY_\', NOW(), \'_ADDED_BY_\')'),
(144, 'remove_transfer_record', 'DELETE FROM transfer WHERE id=\'_TRANSFER_ID_\''),
(145, 'change_leave_field', 'UPDATE `leave` SET _FIELD_NAME_=\'_FIELD_VALUE_\', last_updated_by=\'_UPDATED_BY_\', last_updated=NOW() WHERE id=\'_LEAVE_ID_\''),
(146, 'remove_leave_record', 'DELETE FROM `leave` WHERE id=\'_LEAVE_ID_\''),
(147, 'update_leave_dates', 'UPDATE `leave` SET actual_start_date=\'_ACTUAL_START_DATE_\', actual_end_date=\'_ACTUAL_END_DATE_\' WHERE id=\'_LEAVE_ID_\''),
(148, 'change_retirement_field', 'UPDATE retirement SET _FIELD_NAME_=\'_FIELD_VALUE_\', last_updated_by=\'_UPDATED_BY_\', last_updated=NOW() WHERE id=\'_RETIREMENT_ID_\''),
(149, 'remove_retirement_record', 'DELETE FROM retirement WHERE id=\'_RETIREMENT_ID_\''),
(150, 'remove_transfer_application', 'DELETE FROM transfer WHERE teacher_id=\'_TEACHER_ID_\' AND status=\'pending\''),
(151, 'remove_leave_application', 'DELETE FROM `leave` WHERE teacher_id=\'_TEACHER_ID_\' AND status=\'pending\''),
(152, 'remove_retirement_application', 'DELETE FROM retirement WHERE retiree_id=\'_RETIREE_ID_\' AND status=\'pending\''),
(153, 'validate_system_document', 'SELECT D.*, CONCAT(P.last_name, \', \', P.first_name) AS owner_name \r\nFROM document D\r\nLEFT JOIN user U ON \r\n(U.id=D.parent_id AND D.parent_type=\'person\')\r\nLEFT JOIN person P ON \r\n(U.person_id=P.id) WHERE document_type=\'_DOCUMENT_TYPE_\' AND tracking_number=\'_TRACKING_NUMBER_\''),
(154, 'add_system_document', 'INSERT INTO document (url, document_type, tracking_number, description, parent_id, parent_type, date_added) VALUES \r\n(\'_URL_\', \'_DOCUMENT_TYPE_\', \'_TRACKING_NUMBER_\', \'_DESCRIPTION_\', \'_PARENT_ID_\', \'_PARENT_TYPE_\', NOW())'),
(155, 'get_county_list_data', 'SELECT C.name, D.name AS district_name, C.name AS value, C.name AS display \r\nFROM county C \r\nLEFT JOIN district D ON (C.district_id=D.id) \r\nWHERE _SEARCH_QUERY_ ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(156, 'add_approved_school_data', 'INSERT INTO institution (name, \r\n\r\nstart_date, end_date, status, date_added, added_by, last_updated, \r\n\r\nlast_updated_by) VALUES (\'_INSTITUTION_NAME_\', \'_START_DATE_\', \r\n\r\n\'0000-00-00\', \'verified\', NOW(), \'_ADDED_BY_\', NOW(), \r\n\r\n\'_ADDED_BY_\')'),
(157, 'get_schools_with_ids', 'SELECT * FROM institution WHERE id IN (_ID_LIST_)'),
(158, 'add_old_posting', 'INSERT INTO posting (postee_id, institution_id, posting_start_date, posting_end_date, notes, role_id, status, final_interview_id, applied_for_confirmation, date_added, added_by, last_updated, last_updated_by) \r\n\r\n(SELECT \'_POSTEE_ID_\' AS postee_id, \'_INSTITUTION_ID_\' AS institution_id, \'_START_DATE_\' AS posting_start_date, \'0000-00-00\' AS posting_end_date, \'_NOTES_\' AS notes, D.id AS role_id, \'_STATUS_\' AS status, \'_FINAL_INTERVIEW_ID_\' AS final_interview_id, \'_APPLIED_FOR_CONFIRMATION_\' AS applied_for_confirmation, NOW() AS date_added, \'_ADDED_BY_\' AS added_by, NOW() AS last_updated, \'_ADDED_BY_\' AS last_updated_by FROM duty D WHERE D.name=\'_JOB_NAME_\' LIMIT 1)'),
(159, 'get_user_documents', 'SELECT D.* FROM document D \nLEFT JOIN user U ON (U.person_id=D.parent_id AND D.parent_type=\'person\') \n\nWHERE U.id=\'_USER_ID_\' AND document_type <> \'qualification_document\' \nORDER BY D.date_added DESC'),
(160, 'get_interview_board', 'SELECT B.name AS board_name, M.board_id, M.member_id, CONCAT(P.last_name, \', \', P.first_name) AS member_name, M.is_chairman \n\nFROM interview_board_member M \nLEFT JOIN interview_board B ON (B.id = M.board_id) \nLEFT JOIN user U ON (U.id=M.member_id) \nLEFT JOIN person P ON (P.id=U.person_id) \nLEFT JOIN interview I ON (I.board_id=M.board_id)\n\nWHERE I.id=\'_INTERVIEW_ID_\' ORDER BY P.last_name '),
(161, 'get_board_by_id', 'SELECT * FROM interview_board WHERE id=\'_BOARD_ID_\''),
(162, 'remove_board_members', 'DELETE FROM interview_board_member WHERE board_id = \'_BOARD_ID_\''),
(163, 'add_board_members', 'INSERT INTO interview_board_member (board_id, member_id, is_chairman, date_added, added_by) \r\n\r\n(SELECT \'_BOARD_ID_\' AS board_id, id AS member_id, IF(id=\'_CHAIRMAN_\',\'Y\',\'N\') AS is_chairman, NOW() AS date_added, \'_ADDED_BY_\' AS added_by FROM user WHERE id IN (_MEMBER_IDS_))'),
(164, 'update_interview_board', 'UPDATE interview SET interviewer_id=\'_INTERVIEWER_ID_\', board_id=\'_BOARD_ID_\', last_updated=NOW(), last_updated_by=\'_UPDATED_BY_\' WHERE id=\'_INTERVIEW_ID_\''),
(165, 'add_new_board', 'INSERT INTO interview_board (name, date_added, 	added_by, last_updated, last_updated_by) VALUES \r\n(\'_BOARD_NAME_\', NOW(), \'_ADDED_BY_\', NOW(), \'_ADDED_BY_\')'),
(166, 'get_list_of_boards', 'SELECT *, name AS value, name AS display FROM interview_board ORDER BY name'),
(167, 'get_board_members', 'SELECT M.board_id, M.member_id, CONCAT(P.last_name, \', \', P.first_name) AS member_name, M.is_chairman \r\n\r\nFROM interview_board_member M \r\nLEFT JOIN user U ON (U.id=M.member_id) \r\nLEFT JOIN person P ON (P.id=U.person_id) \r\n\r\nWHERE M.board_id=\'_BOARD_ID_\' ORDER BY P.last_name '),
(168, 'get_approval_list_data', 'SELECT \r\nDISTINCT IF(A.chain_type=\'data\', CONCAT(A.chain_type,\' (\', LEFT(A.subject_id,LOCATE(\'|\',A.subject_id) - 1), \')\'), \n\r\n\r\nA.chain_type) AS item_name, \r\n\r\nA.subject_id, \r\n\r\n(SELECT CASE A.chain_type \r\n   WHEN \'registration\' THEN (SELECT CONCAT(P.last_name, \', \', P.first_name) \nFROM user U LEFT JOIN person P \r\n\r\nON (U.person_id=P.id) WHERE U.id=A.subject_id LIMIT 1) \r\n\r\n   WHEN \'vacancy\' THEN (SELECT CONCAT(V.topic, \' (\', \n(SELECT name FROM institution WHERE \r\n\r\nid=V.school_id),\')\') FROM vacancy V WHERE V.id=A.subject_id LIMIT 1) \r\n\r\n   WHEN \'transfer\' THEN (SELECT CONCAT(\'FOR \', \nP.last_name, \', \', P.first_name, \' FROM \', (SELECT name \r\n\r\nFROM institution WHERE id=T.old_school_id), \' TO \', (SELECT name FROM institution WHERE \r\n\r\nid=T.new_school_id))\nFROM transfer T WHERE T.id=A.subject_id LIMIT 1) \r\n\r\n   WHEN \'confirmation\' THEN (SELECT CONCAT((SELECT CONCAT(P.last_name, \', \', P.first_name) FROM user U \r\n\r\nLEFT \nJOIN person P ON (U.person_id=P.id) WHERE U.id=PS.postee_id LIMIT 1), \' (\', (SELECT name FROM \r\n\r\ninstitution WHERE id=PS.institution_id),\')\') FROM posting PS \nWHERE PS.id=A.subject_id LIMIT 1) \r\n\r\n   WHEN \'retirement\' THEN (SELECT CONCAT(P.last_name, \', \', P.first_name) FROM user U LEFT JOIN \r\n\r\nperson P ON (U.person_id=P.id) \nWHERE U.id=A.subject_id LIMIT 1) \r\n\r\n   WHEN \'leave\' THEN (SELECT (SELECT CONCAT(P.last_name, \', \', P.first_name) FROM user U LEFT JOIN person \r\n\r\nP ON (U.person_id=P.id)\n WHERE U.id=L.teacher_id) FROM `leave` L WHERE L.id=A.subject_id LIMIT 1) \r\n\r\n   WHEN \'data\' THEN (SELECT \r\n      \n IF(LEFT(A.subject_id,LOCATE(\'|\',A.subject_id) - 1) = \'school\', (SELECT name FROM institution WHERE \r\n\r\nid=SUBSTRING_INDEX(A.subject_id,\'|\',-1)), \r\n    \n \'Other Data\'\r\n      ) LIMIT 1) \r\n\r\n   ELSE \'Other\'\r\nEND) AS subject, \r\n\r\n(SELECT GROUP_CONCAT(CONCAT(\'[\',A2.step_number,\'] \', P2.last_name, \', \', P2.first_name, \n \' ON \', \r\n\r\nDATE_FORMAT(A2.date_created, \"%d-%b-%Y %h:%i%p\"), \'    \') SEPARATOR \' &#10148; \') \r\nFROM approval_chain A2 \r\nLEFT JOIN user U2 ON (U2.id=A2.actual_approver)\n \r\nLEFT JOIN person P2 ON (U2.person_id=P2.id)\r\nWHERE A2.subject_id=A.subject_id AND A2.chain_type=A.chain_type \r\nORDER BY A2.step_number,date_created DESC) AS approval_chain, \n \r\n\r\n\r\n(SELECT MAX(A1.date_created) FROM approval_chain A1 WHERE A1.subject_id=A.subject_id AND \r\n\r\nA1.chain_type=A.chain_type) AS last_updated\r\n\r\nFROM approval_chain A \n \r\nLEFT JOIN user U ON (U.id=A.actual_approver)\r\nLEFT JOIN person P ON (P.id=U.person_id)\r\nWHERE _SEARCH_QUERY_ ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_\r\n'),
(169, 'add_user_document', 'INSERT INTO document (url, document_type, tracking_number, description, is_removable, parent_id, parent_type, date_added) VALUES \r\n(\'_URL_\', \'_DOCUMENT_TYPE_\', \'_TRACKING_NUMBER_\', \'_DESCRIPTION_\', \'_IS_REMOVABLE_\', \'_PARENT_ID_\', \'_PARENT_TYPE_\', NOW())'),
(170, 'delete_user_document_by_url', 'DELETE FROM document WHERE url=\'_URL_\' '),
(171, 'get_teacher_documents', 'SELECT D.id AS document_id, D.url AS documenturl, D.description AS documentname, D.tracking_number, D.is_removable, \nU.teacher_status AS TeacherStatus\r\nFROM document D\r\nRIGHT JOIN user U ON D.parent_id = U.person_id\r\nWHERE document_type=\'qualification_document\' \nAND parent_id=\'_PERSON_ID_\' AND parent_type=\'person\' \r\nORDER BY D.date_added ASC'),
(172, 'update_document_field', 'UPDATE document SET _FIELD_NAME_=\'_FIELD_VALUE_\' WHERE id=\'_DOCUMENT_ID_\''),
(173, 'update_document_owner', 'UPDATE document SET parent_id=\'_ACTUAL_ID_\' WHERE parent_type=\'person\' AND parent_id=\'_TEMP_ID_\''),
(174, 'disable_document_editing', 'UPDATE document SET is_removable=\'N\' WHERE parent_id=\'_PERSON_ID_\' AND parent_type=\'person\''),
(175, 'get_teacher_payroll_data', 'SELECT P.file_number,  \n\n(SELECT id_value FROM other_user_id WHERE parent_id=P.id AND parent_type=\'person\' AND id_type=\'teacher_id\' LIMIT 1) AS uts_number, \n\nP.first_name, P.last_name, \n\nCONCAT(P.last_name, \', \', P.first_name) AS name, \n\nIF(P.date_of_birth <> \'0000-00-00\', DATE_FORMAT(P.date_of_birth, \"%d-%b-%Y\"), \'Unknown\') AS date_of_birth, \n\n(SELECT D.name FROM posting PS LEFT JOIN duty D ON (PS.role_id=D.id) WHERE (PS.posting_end_date=\'0000-00-00\' OR PS.posting_end_date=(SELECT MAX(posting_end_date) FROM posting PS1 WHERE PS1.postee_id=PS.postee_id)) AND PS.postee_id=U.id ORDER BY PS.posting_end_date ASC LIMIT 1) AS title, \n\n(SELECT D.salary_scale FROM posting PS LEFT JOIN duty D ON (PS.role_id=D.id) WHERE (PS.posting_end_date=\'0000-00-00\' OR PS.posting_end_date=(SELECT MAX(posting_end_date) FROM posting PS1 WHERE PS1.postee_id=PS.postee_id)) AND PS.postee_id=U.id ORDER BY PS.posting_end_date ASC LIMIT 1) AS salary_scale, \n\n(SELECT DATE_FORMAT(D.date_added, \"%d-%b-%Y\") FROM document D WHERE D.document_type=\'confirmation_letter\' AND D.parent_id=P.id AND D.parent_type=\'person\' LIMIT 1) AS date_of_confirmation, \n\n(SELECT DATE_FORMAT(PS.posting_start_date, \"%d-%b-%Y\") FROM posting PS WHERE PS.postee_id=U.id AND PS.status NOT IN (\'saved\', \'reversed\') ORDER BY PS.posting_start_date ASC LIMIT 1) AS first_appointment_date, \n\n(SELECT DATE_FORMAT(PS.posting_start_date, \"%d-%b-%Y\") FROM posting PS WHERE (PS.posting_end_date=\'0000-00-00\' OR PS.posting_end_date=(SELECT MAX(posting_end_date) FROM posting PS1 WHERE PS1.postee_id=PS.postee_id)) AND PS.postee_id=U.id ORDER BY PS.posting_end_date ASC LIMIT 1) AS current_appointment_date, \n\n(SELECT CASE U.teacher_status \nWHEN \'completed\' THEN \'SUBMITTED\'  \nWHEN \'pending\' THEN \'ISSUED FILENUMBER\' \nWHEN \'approved\' THEN \'ISSUED CERTIFICATE\' \nWHEN \'active\' THEN \'ACTIVE\' \nWHEN \'archived\' THEN \'RETIRED\' \nELSE \'UNKNOWN\' END) AS teacher_status, \n\n(SELECT CONCAT(\'CERTIFICATES: \', GROUP_CONCAT(CONCAT(H.certificate_name,\' (\',H.institution,\')\')  SEPARATOR \', \'), \' SUBJECTS: \', (SELECT GROUP_CONCAT(CONCAT(S.details,\' (\',S.study_category,\')\')  SEPARATOR \', \') FROM subject S WHERE S.parent_id=H.person_id AND S.parent_type=\'person\')) FROM academic_history H WHERE H.person_id=P.id) AS qualifications, \n\nIF((SELECT id FROM retirement WHERE retiree_id=U.id LIMIT 1) IS NOT NULL, \n(SELECT IF(confirmed_date <> \'0000-00-00\', DATE_FORMAT(confirmed_date, \"%d-%b-%Y\"), DATE_FORMAT(proposed_date, \"%d-%b-%Y\")) FROM retirement WHERE retiree_id=U.id LIMIT 1), \nIF(P.date_of_birth <> \'0000-00-00\', (SELECT DATE_FORMAT(DATE_ADD(P.date_of_birth,INTERVAL 60 YEAR), \"%d-%b-%Y\")), \'UNKNOWN\')\n) AS proposed_retirement, \n\nIF((SELECT id FROM retirement WHERE retiree_id=U.id LIMIT 1) IS NOT NULL, \n(SELECT CONCAT(\'DATE: \', IF(confirmed_date <> \'0000-00-00\', DATE_FORMAT(confirmed_date, \"%d-%b-%Y\"), DATE_FORMAT(proposed_date, \"%d-%b-%Y\")),\' REASON: \', retiree_reason) FROM retirement WHERE retiree_id=U.id LIMIT 1), \nIF(P.date_of_birth <> \'0000-00-00\', (SELECT CONCAT(DATE_FORMAT(DATE_ADD(P.date_of_birth,INTERVAL 60 YEAR), \"%d-%b-%Y\"),\' (AMAR)\')), \'UNKNOWN\')\n) AS retirement_status\n\nFROM user U \nLEFT JOIN person P ON (P.id=U.person_id) \n\nWHERE (U.permission_group_id=\'2\' OR U.permission_group_id = \'1\') \nAND _SEARCH_QUERY_ _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(176, 'get_teacher_cim_data', 'SELECT P.file_number, \r\n\r\n(SELECT id_value FROM other_user_id WHERE parent_id=P.id AND parent_type=\'person\' AND id_type=\'teacher_id\' LIMIT 1) AS uts_number, \r\n\r\nP.first_name, P.last_name, \r\n\r\nCONCAT(P.last_name, \', \', P.first_name) AS name, \r\n\r\n(SELECT D.name FROM posting PS LEFT JOIN duty D ON (PS.role_id=D.id) WHERE (PS.posting_end_date=\'0000-00-00\' OR PS.posting_end_date=(SELECT MAX(posting_end_date) FROM posting PS1 WHERE PS1.postee_id=PS.postee_id)) AND PS.postee_id=U.id ORDER BY PS.posting_end_date ASC LIMIT 1) AS title, \r\n\r\n(SELECT GROUP_CONCAT(CONCAT(R.notes,\' (\',R.code,\')\') SEPARATOR \', \')\r\nFROM census C \r\nLEFT JOIN census_responsibility CR ON (CR.census_id=C.id) \r\nLEFT JOIN responsibility R ON (CR.responsibility_id=R.id)\r\nWHERE C.status=\'active\' AND C.teacher_id=U.id ORDER BY C.date_added DESC LIMIT 1) AS responsibility, \r\n\r\n(SELECT D.name FROM posting PS LEFT JOIN duty D ON (PS.role_id=D.id) WHERE PS.status=\'saved\' AND PS.postee_id=U.id ORDER BY PS.last_updated DESC LIMIT 1) AS substantive_post, \r\n\r\nIF(P.date_of_birth <> \'0000-00-00\', DATE_FORMAT(P.date_of_birth, \"%d-%b-%Y\"), \'Unknown\') AS date_of_birth, \r\n\r\n(SELECT DATE_FORMAT(D.date_added, \"%d-%b-%Y\") FROM document D WHERE D.document_type=\'confirmation_letter\' AND D.parent_id=P.id AND D.parent_type=\'person\' LIMIT 1) AS date_of_confirmation, \r\n\r\n(SELECT (SELECT CONCAT(A.details, \' \', A.county, \' \', (SELECT name FROM district WHERE id=A.district_id LIMIT 1), \', \', (SELECT name FROM country WHERE id=A.country_id LIMIT 1)) \r\nFROM address A \r\nWHERE A.parent_id=PS.institution_id AND A.parent_type=\'school\' AND A.is_primary=\'Y\') \r\nFROM posting PS WHERE (PS.posting_end_date=\'0000-00-00\' OR PS.posting_end_date=(SELECT MAX(posting_end_date) FROM posting PS1 WHERE PS1.postee_id=PS.postee_id)) AND PS.postee_id=U.id ORDER BY PS.posting_end_date ASC LIMIT 1) AS location, \r\n\r\n(SELECT (SELECT name FROM institution WHERE id=PS.institution_id) FROM posting PS WHERE (PS.posting_end_date=\'0000-00-00\' OR PS.posting_end_date=(SELECT MAX(posting_end_date) FROM posting PS1 WHERE PS1.postee_id=PS.postee_id)) AND PS.postee_id=U.id ORDER BY PS.posting_end_date ASC LIMIT 1) AS school, \r\n\r\n(SELECT (SELECT school_type FROM institution WHERE id=PS.institution_id) FROM posting PS WHERE (PS.posting_end_date=\'0000-00-00\' OR PS.posting_end_date=(SELECT MAX(posting_end_date) FROM posting PS1 WHERE PS1.postee_id=PS.postee_id)) AND PS.postee_id=U.id ORDER BY PS.posting_end_date ASC LIMIT 1) AS school_type, \r\n\r\n(SELECT GROUP_CONCAT(S.details SEPARATOR \', \') FROM subject S WHERE S.study_category=\'Major\' AND S.parent_id=P.id AND S.parent_type=\'person\') AS subjects_major, \r\n\r\n(SELECT GROUP_CONCAT(S.details SEPARATOR \', \') FROM subject S WHERE S.study_category=\'Minor\' AND S.parent_id=P.id AND S.parent_type=\'person\') AS subjects_minor, \r\n\r\n(SELECT GROUP_CONCAT(S.details SEPARATOR \', \') FROM subject S WHERE S.study_category=\'Other\' AND S.parent_id=P.id AND S.parent_type=\'person\') AS subjects_other, \r\n\r\n(SELECT DATE_FORMAT(PS.posting_start_date, \"%d-%b-%Y\") FROM posting PS WHERE PS.postee_id=U.id AND PS.status NOT IN (\'saved\', \'reversed\') ORDER BY PS.posting_start_date ASC LIMIT 1) AS first_appointment_date, \r\n\r\n(SELECT DATE_FORMAT(PS.last_updated, \"%d-%b-%Y\") FROM posting PS WHERE (PS.posting_end_date=\'0000-00-00\' OR PS.posting_end_date=(SELECT MAX(posting_end_date) FROM posting PS1 WHERE PS1.postee_id=PS.postee_id)) AND PS.postee_id=U.id AND PS.status <> \'saved\' ORDER BY PS.posting_end_date ASC LIMIT 1) AS posting_date, \r\n\r\n(SELECT DATE_FORMAT(PS.posting_start_date, \"%d-%b-%Y\") FROM posting PS WHERE (PS.posting_end_date=\'0000-00-00\' OR PS.posting_end_date=(SELECT MAX(posting_end_date) FROM posting PS1 WHERE PS1.postee_id=PS.postee_id)) AND PS.postee_id=U.id AND PS.status <> \'saved\' ORDER BY PS.posting_end_date ASC LIMIT 1) AS current_appointment_date, \r\n\r\n(SELECT CASE U.teacher_status \r\nWHEN \'completed\' THEN \'SUBMITTED\'  \r\nWHEN \'pending\' THEN \'ISSUED FILENUMBER\' \r\nWHEN \'approved\' THEN \'ISSUED CERTIFICATE\' \r\nWHEN \'active\' THEN \'ACTIVE\' \r\nWHEN \'archived\' THEN \'RETIRED\' \r\nELSE \'UNKNOWN\' END) AS teacher_status, \r\n\r\n(SELECT CONCAT(\'CERTIFICATES: \', GROUP_CONCAT(CONCAT(H.certificate_name,\' (\',H.institution,\')\')  SEPARATOR \', \') ) FROM academic_history H WHERE H.person_id=P.id) AS qualifications, \r\n\r\nIF((SELECT id FROM retirement WHERE retiree_id=U.id LIMIT 1) IS NOT NULL, \r\n(SELECT IF(confirmed_date <> \'0000-00-00\', DATE_FORMAT(confirmed_date, \"%d-%b-%Y\"), DATE_FORMAT(proposed_date, \"%d-%b-%Y\")) FROM retirement WHERE retiree_id=U.id LIMIT 1), \r\nIF(P.date_of_birth <> \'0000-00-00\', (SELECT DATE_FORMAT(DATE_ADD(P.date_of_birth,INTERVAL 60 YEAR), \"%d-%b-%Y\")), \'UNKNOWN\')\r\n) AS proposed_retirement, \r\n\r\nIF((SELECT id FROM retirement WHERE retiree_id=U.id LIMIT 1) IS NOT NULL, \r\n(SELECT CONCAT(\'DATE: \', IF(confirmed_date <> \'0000-00-00\', DATE_FORMAT(confirmed_date, \"%d-%b-%Y\"), DATE_FORMAT(proposed_date, \"%d-%b-%Y\")),\' REASON: \', retiree_reason) FROM retirement WHERE retiree_id=U.id LIMIT 1), \r\nIF(P.date_of_birth <> \'0000-00-00\', (SELECT CONCAT(DATE_FORMAT(DATE_ADD(P.date_of_birth,INTERVAL 60 YEAR), \"%d-%b-%Y\"),\' (AMAR)\')), \'UNKNOWN\')\r\n) AS retirement_status\r\n\r\nFROM user U \r\nLEFT JOIN person P ON (P.id=U.person_id) \r\n\r\nWHERE (U.permission_group_id=\'2\' OR U.permission_group_id = \'1\') \r\nAND _SEARCH_QUERY_ _ORDER_BY_ LIMIT _LIMIT_TEXT_\r\n'),
(177, 'get_board_chairman', 'SELECT B.name AS board_name, M.board_id, M.member_id AS chairman_id, \n(SELECT CONCAT(P.last_name, \', \', P.first_name) FROM user U LEFT JOIN person P ON (P.id=U.person_id) WHERE U.id=M.member_id) AS chairman_name\n\nFROM interview_board_member M \nLEFT JOIN interview_board B ON (B.id = M.board_id)\nWHERE B.id=\'_BOARD_ID_\' \nORDER BY CAST(M.is_chairman AS CHAR) DESC, M.date_added ASC LIMIT 1'),
(178, 'record_multiple_interviews', 'INSERT IGNORE INTO interview (application_id, interviewer_id, board_id, planned_date, interview_date, date_added, added_by, last_updated, last_updated_by) \n\n(SELECT A.id AS application_id, \'_INTERVIEWER_ID_\' AS interviewer_id, \'_BOARD_ID_\' AS board_id, \'_PLANNED_DATE_\' AS planned_date, \'_PLANNED_DATE_\' AS interview_date, NOW() AS date_added, \'_ADDED_BY_\' AS added_by, NOW() AS last_updated, \'_ADDED_BY_\' AS last_updated_by FROM application A WHERE A.id IN (_APPLICATION_IDS_))'),
(179, 'get_application_list_data', 'SELECT DISTINCT A.id AS application_id, \r\nA.user_id AS applicant_id, \r\nA.date_added AS submission_date, \r\n\r\n(SELECT CONCAT(P.last_name, \', \', P.first_name) FROM user U LEFT JOIN person P ON (U.person_id=P.id) WHERE U.id=A.user_id LIMIT 1) AS applicant_name, \r\n\r\n(SELECT I.name FROM vacancy V LEFT JOIN institution I ON (V.school_id=I.id) WHERE A.vacancy_id=V.id LIMIT 1) AS institution_name\r\n\r\nFROM application A \r\nWHERE A.id IN (_APPLICATION_IDS_)'),
(180, 'report_stat_registerednumbers_by_gender', 'SELECT \r\n(SELECT COUNT(U1.id) FROM user U1 LEFT JOIN person P1 ON (U1.person_id=P1.id) WHERE U1.permission_group_id=\'2\' AND U1.teacher_status IN (\'approved\',\'active\') AND P1.gender=\'male\') AS Male, \r\n\r\n(SELECT COUNT(U1.id) FROM user U1 LEFT JOIN person P1 ON (U1.person_id=P1.id) WHERE  U1.permission_group_id=\'2\' AND U1.teacher_status IN (\'approved\',\'active\') AND P1.gender=\'female\') AS Female,\r\n\r\n(SELECT COUNT(U1.id) FROM user U1 LEFT JOIN person P1 ON (U1.person_id=P1.id) WHERE  U1.permission_group_id=\'2\' AND U1.teacher_status IN (\'approved\',\'active\') AND P1.gender=\'unknown\') AS Unknown'),
(181, 'report_stat_registerednumbers_by_grade', 'SELECT \nCONCAT(G.name, \' (\',G.code,\')\') AS Grade, \n\n(SELECT COUNT(U.id) FROM user U \nLEFT JOIN document D ON (U.person_id=D.parent_id AND D.parent_type=\'person\') \nWHERE D.tracking_number LIKE CONCAT(G.number,\'%\') AND D.document_type=\'registration_certificate\') AS Teachers \n\nFROM grade G \nORDER BY number'),
(182, 'report_stat_registerednumbers_by_subject', 'SELECT DISTINCT S.details AS Subject, \r\n\r\n(SELECT COUNT(U.id) FROM user U \r\n LEFT JOIN subject S1 ON (U.person_id=S1.parent_id AND S1.parent_type=\'person\') WHERE U.teacher_status IN (\'approved\',\'active\') AND S1.details=S.details) AS Teachers \r\n\r\nFROM subject S ORDER BY S.details ASC'),
(183, 'report_stat_registerednumbers_by_school', 'SELECT \nCONCAT(I.name, \' - \', I.school_type) AS field, \n(SELECT COUNT(DISTINCT PS.postee_id) FROM posting PS WHERE (PS.posting_end_date=\'0000-00-00\' OR DATE(PS.posting_end_date) > NOW()) AND PS.institution_id=I.id AND PS.status <> \'reversed\') AS value \n\nFROM institution I \nWHERE I.status=\'verified\' \nHAVING value > 0'),
(184, 'report_stat_registerednumbers_by_district', 'SELECT D.name AS field, \n\n(SELECT COUNT(DISTINCT PS.postee_id) \nFROM posting PS \nLEFT JOIN address A ON (A.parent_id=PS.institution_id AND A.parent_type=\'school\')\nWHERE (PS.posting_end_date=\'0000-00-00\' OR DATE(PS.posting_end_date) > NOW()) AND PS.status <> \'reversed\' AND A.district_id=D.id\n) AS value\n\nFROM district D \nORDER BY D.name ASC'),
(185, 'report_stat_registerednumbers_by_region', 'SELECT DISTINCT D.region AS Region, \r\n(SELECT COUNT(DISTINCT PS.postee_id) \r\nFROM posting PS\r\nLEFT JOIN address A ON (A.parent_id = PS.institution_id AND A.parent_type = \'school\') \r\nLEFT JOIN district D1 ON (A.district_id = D1.id)\r\nWHERE (PS.posting_end_date = \'0000-00-00\' OR DATE(PS.posting_end_date) > NOW())\r\nAND PS.status <> \'reversed\'\r\nAND D1.region=D.region) AS Teachers\r\n\r\nFROM district D\r\nORDER BY D.region ASC '),
(186, 'report_stat_teacherappointments_by_post', 'SELECT D.name AS Post, \r\n\r\n(SELECT COUNT(DISTINCT PS.postee_id) FROM posting PS \r\nWHERE PS.role_id=D.id AND PS.status <> \'reversed\'\r\nAND (PS.posting_start_date BETWEEN DATE(\'_START_DATE_\') AND DATE(\'_END_DATE_\'))) AS Teachers\r\n\r\nFROM duty D \r\nORDER BY D.name '),
(187, 'report_stat_teacherappointments_by_school', 'SELECT DISTINCT (SELECT I.name FROM institution I WHERE I.id=PS.institution_id) AS field, \n\n(SELECT COUNT(DISTINCT PS1.postee_id) FROM posting PS1 WHERE PS1.institution_id = PS.institution_id AND PS1.status <> \'reversed\' AND (PS1.posting_start_date BETWEEN DATE(\'_START_DATE_\') AND DATE(\'_END_DATE_\'))) AS value\n\nFROM posting PS \nWHERE PS.status <> \'reversed\' \nAND (PS.posting_start_date BETWEEN DATE(\'_START_DATE_\') AND DATE(\'_END_DATE_\'))\n\nORDER BY field'),
(188, 'report_stat_teacherappointments_by_district', 'SELECT D.name AS field, \n\n(SELECT COUNT(DISTINCT PS.postee_id) FROM posting PS \nLEFT JOIN address A ON (A.parent_id=PS.institution_id AND A.parent_type=\'school\')\nWHERE A.district_id=D.id AND PS.status <> \'reversed\'\nAND (PS.posting_start_date BETWEEN DATE(\'_START_DATE_\') AND DATE(\'_END_DATE_\'))) AS value\n\nFROM district D \nORDER BY D.name '),
(189, 'report_stat_teacherappointments_by_region', 'SELECT DISTINCT D.region AS Region, \r\n\r\n(SELECT COUNT(DISTINCT PS.postee_id) FROM posting PS \r\nLEFT JOIN address A ON (A.parent_id=PS.institution_id AND A.parent_type=\'school\') \r\nLEFT JOIN district D1 ON (A.district_id=D1.id)\r\nWHERE D1.region=D.region AND PS.status <> \'reversed\'\r\nAND (PS.posting_start_date BETWEEN DATE(\'_START_DATE_\') AND DATE(\'_END_DATE_\'))) AS Teachers\r\n\r\nFROM district D \r\nORDER BY D.region '),
(190, 'report_stat_teacherstatus_applied', 'SELECT \'Teachers Who Submitted Their Application:\' AS Label,\r\n(SELECT COUNT(id) FROM user \nWHERE permission_group_id=\'1\' AND teacher_status=\'completed\') AS `Count`'),
(191, 'report_stat_teacherstatus_on_probation', 'SELECT \'Teachers On Probation:\' AS Label,\n(SELECT COUNT(DISTINCT PS.postee_id) FROM posting PS WHERE PS.status IN (\'saved\',\'pending\') AND (PS.posting_end_date=\'0000-00-00\' OR DATE(PS.posting_end_date) > NOW()) ) AS Count'),
(192, 'report_stat_teacherstatus_confirmed', 'SELECT \'Teachers Confirmed:\' AS Label,\r\n(SELECT COUNT(DISTINCT PS.postee_id) FROM posting PS WHERE PS.status IN (\'confirmed\') AND (PS.posting_end_date=\'0000-00-00\' OR DATE(PS.posting_end_date) > NOW()) ) AS Count'),
(193, 'report_stat_teacherstatus_on_leave', 'SELECT \'Teachers On Leave:\' AS Label,\n(SELECT COUNT(DISTINCT L.teacher_id) FROM `leave` L WHERE L.status =\'confirmed\' AND NOW() BETWEEN DATE(L.actual_start_date) AND DATE(L.actual_end_date)) AS `Count`'),
(194, 'report_stat_teacherstatus_retired', 'SELECT \'Teachers Who Retired:\' AS Label,\r\n(SELECT COUNT(id) FROM user WHERE permission_group_id=\'2\' AND teacher_status=\'archived\') AS `Count`'),
(195, 'grade_category', 'SELECT id  AS value, category AS display FROM grade_category ORDER BY category'),
(196, 'save_certificate', 'INSERT\r\nINTO teacher_certificates\r\n  (person_id,certificate,approved_by,commissioned_by,date_approved,date_commissioned,date_added,grade)\r\n  VALUES (\'_PERSON_ID_\',\'_CERTIFICATE_\',\'_APPROVED_BY_\',\'_COMMISSIONED_BY_\',\'_DATE_APPROVED_\',\'_DATE_COMMISSIONED_\',\'_DATE_ADDED_\',\'_GRADE_\')\r\n'),
(197, 'report_stat_teacherstatus_certified', 'SELECT \'Teachers Whose Applications Certified by Commissioner Tiet:\' AS Label,\r\n(SELECT COUNT(id) FROM `user` WHERE `teacher_status` = \'active\') AS \'Number\''),
(198, 'report_stat_teacherstatus_pending', 'SELECT \'Teachers Whose Applications are pending:\' AS Label, \n(SELECT COUNT(DISTINCT id) FROM `user` \r\nWHERE `teacher_status`=\'pending\')AS `Number`'),
(199, 'report_stat_teacherstatus_approved', 'SELECT \'Teachers Whose Applications were approved by HR:\' AS Label,\r\n(SELECT COUNT(id) FROM `user` WHERE `teacher_status` = \'approved\') as \'Number\''),
(200, 'get_teacher_certificates', 'SELECT id AS document_id, url AS documenturl, description AS documentname, tracking_number, \r\nis_removable FROM document WHERE parent_id=\'PERSON_ID\' AND parent_type=\'person\' AND NOT document_type=\'qualification_document\' ORDER BY date_added ASC'),
(201, 'report_stat_teacherstatus_approved', 'SELECT \'Teachers Whose Applications were approved by HR:\' AS Label,\r\n(SELECT COUNT(id) FROM `user` WHERE `teacher_status` = \'approved\') as \'Number\''),
(202, 'report_stat_teacherstatus_pending', 'SELECT \'Teachers Whose Applications are pending(rejected):\' AS Label, (SELECT COUNT(DISTINCT id) FROM `user` WHERE `teacher_status` = \'rejected\')AS `Number`'),
(203, 'report_stat_teacherstatus_certified', 'SELECT \'Teachers Whose Applications Certified by Commissioner Tiet:\' AS Label,\r\n(SELECT COUNT(id) FROM `user` WHERE `teacher_status` = \'certified\') AS \'Number\''),
(204, 'report_stat_teacherstatus_verified', 'SELECT \'Teachers Verified:\' AS Label,\r\n(SELECT COUNT(DISTINCT PS.postee_id) FROM posting PS WHERE PS.status IN (\'verified\') AND (PS.posting_end_date=\'0000-00-00\' OR DATE(PS.posting_end_date) > NOW()) ) AS Count'),
(205, 'update_user_email', 'UPDATE user, contact SET user.login_name=\'_LOGIN_NAME_\',user.last_updated_by=\'_UPDATED_BY_\', \nuser.last_updated=NOW(),contact.details=\'_DETAILS_\', contact.carrier_id=\'_CARRIER_ID_\'  \nWHERE contact.contact_type=\'_CONTACT_TYPE_\' AND contact.parent_id=\'_PARENT_ID_\' AND contact.parent_type=\'_PARENT_TYPE_\' AND user.id=\'_USER_ID_\''),
(206, 'get_telephone_number', 'SELECT details FROM `contact` WHERE `contact_type` = \'telephone\' AND `parent_id`=\'_PARENT_ID_\''),
(207, 'get_teacher_certificates', 'SELECT id AS document_id, attachment AS documenturl, subject AS documentname FROM message_exchange\r\n WHERE recipient_id=\'_RECIPIENT_ID_\' AND `message_id` LIKE \'9\' AND `send_format` LIKE \'system\' ORDER BY date_added DESC;\r\n'),
(208, 'get_tiet_certificates', 'SELECT `certificate` FROM `teacher_certificates` WHERE `person_id` =\'_PERSON_ID_\' ORDER BY date_added DESC LIMIT 1'),
(209, 'get_reject_list', 'SELECT \r\n\"registration\" AS Item, (SELECT CONCAT(P.last_name, \', \', P.first_name) FROM user U LEFT JOIN person P \r\nON (U.person_id=P.id) WHERE U.id=A.subject_id LIMIT 1)AS Applicant,(SELECT U2.login_name FROM user U2 WHERE U2.id=A.subject_id LIMIT 1)AS ApplicantEmail,\r\nstep_number AS Step,(SELECT CONCAT(P.last_name, \', \', P.first_name) FROM user U LEFT JOIN person P \r\nON (U.person_id=P.id) WHERE U.id=A.actual_approver LIMIT 1) AS Approver, (SELECT U3.login_name FROM user U3 WHERE U3.id=A.actual_approver LIMIT 1)AS ApproverEmail, \r\ncomment AS Reason, \r\ndate_created AS Date FROM approval_chain A \r\nLEFT JOIN user U ON (U.id=A.subject_id)\r\nLEFT JOIN person P ON (U.person_id=P.id)\r\nWHERE _SEARCH_QUERY_ AND `step_number` NOT LIKE \'1\' AND `chain_type` LIKE \'registration\' ORDER BY date_created DESC LIMIT _LIMIT_TEXT_'),
(210, 'get_schoollist_data', 'SELECT S.status,S.id, S.name, S.last_updated, S.school_type, \n\r\nS.start_date AS date_registered, \r\nA.details AS addressline, \r\nA.county AS county,\r\n\r\nIF((SELECT name FROM district WHERE id=A.district_id LIMIT 1) \nIS NOT NULL, \r\n(SELECT name FROM district WHERE id=A.district_id LIMIT 1), A.district_id) AS district,\r\n\r\nIF((SELECT name FROM country WHERE id=A.country_id \nLIMIT 1) IS NOT NULL, \r\n(SELECT name FROM country WHERE id=A.country_id LIMIT 1), A.country_id) AS country\r\nFROM institution S \r\nJOIN address A ON \n(A.parent_id=S.id AND A.parent_type=\'school\' AND A.is_primary=\'Y\')\r\nWHERE _SEARCH_QUERY_ ORDER BY _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(211, 'get_userlist_data', 'SELECT U.id, U.last_updated, U.teacher_status AS status,U.status AS UserStatus, P.first_name, \nP.last_name,\r\n(SELECT notes FROM permission_group WHERE id=U.permission_group_id LIMIT 1) AS user_role\r\nFROM user U  \r\nJOIN person P ON (P.id=U.person_id)  \n\r\nLEFT JOIN posting PS ON (PS.postee_id=U.id AND PS.posting_end_date=\'0000-00-00\' AND PS.status=\'verified\') \n\r\nWHERE _SEARCH_QUERY_ _ORDER_BY_ LIMIT _LIMIT_TEXT_'),
(212, 'monitor_staff_report', 'SELECT \r\n(SELECT CONCAT(P.last_name, \', \', P.first_name) FROM user U \nLEFT JOIN person P ON (U.person_id=P.id) WHERE U.id=`actual_approver` LIMIT 1) AS Approver,\r\n SUM(`status` =\'rejected\') AS Rejected, \nSUM(`status` =\'approved\') AS Approved, COUNT(`status`) AS tally \r\nFROM `approval_chain` \nWHERE `chain_type`=\'registration\' AND `step_number` !=\'1\' AND (`date_created` BETWEEN DATE(\'_START_DATE_\') AND \nDATE(\'_END_DATE_\'))\r\nGROUP BY `actual_approver` ORDER BY tally DESC'),
(213, 'monitor_applications_report', 'SELECT \"Applications Recieved:\" AS Designation,\n COUNT(*) AS Number FROM  `approval_chain` WHERE `chain_type`=\'registration\' AND `step_number` = \'1\' AND \r\n (`date_created` BETWEEN DATE(\'_START_DATE_\')\n AND DATE(\'_END_DATE_\'));'),
(214, 'monitor_department_report', 'SELECT\r\n(SELECT p.notes FROM permission_group p WHERE p.id=u.permission_group_id LIMIT 1)As Department,\r\n COUNT(*) AS Number \r\n FROM approval_chain a \r\nLEFT JOIN user u ON(u.id=a.actual_approver)\r\nLEFT JOIN permission_group p ON (p.id=u.permission_group_id)\r\nWHERE `chain_type`=\'registration\' AND `step_number` != \'1\'\r\n AND (`date_created` BETWEEN DATE(\'_START_DATE_\') AND DATE(\'_END_DATE_\')) GROUP BY `step_number` ORDER BY COUNT(*) DESC'),
(215, 'report_stat_teacherstatus_rejected', 'SELECT \'Teachers Whose Applications are rejected:\' AS Label, (SELECT COUNT(DISTINCT id) FROM `user` \r\nWHERE `teacher_status` =\'rejected\')AS \n`Number`'),
(216, 'get_teacher_certificate1', 'SELECT id AS document_id, attachment AS documenturl, subject AS documentname FROM message_exchange\r\n WHERE recipient_id=\'_RECIPIENT_ID_\' AND `message_id` LIKE \'9\' AND `send_format` LIKE \'system\' ORDER BY date_added DESC;');

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

--
-- Table structure for table `recommendation`
--

CREATE TABLE `recommendation` (
  `id` bigint(20) NOT NULL,
  `change_application_id` varchar(100) NOT NULL,
  `application_type` varchar(100) NOT NULL,
  `recommended_by` varchar(100) NOT NULL,
  `notes` text NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=8192 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `responsibility`
--

CREATE TABLE `responsibility` (
  `id` bigint(20) NOT NULL,
  `code` varchar(100) NOT NULL,
  `notes` varchar(500) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=8192 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `retirement`
--

CREATE TABLE `retirement` (
  `id` bigint(20) NOT NULL,
  `retiree_id` varchar(100) NOT NULL,
  `retiree_reason` text NOT NULL,
  `proposed_date` date NOT NULL,
  `confirmed_date` date NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime NOT NULL,
  `last_updated_by` varchar(100) NOT NULL,
  `status` enum('pending','confirmed') NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB AVG_ROW_LENGTH=2340 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `retirement`
--

INSERT INTO `retirement` (`id`, `retiree_id`, `retiree_reason`, `proposed_date`, `confirmed_date`, `date_added`, `added_by`, `last_updated`, `last_updated_by`, `status`) VALUES
(1, '32', 'Sinze naleta enaku', '2024-09-18', '0000-00-00', '2021-07-01 22:36:27', '32', '2021-07-01 22:36:27', '32', 'pending'),
(2, '32', 'Saleta naku', '2025-10-31', '0000-00-00', '2021-07-01 22:44:45', '32', '2021-07-01 22:44:45', '32', 'pending');

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

--
-- Table structure for table `saved_vacancies`
--

CREATE TABLE `saved_vacancies` (
  `id` bigint(20) NOT NULL,
  `user_id` varchar(100) NOT NULL,
  `vacancy_id` varchar(100) NOT NULL,
  `date_added` datetime NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=2730 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `shortlist`
--

CREATE TABLE `shortlist` (
  `id` bigint(20) NOT NULL,
  `shortlist_name` varchar(300) NOT NULL,
  `vacancy_id` varchar(100) NOT NULL,
  `applicant_id` varchar(100) NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=5461 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `status_change_application`
--

CREATE TABLE `status_change_application` (
  `id` bigint(20) NOT NULL,
  `change_type` varchar(200) NOT NULL,
  `change_id` varchar(100) NOT NULL,
  `old_school_id` varchar(100) NOT NULL,
  `new_school_id` varchar(100) NOT NULL,
  `applicant_id` varchar(100) NOT NULL,
  `old_applicant_role_id` varchar(100) NOT NULL,
  `new_applicant_role_id` varchar(100) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `notes` text NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime NOT NULL,
  `last_updated_by` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `subject`
--

CREATE TABLE `subject` (
  `id` bigint(20) NOT NULL,
  `details` varchar(500) NOT NULL,
  `study_category` varchar(100) NOT NULL,
  `parent_id` varchar(100) NOT NULL,
  `parent_type` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=119 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `subject`
--

INSERT INTO `subject` (`id`, `details`, `study_category`, `parent_id`, `parent_type`) VALUES
(10, 'Codeigniter', 'Major', '981', 'person'),
(11, 'PHP programming', 'Minor', '981', 'person'),
(12, 'Data and Information Management', 'Other', '981', 'person'),
(16, 'structural analysis', 'Major', '982', 'person'),
(17, 'hydraulics', 'Minor', '982', 'person'),
(18, 'geotechnics', 'Major', '982', 'person'),
(19, 'Hydraulics', 'Major', '983', 'person'),
(20, 'Electricity and Electronics', 'Minor', '983', 'person');

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

--
-- Table structure for table `teacher_certificates`
--

CREATE TABLE `teacher_certificates` (
  `id` bigint(20) NOT NULL,
  `person_id` bigint(20) NOT NULL,
  `certificate` text NOT NULL,
  `approved_by` bigint(20) NOT NULL,
  `commissioned_by` bigint(20) NOT NULL,
  `date_approved` date NOT NULL,
  `date_commissioned` date NOT NULL,
  `date_added` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `isactive` enum('Y','N') NOT NULL,
  `is_comissioned` enum('Y','N') NOT NULL DEFAULT 'N',
  `grade` varchar(255) DEFAULT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=7801 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `training`
--

CREATE TABLE `training` (
  `id` bigint(20) NOT NULL,
  `code` varchar(100) NOT NULL,
  `notes` varchar(500) NOT NULL,
  `type` enum('physical','educational') NOT NULL DEFAULT 'educational'
) ENGINE=InnoDB AVG_ROW_LENGTH=3276 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `training`
--

INSERT INTO `training` (`id`, `code`, `notes`, `type`) VALUES
(1, 'T001', 'Lab Technicals', 'educational'),
(2, 'T002', 'First Aid', 'physical'),
(3, 'T073', 'Soccer School', 'physical'),
(4, 'T092', 'Ferrous Materials in Nature', 'educational'),
(5, 'T007', 'Advanced Botany', 'educational');

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

--
-- Table structure for table `transfer`
--

CREATE TABLE `transfer` (
  `id` bigint(20) NOT NULL,
  `teacher_id` varchar(100) NOT NULL,
  `old_school_id` varchar(100) NOT NULL,
  `new_school_id` varchar(100) NOT NULL,
  `reason` text NOT NULL,
  `proposed_date` date NOT NULL,
  `actual_date` date NOT NULL,
  `status` enum('pending','institutionapproved','countyapproved','pcaissued','confirmed','archived') NOT NULL DEFAULT 'pending',
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime NOT NULL,
  `last_updated_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=1024 DEFAULT CHARSET=latin1;

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

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

CREATE TABLE `user` (
  `id` bigint(20) NOT NULL,
  `person_id` varchar(100) NOT NULL,
  `permission_group_id` varchar(100) NOT NULL,
  `login_name` varchar(100) NOT NULL,
  `login_password` varchar(300) NOT NULL,
  `previous_password` varchar(300) NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `status` enum('pending','completed','active','archived','blocked','confirmed') NOT NULL DEFAULT 'pending',
  `teacher_status` enum('unknown','pending','completed','approved','active','archived','confirmed','rejected','certified') NOT NULL DEFAULT 'unknown',
  `last_updated` datetime NOT NULL,
  `last_updated_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=193 DEFAULT CHARSET=latin1;

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

INSERT INTO `user` (`id`, `person_id`, `permission_group_id`, `login_name`, `login_password`, `previous_password`, `date_added`, `added_by`, `status`, `teacher_status`, `last_updated`, `last_updated_by`) VALUES
(13, '17', '4', 'admin@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '50ef8f15e5cb26f750a4a1d4ae983514b640d864', '2015-01-19 08:47:37', '', 'active', 'unknown', '2019-11-13 17:20:34', '13'),
(19, '22', '5', 'moes@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '6257db36214757ffa57aa6b65d064f7fe777cea5', '2015-01-31 08:35:59', '', 'active', 'unknown', '2015-02-20 18:57:31', '13'),
(20, '23', '10', 'cim@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '2015-01-31 11:23:55', '', 'active', 'unknown', '2015-02-20 18:56:58', '13'),
(25, '29', '11', 'tiet@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '678c8f97a959225e3cf5fef77751a857d5c79038', '2015-02-02 18:24:08', '', 'active', 'unknown', '0000-00-00 00:00:00', ''),
(28, '32', '9', 'mops@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '678c8f97a959225e3cf5fef77751a857d5c79038', '2015-02-03 22:54:33', '', 'active', 'unknown', '2015-02-03 22:54:33', ''),
(29, '33', '7', 'esc@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '678c8f97a959225e3cf5fef77751a857d5c79038', '2015-02-04 21:55:36', '', 'active', 'unknown', '2015-02-04 21:55:36', ''),
(32, '36', '3', 'manager@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '678c8f97a959225e3cf5fef77751a857d5c79038', '2015-02-05 12:06:55', '', 'active', 'active', '2015-02-05 12:06:55', ''),
(33, '37', '12', 'cao@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '678c8f97a959225e3cf5fef77751a857d5c79038', '2015-02-06 12:32:06', '', 'active', 'unknown', '2020-02-21 09:47:14', '438'),
(86, '90', '10', 'hr@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '69b14eb416487f735049e829576a9b85c204d0a3', '2015-05-19 06:58:59', '', 'active', 'unknown', '2015-05-19 07:39:41', ''),
(568, '572', '6', 'deo@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '0bb58557bd614d3664cb9e5e5404c1e9312838ba', '2018-08-24 13:27:18', '', 'active', 'pending', '2019-09-30 11:10:37', '438'),
(594, '598', '8', 'dsc@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', 'a152861de1412d49ef914ee3168f30741284c6d0', '2018-09-19 10:21:01', '', 'active', 'pending', '2020-11-16 13:09:53', '438'),
(971, '975', '18', 'commissionertiet@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '2bf00348d44b7e591a6726a5d257f00f0911cb70', '2018-10-12 15:16:22', '', 'archived', 'completed', '2021-04-13 16:04:14', '438'),
(974, '981', '2', 'deuson8@muto.com', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '', '2021-07-01 16:36:12', '', 'active', 'approved', '2021-07-03 02:55:00', '86'),
(975, '982', '1', 'dbowe@tmis.go.ug', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '', '2021-07-03 03:02:42', '', 'active', 'pending', '2021-07-03 03:13:41', ''),
(976, '983', '2', 'dbowe@maverick.com', 'c373c8c3b9598ff826f3a42c95b86cbb2aac0a8f', '', '2021-07-03 12:01:35', '', 'active', 'approved', '2021-07-03 12:10:08', '86'),
(977, '984', '19', 'slimdaddy@tmis.go.ug', '7109e40aaf620bb22d6295e4e7a9ea951c6b471e', '', '2021-07-03 15:14:53', '', 'completed', 'unknown', '2021-07-03 15:14:53', '');

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

--
-- Table structure for table `vacancy`
--

CREATE TABLE `vacancy` (
  `id` bigint(20) NOT NULL,
  `school_id` varchar(100) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `topic` varchar(200) NOT NULL,
  `summary` varchar(500) NOT NULL,
  `details` text NOT NULL,
  `status` enum('saved','verified','published','archived') NOT NULL DEFAULT 'saved',
  `role_id` varchar(100) NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` varchar(100) NOT NULL,
  `last_updated` datetime NOT NULL,
  `last_updated_by` varchar(100) NOT NULL
) ENGINE=InnoDB AVG_ROW_LENGTH=712 DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `academic_history`
--
ALTER TABLE `academic_history`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `person_id` (`person_id`,`institution`,`institution_type`,`certificate_number`);

--
-- Indexes for table `address`
--
ALTER TABLE `address`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `parent_id` (`parent_id`,`parent_type`,`importance`);

--
-- Indexes for table `application`
--
ALTER TABLE `application`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `vacancy_id` (`vacancy_id`,`user_id`);

--
-- Indexes for table `approval_chain`
--
ALTER TABLE `approval_chain`
  ADD PRIMARY KEY (`id`),
  ADD KEY `unique_approval` (`chain_type`,`step_number`,`subject_id`,`originator_id`,`actual_approver`);

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

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

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

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

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

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

--
-- Indexes for table `contact`
--
ALTER TABLE `contact`
  ADD PRIMARY KEY (`id`),
  ADD KEY `parent_index` (`parent_type`(5),`contact_type`(5),`details`(5));

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

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

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

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

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

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

--
-- Indexes for table `institution`
--
ALTER TABLE `institution`
  ADD PRIMARY KEY (`id`);
ALTER TABLE `institution` ADD FULLTEXT KEY `name` (`name`);

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

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

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

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

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

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

--
-- Indexes for table `message_exchange`
--
ALTER TABLE `message_exchange`
  ADD PRIMARY KEY (`id`),
  ADD KEY `message_index` (`recipient_id`,`date_added`,`send_format`);

--
-- Indexes for table `message_status`
--
ALTER TABLE `message_status`
  ADD PRIMARY KEY (`id`),
  ADD KEY `msg_index` (`user_id`(8),`message_exchange_id`(8));

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

--
-- Indexes for table `other_user_id`
--
ALTER TABLE `other_user_id`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `parent_id` (`parent_id`,`parent_type`,`id_type`);

--
-- Indexes for table `permission`
--
ALTER TABLE `permission`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `code` (`code`);

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

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

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

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

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

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

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

--
-- Indexes for table `recommendation`
--
ALTER TABLE `recommendation`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `change_application_id` (`change_application_id`,`application_type`,`recommended_by`),
  ADD UNIQUE KEY `change_application_id_2` (`change_application_id`,`application_type`,`recommended_by`);

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

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

--
-- Indexes for table `saved_vacancies`
--
ALTER TABLE `saved_vacancies`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `user_id` (`user_id`,`vacancy_id`);

--
-- Indexes for table `shortlist`
--
ALTER TABLE `shortlist`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `shortlist_name` (`shortlist_name`,`vacancy_id`,`applicant_id`);

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

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

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

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

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

--
-- Indexes for table `user`
--
ALTER TABLE `user`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `login_name` (`login_name`,`login_password`);

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `academic_history`
--
ALTER TABLE `academic_history`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `address`
--
ALTER TABLE `address`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=67;

--
-- AUTO_INCREMENT for table `application`
--
ALTER TABLE `application`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `approval_chain`
--
ALTER TABLE `approval_chain`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `approval_chain_scope`
--
ALTER TABLE `approval_chain_scope`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `approval_chain_setting`
--
ALTER TABLE `approval_chain_setting`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `carrier`
--
ALTER TABLE `carrier`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `census`
--
ALTER TABLE `census`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `census_responsibility`
--
ALTER TABLE `census_responsibility`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `census_training`
--
ALTER TABLE `census_training`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contact`
--
ALTER TABLE `contact`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1667;

--
-- AUTO_INCREMENT for table `country`
--
ALTER TABLE `country`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=234;

--
-- AUTO_INCREMENT for table `county`
--
ALTER TABLE `county`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=239;

--
-- AUTO_INCREMENT for table `district`
--
ALTER TABLE `district`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=113;

--
-- AUTO_INCREMENT for table `document`
--
ALTER TABLE `document`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `duty`
--
ALTER TABLE `duty`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `grade`
--
ALTER TABLE `grade`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;

--
-- AUTO_INCREMENT for table `institution`
--
ALTER TABLE `institution`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `interview`
--
ALTER TABLE `interview`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `interview_board`
--
ALTER TABLE `interview_board`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `interview_board_member`
--
ALTER TABLE `interview_board_member`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `leave`
--
ALTER TABLE `leave`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `log`
--
ALTER TABLE `log`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=154;

--
-- AUTO_INCREMENT for table `message`
--
ALTER TABLE `message`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;

--
-- AUTO_INCREMENT for table `message_exchange`
--
ALTER TABLE `message_exchange`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `message_status`
--
ALTER TABLE `message_status`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `note`
--
ALTER TABLE `note`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;

--
-- AUTO_INCREMENT for table `other_user_id`
--
ALTER TABLE `other_user_id`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `permission`
--
ALTER TABLE `permission`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=96;

--
-- AUTO_INCREMENT for table `permission_group`
--
ALTER TABLE `permission_group`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `permission_group_mapping`
--
ALTER TABLE `permission_group_mapping`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3119;

--
-- AUTO_INCREMENT for table `person`
--
ALTER TABLE `person`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=985;

--
-- AUTO_INCREMENT for table `posting`
--
ALTER TABLE `posting`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `promotion`
--
ALTER TABLE `promotion`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `qualification`
--
ALTER TABLE `qualification`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `query`
--
ALTER TABLE `query`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=217;

--
-- AUTO_INCREMENT for table `recommendation`
--
ALTER TABLE `recommendation`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `responsibility`
--
ALTER TABLE `responsibility`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `retirement`
--
ALTER TABLE `retirement`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `saved_vacancies`
--
ALTER TABLE `saved_vacancies`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `shortlist`
--
ALTER TABLE `shortlist`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `status_change_application`
--
ALTER TABLE `status_change_application`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `subject`
--
ALTER TABLE `subject`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `teacher_certificates`
--
ALTER TABLE `teacher_certificates`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `training`
--
ALTER TABLE `training`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `transfer`
--
ALTER TABLE `transfer`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=978;

--
-- AUTO_INCREMENT for table `vacancy`
--
ALTER TABLE `vacancy`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
