-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 17, 2018 at 12:04 PM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 7.1.7

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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: `apl_portal`
--

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

--
-- Table structure for table `apl_it_stock_dispatch`
--

CREATE TABLE `apl_it_stock_dispatch` (
  `dispatch_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `qty_dispatched` double NOT NULL,
  `dispatched_to` varchar(225) NOT NULL,
  `dispatched_by` int(11) NOT NULL,
  `dispatch_reason` text NOT NULL,
  `date_dispatched` varchar(32) NOT NULL,
  `time_created` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `apl_it_stock_received`
--

CREATE TABLE `apl_it_stock_received` (
  `received_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `qty_received` double NOT NULL,
  `date_received` date NOT NULL,
  `received_from` varchar(32) NOT NULL,
  `received_by` int(11) NOT NULL,
  `remarks` text NOT NULL,
  `time_created` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `apl_it_stock_received`
--

INSERT INTO `apl_it_stock_received` (`received_id`, `item_id`, `qty_received`, `date_received`, `received_from`, `received_by`, `remarks`, `time_created`) VALUES
(1, 2, 540, '0000-00-00', 'Sky Born', 31, 'ref no; 000029387463', 1525266979),
(2, 8, 10, '2018-05-16', 'Eddy', 31, 'Requested Item', 1525268741),
(3, 6, 15, '0000-00-00', 'Eddy', 31, 'requested item', 1525269079),
(4, 6, -5, '0000-00-00', 'Eddy', 31, 'requested item', 1525269354),
(5, 6, 5, '0000-00-00', 'Eddy', 31, 'requested item', 1525269718),
(6, 6, 5, '0000-00-00', 'Eddy', 31, 'ssasdad', 1525269804),
(7, 1, 400, '0000-00-00', 'Sky Born', 31, 'ref;2308298383123123', 1525335973),
(8, 6, -20, '0000-00-00', 'Eddy', 31, 'Empty', 1525346040),
(9, 8, -10, '0000-00-00', 'Eddy', 31, 'empty', 1525346063),
(10, 11, 10, '0000-00-00', 'Procurement (Eddy)', 31, 'None', 1525876308),
(11, 11, -3, '0000-00-00', 'Procurement (Eddy)', 31, 'none', 1525876346);

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

--
-- Table structure for table `apl_it_store_item`
--

CREATE TABLE `apl_it_store_item` (
  `item_id` int(11) NOT NULL,
  `item_name` varchar(225) NOT NULL,
  `stock_level` int(11) NOT NULL DEFAULT '0',
  `reorder_level` int(11) NOT NULL,
  `unit_measure` varchar(32) NOT NULL,
  `userid` int(11) NOT NULL,
  `time_created` int(11) NOT NULL,
  `dropped` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `apl_it_store_item`
--

INSERT INTO `apl_it_store_item` (`item_id`, `item_name`, `stock_level`, `reorder_level`, `unit_measure`, `userid`, `time_created`, `dropped`) VALUES
(1, 'Baggage Tag', 846, 150, 'Cartons', 31, 1524752947, 0),
(2, 'Boarding Pass', 536, 200, 'Cartons', 31, 1524752960, 0),
(3, 'Mouse', 0, 0, 'Pieces', 31, 1525087267, 1),
(4, 'Key Board', 0, 0, 'Pieces', 31, 1525087274, 1),
(5, 'Wireless Adapter', 0, 0, 'Pieces', 31, 1525087296, 1),
(6, 'Double A Battery', 0, 0, 'Pieces', 31, 1525087334, 1),
(7, 'Triple A Battery', 0, 0, 'Pieces', 31, 1525087343, 1),
(8, 'AIO Desktop Power Pack', 0, 5, 'Pieces', 31, 1525091321, 1),
(9, 'Triple A Battery', 0, 4, 'Pieces', 31, 1525094870, 1),
(10, 'Wireless Adapter', 0, 3, 'Pieces', 31, 1525094888, 1),
(11, 'Mouse', 7, 4, 'Pieces', 31, 1525876227, 0);

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

--
-- Table structure for table `apl_requisition`
--

CREATE TABLE `apl_requisition` (
  `requisition_id` smallint(5) UNSIGNED ZEROFILL NOT NULL,
  `requested_by` int(11) NOT NULL,
  `request_scope` enum('Station','Individual') NOT NULL,
  `station_id` int(11) DEFAULT NULL,
  `request_status` enum('Pending','Processing','Completed') NOT NULL,
  `remark` text NOT NULL,
  `date_requested` int(11) NOT NULL,
  `date_accepted` int(11) NOT NULL,
  `accepted_by` int(11) NOT NULL,
  `dated_completed` int(11) NOT NULL,
  `completed_by` int(11) NOT NULL,
  `acknowledgment` enum('N/A','Awaiting','Acknowledged') NOT NULL,
  `date_acknowledged` int(11) NOT NULL,
  `acknowledged_by` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `apl_requisition`
--

INSERT INTO `apl_requisition` (`requisition_id`, `requested_by`, `request_scope`, `station_id`, `request_status`, `remark`, `date_requested`, `date_accepted`, `accepted_by`, `dated_completed`, `completed_by`, `acknowledgment`, `date_acknowledged`, `acknowledged_by`) VALUES
(00001, 31, 'Station', 1, 'Completed', '', 1526462300, 0, 0, 1526544830, 31, 'Acknowledged', 1526550995, 46),
(00002, 31, 'Station', 1, 'Completed', '', 1526462915, 1526480588, 31, 1526545854, 31, 'Acknowledged', 1526550985, 46),
(00003, 102, 'Station', 4, 'Completed', '', 1526472859, 1526546053, 31, 1526546288, 31, 'Awaiting', 0, 0),
(00004, 46, 'Station', 1, 'Pending', '', 1526551010, 0, 0, 0, 0, 'N/A', 0, 0);

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

--
-- Table structure for table `apl_requisition_items`
--

CREATE TABLE `apl_requisition_items` (
  `id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `requisition_id` int(11) NOT NULL,
  `requested_qty` double NOT NULL,
  `approved_qty` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `apl_requisition_items`
--

INSERT INTO `apl_requisition_items` (`id`, `item_id`, `requisition_id`, `requested_qty`, `approved_qty`) VALUES
(1, 2, 1, 2, 2),
(2, 1, 1, 4, 3),
(3, 1, 2, 2, 2),
(4, 2, 2, 3, 3),
(5, 1, 3, 5, 5),
(6, 2, 3, 3, 3),
(7, 1, 4, 2, 0),
(8, 2, 4, 2, 0);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `apl_it_stock_dispatch`
--
ALTER TABLE `apl_it_stock_dispatch`
  ADD PRIMARY KEY (`dispatch_id`);

--
-- Indexes for table `apl_it_stock_received`
--
ALTER TABLE `apl_it_stock_received`
  ADD PRIMARY KEY (`received_id`);

--
-- Indexes for table `apl_it_store_item`
--
ALTER TABLE `apl_it_store_item`
  ADD PRIMARY KEY (`item_id`),
  ADD KEY `dropped` (`dropped`);

--
-- Indexes for table `apl_requisition`
--
ALTER TABLE `apl_requisition`
  ADD PRIMARY KEY (`requisition_id`);

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `apl_it_stock_dispatch`
--
ALTER TABLE `apl_it_stock_dispatch`
  MODIFY `dispatch_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `apl_it_stock_received`
--
ALTER TABLE `apl_it_stock_received`
  MODIFY `received_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `apl_it_store_item`
--
ALTER TABLE `apl_it_store_item`
  MODIFY `item_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `apl_requisition`
--
ALTER TABLE `apl_requisition`
  MODIFY `requisition_id` smallint(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `apl_requisition_items`
--
ALTER TABLE `apl_requisition_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;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 */;
