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

START TRANSACTION;



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

--
-- Table structure for table `aadminroles`
--

CREATE TABLE `aadminroles` (
  `ARId` int(11) NOT NULL,
  `ARAdmin` int(11) DEFAULT NULL,
  `ARRoles` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `aadminroles`
--

INSERT INTO `aadminroles` (`ARId`, `ARAdmin`, `ARRoles`) VALUES
(1, 1, '1,2,3,4,5,6,7,8'),
(4, 6, '1');

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

--
-- Table structure for table `asidemenu`
--

CREATE TABLE `asidemenu` (
  `ASId` int(11) NOT NULL,
  `ASMenu` varchar(50) DEFAULT NULL,
  `ASLink` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `asidemenu`
--

INSERT INTO `asidemenu` (`ASId`, `ASMenu`, `ASLink`) VALUES
(1, 'Dashboard', './'),
(2, 'Users', 'user'),
(3, 'Appointment', 'appointment'),
(4, 'Store', 'store'),
(5, 'Advert', 'advert'),
(6, 'System', 'system'),
(7, 'Feedback', 'feedback'),
(8, 'Admin', 'admin');

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

--
-- Table structure for table `bnotif`
--

CREATE TABLE `bnotif` (
  `ANId` int(11) NOT NULL,
  `ANUser` int(11) DEFAULT NULL,
  `ANMsg` text NOT NULL,
  `ANTitle` varchar(50) DEFAULT NULL,
  `ANStatus` enum('N','S') NOT NULL DEFAULT 'N' COMMENT 'NEW AND SEEN',
  `ANDate` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `bnotif`
--

INSERT INTO `bnotif` (`ANId`, `ANUser`, `ANMsg`, `ANTitle`, `ANStatus`, `ANDate`) VALUES
(1, 1, 'Transact now to enjoy the best rate with us', 'Welcome to BitWayne', 'S', '2025-06-28 17:56:19'),
(2, 1, 'You\'ve Successfully Created a transaction Pin for ', 'New Pin Created', 'S', '2025-06-29 10:29:40'),
(3, 1, 'You Successfully changed your transaction Pin ', 'Pin Updated', 'S', '2025-06-29 10:33:53'),
(4, 1, 'You\'ve added a new payout Bank Account', 'Bank Account Added', 'S', '2025-06-29 10:35:43'),
(5, 1, 'You successfully removed a payout Bank Account', 'Bank Account Removed', 'N', '2025-06-29 10:38:21');

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

--
-- Table structure for table `botp`
--

CREATE TABLE `botp` (
  `OId` int(11) NOT NULL,
  `OUser` int(11) NOT NULL DEFAULT 0,
  `OCode` varchar(10) DEFAULT NULL,
  `OExpiryDate` varchar(50) DEFAULT NULL,
  `OStatus` enum('U','N') NOT NULL DEFAULT 'N' COMMENT 'New, Used'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `botp`
--

INSERT INTO `botp` (`OId`, `OUser`, `OCode`, `OExpiryDate`, `OStatus`) VALUES
(1, 1, 'd3D0S', '1751211816', 'U');

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

--
-- Table structure for table `cagency`
--

CREATE TABLE `cagency` (
  `CAId` int(11) NOT NULL,
  `CAName` varchar(100) DEFAULT NULL,
  `CAStatus` enum('A','D') NOT NULL DEFAULT 'D'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cagency`
--

INSERT INTO `cagency` (`CAId`, `CAName`, `CAStatus`) VALUES
(1, 'Police', 'A');

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

--
-- Table structure for table `cemergencies`
--

CREATE TABLE `cemergencies` (
  `EId` int(11) NOT NULL,
  `EAgency` int(11) DEFAULT NULL,
  `EEmergency` varchar(100) DEFAULT NULL,
  `ERewardPoint` float DEFAULT NULL,
  `EStatus` enum('A','D') NOT NULL DEFAULT 'D'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cemergencies`
--

INSERT INTO `cemergencies` (`EId`, `EAgency`, `EEmergency`, `ERewardPoint`, `EStatus`) VALUES
(1, 1, 'Kidnapping', 100, 'A'),
(2, 1, 'Robbery', 100, 'A'),
(3, 1, 'One Chance Drivers', 100, 'A');

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

--
-- Table structure for table `crewardhistory`
--

CREATE TABLE `crewardhistory` (
  `RHId` int(11) NOT NULL,
  `RHEmergency` int(11) DEFAULT NULL,
  `RHTitle` varchar(50) DEFAULT NULL,
  `RHAmount` float NOT NULL DEFAULT 0,
  `RHTimestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `RHStatus` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `csos`
--

CREATE TABLE `csos` (
  `SId` int(11) NOT NULL,
  `SEmergency` int(11) DEFAULT NULL,
  `SDivision` int(11) DEFAULT NULL,
  `SUser` int(11) DEFAULT NULL,
  `SLocation` varchar(255) DEFAULT NULL,
  `ETA` varchar(50) DEFAULT NULL,
  `SRejectionReason` varchar(255) DEFAULT NULL,
  `STimestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `SStatus` enum('WAITING','ACCEPTED','TIMED','RESOLVED','FALSE') NOT NULL DEFAULT 'WAITING'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Indexes for table `aadminroles`
--
ALTER TABLE `aadminroles`
  ADD PRIMARY KEY (`ARId`),
  ADD KEY `FK_aadminroles_aadmin` (`ARAdmin`);

--
-- Indexes for table `asidemenu`
--
ALTER TABLE `asidemenu`
  ADD PRIMARY KEY (`ASId`);

--
-- Indexes for table `bnotif`
--
ALTER TABLE `bnotif`
  ADD PRIMARY KEY (`ANId`),
  ADD KEY `ANStatus` (`ANStatus`),
  ADD KEY `FK_anotif_ausers` (`ANUser`);

--
-- Indexes for table `botp`
--
ALTER TABLE `botp`
  ADD PRIMARY KEY (`OId`),
  ADD KEY `FK_kotp_kusers` (`OUser`),
  ADD KEY `OStatus` (`OStatus`),
  ADD KEY `OCode` (`OCode`),
  ADD KEY `OExpiryDate` (`OExpiryDate`);

--
-- Indexes for table `cagency`
--
ALTER TABLE `cagency`
  ADD PRIMARY KEY (`CAId`),
  ADD KEY `CAStatus` (`CAStatus`);

--
-- Indexes for table `cemergencies`
--
ALTER TABLE `cemergencies`
  ADD PRIMARY KEY (`EId`),
  ADD KEY `EAgency` (`EAgency`);

--
-- Indexes for table `crewardhistory`
--
ALTER TABLE `crewardhistory`
  ADD PRIMARY KEY (`RHId`),
  ADD KEY `RHEmergency` (`RHEmergency`);

--
-- Indexes for table `csos`
--
ALTER TABLE `csos`
  ADD PRIMARY KEY (`SId`),
  ADD KEY `SDivision` (`SDivision`),
  ADD KEY `SEmergency` (`SEmergency`),
  ADD KEY `SUser` (`SUser`);

--
-- AUTO_INCREMENT for table `aadminroles`
--
ALTER TABLE `aadminroles`
  MODIFY `ARId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `asidemenu`
--
ALTER TABLE `asidemenu`
  MODIFY `ASId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `bnotif`
--
ALTER TABLE `bnotif`
  MODIFY `ANId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `botp`
--
ALTER TABLE `botp`
  MODIFY `OId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `cagency`
--
ALTER TABLE `cagency`
  MODIFY `CAId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `cemergencies`
--
ALTER TABLE `cemergencies`
  MODIFY `EId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `crewardhistory`
--
ALTER TABLE `crewardhistory`
  MODIFY `RHId` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `csos`
--
ALTER TABLE `csos`
  MODIFY `SId` int(11) NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `aadminroles`
--
ALTER TABLE `aadminroles`
  ADD CONSTRAINT `FK_aadminroles_aadmin` FOREIGN KEY (`ARAdmin`) REFERENCES `aadmin` (`AAId`);

--
-- Constraints for table `bnotif`
--
ALTER TABLE `bnotif`
  ADD CONSTRAINT `FK_anotif_ausers` FOREIGN KEY (`ANUser`) REFERENCES `busers` (`UKId`);

--
-- Constraints for table `botp`
--
ALTER TABLE `botp`
  ADD CONSTRAINT `FK_kotp_kusers` FOREIGN KEY (`OUser`) REFERENCES `busers` (`UKId`);

--
-- Constraints for table `cemergencies`
--
ALTER TABLE `cemergencies`
  ADD CONSTRAINT `cemergencies_ibfk_1` FOREIGN KEY (`EAgency`) REFERENCES `cagency` (`CAId`);

--
-- Constraints for table `crewardhistory`
--
ALTER TABLE `crewardhistory`
  ADD CONSTRAINT `crewardhistory_ibfk_1` FOREIGN KEY (`RHEmergency`) REFERENCES `csos` (`SId`);

--
-- Constraints for table `csos`
--
ALTER TABLE `csos`
  ADD CONSTRAINT `csos_ibfk_1` FOREIGN KEY (`SDivision`) REFERENCES `cdivisions` (`CDId`),
  ADD CONSTRAINT `csos_ibfk_2` FOREIGN KEY (`SEmergency`) REFERENCES `cemergencies` (`EId`),
  ADD CONSTRAINT `csos_ibfk_3` FOREIGN KEY (`SUser`) REFERENCES `busers` (`UKId`);
COMMIT;

