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

START TRANSACTION;



--
-- Database: `user`
--

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

--
-- Table structure for table `company`
--

CREATE TABLE `company` (
  `company_id` int(10) NOT NULL,
  `company_name` varchar(150) NOT NULL,
  `company_address` varchar(300) NOT NULL,
  `bir_tin` int(12) NOT NULL,
  `contact_name` varchar(150) NOT NULL,
  `Business_Type` varchar(150) NOT NULL,
  `Status` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `company`
--

INSERT INTO `company` (`company_id`, `company_name`, `company_address`, `bir_tin`, `contact_name`, `Business_Type`, `Status`) VALUES
(1, 'Lenovo', '10/F 11th Corporate Center, 11th Ave, Taguig, Kalakhang Maynila', 1300557073, 'Reden Rudolf Recto', 'Fortune Global 500 technology company', 1),
(3, 'Sampl', 'sample', 2147483647, 'sample', 'sample', 0),
(4, 'Kopiko', 'Manila', 0, 'Reden', 'Shop', 1);

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

--
-- Table structure for table `order`
--

CREATE TABLE `order` (
  `OrderID` int(11) NOT NULL,
  `ProductID` int(11) NOT NULL,
  `Quantity` int(11) NOT NULL,
  `OrderedBy` varchar(255) NOT NULL,
  `OrderDate` datetime DEFAULT current_timestamp(),
  `ApprovedBy` varchar(255) DEFAULT NULL,
  `ApprovedDate` datetime DEFAULT NULL,
  `ApprovalStatus` int(11) DEFAULT 0,
  `ApprovalNote` text DEFAULT NULL,
  `PaymentBy` varchar(255) DEFAULT NULL,
  `PaymentDate` datetime DEFAULT NULL,
  `PaymentReceipt` varchar(255) DEFAULT NULL,
  `PaymentStatus` int(11) DEFAULT 0,
  `PaymentNote` text DEFAULT NULL,
  `RecommendedForPrintingBy` varchar(255) DEFAULT NULL,
  `RecommendedForPrintingDate` datetime DEFAULT NULL,
  `RecommendedForPrintingNote` text DEFAULT NULL,
  `ApprovedForPrintingBy` varchar(255) DEFAULT NULL,
  `ApprovedForPrintingDate` datetime DEFAULT NULL,
  `ApprovedForPrintingNote` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `order`
--

INSERT INTO `order` (`OrderID`, `ProductID`, `Quantity`, `OrderedBy`, `OrderDate`, `ApprovedBy`, `ApprovedDate`, `ApprovalStatus`, `ApprovalNote`, `PaymentBy`, `PaymentDate`, `PaymentReceipt`, `PaymentStatus`, `PaymentNote`, `RecommendedForPrintingBy`, `RecommendedForPrintingDate`, `RecommendedForPrintingNote`, `ApprovedForPrintingBy`, `ApprovedForPrintingDate`, `ApprovedForPrintingNote`) VALUES
(1, 2, 2, 'Reden', '2024-10-03 04:31:19', 'Reden', '2024-10-03 05:06:19', 0, 'This is approved.', 'Me', NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(2, 3, 3, 'Reden', '2024-10-03 05:08:46', 'Reden', '2024-10-03 05:09:14', 2, 'This is rejected', 'Reden', NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `product`
--

CREATE TABLE `product` (
  `product_id` int(10) NOT NULL,
  `company_id` int(11) NOT NULL,
  `product_name` varchar(150) NOT NULL,
  `product_description` varchar(300) NOT NULL,
  `content_type` varchar(50) NOT NULL,
  `amount` varchar(50) NOT NULL,
  `Status` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `product`
--

INSERT INTO `product` (`product_id`, `company_id`, `product_name`, `product_description`, `content_type`, `amount`, `Status`) VALUES
(2, 1, 'Lenovo Ideapad', 'Laptop', 'solid', '0', 1),
(3, 1, 'Gaming Phone', 'Mobile Phne', 'solid', '0', 1);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `company`
--
ALTER TABLE `company`
  ADD PRIMARY KEY (`company_id`);

--
-- Indexes for table `order`
--
ALTER TABLE `order`
  ADD PRIMARY KEY (`OrderID`),
  ADD KEY `ProductID` (`ProductID`);

--
-- Indexes for table `product`
--
ALTER TABLE `product`
  ADD PRIMARY KEY (`product_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `company`
--
ALTER TABLE `company`
  MODIFY `company_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `order`
--
ALTER TABLE `order`
  MODIFY `OrderID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `product`
--
ALTER TABLE `product`
  MODIFY `product_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `order`
--
ALTER TABLE `order`
  ADD CONSTRAINT `order_ibfk_1` FOREIGN KEY (`ProductID`) REFERENCES `product` (`product_id`) ON DELETE CASCADE;
COMMIT;

