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




--
-- Database: `accounts`
--

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

--
-- Table structure for table `advance`
--

CREATE TABLE `advance` (
  `Cus_id` int(20) DEFAULT NULL,
  `Advance` varchar(30) DEFAULT NULL,
  `Date` date DEFAULT NULL,
  `Bill_no` int(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `advance`
--

INSERT INTO `advance` (`Cus_id`, `Advance`, `Date`, `Bill_no`) VALUES
(34, '10000', '2016-06-15', 2016062812),
(34, '10000', '2016-06-15', 2016062812),
(34, '10000', '2016-06-15', 2016064322),
(34, '100000', '2016-06-18', 2016064322),
(34, '1000', '2016-06-18', 2016064673),
(34, '1000', '2016-06-18', 2016064673),
(34, '32', '2016-06-18', 2016063211),
(34, '1000', '2016-06-18', 2016064673),
(34, '32', '2016-06-18', 2016063211),
(34, '4432', '2016-06-18', 2016063509),
(34, '1000', '2016-06-18', 2016064673),
(34, '32', '2016-06-18', 2016063211),
(34, '4432', '2016-06-18', 2016063509),
(34, '1000', '2016-06-18', 2016066143),
(34, '1000', '2016-06-18', 2016064673),
(34, '32', '2016-06-18', 2016063211),
(34, '4432', '2016-06-18', 2016063509),
(34, '1000', '2016-06-18', 2016066143),
(34, '8000', '2016-06-18', 2016061615),
(34, '1000', '2016-06-18', 2016064673),
(34, '32', '2016-06-18', 2016063211),
(34, '4432', '2016-06-18', 2016063509),
(34, '1000', '2016-06-18', 2016066143),
(34, '8000', '2016-06-18', 2016061615),
(34, '10000', '2016-06-18', 2016064738),
(34, '10000', '2016-06-19', 2016061034),
(34, '100000', '2016-06-19', 2016061034),
(34, '10000', '2016-06-19', 2016061034),
(34, '10000', '2016-06-19', 2016066311),
(34, '10000', '2016-06-19', 2016061034),
(34, '10000', '2016-06-19', 2016066311),
(34, '1000', '2016-06-19', 2016061884),
(34, '', '2016-06-20', 2016064189);

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

--
-- Table structure for table `customer_details`
--

CREATE TABLE `customer_details` (
  `Cus_id` int(20) NOT NULL,
  `Name` varchar(80) DEFAULT NULL,
  `fname` varchar(80) DEFAULT NULL,
  `Cnic` varchar(40) NOT NULL,
  `Company_name` varchar(40) DEFAULT NULL,
  `cell_no` varchar(80) DEFAULT NULL,
  `Home_office` varchar(40) DEFAULT NULL,
  `Fax_no` varchar(60) DEFAULT NULL,
  `Adrees` varchar(100) DEFAULT NULL,
  `Date` date DEFAULT NULL,
  `place_issue` varchar(40) DEFAULT NULL,
  `purpose_visit` varchar(50) DEFAULT NULL,
  `Arried_form` varchar(40) DEFAULT NULL,
  `Pic` varchar(255) DEFAULT NULL,
  `DateOfBirth` date DEFAULT NULL,
  `Gender` varchar(80) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `customer_details`
--

INSERT INTO `customer_details` (`Cus_id`, `Name`, `fname`, `Cnic`, `Company_name`, `cell_no`, `Home_office`, `Fax_no`, `Adrees`, `Date`, `place_issue`, `purpose_visit`, `Arried_form`, `Pic`, `DateOfBirth`, `Gender`) VALUES
(33, 'Nazir-ul-haq', 'Sabir Wali Taj', '15202-0905283-7', 'CVP-T.D.A', '3359147774', 'home', 'no', '', '2016-05-23', '', '', '', 'upload/no-thumb.jpg', '2016-06-06', ''),
(34, 'sami', 'Qadeer Ahmed Khan ', '413414314315', 'miz', '0308-3790155', 'home', 'no', 'house no 57/d', '2016-06-14', '', '', '', 'upload/no-thumb.jpg', '2016-06-14', 'Male');

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

--
-- Table structure for table `datewise_entry`
--

CREATE TABLE `datewise_entry` (
  `Sr_no` int(40) NOT NULL,
  `Cus_id` int(20) NOT NULL,
  `Room_no` varchar(20) DEFAULT NULL,
  `Bill_date` date DEFAULT NULL,
  `Bill_no` int(255) DEFAULT NULL,
  `F_amount` varchar(30) DEFAULT NULL,
  `L_Amount` varchar(30) DEFAULT NULL,
  `Other_amount` varchar(30) DEFAULT NULL,
  `Grand_amount` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `datewise_entry`
--

INSERT INTO `datewise_entry` (`Sr_no`, `Cus_id`, `Room_no`, `Bill_date`, `Bill_no`, `F_amount`, `L_Amount`, `Other_amount`, `Grand_amount`) VALUES
(1, 34, '804', '2016-06-18', 2016064322, '42', '343', '343', '728'),
(2, 34, '804', '2016-06-18', 2016064322, '0', '0', '0', '0'),
(3, 34, '854', '2016-06-19', 2016064738, '1000', '100', '1000', '2100'),
(4, 34, '850', '2016-06-19', 2016061034, '1000', '10000', '1000', '12000');

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

--
-- Table structure for table `reservation_rooms`
--

CREATE TABLE `reservation_rooms` (
  `Sr-no` int(80) NOT NULL,
  `Room_no` int(100) DEFAULT NULL,
  `bill_no` varchar(100) DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `reservation_rooms`
--

INSERT INTO `reservation_rooms` (`Sr-no`, `Room_no`, `bill_no`, `status`) VALUES
(1, 801, '2016061884', 'Reserved'),
(2, 802, '2016064673', 'Reserved'),
(3, 803, '', 'Reserved'),
(4, 804, '', 'Reserved'),
(5, 805, '', 'Aviliable'),
(6, 806, '', 'Aviliable'),
(7, 807, NULL, 'Aviliable'),
(8, 808, NULL, 'Aviliable'),
(9, 809, '', 'Aviliable'),
(10, 810, '', 'Aviliable'),
(11, 811, '', 'Aviliable'),
(12, 812, NULL, 'Aviliable'),
(13, 813, NULL, 'Aviliable'),
(14, 814, NULL, 'Aviliable'),
(15, 815, NULL, 'Aviliable'),
(16, 816, NULL, 'Aviliable'),
(17, 817, NULL, 'Aviliable'),
(18, 818, NULL, 'Aviliable'),
(19, 819, NULL, 'Aviliable'),
(20, 820, NULL, 'Aviliable'),
(21, 821, NULL, 'Aviliable'),
(22, 822, NULL, 'Aviliable'),
(23, 823, NULL, 'Aviliable'),
(24, 824, NULL, 'Aviliable'),
(25, 825, NULL, 'Aviliable'),
(26, 826, NULL, 'Aviliable'),
(27, 827, NULL, 'Aviliable'),
(28, 828, NULL, 'Aviliable'),
(29, 829, NULL, 'Aviliable'),
(30, 830, NULL, 'Aviliable'),
(31, 831, NULL, 'Aviliable'),
(32, 832, NULL, 'Aviliable'),
(33, 833, NULL, 'Aviliable'),
(34, 834, NULL, 'Aviliable'),
(35, 835, NULL, 'Aviliable'),
(36, 836, NULL, 'Aviliable'),
(37, 837, NULL, 'Aviliable'),
(38, 838, NULL, 'Aviliable'),
(39, 839, NULL, 'Aviliable'),
(40, 840, '', 'Reserved'),
(41, 841, NULL, 'Aviliable'),
(42, 842, NULL, 'Aviliable'),
(43, 843, NULL, 'Aviliable'),
(44, 844, NULL, 'Aviliable'),
(45, 845, NULL, 'Aviliable'),
(46, 846, NULL, 'Aviliable'),
(47, 847, NULL, 'Aviliable'),
(48, 848, NULL, 'Aviliable'),
(49, 849, NULL, 'Aviliable'),
(50, 850, '', 'Reserved'),
(51, 851, NULL, 'Aviliable'),
(52, 852, NULL, 'Aviliable'),
(53, 853, NULL, 'Aviliable'),
(54, 854, '2016064738', 'Reserved'),
(55, 855, NULL, 'Aviliable'),
(56, 856, NULL, 'Aviliable'),
(57, 857, NULL, 'Aviliable'),
(58, 858, NULL, 'Aviliable'),
(59, 859, NULL, 'Aviliable'),
(60, 860, '', 'Aviliable'),
(61, 861, NULL, 'Aviliable'),
(62, 862, NULL, 'Aviliable'),
(63, 863, '', 'Aviliable'),
(64, 864, '2016064189', 'Reserved'),
(65, 865, '2016066143', 'Reserved'),
(66, 866, NULL, 'Aviliable'),
(67, 867, '2016063509', 'Reserved'),
(68, 868, NULL, 'Aviliable'),
(69, 869, NULL, 'Aviliable'),
(70, 870, '2016066311', 'Reserved'),
(71, 871, '', 'Reserved'),
(72, 872, NULL, 'Aviliable'),
(73, 873, NULL, 'Aviliable'),
(74, 874, NULL, 'Aviliable'),
(75, 875, NULL, 'Aviliable'),
(76, 876, '2016061615', 'Reserved'),
(77, 877, NULL, 'Aviliable'),
(78, 878, NULL, 'Aviliable'),
(79, 879, NULL, 'Aviliable'),
(80, 880, '2016063211', 'Reserved');

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

--
-- Table structure for table `room_details`
--

CREATE TABLE `room_details` (
  `Sr_no` int(40) NOT NULL,
  `Cus_id` int(20) NOT NULL,
  `Reservation_date` date DEFAULT NULL,
  `Time` varchar(80) DEFAULT NULL,
  `Reservation_end` date DEFAULT NULL,
  `end_time` varchar(50) DEFAULT NULL,
  `No_of_persons` varchar(30) DEFAULT NULL,
  `Adult` varchar(30) DEFAULT NULL,
  `childeren` varchar(30) DEFAULT NULL,
  `Room_no` varchar(20) DEFAULT NULL,
  `Room_rent` varchar(30) DEFAULT NULL,
  `Advance` varchar(60) DEFAULT NULL,
  `Tax` varchar(80) DEFAULT NULL,
  `Bed_qutity` varchar(40) DEFAULT NULL,
  `Extera_rent` varchar(30) DEFAULT NULL,
  `Amount` varchar(40) DEFAULT NULL,
  `Room_type` varchar(40) DEFAULT NULL,
  `Bill_No` int(255) DEFAULT NULL,
  `No_0f_Rooms` varchar(40) DEFAULT NULL,
  `No_days` varchar(40) DEFAULT NULL,
  `Status` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `room_details`
--

INSERT INTO `room_details` (`Sr_no`, `Cus_id`, `Reservation_date`, `Time`, `Reservation_end`, `end_time`, `No_of_persons`, `Adult`, `childeren`, `Room_no`, `Room_rent`, `Advance`, `Tax`, `Bed_qutity`, `Extera_rent`, `Amount`, `Room_type`, `Bill_No`, `No_0f_Rooms`, `No_days`, `Status`) VALUES
(1, 34, '2016-06-15', '6:15 PM', '2016-06-16', '12:00:00', '4', '5', '4', '801', '5000', '10000', 'yes', '1', '1000', 'Cash', 'deluxe', 2016062812, '1', '1', 'Check In'),
(2, 34, '2016-06-15', '6:39 PM', '2016-06-16', '00:00', '3', '4', '3', '804', '4000', '10000', 'yes', '1', '1000', 'Credit', 'single', 2016064322, '1', '1', 'CheckOut'),
(3, 34, '2016-06-18', '4:36 AM', '2016-06-19', '12:00:00', '4', '3', '3', '802', '4000', '1000', '', '0', '0', 'Cash', 'single', 2016064673, '1', '1', 'Check In'),
(4, 34, '2016-06-18', '5:24 AM', '2016-06-19', '12:00:00', '34', '3', '3', '880', '4000', '32', '', '0', '0', 'Cash', 'single', 2016063211, '1', '1', 'Check In'),
(5, 34, '2016-06-18', '5:26 AM', '2016-06-19', '11:00:00', '3', '3', '3', '867', '4000', '4432', '', '0', '0', 'Cash', 'single', 2016063509, '1', '1', 'Check In'),
(6, 34, '2016-06-18', '5:27 AM', '2016-06-19', '00:00:00', '3', '2', '2', '865', '4000', '1000', 'yes', '', '0', 'Cash', 'single', 2016066143, '1', '1', 'Check In'),
(7, 34, '2016-06-18', '5:36 AM', '2016-06-19', '00:00:00', '3', '3', '3', '876', '4000', '8000', 'yes', '2', '2000', 'Cash', 'single', 2016061615, '1', '1', 'Check In'),
(8, 34, '2016-06-18', '5:39 AM', '2016-06-19', ':00', '3', '3', '3', '854', '4000', '10000', '', '0', '0', 'Cash', 'single', 2016064738, '1', '1', 'Check In'),
(9, 34, '2016-06-19', '3:38 AM', '2016-06-20', '03:39', '4', '5', '4', '850,870', '4000', '10000', 'yes', '1', '1000', 'Cash', 'single', 2016061034, '1', '1', 'CheckOut'),
(10, 34, '2016-06-19', '5:34 PM', '2016-06-21', '17:35:00', '3', '2', '2', '871,840', '8000', '10000', 'yes', '1', '1000', 'Cash', 'single', 2016066311, '1', '2', 'Check In'),
(11, 34, '2016-06-19', '5:37 PM', '2016-06-20', '12:00:00', '4', '5', '5', '804,803', '4000', '1000', '', '0', '0', 'Cash', 'single', 2016061884, '1', '1', 'Check In'),
(12, 34, '2016-06-20', '6:00 AM', '2016-06-21', '13:00:00', '4', '3', '3', '864', '4000', '', '', '1', '1000', 'Cash', 'single', 2016064189, '1', '1', 'Check In');

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

--
-- Table structure for table `total_bill`
--

CREATE TABLE `total_bill` (
  `Cus_id` int(20) DEFAULT NULL,
  `Total_Rent` varchar(40) DEFAULT NULL,
  `Total_food` varchar(40) DEFAULT NULL,
  `Total_Lundry` varchar(40) DEFAULT NULL,
  `total_Other` varchar(40) DEFAULT NULL,
  `Service_Charges` varchar(40) DEFAULT NULL,
  `GST` varchar(40) DEFAULT NULL,
  `Total_Amount` varchar(40) DEFAULT NULL,
  `Total_Advance` varchar(40) DEFAULT NULL,
  `Discount` varchar(40) DEFAULT NULL,
  `Net_Balance` varchar(40) DEFAULT NULL,
  `Payment` varchar(40) DEFAULT NULL,
  `ctw` varchar(255) DEFAULT NULL,
  `crb` varchar(255) DEFAULT NULL,
  `creditby` varchar(255) DEFAULT NULL,
  `date` date DEFAULT NULL,
  `Time` varchar(100) DEFAULT NULL,
  `Bill_no` int(255) DEFAULT NULL,
  `Room_no` varchar(80) DEFAULT NULL,
  `Extera_hour` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `total_bill`
--

INSERT INTO `total_bill` (`Cus_id`, `Total_Rent`, `Total_food`, `Total_Lundry`, `total_Other`, `Service_Charges`, `GST`, `Total_Amount`, `Total_Advance`, `Discount`, `Net_Balance`, `Payment`, `ctw`, `crb`, `creditby`, `date`, `Time`, `Bill_no`, `Room_no`, `Extera_hour`) VALUES
(34, '5000', '42', '343', '343', '1000', '1000', '9837', '110000', '100000', '-200163', 'Credit', 'negative two hundred thousand one hundred and sixty-three Rupees Only', 'waqas', 'waqas', '2016-06-18', '12:35 AM', 2016064322, '804', '2109'),
(34, '6000', '0', '0', '0', '1000', '1000', '10000', '20000', '0', '-10000', 'Cash', 'negative ten thousand  Rupees Only', 'WAQAS', 'WAQAS', '2016-06-18', '12:51 AM', 2016062812, '801', '2000'),
(34, '5000', '1000', '10000', '1000', '1000', '100', '20725', '110000', '100', '-89375', 'Cash', 'negative eighty-nine thousand three hundred and seventy-five Rupees Only', 'waqas', 'waqas', '2016-06-20', '3:39 AM', 2016061034, '850', '2625'),
(34, '5000', '0', '0', '0', '100', '100', '8045', '0', '1000', '7045', 'Cash', 'seven thousand forty-five Rupees Only', 'waqas', 'waqas', '2016-06-21', '6:01 AM', 2016064189, '', '2845');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `advance`
--
ALTER TABLE `advance`
  ADD KEY `advance_ibfk_1` (`Cus_id`);

--
-- Indexes for table `customer_details`
--
ALTER TABLE `customer_details`
  ADD PRIMARY KEY (`Cus_id`,`Cnic`);

--
-- Indexes for table `datewise_entry`
--
ALTER TABLE `datewise_entry`
  ADD PRIMARY KEY (`Sr_no`),
  ADD KEY `datewise_entry_ibfk_1` (`Cus_id`);

--
-- Indexes for table `reservation_rooms`
--
ALTER TABLE `reservation_rooms`
  ADD PRIMARY KEY (`Sr-no`);

--
-- Indexes for table `room_details`
--
ALTER TABLE `room_details`
  ADD PRIMARY KEY (`Sr_no`),
  ADD KEY `Cus_id` (`Cus_id`);

--
-- Indexes for table `total_bill`
--
ALTER TABLE `total_bill`
  ADD KEY `total_bill_ibfk_1` (`Cus_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `customer_details`
--
ALTER TABLE `customer_details`
  MODIFY `Cus_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35;
--
-- AUTO_INCREMENT for table `datewise_entry`
--
ALTER TABLE `datewise_entry`
  MODIFY `Sr_no` int(40) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `reservation_rooms`
--
ALTER TABLE `reservation_rooms`
  MODIFY `Sr-no` int(80) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=81;
--
-- AUTO_INCREMENT for table `room_details`
--
ALTER TABLE `room_details`
  MODIFY `Sr_no` int(40) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- Constraints for dumped tables
--

--
-- Constraints for table `advance`
--
ALTER TABLE `advance`
  ADD CONSTRAINT `advance_ibfk_1` FOREIGN KEY (`Cus_id`) REFERENCES `customer_details` (`Cus_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `datewise_entry`
--
ALTER TABLE `datewise_entry`
  ADD CONSTRAINT `datewise_entry_ibfk_1` FOREIGN KEY (`Cus_id`) REFERENCES `customer_details` (`Cus_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `room_details`
--
ALTER TABLE `room_details`
  ADD CONSTRAINT `room_details_ibfk_1` FOREIGN KEY (`Cus_id`) REFERENCES `customer_details` (`Cus_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `total_bill`
--
ALTER TABLE `total_bill`
  ADD CONSTRAINT `total_bill_ibfk_1` FOREIGN KEY (`Cus_id`) REFERENCES `room_details` (`Cus_id`) ON DELETE CASCADE ON UPDATE CASCADE;

