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


-- 
-- Database: `ckraal`
-- 

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

-- 
-- Table structure for table `amaster`
-- 

CREATE TABLE `amaster` (
  `ano` int(11) NOT NULL,
  `atype` varchar(50) NOT NULL,
  `Descr` varchar(50) default NULL,
  PRIMARY KEY  (`atype`),
  UNIQUE KEY `ano` (`ano`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `amaster`
-- 

INSERT INTO `amaster` (`ano`, `atype`, `Descr`) VALUES 
(1, 'Cattle', 'Kgomo'),
(7, 'Dog', 'Ntcha'),
(2, 'Donkeys', 'Tonki'),
(3, 'Goat', 'Pudi'),
(5, 'Horse', 'Pitse'),
(8, 'Mule', 'Mmoulo'),
(6, 'Pig', 'Kolobe'),
(4, 'Sheep', 'Nku');

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

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

CREATE TABLE `district` (
  `dcode` varchar(10) NOT NULL,
  `dname` varchar(100) NOT NULL,
  `contact` int(7) default NULL,
  PRIMARY KEY  (`dname`),
  UNIQUE KEY `dcode` (`dcode`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `district` (`dcode`, `dname`, `contact`) VALUES 
('BSDC', 'Bobonong Sub District Council', 4601230),
('KDC', 'Kweneng District Council', 2147483),
('LSDC', 'Lethakane Subdistrict Council', 4632152),
('MSDC', 'Mahalapye Subdistrict Council', 4263210),
('PLA', 'Palapye Local Authority', 4253210),
('TSDC', 'Tlokweng Subdistrcit Council', 3654123);

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

-- 
-- Table structure for table `kraal`
-- 

CREATE TABLE `kraal` (
  `kno` varchar(15) NOT NULL,
  `kname` varchar(30) NOT NULL,
  `loc` varchar(30) NOT NULL,
  `dcode` varchar(10) default NULL,
  PRIMARY KEY  (`kno`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `kraal`
-- 

INSERT INTO `kraal` (`kno`, `kname`, `loc`, `dcode`) VALUES 
('1', 'Serilatlholo', 'Letlhakane', 'KDC'),
('2', 'Kwenabodiba', 'Molepolole', 'KDC'),
('3', 'Metsimotlhaba', 'Mogoditsane', 'KDC');

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

-- 
-- Table structure for table `matimela`
-- 

CREATE TABLE `matimela` (
  `sno` int(11) NOT NULL,
  `acolour` varchar(30) NOT NULL,
  `bstyle` varchar(15) default NULL,
  `b1c1` varchar(1) default NULL,
  `b1c2` varchar(1) default NULL,
  `b1c3` varchar(1) default NULL,
  `b1c4` varchar(1) default NULL,
  `bstyle2` varchar(15) default NULL,
  `b2c1` varchar(1) default NULL,
  `b2c2` varchar(1) default NULL,
  `b2c3` varchar(1) default NULL,
  `b2c4` varchar(1) default NULL,
  `dbrand` varchar(4) default NULL,
  `emark` varchar(30) default NULL,
  `atype` varchar(20) NOT NULL,
  `adesc` varchar(50) default NULL,
  `sex` varchar(1) default NULL,
  `kno` varchar(100) default NULL,
  `idate` date NOT NULL,
  `dcode` varchar(20) NOT NULL,
  PRIMARY KEY  (`sno`,`dcode`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `matimela`
-- 

INSERT INTO `matimela` (`sno`, `acolour`, `bstyle`, `b1c1`, `b1c2`, `b1c3`, `b1c4`, `bstyle2`, `b2c1`, `b2c2`, `b2c3`, `b2c4`, `dbrand`, `emark`, `atype`, `adesc`, `sex`, `kno`, `idate`, `dcode`) VALUES 
(1, 'Phatshwana', 'Square', 'B', 'N', '4', 'S', 'NULL', 'N', 'N', 'N', 'N', '', 'Lephaga', '1', 'Namane e namagadi ', 'F', 'Tsetsejwe', '2020-05-31', 'BSDC'),
(1, 'Phatshwana', 'Square', 'B', 'N', '4', 'S', NULL, NULL, NULL, NULL, NULL, '', 'Lephaga', '1', 'Namane e namagadi              \r\n              ', 'F', 'Kwenabodiba', '2020-04-19', 'KDC'),
(2, 'Tshetlha', 'Flat', 'T', 'N', '5', NULL, NULL, NULL, NULL, NULL, NULL, '', 'Lesifi le sekei', '2', ' Tonkana e tshetha             \r\n              ', 'M', 'Serilatlholo', '2020-04-14', 'KDC'),
(3, 'Kgwebana', 'Square', 'T', '9', 'R', 'W', NULL, NULL, NULL, NULL, NULL, '', 'Lesusu', '1', 'Kgwebana e bo ngolo              \r\n              ', 'F', 'Metsimotlhaba', '2019-03-04', 'KDC'),
(4, 'Kgwebana', 'Flat', '7', 'D', '4', NULL, NULL, NULL, NULL, NULL, NULL, '', 'Lesusu', '1', 'Kgwebana e bo ngolo              \r\n              ', 'F', 'Metsimotlhaba', '2020-03-31', 'KDC'),
(5, 'Kwebu', 'Flat', 'R', '7', '5', 'N', 'Null', 'N', 'N', 'N', 'N', '', 'Lesusu', '1', 'Poo e dinaka', 'M', 'Molalatau', '2020-04-30', 'BSDC'),
(5, 'Kotswana', 'N/A', 'N', 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'Lephaga', '3', 'Kotswana e bo buswana              \r\n             ', 'M', 'Kwenabodiba', '2020-03-02', 'KDC'),
(6, 'Khunou', 'Square', 'F', 'J', 'R', 'J', 'Null', 'N', 'N', 'N', 'N', '', 'Sekei', '1', 'pholwana e bongolo', 'M', 'Molalatau', '2020-05-01', 'BSDC'),
(6, 'Tshuma', 'N/A', 'N', 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'N/A', '5', 'Pitsi e tshumu le bo thaba              \r\n        ', 'M', 'Metsimotlhaba', '2019-12-02', 'KDC'),
(7, 'Tshetha', 'Triangle-Down', '2', 'V', 'J', 'N', 'Null', 'N', 'N', 'N', 'N', '', 'Lephaga', '2', 'Tonki e tshetlha', 'M', 'Tsetsejwe', '2020-05-02', 'BSDC'),
(7, 'Ngolo', 'N/A', 'N', 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'Mothalakgama', '3', 'Pudi e ngolo le bosetlha              \r\n          ', 'M', 'Serilatlholo', '2020-01-14', 'KDC'),
(8, 'Puswa', 'Triangle-Up', 'T', 'S', '9', 'N', 'Null', 'N', 'N', 'N', 'N', '', 'n/a', '8', 'Mmoulo o mo puswa', 'M', 'Mathathane', '2020-05-03', 'BSDC'),
(8, 'Thaba', 'Flat', 'T', 'L', '6', NULL, NULL, NULL, NULL, NULL, NULL, '', 'N/A', '5', 'Thaba e bontsho', 'M', 'Metsimotlhaba', '2020-04-13', 'KDC'),
(9, 'Naana', 'N/A', 'n', 'n', 'n', 'N', 'Null', 'N', 'N', 'N', 'N', '', 'Lekekete', '3', 'Pudi e naana le bosweu', 'F', 'Tsetsejwe', '2020-03-04', 'BSDC'),
(9, 'Tshweu', 'N/A', 'N', 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'Lesifi', '1', 'Tshweu, e dinaka', 'M', 'Kwenabodiba', '2020-04-16', 'KDC'),
(10, 'Ngolo', 'Flat', 'T', 'J', '5', 'N', 'Null', 'N', 'N', 'N', 'N', '', 'Thako ya phala', '1', 'Pholo e ngolo', 'M', 'Bobonong', '2020-01-05', 'BSDC'),
(10, 'Thokwana', 'N/A', 'N', 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'Motoka', '4', 'Thokwana e lebante mo kotlase', 'F', 'Metsimotlhaba', '2019-08-17', 'KDC'),
(11, 'Phatshwana', 'N/A', 'N', 'N', 'n', 'N', 'Null', 'N', 'N', 'N', 'N', '', 'Sekei', '4', 'Nku e phatshwana', 'F', 'Molalatau', '2020-05-06', 'BSDC'),
(11, 'Ntso', 'Triangle-Down', '9', 'L', 'P', NULL, NULL, NULL, NULL, NULL, NULL, '', 'Motoka', '2', 'Pheke e ntsho, e sebola kaha mojeng', 'M', 'Metsimotlhaba', '2019-12-09', 'KDC'),
(12, 'Kotswana', 'Square', 'K', 'L', '7', '2', 'Null', 'N', 'N', 'N', 'N', '', 'Lesusu', '1', 'Kgomo e Kotswana', 'F', 'Kobojango', '2020-06-07', 'BSDC'),
(12, 'Tshweu', 'N/A', 'N', 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'N/A', '7', 'Ntsa e tshweu e dibata di rokwa', 'M', 'Serilatlholo', '2020-04-23', 'KDC'),
(13, 'Kotswana', 'N/A', 'N', 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'N/A', '6', 'Kotswana e dibatabata', 'F', 'Metsimotlhaba', '2020-04-22', 'KDC'),
(14, 'Naana', 'Triangle-Up', 'T', 'L', '9', '', 'N/A', '', '', '', '', '', 'Lephaga', '1', 'Naana e boswaana. E dinaka', 'F', 'Metsimotlhaba', '2020-04-18', 'KDC'),
(15, 'Puswe', 'Square', 'W', 'F', 'G', 'D', 'N/A', '', '', '', '', '', 'Lesusu', '2', 'Tonki e puswa, e tshipe di pedi mme ya bobedi Ga e', 'M', 'Kwenabodiba', '2020-04-10', 'KDC');

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

-- 
-- Table structure for table `pkraal`
-- 

CREATE TABLE `pkraal` (
  `sno` int(11) NOT NULL,
  `acolour` varchar(30) NOT NULL,
  `bstyle` varchar(15) default NULL,
  `b1c1` varchar(1) default NULL,
  `b1c2` varchar(1) default NULL,
  `b1c3` varchar(1) default NULL,
  `b1c4` varchar(1) default NULL,
  `emark` varchar(30) default NULL,
  `atype` varchar(20) NOT NULL,
  `loc` varchar(50) default NULL,
  `reporter` varchar(100) default NULL,
  `contact` int(11) NOT NULL,
  `rdate` date NOT NULL,
  `dcode` varchar(20) NOT NULL,
  PRIMARY KEY  (`sno`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `pkraal`
-- 

INSERT INTO `pkraal` (`sno`, `acolour`, `bstyle`, `b1c1`, `b1c2`, `b1c3`, `b1c4`, `emark`, `atype`, `loc`, `reporter`, `contact`, `rdate`, `dcode`) VALUES 
(1, 'Tshetlha', 'Triangle-Down', '7', 'D', '3', '', 'Motoka mo mojeng', '2', 'Serilathole', 'Dipula Tefho', 73734600, '0000-00-00', 'KDC'),
(2, 'Tshunyana', 'Flat', 'T', 'L', '6', '', 'Lesifi', '1', 'Shoshong/Segompo', 'Gaketshabe Mosweunyane', 71234567, '2020-05-21', 'MSDC'),
(3, 'Nkgwe', 'Triangle-Up', '2', 'v', 'j', '', 'sekei', '1', 'Molepolole/serinane', 'Modisa', 72456789, '2020-05-30', 'KDC'),
(4, 'Puswa', 'Flat', 'R', 'D', '6', '', 'Motoka', '2', 'Kobajango', 'Keaja Nawa', 76456134, '2020-05-30', 'BSDC');

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

-- 
-- Table structure for table `tbl_mstl`
-- 

CREATE TABLE `tbl_mstl` (
  `lic` varchar(10) NOT NULL,
  `lno` smallint(11) NOT NULL default '0',
  `stdate` date NOT NULL,
  `endate` date NOT NULL,
  PRIMARY KEY  (`lno`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `tbl_mstl`
-- 

INSERT INTO `tbl_mstl` (`lic`, `lno`, `stdate`, `endate`) VALUES 
('SEDC', 3, '2014-04-24', '2021-12-15');

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

-- 
-- Table structure for table `users`
-- 

CREATE TABLE `users` (
  `SID` int(11) NOT NULL auto_increment,
  `uname` char(20) character set utf8 NOT NULL,
  `pwd` varchar(15) character set utf8 NOT NULL,
  `dcode` varchar(25) character set utf8 NOT NULL,
  `role` varchar(20) default NULL,
  `fname` char(20) character set utf8 default NULL,
  `lname` char(20) character set utf8 default NULL,
  `user_status` varchar(20) NOT NULL default 'active',
  PRIMARY KEY  (`SID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=40124 ;

-- 
-- Dumping data for table `users`
-- 

INSERT INTO `users` (`SID`, `uname`, `pwd`, `dcode`, `role`, `fname`, `lname`, `user_status`) VALUES 
(1020, 'mgaboalapswe', 'password', ' KDC', 'sa', 'Motlhatlhedi', 'Gaboalapswe', 'Active'),
(1120, 'mmetsemebedi', 'password', 'KDC', 'LA_registrar', 'Mothusi', 'Metsemebedi', 'Active'),
(2345, 'msekobolo', 'password', 'BSDC', 'LA_registrar', 'Monate', 'Sekobolo', 'Active'),
(40123, 'pseshoka', 'password', ' MLG_HQ', 'HQ_Registrar', 'Phillip', 'Seshoka', 'Active');
