-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 11, 2019 at 09:02 PM
-- Server version: 5.7.14
-- PHP Version: 5.6.25

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


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

--
-- Database: `foresight`
--

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

--
-- Table structure for table `udut_appointments`
--

CREATE TABLE `udut_appointments` (
  `appointmentId` int(11) NOT NULL,
  `patientId` int(11) NOT NULL,
  `doctorId` int(11) NOT NULL,
  `departmentId` int(11) NOT NULL,
  `appointmentNo` int(11) NOT NULL,
  `appointmentDescription` varchar(250) NOT NULL,
  `appointmentDate` date NOT NULL,
  `appointmentTime` time NOT NULL,
  `appointmentDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `appointmentDateModified` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `udut_configurations`
--

CREATE TABLE `udut_configurations` (
  `configId` int(11) NOT NULL,
  `configName` varchar(100) NOT NULL,
  `configValue` varchar(100) NOT NULL,
  `configStatus` int(11) NOT NULL,
  `configDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `configDateModified` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `udut_configurations`
--

INSERT INTO `udut_configurations` (`configId`, `configName`, `configValue`, `configStatus`, `configDateAdded`, `configDateModified`) VALUES
(1, 'siteName', 'UDUT PPP Partners Project', 1, '2019-01-01 17:59:25', '2019-01-01 17:59:25'),
(2, 'siteLogo', 'logo.png', 1, '2019-01-01 17:59:25', '2019-01-01 17:59:25'),
(3, 'runningCost', '300000', 1, '2019-01-01 18:01:15', '2019-01-01 18:01:15'),
(4, 'HosAccPer', '30', 1, '2019-01-01 18:10:45', '2019-01-01 18:10:45'),
(5, 'ManAccPer', '5', 1, '2019-01-01 18:10:45', '2019-01-01 18:10:45'),
(6, 'HosHosAccPer', '15', 1, '2019-01-01 18:13:32', '2019-01-01 18:13:32'),
(7, 'HosAdmFee', '5', 1, '2019-01-01 18:13:32', '2019-01-01 18:13:32'),
(8, 'HosCMD', '5', 1, '2019-01-01 18:14:09', '2019-01-01 18:14:09'),
(9, 'HosDrAdm', '2.5', 1, '2019-01-01 18:14:09', '2019-01-01 18:14:09'),
(10, 'HosRadDep', '2.5', 1, '2019-01-01 18:14:36', '2019-01-01 18:14:36'),
(11, 'foresightPer', '70', 1, '2019-01-01 18:16:55', '2019-01-01 18:16:55'),
(12, 'khalifaPer', '30', 1, '2019-01-01 18:16:55', '2019-01-01 18:16:55');

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

--
-- Table structure for table `udut_departments`
--

CREATE TABLE `udut_departments` (
  `departmentId` int(11) NOT NULL,
  `departmentName` varchar(100) NOT NULL,
  `departmentDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `departmentDateModified` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `udut_doctors`
--

CREATE TABLE `udut_doctors` (
  `doctorId` int(11) NOT NULL,
  `doctorUId` varchar(100) NOT NULL,
  `doctorName` varchar(100) NOT NULL,
  `doctorDateOfBirth` date DEFAULT NULL,
  `doctorGender` varchar(100) NOT NULL,
  `doctorEmail` varchar(100) NOT NULL,
  `doctorPhone` varchar(100) NOT NULL,
  `doctorAddress` varchar(250) DEFAULT NULL,
  `doctorExperience` varchar(100) DEFAULT NULL,
  `doctorSpecialization` varchar(100) DEFAULT NULL,
  `doctorDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `doctorDateModified` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `udut_doctors_activities`
--

CREATE TABLE `udut_doctors_activities` (
  `activityId` int(11) NOT NULL,
  `doctorId` int(11) NOT NULL,
  `patientId` int(11) NOT NULL,
  `injuryId` int(11) NOT NULL,
  `visitId` int(11) NOT NULL,
  `visitStatusId` int(11) NOT NULL,
  `activityDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `activityDateModified` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `udut_injuries`
--

CREATE TABLE `udut_injuries` (
  `injuryId` int(11) NOT NULL,
  `injuryName` varchar(100) NOT NULL,
  `injuryDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `injuryDateModified` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `udut_injuries`
--

INSERT INTO `udut_injuries` (`injuryId`, `injuryName`, `injuryDateAdded`, `injuryDateModified`) VALUES
(1, 'Viral fever', '2018-12-30 14:34:00', '0000-00-00 00:00:00'),
(2, 'Hand Fracture', '2018-12-30 14:34:00', '0000-00-00 00:00:00'),
(3, 'Dengue', '2018-12-30 15:04:43', '0000-00-00 00:00:00'),
(4, 'Malayria', '2018-12-30 15:04:43', '0000-00-00 00:00:00');

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

--
-- Table structure for table `udut_patients`
--

CREATE TABLE `udut_patients` (
  `patientId` int(11) NOT NULL,
  `patientUId` varchar(100) NOT NULL,
  `patientName` varchar(100) DEFAULT NULL,
  `patientDob` date DEFAULT NULL,
  `patientGender` varchar(100) DEFAULT NULL,
  `patientAddress` varchar(100) DEFAULT NULL,
  `patientPhone` varchar(100) DEFAULT NULL,
  `patientEmail` varchar(100) DEFAULT NULL,
  `patientCompanion` varchar(100) DEFAULT NULL,
  `patientuduthReferredName` varchar(100) DEFAULT NULL,
  `patientReferredPaper` varchar(250) DEFAULT NULL,
  `patientUserAdded` int(11) NOT NULL,
  `patientDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `patientDateModified` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `udut_payments`
--

CREATE TABLE `udut_payments` (
  `paymentId` int(11) NOT NULL,
  `patientId` int(11) NOT NULL,
  `paymentTypeId` int(11) NOT NULL,
  `paymentAmount` int(11) NOT NULL,
  `paymentDiscount` int(11) NOT NULL,
  `paymentStatusId` int(11) NOT NULL,
  `serviceId` int(11) NOT NULL,
  `paymentDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `udut_payments_status`
--

CREATE TABLE `udut_payments_status` (
  `paymentStatusId` int(11) NOT NULL,
  `paymentStatusName` varchar(100) NOT NULL,
  `paymentStatusDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `udut_payments_types`
--

CREATE TABLE `udut_payments_types` (
  `paymentTypeId` int(11) NOT NULL,
  `paymentTypeName` varchar(100) NOT NULL,
  `PaymentDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `udut_payments_types`
--

INSERT INTO `udut_payments_types` (`paymentTypeId`, `paymentTypeName`, `PaymentDateAdded`) VALUES
(1, 'Check', '2018-12-30 11:32:40'),
(2, 'Credit Card', '2018-12-30 11:32:40'),
(3, 'Cash', '2018-12-30 11:32:59'),
(4, 'Insurance', '2018-12-30 11:32:59');

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

--
-- Table structure for table `udut_scan_types`
--

CREATE TABLE `udut_scan_types` (
  `typeId` int(11) NOT NULL,
  `typeName` varchar(100) DEFAULT NULL,
  `typeAmount` varchar(100) DEFAULT NULL,
  `typeUserAdded` varchar(100) DEFAULT NULL,
  `typeDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `udut_scan_types`
--

INSERT INTO `udut_scan_types` (`typeId`, `typeName`, `typeAmount`, `typeUserAdded`, `typeDateAdded`) VALUES
(1, 'Adult', '30000', '1', '2018-12-29 13:16:52'),
(2, 'Minor', '15000', '1', '2018-12-29 13:16:52');

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

--
-- Table structure for table `udut_services`
--

CREATE TABLE `udut_services` (
  `serviceId` int(11) NOT NULL,
  `serviceName` varchar(100) NOT NULL,
  `serviceDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `serviceDateModified` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `udut_services`
--

INSERT INTO `udut_services` (`serviceId`, `serviceName`, `serviceDateAdded`, `serviceDateModified`) VALUES
(1, 'X-ray', '2019-01-01 13:59:18', '2019-01-01 13:59:18'),
(2, 'ECG', '2019-01-01 13:59:18', '2019-01-01 13:59:18'),
(3, 'Dental', '2019-01-01 13:59:38', '2019-01-01 13:59:38');

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

--
-- Table structure for table `udut_users`
--

CREATE TABLE `udut_users` (
  `userId` int(11) NOT NULL,
  `userUsername` varchar(100) NOT NULL,
  `userPassword` varchar(100) NOT NULL DEFAULT '123456',
  `userFullname` varchar(100) NOT NULL,
  `userDateOfBirth` date DEFAULT NULL,
  `userGender` varchar(100) DEFAULT NULL,
  `userEmail` varchar(100) DEFAULT NULL,
  `userPhone` varchar(100) DEFAULT NULL,
  `userAccountName` varchar(100) DEFAULT NULL,
  `userAccountNumber` varchar(100) DEFAULT NULL,
  `userAccountType` varchar(100) DEFAULT NULL,
  `userDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `userDateModified` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `udut_users`
--

INSERT INTO `udut_users` (`userId`, `userUsername`, `userPassword`, `userFullname`, `userDateOfBirth`, `userGender`, `userEmail`, `userPhone`, `userAccountName`, `userAccountNumber`, `userAccountType`, `userDateAdded`, `userDateModified`) VALUES
(1, 'sminuwa', '123456', 'Sunusi Mohd Inuwa', '1991-01-01', 'Male', 'sminuwa@yahoo.com', '08135067070', 'AccessBankPlc', '0052929034', 'Savings', '2019-01-01 14:12:31', '2019-01-01 14:12:31');

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

--
-- Table structure for table `udut_users_privileges`
--

CREATE TABLE `udut_users_privileges` (
  `privilegeId` int(11) NOT NULL,
  `roleId` int(11) NOT NULL,
  `createUser` int(11) NOT NULL,
  `updateUser` int(11) NOT NULL,
  `deleteUser` int(11) NOT NULL,
  `uduthAccountPercentage` int(11) NOT NULL,
  `managementAccountPercentage` int(11) NOT NULL,
  `foresightAccountPercentage` int(11) NOT NULL,
  `khalifaAccountPercentage` int(11) NOT NULL,
  `privilegeDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `privilegeDateModified` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `udut_users_roles`
--

CREATE TABLE `udut_users_roles` (
  `roleId` int(11) NOT NULL,
  `userId` int(11) NOT NULL,
  `location` varchar(100) NOT NULL,
  `roleDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `roleDateModified` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `udut_users_roles`
--

INSERT INTO `udut_users_roles` (`roleId`, `userId`, `location`, `roleDateAdded`, `roleDateModified`) VALUES
(1, 1, 'patients/', '2019-01-02 12:36:03', '2019-01-02 12:36:03'),
(2, 2, 'doctors/', '2019-01-02 12:36:03', '2019-01-02 13:09:51'),
(3, 2, 'reports/', '2019-01-02 12:36:03', '2019-01-02 13:11:33');

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

--
-- Table structure for table `udut_visits`
--

CREATE TABLE `udut_visits` (
  `visitId` int(11) NOT NULL,
  `patientId` int(11) NOT NULL,
  `doctorId` int(11) NOT NULL,
  `paymentId` int(11) NOT NULL,
  `visitDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `visitStatusId` int(11) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `udut_visits_status`
--

CREATE TABLE `udut_visits_status` (
  `visitStatusId` int(11) NOT NULL,
  `visitStatusName` varchar(100) CHARACTER SET latin1 NOT NULL,
  `visitStatusDateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `udut_visits_status`
--

INSERT INTO `udut_visits_status` (`visitStatusId`, `visitStatusName`, `visitStatusDateAdded`) VALUES
(1, 'Resheduled', '2018-12-30 10:45:29'),
(2, 'Operation', '2018-12-30 10:45:29'),
(3, 'Ortho', '2018-12-30 11:02:08'),
(4, 'General Check-up', '2018-12-30 11:02:08'),
(5, 'Injury', '2018-12-30 11:02:44');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `udut_appointments`
--
ALTER TABLE `udut_appointments`
  ADD PRIMARY KEY (`appointmentId`);

--
-- Indexes for table `udut_configurations`
--
ALTER TABLE `udut_configurations`
  ADD PRIMARY KEY (`configId`);

--
-- Indexes for table `udut_departments`
--
ALTER TABLE `udut_departments`
  ADD PRIMARY KEY (`departmentId`);

--
-- Indexes for table `udut_doctors`
--
ALTER TABLE `udut_doctors`
  ADD PRIMARY KEY (`doctorId`);

--
-- Indexes for table `udut_doctors_activities`
--
ALTER TABLE `udut_doctors_activities`
  ADD PRIMARY KEY (`activityId`);

--
-- Indexes for table `udut_injuries`
--
ALTER TABLE `udut_injuries`
  ADD PRIMARY KEY (`injuryId`);

--
-- Indexes for table `udut_patients`
--
ALTER TABLE `udut_patients`
  ADD PRIMARY KEY (`patientId`);

--
-- Indexes for table `udut_payments`
--
ALTER TABLE `udut_payments`
  ADD PRIMARY KEY (`paymentId`);

--
-- Indexes for table `udut_payments_status`
--
ALTER TABLE `udut_payments_status`
  ADD PRIMARY KEY (`paymentStatusId`);

--
-- Indexes for table `udut_payments_types`
--
ALTER TABLE `udut_payments_types`
  ADD PRIMARY KEY (`paymentTypeId`);

--
-- Indexes for table `udut_scan_types`
--
ALTER TABLE `udut_scan_types`
  ADD PRIMARY KEY (`typeId`);

--
-- Indexes for table `udut_services`
--
ALTER TABLE `udut_services`
  ADD PRIMARY KEY (`serviceId`);

--
-- Indexes for table `udut_users`
--
ALTER TABLE `udut_users`
  ADD PRIMARY KEY (`userId`);

--
-- Indexes for table `udut_users_privileges`
--
ALTER TABLE `udut_users_privileges`
  ADD PRIMARY KEY (`privilegeId`);

--
-- Indexes for table `udut_users_roles`
--
ALTER TABLE `udut_users_roles`
  ADD PRIMARY KEY (`roleId`);

--
-- Indexes for table `udut_visits`
--
ALTER TABLE `udut_visits`
  ADD PRIMARY KEY (`visitId`);

--
-- Indexes for table `udut_visits_status`
--
ALTER TABLE `udut_visits_status`
  ADD PRIMARY KEY (`visitStatusId`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `udut_appointments`
--
ALTER TABLE `udut_appointments`
  MODIFY `appointmentId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `udut_configurations`
--
ALTER TABLE `udut_configurations`
  MODIFY `configId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `udut_departments`
--
ALTER TABLE `udut_departments`
  MODIFY `departmentId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `udut_doctors`
--
ALTER TABLE `udut_doctors`
  MODIFY `doctorId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `udut_doctors_activities`
--
ALTER TABLE `udut_doctors_activities`
  MODIFY `activityId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `udut_injuries`
--
ALTER TABLE `udut_injuries`
  MODIFY `injuryId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `udut_patients`
--
ALTER TABLE `udut_patients`
  MODIFY `patientId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `udut_payments`
--
ALTER TABLE `udut_payments`
  MODIFY `paymentId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `udut_payments_status`
--
ALTER TABLE `udut_payments_status`
  MODIFY `paymentStatusId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `udut_payments_types`
--
ALTER TABLE `udut_payments_types`
  MODIFY `paymentTypeId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `udut_scan_types`
--
ALTER TABLE `udut_scan_types`
  MODIFY `typeId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `udut_services`
--
ALTER TABLE `udut_services`
  MODIFY `serviceId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `udut_users`
--
ALTER TABLE `udut_users`
  MODIFY `userId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `udut_users_privileges`
--
ALTER TABLE `udut_users_privileges`
  MODIFY `privilegeId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `udut_users_roles`
--
ALTER TABLE `udut_users_roles`
  MODIFY `roleId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `udut_visits`
--
ALTER TABLE `udut_visits`
  MODIFY `visitId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `udut_visits_status`
--
ALTER TABLE `udut_visits_status`
  MODIFY `visitStatusId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
/*!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 */;
