-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 23, 2025 at 12:52 PM
-- Server version: 10.4.28-MariaDB
-- PHP Version: 8.0.28

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

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

--
-- Table structure for table `car_sales`
--

CREATE TABLE `car_sales` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `car_id` bigint(20) UNSIGNED NOT NULL,
  `date` date DEFAULT NULL,
  `make` varchar(255) NOT NULL,
  `model` varchar(255) NOT NULL,
  `varient` varchar(1000) NOT NULL,
  `reg_year` varchar(255) NOT NULL,
  `chassis_no` varchar(255) NOT NULL,
  `engine_no` varchar(255) NOT NULL,
  `registered_city` varchar(255) NOT NULL,
  `transmission` varchar(255) NOT NULL,
  `color` varchar(255) NOT NULL,
  `registration_no` varchar(255) NOT NULL,
  `seller_name` varchar(255) NOT NULL,
  `seller_cnic` varchar(255) NOT NULL,
  `seller_phone` varchar(255) NOT NULL,
  `seller_address` varchar(255) NOT NULL,
  `seller_witness_name` varchar(255) DEFAULT NULL,
  `seller_witness_cnic` varchar(255) DEFAULT NULL,
  `buyer_name` varchar(255) NOT NULL,
  `buyer_cnic` varchar(255) NOT NULL,
  `buyer_phone` varchar(255) NOT NULL,
  `buyer_address` varchar(255) NOT NULL,
  `buyer_witness_name` varchar(255) DEFAULT NULL,
  `buyer_witness_cnic` varchar(255) DEFAULT NULL,
  `soled_price` decimal(12,0) NOT NULL,
  `received_amount` varchar(1000) NOT NULL,
  `remaining_payment` varchar(1000) NOT NULL,
  `status` int(255) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `purchase_price` decimal(10,0) DEFAULT NULL,
  `khan_motors` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `car_sales`
--

INSERT INTO `car_sales` (`id`, `car_id`, `date`, `make`, `model`, `varient`, `reg_year`, `chassis_no`, `engine_no`, `registered_city`, `transmission`, `color`, `registration_no`, `seller_name`, `seller_cnic`, `seller_phone`, `seller_address`, `seller_witness_name`, `seller_witness_cnic`, `buyer_name`, `buyer_cnic`, `buyer_phone`, `buyer_address`, `buyer_witness_name`, `buyer_witness_cnic`, `soled_price`, `received_amount`, `remaining_payment`, `status`, `created_at`, `updated_at`, `purchase_price`, `khan_motors`) VALUES
(18, 23, '2025-04-27', 'TOYOTA', '2011', 'SR ALTIS', '2011', 'ZRE141-4500889', '1ZR-FE', 'LAHORE', 'Automatic', 'SILVER', 'LEC-7665', 'ISHFAQ KHAN', '17101-7475622-9', '0301-3024617', 'Tooth kely p/o Sardehri Wardaga tehsil & district Charsadda', 'Usman Ali', '17101-3823555-1', 'Imtiaz Khan', '17102-2912164-9', '0335-1919998', 'Dakhana khas Hisara nehri tehsil Tangi ditrict Charsada', 'Jaffar Khan', '17102-7939325-9', 4200000, '916500', '4150000', 1, '2025-04-27 05:49:19', '2025-08-14 06:26:23', 4100000, 1);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `car_sales`
--
ALTER TABLE `car_sales`
  ADD PRIMARY KEY (`id`),
  ADD KEY `car_sales_car_id_foreign` (`car_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `car_sales`
--
ALTER TABLE `car_sales`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `car_sales`
--
ALTER TABLE `car_sales`
  ADD CONSTRAINT `car_sales_car_id_foreign` FOREIGN KEY (`car_id`) REFERENCES `cars` (`id`) ON DELETE CASCADE;
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 */;
