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

START TRANSACTION;



--
-- Database: `phpcrm_free`
--

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

--
-- Table structure for table `phpcrm_customers`
--

CREATE TABLE `phpcrm_customers` (
  `id` int(10) UNSIGNED NOT NULL,
  `customer_code` varchar(50) DEFAULT NULL,
  `name` varchar(150) NOT NULL,
  `email` varchar(150) NOT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `company_name` varchar(200) DEFAULT NULL,
  `company_reg_no` varchar(100) DEFAULT NULL,
  `company_address` text DEFAULT NULL,
  `country` varchar(100) DEFAULT NULL,
  `role` varchar(100) DEFAULT NULL,
  `employees` varchar(20) DEFAULT NULL,
  `user_status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `phpcrm_customers`
--

INSERT INTO `phpcrm_customers` (`id`, `customer_code`, `name`, `email`, `phone`, `company_name`, `company_reg_no`, `company_address`, `country`, `role`, `employees`, `user_status`, `created_at`, `updated_at`) VALUES
(3, 'CUST-0182', 'Test Customer', 'test@gmail.com', '(888) 888-8888', 'Test', 'Kobu', 'c-81, kv2 Sector 82 Noida', 'India', 'Sr Manager', '1-10', 'active', '2025-11-29 14:31:44', '2025-12-01 07:32:28');

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

--
-- Table structure for table `phpcrm_leads`
--

CREATE TABLE `phpcrm_leads` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(150) NOT NULL,
  `email` varchar(150) DEFAULT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `company_name` varchar(200) DEFAULT NULL,
  `lead_source` varchar(100) DEFAULT NULL,
  `status` enum('new','contacted','qualified','lost') NOT NULL DEFAULT 'new',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `phpcrm_leads`
--

INSERT INTO `phpcrm_leads` (`id`, `name`, `email`, `phone`, `company_name`, `lead_source`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Test Lead', 'test@gmail.com', '(888) 888-8888', 'Kobu', 'dd', 'contacted', '2025-11-29 15:25:13', '2025-12-01 07:32:50');

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

--
-- Table structure for table `phpcrm_notes`
--

CREATE TABLE `phpcrm_notes` (
  `id` int(10) UNSIGNED NOT NULL,
  `customer_id` int(10) UNSIGNED NOT NULL,
  `note` text NOT NULL,
  `added_by` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `phpcrm_tasks`
--

CREATE TABLE `phpcrm_tasks` (
  `id` int(10) UNSIGNED NOT NULL,
  `customer_id` int(10) UNSIGNED NOT NULL,
  `title` varchar(200) NOT NULL,
  `description` text DEFAULT NULL,
  `followup_date` datetime NOT NULL,
  `status` enum('pending','completed') NOT NULL DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `phpcrm_customers`
--
ALTER TABLE `phpcrm_customers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`);

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `phpcrm_customers`
--
ALTER TABLE `phpcrm_customers`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `phpcrm_leads`
--
ALTER TABLE `phpcrm_leads`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `phpcrm_notes`
--
ALTER TABLE `phpcrm_notes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `phpcrm_tasks`
--
ALTER TABLE `phpcrm_tasks`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
COMMIT;

