-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 25, 2026 at 12:54 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.0.30

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: `erp`
--

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

--
-- Table structure for table `assets_cctv`
--

CREATE TABLE `assets_cctv` (
  `id` int(11) NOT NULL,
  `contract_id` int(11) NOT NULL,
  `camera_no` varchar(20) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `floor_area` varchar(100) DEFAULT NULL,
  `location_details` text DEFAULT NULL,
  `megapixel` varchar(20) DEFAULT NULL,
  `model` varchar(100) DEFAULT NULL,
  `dvr_connection` varchar(50) DEFAULT NULL,
  `channel_no` varchar(20) DEFAULT NULL,
  `client_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `assets_cctv`
--

INSERT INTO `assets_cctv` (`id`, `contract_id`, `camera_no`, `description`, `floor_area`, `location_details`, `megapixel`, `model`, `dvr_connection`, `channel_no`, `client_id`) VALUES
(1, 8, 'cam1', 'شارع امام البوابه الرئيسيه', 'خارجي', 'امام البوابه مباشره', '4', 'Hikvision', 'DVR-1', 'CH1', 0),
(2, 8, 'Cam-2', 'يمين البوابه', 'خارجي', 'يمين البوابه', '4', 'HIKVision', 'DVR-1', 'CH2', 0),
(3, 8, 'Cam-3', 'شمال البوابه', 'خارجي', 'يسار البوابه', '4', 'HIKVision', 'DVR-1', 'CH3', 0),
(4, 8, 'Cam-4', 'كاميرا السور', 'خارجي', 'السور الامامي', '4', 'Hikvision', 'DVR--1', 'CH4', 0),
(5, 8, 'Cam-5', 'كاميرا السور الاخر', 'خارجي', 'السور الجانبي', '4', 'Hikvision', 'DVR-1', 'CH5', 0),
(6, 8, 'Cam-6', 'خلف المستشفي ', 'خارجي', 'الساحات الخلفيه', '4', 'Hikvision', 'DVR-1', 'CH6', 0),
(7, 8, 'Cam-7', 'الباب الخلفي', 'خارجي', 'امام باب المخازن الخلفي', '4', 'Hikvision', 'DVR-1', 'CH7', 0),
(8, 8, 'Cam-8', 'يسار الباب الخلفي', 'خارجي', 'يسار باب الخدمات', '4', 'Hikvision', 'DVR-1', 'CH8', 0),
(9, 8, 'Cam-9', 'يمين الباب الخلفي', 'خارجي', 'يمين باب الخدمات', '4', 'Hikvision', 'DVR-1', 'CH9', 0),
(10, 8, 'Cam-10', 'مداخل المستشفي من الباب الرئيسي', 'داخلي', 'ريسبشن امام الباب', '4', 'Hikvision', 'DVR-1', 'CH10', 0),
(11, 8, 'Cam11', 'الطرقه 1', 'داخلي', 'الطابق الارضي-ممر رقم 1', '2', 'Hikvision', 'DVR-1', 'CH11', 0),
(12, 8, 'Cam12', 'الطرقه 2', 'داخلي', 'الطابق الارضي-ممر رقم 2', '2', 'Hikvision', 'DVR-1', 'CH12', 0),
(13, 8, 'Cam13', 'الطرقه 3', 'داخلي', 'الطابق الارضي-ممر رقم 3', '2', 'Hikvision', 'DVR-1', 'CH13', 0),
(14, 8, 'Cam14', 'الطرقه 4', 'داخلي', 'الطابق الارضي-ممر رقم 4', '2', 'Hikvision', 'DVR-1', 'CH14', 0),
(15, 8, 'Cam15', '', '', '', '', '', '', '', 0),
(16, 8, 'Cam15', '', '', '', '2', 'Hikvision', 'DVR-1', 'CH15', 0),
(17, 8, 'Cam16', '', '', '', '2', 'Hikvision', 'DVR-1', 'CH16', 0),
(18, 8, 'Cam17', 'خلف المستشفي', 'خارجي', 'ساحه خلفيه', '4', 'HIKVision', 'DVR-2', 'CH1', 0),
(19, 8, 'Cam-18', 'الباب الخلفي', 'خارجي', 'مخازن', '4', 'Hikvision', 'DVR-2', 'CH2', 0),
(20, 8, 'Cam-19', 'يسار الباب الخلفي', 'خارجي', 'خدمات', '4', 'Hikvision', 'DVR-2', 'CH3', 0),
(21, 8, 'Cam-20', 'يمين الباب الخلفي', 'خارجي', 'خدمات', '4', 'Hikvision', 'DVR-2', 'CH4', 0),
(22, 8, 'Cam-21', 'كاميرا ممر الدور الاول', 'داخلي', 'ممر رئيسي', '4', 'Hikvision', 'DVR-2', 'CH5', 0),
(23, 8, 'Cam-22', 'كاميرا عيادات الدور الاول', 'داخلي', 'عيادات-مدخل', '4', 'Hikvision', 'DVR-2', 'CH6', 0),
(24, 2, 'Gateway Router', 'admin', 'Glob2@255255', '192.168.1.1', '', 'Hik', '', '', 0),
(25, 2, 'camera 1', 'admin', 'Glob@255255', '192.168.1.10', '', 'Hik', '', '', 0),
(26, 2, 'camera 2', 'admin', 'Glob@255255', '192.168.1.11', '', 'Hik', '', '', 0),
(27, 2, 'camera 3', 'admin', 'Glob@255255', '192.168.1.12', '', 'Hik', '', '', 0),
(28, 2, 'camera 4', 'admin', 'Glob@255255', '192.168.1.13', '', 'Hik', '', '', 0),
(29, 2, 'camera 5', 'admin', 'Glob@255255', '192.168.1.14', '', 'Hik', '', '', 0),
(30, 2, 'Camera 6', 'admin', 'Glob@255255', '192.168.1.15', '', 'Hik', '', '', 0);

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

--
-- Table structure for table `assets_network`
--

CREATE TABLE `assets_network` (
  `id` int(11) NOT NULL,
  `contract_id` int(11) NOT NULL,
  `ip_address` varchar(20) DEFAULT NULL,
  `device_type` varchar(100) DEFAULT NULL,
  `username` varchar(50) DEFAULT NULL,
  `password` varchar(100) DEFAULT NULL,
  `location` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `assets_network`
--

INSERT INTO `assets_network` (`id`, `contract_id`, `ip_address`, `device_type`, `username`, `password`, `location`) VALUES
(1, 8, '', '', 'Al Rayyan Hospital', 'Glob@255255', ''),
(2, 8, '', '', '', '', ''),
(3, 8, '', '', 'Al Rayyan Hospital-1', 'IT@Glob-255255.net', ''),
(4, 8, '', '', 'Al Rayyan Hospital -IT', 'IT@Glob-255255..IT', ''),
(5, 8, '', '', 'Rayyan Hospital-CH', 'IT@Glob-255255.CH', ''),
(6, 8, '192.168.1.1', 'ROUTER WE', 'ADMIN', 'IT@dmin2001/Glob@255255', ''),
(7, 2, '192.161', '', '', '', ''),
(8, 2, '192.168.1.20', 'Access Point 1', '', '', ''),
(9, 2, '192.168.1.21', 'Access point 2', '', '', ''),
(10, 2, '192.168.1.22', 'Access point 3', '', '', ''),
(11, 2, '192.168.1.250', 'NVR HIKVISION', 'A', '', ''),
(12, 2, '192.168.1.250', 'NVR HIKVISION', 'admin', 'Glob@255255', ''),
(13, 2, '192.168.1.253', 'Grandstream HT841 FXO', 'admin', 'Grand123', ''),
(14, 2, '192.168.1.254', 'VOIP Server-Issabel', 'admin', 'root@123', '');

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

--
-- Table structure for table `assets_pcs`
--

CREATE TABLE `assets_pcs` (
  `id` int(11) NOT NULL,
  `contract_id` int(11) NOT NULL,
  `pc_id` varchar(50) DEFAULT NULL,
  `employee_name` varchar(100) DEFAULT NULL,
  `job_title` varchar(100) DEFAULT NULL,
  `os_type` varchar(50) DEFAULT NULL,
  `computer_name` varchar(100) DEFAULT NULL,
  `processor` varchar(100) DEFAULT NULL,
  `ram` varchar(50) DEFAULT NULL,
  `hard_drive` varchar(100) DEFAULT NULL,
  `rustdesk_id` varchar(50) DEFAULT NULL,
  `password` varchar(50) DEFAULT NULL,
  `floor` varchar(50) DEFAULT NULL,
  `client_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `assets_pcs`
--

INSERT INTO `assets_pcs` (`id`, `contract_id`, `pc_id`, `employee_name`, `job_title`, `os_type`, `computer_name`, `processor`, `ram`, `hard_drive`, `rustdesk_id`, `password`, `floor`, `client_id`) VALUES
(1, 8, '', 'دنيا احمد ', 'المشتريات', 'win10  64', 'hp desktop pro MT', 'intel® core™ i3-7100', '4GB 1 of 4', 'WDC WD5000AZLX-60K2TA0', '102422026', 'Glob@255255', 'الدور التالت', 0),
(2, 8, 'PC002', 'هدير حموده ', 'المشتريات', 'win10  64', 'dell optiplex 990', 'intel® core™ i3-2120', '8GB 2 of 4', 'ST500DM002-1SB10A', '', '322814490', 'الدور الثالث', 0),
(3, 8, 'PC003', 'نهي', 'HR موارد بشريه ', 'win7 64', 'dell optiplex 3020', 'intel® core™ i3-4130', '4GB 1 of 4', 'WDC WD5000AAKX-75U6AA0 ATA', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(4, 8, 'PC004', 'عبير ', 'HR موارد بشريه ', 'win10  64', 'hp desktop pro MT', 'intel® core™ i3-7100', '4GB 1 of 4', 'WDC WD5000AZLX-60K2TA0', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(5, 8, 'PC005', 'ناهد', 'HR موارد بشريه ', 'win7 64', 'hp desktop pro MT', 'intel® core™ i3-7100', '4GB 1 of 4', 'WDC WD5000AZLX-60K2TA0 SCSI', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(6, 8, 'PC006', 'شيماء ', 'الموارد الماليه', 'win7 64', 'hp desktop pro MT', 'intel® core™ i3-7100', '4GB 1 of 4', 'WDC WD5000AZLX-60K2TA0 ATA', 'WDC WD5000AZLX-60K2TA0 ATA', 'Glob@255255', 'الدور الثالث', 0),
(7, 8, 'PC007', 'منال', 'الموارد الماليه', 'win10  64', 'dell optiplex 390', 'intel® core™ i3-2120', '8GB 2 of 4', 'WDC WD5000AVCS-612DY1 ATA', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(8, 8, 'PC008', 'سلوى', 'الموارد الماليه', 'win7 64', 'dell optiplex 3010', 'intel® core™ i3-2120', '8GB 2 of 4', 'ST3500414CS ATA', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(9, 8, 'PC009', 'هانم محمود', 'الموارد الماليه', 'win10  64', 'hp desktop pro MT', 'intel® core™ i3-7100', '4GB 1 of 4', 'WDC WD5000AZLX-60K2TA0', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(10, 8, 'PC010', 'ناديه', 'الموارد الماليه', 'win10  64', 'dell optiplex 390', 'intel® core™ i3-2120', '8GB 2 of 4', 'WDC WD5000AVCS-612DY1 ATA', '434460067', 'Glob@255255', 'الدور الثالث', 0),
(11, 8, 'PC011', 'ماهيتاب ', 'الموارد الماليه', 'win10  64', 'dell optiplex 3080', 'intel® core™ i3-10100', '8GB 2 of 4', 'ST1000DM010-2EP102', '138757266', 'Glob@255255', 'الدور الثالث', 0),
(12, 8, 'PC012', 'خديجه ', 'الموارد الماليه', 'win7 64', 'dell optiplex 3010', 'intel® core™ i3-3220', '8GB 2 of 4', 'ST3500414CS ATA', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(13, 8, 'PC013', 'ميرفت', 'الموارد الماليه', 'win7 64', 'gigbyte technology co.,ltd GA-MA78LMT-S2', 'AMD Phenom™ ii *2 550', '4GB 2 of 4', 'TOSHIBA DT01AGA050 ATA', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(14, 8, 'PC014', 'محمد رزق', 'الشئون القانونيه', 'win7 64', 'HP compaq dx2400 microtower ', 'intel® core™ 2-Quad CPU Q9550', '4GB 3 of 4', 'ST3250310AS ATA', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(15, 8, 'PC015', 'عزه', 'الشئون القانونيه', 'win7 64', 'HP pro 3500 series', 'intel® core™ i3-3220', '4GB 2 of 4', 'ST500DM002-1BD142', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(16, 8, 'PC016', 'استاذ نور ', 'رئيس مجلس الاداره', 'win10  64', 'dell optiplex 3080', 'intel® core™ i3-10100', '8GB 2 of 4', 'ST1000DM010-2EP102', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(17, 8, 'PC017', 'استاذ كريم (الجهاز الشخصى)', 'المدير الادارى', 'win10  64', 'hp desktop pro MT', 'intel® core™ i3-7100', '4GB 1 of 4', 'WDC WD5000AZLX-60K2TA0', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(18, 8, 'PC018', 'استاذ كريم 2', 'المدير الادارى', 'win7 64', 'dell optiplex 7010', 'intel® core™ i5-2400', '4GB 1 of 4', 'ST3500414CS ATA', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(19, 8, 'PC019', 'هاله (الجهاز الاول جمب الباب كيبورد زراير خضراء)', 'مخزن صيدليه', 'win 8 64', 'dell optiplex 3040', 'intel® core™ i3-6100', '4GB 1 of 4', 'TOSHIBA DT01ACA050 ', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(20, 8, 'PC020', 'هاله (الجهاز وش الباب متوصل بطابعه)', 'مخزن صيدليه', 'win7 64', 'COMPULAND *', 'intel® Pentium® 4', '4GB 2 of 4', 'WDC WD5000AAKX-003CA0 ATA', 'installing problem ', 'Glob@255255', 'الدور الثالث', 0),
(21, 8, 'PC021', 'المنوعات', 'مخزن المنوعات', 'win7 64', 'dell optiplex 990', 'intel® core™ i3-2100', '8GB 2 of 4', 'ST3500414CS ATA', 'installing problem ', 'Glob@255256', 'الدور الثالث', 0),
(22, 8, 'PCC022', 'الجهاز اللى عند الاكسيس اللى بايظه', 'الكلى', 'win7 64', 'gigbyte technology co.,ltd G41MT-S2PT', 'intel® Pentium® 4', '4GB 1 of 4', 'ST500DM002-1BD142 ATA', 'installing problem ', 'Glob@255255', 'الدور الثانى', 0),
(23, 8, 'PC023', 'ا ايمان', 'مجلس الاداره', 'win7 64', 'dell optiplex 3010', 'intel® core™ i3-3220', '4GB 1 of 4', 'WDC WD5000AAKX-75U6AA0 ATA', 'installing problem ', 'Glob@255255', 'الدورالاول', 0),
(24, 8, 'PC024', 'ا امانى', 'مجلس الاداره', 'win7 64', 'dell optiplex 3020', 'intel® core™ i3-4150', '4GB 1 of 4', 'WDC WD5000AAKX-75U6AA0 ATA', 'installing problem ', 'Glob@255255', 'الدورالاول', 0),
(25, 8, 'PC025', 'امل ', 'مخزن تغذيه', 'win7 64', 'dell optiplex 990', 'intel® core™ i3-2100', '8GB 2 of 4', 'ST3500414CS ', 'installing problem ', 'Glob@255255', 'الدورالاول', 0),
(26, 8, 'PC026', 'استاذ مصطفى', 'مكتب الدخول', 'win7 64', 'dell optiplex 790', 'intel® core™ i3-2120', '8GB 2 of 4', 'WDC WD5000AVCS-612DY SCSI', 'installing problem ', 'Glob@255255', 'الدور الارضى', 0),
(27, 8, 'PC027', 'امنيه', 'مكتب الدخول', 'win7 64', 'hp desktop pro MT', 'intel® core™ i3-7100', '4GB 1 of 4', 'ST350041 4CS SCSI', 'installing problem ', 'Glob@255255', 'الدور الارضى', 0),
(28, 8, 'PC028', 'متوصل ب اول جهاز للتحاليل فى المعمل اسمه medonic', 'معمل التحاليل خلف الريسبشن ', 'win10  64', 'LENOVO 7360D47', 'intel® Celeron ® ', '4GB 2 of 4', 'Hitachi HDS721050CLA360', 'installing problem ', 'Glob@255255', 'الدور الارضى', 0),
(29, 8, 'PC029', 'متوصل بطابعه laser jet pro M402n', 'معمل التحاليل خلف الريسبشن ', 'win7 64', 'dell optiplex 3050', 'intel® core™ i3-7100', '4GB 1 of 4', 'ST350041 4CS ATA', 'installing problem ', 'Glob@255255', 'الدور الارضى', 0),
(30, 8, 'PC030', 'علي الرخامه اللى في النص متوصل بجهاز طبى ضخم', 'معمل التحاليل خلف الريسبشن ', 'win7 64', 'dell optiplex 3050', 'intel® core™ i3-7100', '4GB 1 of 4', 'WDC WD5000AZLX-75K2TA0 ATA', 'installing problem ', 'Glob@255255', 'الدور الارضى', 0),
(31, 8, 'PC031', 'السيرفر', 'معمل التحاليل جانب الريسبشن', 'win server 2012 R2 Datacenter', 'dell optiplex 3060', 'intel® core™ i5-8500', '8GB 2 of 4', 'TOSHIBA DT01ACA100', 'installing problem ', 'Glob@255255', 'الدور الارضى', 0),
(32, 8, 'PC032', 'متوصل بجهاز طبى autolumo', 'معمل التحاليل جانب الريسبشن', 'win10  64', 'LENOVO 11BAA0KYCD', 'intel® core™ i3-9100', '4GB 1 of 4', 'TOSHIBA DT01ACA100', 'installing problem ', 'Glob@255255', 'الدور الارضى', 0),
(33, 8, 'PC033', 'الجهاز اللى من بره ', 'ريسبشن معمل التحاليل', 'win7 64', 'dell optiplex 3050', 'intel® core™ i3-7100', '4GB 1 of 4', 'ST500DM009-2F110A ATA', 'installing problem ', 'Glob@255255', 'الدور الارضي', 0),
(34, 8, 'PC034', 'الجهاز اللى من جوه', 'ريسبشن معمل التحاليل', 'win7 64', 'dell optiplex 7010', 'intel® core™ i5-3570', '4GB 2 of 4', 'ST500DM002-1BD142 ATA', 'installing problem ', 'Glob@255255', 'الدور الارضى', 0),
(35, 8, 'PC035', 'الجهاز اللي بره ', 'مركز الاشعه العاديه ', 'win7 64', 'dell optiplex 755', 'intel® core™ 2 Duo', '4GB 3 of 4', 'Hitachi HDS721616PLA380 ATA', 'installing problem ', 'Glob@255255', 'الدور الارضى', 0),
(36, 8, 'PC036', 'الجهاز اللي جوه ', 'مركز الاشعه العاديه ', 'win10  64', 'dell optiplex 3070', 'intel® core™ i5-9500', '4GB 1 of 4', 'ST1000DM010-2EP102', 'installing problem ', 'Glob@255255', 'الدور الارضى', 0),
(37, 8, 'PC037', '(د سميره)', 'اشعه السونار', 'win 7 64', 'dell optiplex 3010', 'intel® core™ i3-3220', '8GB 2 of 4', 'ST350041 4CS SCSI ', 'installing problem ', 'Glob@255255', 'الدور الارضى', 0),
(38, 8, 'PC038', 'جها شباك الدفع امام مكتب الدخول(ساره)', 'مكتب حسابات المرضى', 'مكتب حسابات المرضى', 'HP compaq dc7700 small from factor', 'intel® core™ 2 Duo 6700', '2GB 2 of 4', 'ST500M002-1BD142 ATA', 'installing problem ', '', '', 0),
(39, 8, 'PC038', 'جها شباك الدفع امام مكتب الدخول(ساره)', 'مكتب حسابات المرضى', 'win7 64', 'HP compaq dc7700 small from factor', 'intel® core™ 2 Duo 6700', '2GB 2 of 4', 'ST500M002-1BD142 ATA', 'installing problem ', 'Glob@255255', 'الدور الارضى', 0),
(40, 8, 'PC039', 'جهاز 1 خارجى غرفه قريبه من البوابه  الجهاز اللى من جوه عالشمال ', 'الخزنه', 'win7 64', 'dell optiplex 3010', 'intel® core™ i3-3220', '4GB 1 of 4', 'ST3500414CS ATA', 'installing problem ', 'Glob@255256', 'الدور الارضى', 0),
(41, 8, 'PC040', 'جهاز 2 خارجى غرفه قريبه من البوابه (سيد)', 'الخزنه', 'win7 64', 'dell optiplex 3010', 'intel® core™ i3-3220', '4GB 1 of 4', 'WDC WD3200AAJS-00L ATA', 'installing problem ', 'Glob@255257', 'الدور الارضى', 0),
(42, 8, 'PC041', 'جهاز 3 خارجى غرفه قريبه من البوابه (جمب سيد)', 'الخزنه', 'win7 64', 'dell optiplex 3010', 'intel® core™ i3-3220', '4GB 1 of 4', 'ST3500414CS ATA', 'installing problem ', 'Glob@255258', 'الدور الارضى', 0);

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

--
-- Table structure for table `client_files`
--

CREATE TABLE `client_files` (
  `id` int(11) NOT NULL,
  `contract_id` int(11) DEFAULT NULL,
  `file_name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `contracts`
--

CREATE TABLE `contracts` (
  `id` int(11) NOT NULL,
  `contract_status` varchar(50) DEFAULT NULL,
  `client_name` varchar(200) DEFAULT NULL,
  `contact_person` varchar(200) DEFAULT NULL,
  `job_title` varchar(200) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `payment_plan` varchar(50) DEFAULT NULL,
  `visits` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `contract_value` decimal(10,2) NOT NULL DEFAULT 0.00,
  `currency` varchar(10) DEFAULT NULL,
  `location_link` text DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `contract_duration` int(11) DEFAULT NULL COMMENT 'مدة العقد بالشهور',
  `contract_file` text DEFAULT NULL,
  `client_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `contracts`
--

INSERT INTO `contracts` (`id`, `contract_status`, `client_name`, `contact_person`, `job_title`, `phone`, `address`, `payment_plan`, `visits`, `created_at`, `contract_value`, `currency`, `location_link`, `start_date`, `end_date`, `contract_duration`, `contract_file`, `client_id`) VALUES
(2, 'جاري', 'جولدن فوياج ', 'Mr. Mohamed Shaban', 'CEO', '01140685555', 'المعادى - عين الحياة \r\n5,000- غير شامل ضريبه المبيعات ', '6', 4, '2026-06-13 11:14:58', 5000.00, 'EGP', 'https://maps.app.goo.gl/g3oqzS99djznrz486?g_st=ipc', '2026-04-20', '2026-10-20', 12, '', 0),
(3, 'جاري', 'kabaa bazar', NULL, NULL, '01140685555', NULL, NULL, NULL, '2026-06-13 11:37:36', 0.00, NULL, NULL, NULL, NULL, NULL, NULL, 0),
(4, 'جاري', 'ميتالتك ', 'م. شيماء صقر', 'CEO', '01050898142', 'التجمع - قليوبيه', 'شهري', 1, '2026-06-14 07:31:37', 3000.00, 'EGP', 'https://www.google.com/maps?q=30.1571679,31.2218388&z=17&hl=en', '2026-04-01', '2027-01-14', 12, 'contracts_files/1783865179_Globnetwork maintenance contract -Metal tech 2026-2027 (1).pdf', 0),
(5, 'جاري', 'ارك زوون ', 'م.محمد  سمارة', 'CEO', '01066614824', 'مدينة نصر', 'شهري', 2, '2026-06-14 07:38:16', 3300.00, 'EGP', '', '2026-04-01', '2027-01-14', 12, '', 0),
(6, 'جاري', 'ريبرندينج', 'ياسين محى -', 'Billing', '01156671577', '', '1', 4, '2026-06-14 07:41:33', 7000.00, 'EGP', 'https://maps.google.com/?q=30.112911,31.335041', '2026-05-01', '2026-07-14', 12, '', 0),
(7, 'جاري', 'إسكان', 'مدحت القاضى', 'المدير العام', '01096066614', 'الدقى', 'شهري', 2, '2026-06-14 07:44:26', 5000.00, 'EGP', 'https://maps.google.com/?q=30.055504,31.203060', '2026-06-14', '2027-01-14', 12, '', 0),
(8, 'جاري', 'مستشفى الريان الخيرى 2', 'ايمان عبد الرحمن ', 'CEO', '01002338168', 'المعادى - العميل يحتاج فاتوره ضريبيه', 'شهري', 1, '2026-06-14 07:49:31', 8000.00, 'EGP', 'https://maps.google.com/?q=30.112911,31.335041', '2026-05-01', '2027-05-01', 12, '', 0),
(9, 'جاري', 'Zoho Egypt', 'مونيكا توفيق', 'Operation', '01119984730', 'التجمع الخامس ', '12', 1, '2026-06-14 07:53:51', 12000.00, 'EGP', '', '2026-06-14', '2027-01-14', 12, '', 0),
(10, 'جاري', 'Asset', 'Essra', 'Operation', '01214448351', '', '1', 3, '2026-06-14 07:58:34', 8000.00, 'EGP', '', '2026-05-01', '2026-07-01', 2, '', 0),
(11, 'جاري', 'شركة حراء العقارية', NULL, NULL, '0100161150', NULL, NULL, NULL, '2026-06-14 11:50:54', 0.00, NULL, NULL, NULL, NULL, NULL, NULL, 0);

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

--
-- Table structure for table `contract_payments`
--

CREATE TABLE `contract_payments` (
  `id` int(11) NOT NULL,
  `contract_id` int(11) DEFAULT NULL,
  `payment_date` date DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `status` varchar(20) DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `contract_payments`
--

INSERT INTO `contract_payments` (`id`, `contract_id`, `payment_date`, `amount`, `notes`, `created_at`, `status`) VALUES
(1, 1, '2026-06-14', 83333.33, NULL, '2026-06-13 11:00:29', 'paid'),
(2, 1, '2026-07-14', 83333.33, NULL, '2026-06-13 11:00:29', 'pending'),
(3, 1, '2026-08-14', 83333.33, NULL, '2026-06-13 11:00:29', 'pending'),
(4, 1, '2026-09-14', 83333.33, NULL, '2026-06-13 11:00:29', 'pending'),
(5, 1, '2026-10-14', 83333.33, NULL, '2026-06-13 11:00:29', 'pending'),
(6, 1, '2026-11-14', 83333.33, NULL, '2026-06-13 11:00:29', 'pending'),
(7, 1, '2026-12-14', 83333.33, NULL, '2026-06-13 11:00:29', 'pending'),
(8, 1, '2027-01-14', 83333.33, NULL, '2026-06-13 11:00:29', 'pending'),
(9, 1, '2027-02-14', 83333.33, NULL, '2026-06-13 11:00:29', 'pending'),
(10, 1, '2027-03-14', 83333.33, NULL, '2026-06-13 11:00:29', 'pending'),
(11, 1, '2027-04-14', 83333.33, NULL, '2026-06-13 11:00:29', 'pending'),
(12, 1, '2027-05-14', 83333.33, NULL, '2026-06-13 11:00:29', 'pending'),
(13, 2, '2026-04-20', 2500.00, NULL, '2026-06-17 08:17:40', 'pending'),
(14, 2, '2026-10-20', 2500.00, NULL, '2026-06-17 08:17:40', 'pending'),
(15, 8, '2026-05-01', 666.67, NULL, '2026-06-17 08:19:14', 'pending'),
(16, 8, '2026-06-01', 666.67, NULL, '2026-06-17 08:19:14', 'pending'),
(17, 8, '2026-07-01', 666.67, NULL, '2026-06-17 08:19:14', 'pending'),
(18, 8, '2026-08-01', 666.67, NULL, '2026-06-17 08:19:14', 'pending'),
(19, 8, '2026-09-01', 666.67, NULL, '2026-06-17 08:19:14', 'pending'),
(20, 8, '2026-10-01', 666.67, NULL, '2026-06-17 08:19:14', 'pending'),
(21, 8, '2026-11-01', 666.67, NULL, '2026-06-17 08:19:14', 'pending'),
(22, 8, '2026-12-01', 666.67, NULL, '2026-06-17 08:19:14', 'pending'),
(23, 8, '2027-01-01', 666.67, NULL, '2026-06-17 08:19:14', 'pending'),
(24, 8, '2027-02-01', 666.67, NULL, '2026-06-17 08:19:14', 'pending'),
(25, 8, '2027-03-01', 666.67, NULL, '2026-06-17 08:19:14', 'pending'),
(26, 8, '2027-04-01', 666.67, NULL, '2026-06-17 08:19:14', 'pending');

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

--
-- Table structure for table `customers`
--

CREATE TABLE `customers` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `phone1` varchar(50) DEFAULT NULL,
  `phone1_name` varchar(100) DEFAULT NULL,
  `phone2` varchar(50) DEFAULT NULL,
  `phone2_name` varchar(100) DEFAULT NULL,
  `email1` varchar(255) DEFAULT NULL,
  `email2` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `engineers`
--

CREATE TABLE `engineers` (
  `id` int(11) NOT NULL,
  `name` varchar(150) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `email` varchar(150) DEFAULT NULL,
  `specialization` varchar(150) DEFAULT NULL,
  `contract_file` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `engineers`
--

INSERT INTO `engineers` (`id`, `name`, `phone`, `email`, `specialization`, `contract_file`) VALUES
(1, 'م أشرف عبد الله', '', '', 'CEO', ''),
(2, 'م محمود محمد أحمد', '', '', 'أنفرا', ''),
(3, 'م رامى رجب ', '', '', 'G I M', ''),
(4, 'م فتحى', '', '', 'برمجه و شبكات', ''),
(5, 'م أسلام', '', '', 'شبكات', ''),
(6, 'م محمد طنطاوى', '', '', 'شبكات ', '');

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

--
-- Table structure for table `engineer_sessions`
--

CREATE TABLE `engineer_sessions` (
  `id` int(11) NOT NULL,
  `engineer_id` int(11) DEFAULT NULL,
  `login_time` datetime DEFAULT NULL,
  `logout_time` datetime DEFAULT NULL,
  `status` varchar(20) DEFAULT 'active'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `engineer_tracking`
--

CREATE TABLE `engineer_tracking` (
  `id` int(11) NOT NULL,
  `session_id` int(11) DEFAULT NULL,
  `engineer_id` int(11) DEFAULT NULL,
  `latitude` varchar(50) DEFAULT NULL,
  `longitude` varchar(50) DEFAULT NULL,
  `track_time` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `invoices`
--

CREATE TABLE `invoices` (
  `id` int(11) NOT NULL,
  `contract_id` int(11) NOT NULL,
  `invoice_date` datetime DEFAULT current_timestamp(),
  `total_amount` decimal(10,2) DEFAULT 0.00,
  `sub_total` decimal(10,2) DEFAULT 0.00,
  `tax_percent` decimal(5,2) DEFAULT 0.00,
  `tax_amount` decimal(10,2) DEFAULT 0.00,
  `notes` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `invoice_installments`
--

CREATE TABLE `invoice_installments` (
  `id` int(11) NOT NULL,
  `invoice_id` int(11) DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `status` varchar(50) DEFAULT 'unpaid'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `invoice_installments`
--

INSERT INTO `invoice_installments` (`id`, `invoice_id`, `amount`, `due_date`, `status`) VALUES
(1, 1, 15.00, '2026-06-19', 'unpaid'),
(2, 2, 120.00, '2026-06-20', 'unpaid');

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

--
-- Table structure for table `pages`
--

CREATE TABLE `pages` (
  `id` int(11) NOT NULL,
  `page_key` varchar(100) NOT NULL,
  `page_name` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `pages`
--

INSERT INTO `pages` (`id`, `page_key`, `page_name`) VALUES
(1, 'dashboard.php', 'لوحة التحكم الرئيسية'),
(2, 'add_asset.php', 'إضافة أصل جديد'),
(3, 'add_contract.php', 'إضافة عقد جديد'),
(4, 'add_engineer.php', 'إضافة مهندس'),
(5, 'add_quotation.php', 'إضافة عرض سعر'),
(6, 'add_user.php', 'إضافة مستخدم'),
(7, 'calendar.php', 'التقويم والمواعيد'),
(8, 'client_dashboard.php', 'لوحة تحكم العميل'),
(9, 'client_profile.php', 'ملف العميل الشخصي'),
(10, 'contracts.php', 'إدارة العقود'),
(11, 'customer_details.php', 'تفاصيل العميل'),
(12, 'customers.php', 'إدارة العملاء'),
(13, 'edit_contract.php', 'تعديل عقد'),
(14, 'edit_invoice.php', 'تعديل فاتورة'),
(15, 'edit_product.php', 'تعديل صنف / منتج'),
(16, 'edit_purchase.php', 'تعديل فاتورة شراء'),
(17, 'edit_sale.php', 'تعديل فاتورة بيع'),
(18, 'edit_supplier.php', 'تعديل بيانات مورد'),
(19, 'edit_user.php', 'تعديل مستخدم'),
(20, 'engineer_dashboard.php', 'لوحة تحكم المهندس'),
(21, 'engineer_profile.php', 'ملف المهندس الشخصي'),
(22, 'engineer_tracking.php', 'تتبع حركة المهندس'),
(23, 'engineers_live_map.php', 'خريطة المهندسين المباشرة'),
(24, 'engineers.php', 'إدارة المهندسين'),
(25, 'inventory_dashboard.php', 'لوحة تحكم المخزون'),
(26, 'live_engineers_map.php', 'خريطة المهندسين الحية'),
(27, 'print_invoice.php', 'طباعة فاتورة'),
(28, 'print_purchase.Php', 'طباعة فاتورة شراء'),
(29, 'products.php', 'إدارة المنتجات'),
(30, 'purchases.php', 'إدارة المشتريات'),
(31, 'quotations.php', 'قائمة عروض الأسعار'),
(32, 'sales.php', 'إدارة المبيعات'),
(33, 'supplier_invoices.php', 'فواتير الموردين'),
(34, 'suppliers.php', 'إدارة الموردين'),
(35, 'users.php', 'إدارة المستخدمين والصلاحيات'),
(36, 'view_quotation.php', 'عرض عرض السعر');

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

--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `page_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` (`id`, `user_id`, `page_id`) VALUES
(1, 1, 2),
(2, 1, 3),
(3, 1, 4),
(4, 1, 5),
(5, 1, 6),
(6, 1, 7),
(7, 1, 8),
(8, 1, 9),
(9, 1, 10),
(10, 1, 12),
(11, 1, 11),
(12, 1, 1),
(13, 1, 13),
(14, 1, 14),
(15, 1, 15),
(16, 1, 16),
(17, 1, 17),
(18, 1, 18),
(19, 1, 19),
(20, 1, 24),
(21, 1, 23),
(22, 1, 20),
(23, 1, 21),
(24, 1, 22),
(25, 1, 25),
(26, 1, 26),
(27, 1, 27),
(28, 1, 28),
(29, 1, 29),
(30, 1, 30),
(31, 1, 31),
(32, 1, 32),
(33, 1, 34),
(34, 1, 33),
(35, 1, 35),
(36, 1, 36),
(64, 13, 1),
(65, 13, 4),
(66, 13, 7),
(67, 14, 1),
(68, 14, 2),
(69, 14, 3),
(70, 14, 4),
(71, 14, 5),
(72, 14, 6),
(73, 14, 7),
(74, 14, 8),
(75, 14, 9),
(76, 14, 10),
(77, 14, 11),
(78, 14, 12),
(79, 14, 13),
(80, 14, 14),
(81, 14, 15),
(82, 14, 16),
(83, 14, 17),
(84, 14, 18),
(85, 14, 19),
(86, 14, 20),
(87, 14, 21),
(88, 14, 22),
(89, 14, 23),
(90, 14, 24),
(91, 14, 25),
(92, 14, 26),
(93, 14, 27),
(94, 14, 28),
(95, 14, 29),
(96, 14, 30),
(97, 14, 31),
(98, 14, 32),
(99, 14, 33),
(100, 14, 34),
(101, 14, 35),
(102, 14, 36);

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

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` int(11) NOT NULL,
  `p_name` varchar(255) NOT NULL,
  `category` varchar(100) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `brand` varchar(100) DEFAULT NULL,
  `supplier_id` int(11) DEFAULT NULL,
  `quantity` int(11) DEFAULT 0,
  `buying_price` decimal(10,2) DEFAULT 0.00,
  `selling_price` decimal(10,2) DEFAULT 0.00,
  `min_quantity` int(11) DEFAULT 5,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `barcode` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `products`
--

INSERT INTO `products` (`id`, `p_name`, `category`, `description`, `brand`, `supplier_id`, `quantity`, `buying_price`, `selling_price`, `min_quantity`, `created_at`, `barcode`) VALUES
(3, 'UCM Series  - 6300 A', 'IP PBX / VoIP Central', 'Enterprise-grade IP PBX solution supporting HD voice, video conferencing, SIP trunk/accounts, call recording, IVR, remote extensions, and unified communication management', 'GrandStream', 2, 10, 0.00, 0.00, 10, '2026-06-13 10:28:51', NULL),
(4, 'UCM 6304A', 'IP PBX / VoIP Central', 'Enterprise-grade IP PBX solution supporting HD voice, video conferencing, SIP trunk/accounts, call recording, IVR, remote extensions, and unified communication management', 'GrandStream ', 2, 10, 0.00, 0.00, 5, '2026-06-13 10:37:34', NULL),
(6, 'P520', 'IP PBX / VoIP Central', 'Compact IP PBX supporting up to 20 users with HD voice, SIP trunk support, IVR, call recording, and remote extensions', 'Yeastar', 3, 10, 18200.00, 21000.00, 10, '2026-06-13 10:49:50', NULL),
(7, 'P520 - License - Enterprise', 'IP PBX / VoIP Central', 'The Yeastar P520 Enterprise Plan is an annual add-on software license that upgrades the Yeastar P520 IP PBX into a full-featured unified communications platform', 'Yeastar', 3, 10, 7280.00, 10000.00, 10, '2026-06-13 10:57:05', NULL),
(8, 'P520 - License - Enterprise', 'IP PBX / VoIP Central', 'The Yeastar P520 Enterprise Plan is an annual add-on software license that upgrades the Yeastar P520 IP PBX into a full-featured unified communications platform', 'Yeastar', 3, 10, 7280.00, 10000.00, 10, '2026-06-13 10:57:39', NULL),
(10, 'CAT7305M', 'Network Cables', 'كابلات برولينك 305 متر', 'Prolink', 2, 5, 0.00, 0.00, 5, '2026-06-13 11:49:13', NULL),
(11, 'Rack 6 U', 'Racks & Cabinets', 'Wall Mount Rack', 'Pro-Rack', 2, 3, 0.00, 0.00, 5, '2026-06-13 11:50:46', NULL),
(12, 'Rack 9 U', 'Racks & Cabinets', 'Wall Mount Rack', 'Pro-Rack', 2, 3, 0.00, 0.00, 5, '2026-06-13 11:51:34', NULL),
(13, 'TA810 Series', 'IP PBX / VoIP Central', 'Analog VoIP gateway with FXO ports for connecting traditional PSTN landlines to IP PBX systems, supporting SIP protocol, HD voice, and easy deployment', 'Yeastar', 3, 5, 0.00, 0.00, 5, '2026-06-15 04:32:27', NULL),
(14, 'TA810 Series', 'IP PBX / VoIP Central', 'Analog VoIP gateway with FXO ports for connecting traditional PSTN landlines to IP PBX systems, supporting SIP protocol, HD voice, and easy deployment', 'Yeastar', 3, 5, 0.00, 0.00, 5, '2026-06-15 04:32:58', NULL),
(15, 'TA810 Series', 'IP PBX / VoIP Central', 'Analog VoIP gateway with FXO ports for connecting traditional PSTN landlines to IP PBX systems, supporting SIP protocol, HD voice, and easy deployment', 'Yeastar', 3, 5, 0.00, 0.00, 5, '2026-06-15 04:33:22', NULL),
(16, 'TA810 Series', 'IP PBX / VoIP Central', 'Analog VoIP gateway with FXO ports for connecting traditional PSTN landlines to IP PBX systems, supporting SIP protocol, HD voice, and easy deployment', 'Yeastar', 3, 5, 0.00, 0.00, 5, '2026-06-15 04:33:33', NULL),
(19, 'UH42', 'IP PBX / VoIP Central', 'Yealink UH42 USB-C/A Mono Headset With Mic For PC Computer, Wired Headphones Teams Certified, Noise Cancelling Microphone, In-Line Controls, All Day Comfort', 'Yealink', 3, 5, 0.00, 0.00, 5, '2026-06-15 06:54:58', NULL),
(20, 'T30P', 'IP PBX / VoIP Central', 'A classic IP phone for small business users, the SIP-T30P delivers a fashionable and user-friendly dialing experience', 'Yealink', 3, 5, 1560.00, 0.00, 5, '2026-06-15 06:57:17', NULL),
(21, 'TG400', 'IP PBX / VoIP Central', '4-channel GSM VoIP gateway supporting SIP and GSM networks, enabling cost-effective mobile-to-VoIP communication with reliable voice quality and easy integration with IP PBX systems', 'Yeastar', 3, 5, 49920.00, 0.00, 5, '2026-06-15 07:00:04', NULL),
(22, 'TA810 Series', 'IP PBX / VoIP Central', 'Analog VoIP gateway with FXO ports for connecting traditional PSTN landlines to IP PBX systems, supporting SIP protocol, HD voice, and easy deployment', 'Yeastar', 3, 5, 0.00, 0.00, 5, '2026-06-15 07:03:16', NULL),
(23, 'O2 Module', 'IP PBX / VoIP Central', '2 RJ11 FXO Ports', 'Yeastar', 3, 5, 0.00, 0.00, 5, '2026-06-15 07:04:35', NULL),
(25, 'VoIP FXO Gateway', 'IP PBX / VoIP Central', 'Analog VoIP gateway with FXO ports for connecting traditional PSTN landlines to IP PBX systems, supporting SIP protocol, HD voice, and easy deployment', 'Yeastar', 3, 5, 0.00, 0.00, 5, '2026-06-15 08:22:54', NULL),
(26, 'TG400', 'VoIP GSM Gateway', '4-channel GSM VoIP gateway supporting SIP and GSM networks, enabling cost-effective mobile-to-VoIP communication with reliable voice quality and easy integration with IP PBX systems', 'Yeastar', 3, 5, 49920.00, 0.00, 5, '2026-06-15 08:27:09', NULL),
(27, 'TG400', 'VoIP GSM Gateway', '4-channel GSM VoIP gateway supporting SIP and GSM networks, enabling cost-effective mobile-to-VoIP communication with reliable voice quality and easy integration with IP PBX systems', 'Yeastar', 3, 5, 49920.00, 0.00, 5, '2026-06-15 08:29:26', NULL),
(28, 'UH34 Dual', 'Headsets', 'Professional USB headset with HD audio, noise cancelling microphone, and comfortable lightweight design for office and call center use', 'Yealink', 3, 5, 1820.00, 2000.00, 5, '2026-06-15 08:32:27', NULL),
(29, 'UH42', 'Headsets', 'Yealink UH42 USB-C/A Mono Headset With Mic For PC Computer, Wired Headphones Teams Certified, Noise Cancelling Microphone, In-Line Controls, All Day Comfort', 'Yealink', 3, 5, 0.00, 0.00, 5, '2026-06-15 08:34:04', NULL),
(30, 'P560', 'IP PBX / VoIP Central', 'Advanced IP PBX supporting up to 100 users with HD audio, remote working, call recording, CRM integration, and unified communication features', 'Yeastar', 3, 5, 0.00, 0.00, 5, '2026-06-15 08:38:46', NULL),
(31, 'P550', 'IP PBX / VoIP Central', 'Business IP PBX supporting up to 50 users with unified communications, HD voice, SIP integration, IVR, and call center features', 'Yeastar', 3, 5, 0.00, 0.00, 5, '2026-06-15 08:40:40', NULL),
(32, 'P520 - License - Enterprise', 'IP PBX / VoIP Central', 'The Yeastar P520 Enterprise Plan is an annual add-on software license that upgrades the Yeastar P520 IP PBX into a full-featured unified communications platform', 'Yeastar', 3, 5, 7280.00, 10000.00, 5, '2026-06-15 08:43:58', NULL),
(33, 'GrandStream 4-port VoIP gateway (HT841)', 'VOIP LandLine Gateway', 'The HT841 is a powerful 4-port VoIP gateway with 4 FXS ports and an integrated Gigabit NAT router. Built for users looking for a strong analog-to-VoIP converter', 'Grandstream', 3, 5, 8715.00, 9100.00, 5, '2026-06-15 08:57:41', NULL),
(34, 'GrandStream 8-port VoIP gateway (HT818 v2)', 'VOIP LandLine Gateway', 'The GUV3000 is HD USB Headsets that pair with Laptops,Computers, IP Telephones and other devices to offer high quality sound ', 'Grandstream', 3, 5, 1417.00, 1500.00, 5, '2026-06-15 08:59:47', NULL);

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

--
-- Table structure for table `purchases`
--

CREATE TABLE `purchases` (
  `id` int(11) NOT NULL,
  `product_id` int(11) DEFAULT NULL,
  `supplier_id` int(11) DEFAULT NULL,
  `p_name` varchar(255) DEFAULT NULL,
  `quantity` int(11) DEFAULT NULL,
  `purchase_price` decimal(10,2) DEFAULT NULL,
  `purchase_date` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `quotations`
--

CREATE TABLE `quotations` (
  `id` int(11) NOT NULL,
  `customer_name` varchar(255) NOT NULL,
  `tax_percentage` decimal(5,2) DEFAULT 0.00,
  `special_terms` text DEFAULT NULL,
  `grand_total` decimal(10,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `quotations`
--

INSERT INTO `quotations` (`id`, `customer_name`, `tax_percentage`, `special_terms`, `grand_total`, `created_at`) VALUES
(1, 'Ora Dev.', 14.00, 'Down Payment \r\n20% in advance \r\n80% after installation', 25992.00, '2026-06-17 11:18:34');

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

--
-- Table structure for table `quotation_items`
--

CREATE TABLE `quotation_items` (
  `id` int(11) NOT NULL,
  `quotation_id` int(11) NOT NULL,
  `product_name` varchar(255) NOT NULL,
  `quantity` int(11) NOT NULL,
  `selling_price` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `quotation_items`
--

INSERT INTO `quotation_items` (`id`, `quotation_id`, `product_name`, `quantity`, `selling_price`) VALUES
(1, 1, 'P520', 1, 21000.00),
(2, 1, 'T30P', 1, 1800.00);

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

--
-- Table structure for table `received_payments`
--

CREATE TABLE `received_payments` (
  `id` int(11) NOT NULL,
  `contract_id` int(11) DEFAULT NULL,
  `payment_date` date DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `payment_method` varchar(50) DEFAULT NULL,
  `notes` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `received_payments`
--

INSERT INTO `received_payments` (`id`, `contract_id`, `payment_date`, `amount`, `payment_method`, `notes`) VALUES
(1, 1, '2026-06-14', 83333.33, 'نقدي', ''),
(2, 2, '2026-04-20', 2500.00, 'نقدي', '');

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

--
-- Table structure for table `sales`
--

CREATE TABLE `sales` (
  `id` int(11) NOT NULL,
  `customer_name` varchar(255) DEFAULT NULL,
  `product_id` int(11) DEFAULT NULL,
  `p_name` varchar(255) DEFAULT NULL,
  `quantity` int(11) DEFAULT NULL,
  `buying_price` decimal(10,2) DEFAULT NULL,
  `selling_price` decimal(10,2) DEFAULT NULL,
  `sale_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `invoice_id` int(11) DEFAULT NULL,
  `quantity_delivered` int(11) DEFAULT 0,
  `quantity_pending` int(11) DEFAULT 0,
  `delivery_due_date` date DEFAULT NULL,
  `item_barcode` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sales`
--

INSERT INTO `sales` (`id`, `customer_name`, `product_id`, `p_name`, `quantity`, `buying_price`, `selling_price`, `sale_date`, `invoice_id`, `quantity_delivered`, `quantity_pending`, `delivery_due_date`, `item_barcode`) VALUES
(1, NULL, 1, 'سيرفر', 2, 100.00, 500.00, '2026-06-14 09:36:16', 1, 1, 1, '2026-06-23', '125125'),
(2, NULL, 1, 'سيرفر', 1, 100.00, 500.00, '2026-06-14 09:38:31', 2, 1, 0, '2026-06-29', '123'),
(3, NULL, 1, 'سيرفر', 1, 100.00, 500.00, '2026-06-14 09:38:31', 2, 1, 0, '2026-06-28', '1234'),
(4, NULL, 5, 'فلاشه', 1, 100.00, 100.00, '2026-06-14 10:08:23', 3, 1, 0, '2026-06-19', '100'),
(7, NULL, 5, 'فلاشه', 20, 100.00, 100.00, '2026-06-14 10:22:10', 4, 15, 5, '2026-06-10', '200'),
(8, NULL, 1, 'سيرفر', 2, 100.00, 500.00, '2026-06-14 10:22:10', 4, 1, 1, '2026-06-22', '150');

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

--
-- Table structure for table `suppliers`
--

CREATE TABLE `suppliers` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `suppliers`
--

INSERT INTO `suppliers` (`id`, `name`, `phone`, `address`, `created_at`) VALUES
(2, 'Brand Connection', '', 'التجمع الخامس', '2026-06-13 10:32:12'),
(3, 'Provad', '', 'مصر الجديده', '2026-06-13 10:32:21'),
(5, 'محمد - ديجتال دريمز', '01004402290', 'مصر الجديدة', '2026-06-13 11:21:47'),
(6, 'الشعار', '01092959721', 'مصر الجديدة', '2026-06-13 11:24:23'),
(7, 'حليم - سمارت زوم', '01066936816', 'التجمع الخامس', '2026-06-13 11:26:37'),
(8, ' تريزا- Smart vision', '01228258502', 'مساكن شيراتون', '2026-06-13 11:27:39'),
(9, 'رضوى - Fiber Me', '01276001166', 'التجمع الخامس', '2026-06-15 06:40:03'),
(10, 'حسين- Gila', '01099917708', 'وسط البلد', '2026-06-15 10:15:03');

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(50) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `username`, `password`) VALUES
(1, 'admin', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi'),
(13, 'test1', '$2y$10$kM0zsJeqf0ikHrLXcQfY/ejrnahb0EP0RYhu9sRXx88NYJuRGaoiG'),
(14, 'eng.ashraf', '$2y$10$igNsXvAW6z0vC1bbjw70QeRozp4HWEkPeOi8E8XFkfdKFj7XAdpkK');

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

--
-- Table structure for table `visits`
--

CREATE TABLE `visits` (
  `id` int(11) NOT NULL,
  `contract_id` int(11) DEFAULT NULL,
  `visit_date` date DEFAULT NULL,
  `engineer_name` varchar(150) DEFAULT NULL,
  `report_file` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `engineer_id` int(11) DEFAULT NULL,
  `client_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `visits`
--

INSERT INTO `visits` (`id`, `contract_id`, `visit_date`, `engineer_name`, `report_file`, `notes`, `engineer_id`, `client_id`) VALUES
(1, 8, '2026-07-11', NULL, '1783776162_Clinic Dr Mohamed Rabie.pdf', NULL, 4, 0);

--
-- Indexes for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Indexes for table `permissions`
--
ALTER TABLE `permissions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `page_id` (`page_id`);

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

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

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

--
-- Indexes for table `quotation_items`
--
ALTER TABLE `quotation_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `quotation_id` (`quotation_id`);

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

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

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `assets_cctv`
--
ALTER TABLE `assets_cctv`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

--
-- AUTO_INCREMENT for table `assets_network`
--
ALTER TABLE `assets_network`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `assets_pcs`
--
ALTER TABLE `assets_pcs`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=43;

--
-- AUTO_INCREMENT for table `client_files`
--
ALTER TABLE `client_files`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `contracts`
--
ALTER TABLE `contracts`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `contract_payments`
--
ALTER TABLE `contract_payments`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;

--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `engineers`
--
ALTER TABLE `engineers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `engineer_sessions`
--
ALTER TABLE `engineer_sessions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `engineer_tracking`
--
ALTER TABLE `engineer_tracking`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `invoices`
--
ALTER TABLE `invoices`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `pages`
--
ALTER TABLE `pages`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;

--
-- AUTO_INCREMENT for table `permissions`
--
ALTER TABLE `permissions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=103;

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35;

--
-- AUTO_INCREMENT for table `purchases`
--
ALTER TABLE `purchases`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `quotations`
--
ALTER TABLE `quotations`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

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

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

--
-- AUTO_INCREMENT for table `sales`
--
ALTER TABLE `sales`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `suppliers`
--
ALTER TABLE `suppliers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `visits`
--
ALTER TABLE `visits`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `quotation_items`
--
ALTER TABLE `quotation_items`
  ADD CONSTRAINT `quotation_items_ibfk_1` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`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 */;
