-- mybase_clean.sql : Structure complète, données conservées uniquement pour lettres_table, marques_transport, menu_items, paiement_mode_table, policy_type, roles_table

-- ...existing code...
-- Table structure for table `clients_table`
DROP TABLE IF EXISTS `clients_table`;
CREATE TABLE IF NOT EXISTS `clients_table` (
  `id` int NOT NULL AUTO_INCREMENT,
  `n_dossier` varchar(15) NOT NULL,
  `client_cin` varchar(10) NOT NULL,
  `client_name` varchar(60) NOT NULL,
  `client_phone` varchar(15) NOT NULL,
  `client_email` varchar(150) NOT NULL,
  `client_genre` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `client_company` varchar(60) NOT NULL,
  `client_adresse` varchar(350) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `client_ice` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `client_cin` (`client_cin`,`client_phone`,`client_email`)
) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- (VIDE)

-- ...existing code...
-- Table structure for table `compagnie_table`
DROP TABLE IF EXISTS `compagnie_table`;
CREATE TABLE IF NOT EXISTS `compagnie_table` (
  `id` int NOT NULL AUTO_INCREMENT,
  `compagnie_name` varchar(60) NOT NULL,
  `adresse` varchar(250) NOT NULL,
  `tel1` varchar(15) NOT NULL,
  `tel2` varchar(15) NOT NULL,
  `fax` varchar(15) NOT NULL,
  `whatsapp` varchar(15) NOT NULL,
  `mail_1` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `mail_2` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `mail_3` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `footer` varchar(250) NOT NULL,
  `facture_ref` varchar(100) NOT NULL,
  `facture_prefixe` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `facture_suffixe` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `use_year_prefix` tinyint NOT NULL DEFAULT '0',
  `use_monthyear_prefix` tinyint NOT NULL DEFAULT '0',
  `use_year_suffix` tinyint NOT NULL DEFAULT '0',
  `use_monthyear_suffix` tinyint NOT NULL DEFAULT '0',
  `reset_number_yearly` tinyint NOT NULL DEFAULT '0',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `logo` varchar(100) NOT NULL,
  `logo_format` enum('wide','square') DEFAULT 'wide',
  `compagnie_ref` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- (VIDE)

-- ...existing code...
-- Table structure for table `facture_table`
DROP TABLE IF EXISTS `facture_table`;
CREATE TABLE IF NOT EXISTS `facture_table` (
  `id` int NOT NULL AUTO_INCREMENT,
  `facture_date` date NOT NULL,
  `facture_num` varchar(100) NOT NULL,
  `libelle` varchar(100) NOT NULL,
  `objet_assure` varchar(100) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `total` decimal(10,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=47 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- (VIDE)

-- ...existing code...
-- Table structure for table `lettres_table`
DROP TABLE IF EXISTS `lettres_table`;
CREATE TABLE IF NOT EXISTS `lettres_table` (
  `id` int NOT NULL AUTO_INCREMENT,
  `lettre` varchar(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- Dumping data for table `lettres_table`
INSERT INTO `lettres_table` (`id`, `lettre`) VALUES
(1, 'أ'),
(5, 'B'),
(3, 'ب'),
(4, ' *'),
(6, 'C'),
(7, 'H');

-- ...existing code...
-- Table structure for table `marques_transport`
DROP TABLE IF EXISTS `marques_transport`;
CREATE TABLE IF NOT EXISTS `marques_transport` (
  `id` int NOT NULL AUTO_INCREMENT,
  `marque` varchar(100) NOT NULL,
  `type` enum('voiture','bus','camion','moto') NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=44 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- Dumping data for table `marques_transport`
INSERT INTO `marques_transport` (`id`, `marque`, `type`) VALUES
(1, 'DACIA', 'voiture'),
(2, 'RENAULT', 'voiture'),
(3, 'PEUGEOT', 'voiture'),
(4, 'HYUNDAI', 'voiture'),
(5, 'KIA', 'voiture'),
(6, 'VOLKSWAGEN', 'voiture'),
(7, 'TOYOTA', 'voiture'),
(8, 'NISSAN', 'voiture'),
(9, 'MERCEDES-BENZ', 'voiture'),
(10, 'BMW', 'voiture'),
(11, 'CITROËN', 'voiture'),
(12, 'FIAT', 'voiture'),
(13, 'FORD', 'voiture'),
(14, 'SUZUKI', 'voiture'),
(16, 'MAN', 'bus'),
(17, 'VOLVO', 'bus'),
(18, 'SCANIA', 'bus'),
(19, 'SETRA', 'bus'),
(20, 'IVECO', 'bus'),
(22, 'VOLVO TRUCKS', 'camion'),
(24, 'DAF', 'camion'),
(26, 'RENAULT TRUCKS', 'camion'),
(27, 'ISUZU', 'camion'),
(28, 'TATA', 'camion'),
(29, 'YAMAHA', 'moto'),
(30, 'HONDA', 'moto'),
(32, 'PIAGGIO', 'moto'),
(33, 'KYMCO', 'moto'),
(34, 'SYM', 'moto'),
(35, 'BAJAJ', 'moto'),
(36, 'DAYUN', 'moto'),
(37, 'VESPA', 'moto');

-- ...existing code...
-- Table structure for table `menu_items`
DROP TABLE IF EXISTS `menu_items`;
CREATE TABLE IF NOT EXISTS `menu_items` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(100) NOT NULL,
  `icon` varchar(50) DEFAULT NULL,
  `link` varchar(255) DEFAULT NULL,
  `parent_id` int DEFAULT NULL COMMENT 'Pour les sous-menus',
  `is_heading` tinyint(1) DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '0',
  `menu_order` int DEFAULT '0',
  `access` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- Dumping data for table `menu_items`
INSERT INTO `menu_items` (`id`, `title`, `icon`, `link`, `parent_id`, `is_heading`, `is_active`, `menu_order`, `access`) VALUES
(1, 'Tableau de bord', 'fas fa-fw fa-tachometer-alt text-danger', 'dashboard.php', NULL, 0, 1, 1, 1),
(2, 'Facturation', 'fas fa-file-invoice text-danger', NULL, NULL, 0, 0, 3, 0),
(3, 'Polices', 'far fa-fw fa-window-maximize text-primary', NULL, NULL, 0, 0, 2, 0),
(4, 'Tableau de Polices', NULL, 'policys_table.php', 3, 0, 0, 0, 0),
(6, 'Clients', 'fas fa-address-card text-warning', NULL, NULL, 0, 0, 4, 0),
(7, 'Nouveau Client', NULL, 'add_client.php', 6, 0, 0, 1, 0),
(8, 'Reçu de Paiement Copie', NULL, 'print_receipt_copy.php', NULL, 1, 0, 5, 0),
(9, 'Utilisateurs', 'fas fa-users fa-2x text-info', NULL, NULL, 0, 0, 6, 3),
(10, 'Liste de clients', NULL, 'clients_table.php', 6, 0, 0, 1, 0),
(11, 'Reçu de Paiement', NULL, 'print_receipt.php', 0, 1, 1, 2, 0),
(12, 'Autorisations utilisateur', NULL, 'manage_permissions.php', 9, 0, 0, 2, 3),
(13, 'Liste d'utilisateurs', NULL, 'users_table.php', 9, 0, 0, 1, 3),
(14, 'Info de Police', NULL, 'info_policy.php', NULL, 1, 1, 1, 0),
(16, 'Modification de Police', NULL, 'edit_policy.php', NULL, 1, 0, 2, 0),
(17, 'Liste de Paiments', NULL, 'liste_paiements_policy.php', NULL, 1, 0, 0, 0),
(18, 'Copier les permissions', NULL, 'copy_permissions.php', 9, 0, 0, 3, 0),
(19, 'Nouvelle police', NULL, 'new_policy.php', 3, 0, 0, 1, 0),
(20, 'Connexion', NULL, 'login.php', NULL, 1, 0, 0, 1),
(21, 'Mot de passe oublié', NULL, 'forgot-password.php', NULL, 1, 0, 0, 1),
(22, 'Vérification du code', NULL, 'verify-code.php', NULL, 1, 0, 0, 0),
(23, 'Informations sur le client', NULL, 'info_client.php', NULL, 1, 0, 0, 0),
(24, 'Modifier un client', NULL, 'edit_client.php', NULL, 1, 0, 0, 0),
(26, 'Reçus de Paiements', NULL, 'liste_recus.php', 27, 0, 0, 0, 0),
(27, 'Paiements', 'fas fa-money-bill fa-2x text-success', NULL, NULL, 0, 0, 2, 0),
(28, 'Banque', NULL, 'liste_cheques_effets.php', 27, 0, 0, 0, 0),
(29, 'Espace Client', NULL, 'espace_client.php', NULL, 1, 0, 0, 0),
(30, 'Caisse', NULL, 'liste_paiements_espece.php', 27, 0, 0, 1, 0),
(31, 'Liste des Factures', NULL, 'liste_factures.php', 2, 0, 1, 1, 0),
(32, 'Facture', NULL, 'facture.php', NULL, 1, 0, 0, 0),
(33, 'Configuration', 'fas fa-solid fa-gear text-dark', NULL, NULL, 0, 0, 7, 0),
(34, 'Ajouter une marque', 'fa-solid fa-car text-warning', 'add_marque.php', 33, 0, 0, 2, 0),
(35, 'Exporter des factures', NULL, 'exportation_factures.php', 2, 0, 0, 1, 0),
(36, 'Configuration Générale', NULL, 'config_compagnie.php', 33, 0, 0, 0, 3),
(37, 'Configuration des Factures', NULL, 'config_facture.php', 33, 0, 0, 1, 3),
(38, 'FAQ', NULL, 'faq.php', 39, 0, 0, 0, 1),
(39, 'Autres', 'fa-solid fa-circle-question text-primary', NULL, NULL, 0, 0, 9, 0),
(40, 'Sauvegarde', NULL, 'backup.php', 64, 0, 0, 0, 0),
(41, 'Journal', NULL, 'view_logs.php', 39, 0, 0, 3, 1),
(42, 'liste de Marques', NULL, 'marques_table.php', 33, 0, 0, 4, 0),
(43, 'Ajouter un Type De police', NULL, 'add_policy_type.php', 33, 0, 0, 5, 0),
(44, 'Liste de Types de Police', NULL, 'policy_types_table.php', 33, 0, 0, 6, 0),
(46, 'Ajouter une Lettre', NULL, 'add_lettre.php', 33, 0, 0, 7, 0),
(47, 'Déconnexion', 'fa-solid fa-arrow-right-from-bracket text-danger', 'logout.php', NULL, 1, 1, 9, 1),
(48, 'Liste de Lettres', NULL, 'lettres_table.php', 33, 0, 0, 8, 0),
(49, 'Appels', NULL, 'appels.php', 3, 0, 0, 2, 0),
(50, 'Échéances d\'aujourd\'hui', NULL, 'echeances_aujourdhui.php', NULL, 1, 0, 0, 0),
(51, 'Rappels Moi', NULL, 'rappels.php', 64, 0, 0, 9, 1),
(52, 'Relevé de compte client', NULL, 'releve_compte.php', NULL, 1, 0, 0, 0),
(53, 'Ajouter un Utilisateur', NULL, 'add_user.php', 9, 0, 0, 0, 3),
(54, 'Mon Profil', NULL, 'profile.php', NULL, 1, 0, 0, 1),
(55, 'Changer le Mot de Passe', NULL, 'change_password.php', NULL, 1, 0, 0, 1),
(56, 'Modifier Mon Profil', NULL, 'edit_profile.php', NULL, 1, 0, 0, 1),
(58, 'Rappels', NULL, 'rappels_jour.php', NULL, 1, 0, 0, 1),
(59, 'Panneau de Contrôle', NULL, 'dashboard_agent.php', NULL, 1, 0, 0, 1),
(60, 'Paiement de la Police', NULL, 'paiement.php', NULL, 1, 0, 0, 0),
(61, 'Reçu de Paiement', NULL, 'recu.php', NULL, 1, 0, 0, 0),
(62, 'Appels Pour les Paiements', NULL, 'appels_paiements_aujourdhui.php', NULL, 1, 0, 0, 0),
(63, 'Infos', NULL, 'infos.php', 39, 0, 0, 5, 3),
(64, 'Outils', 'fa-solid fa-wrench', NULL, NULL, 0, 0, 8, 0);

-- ...existing code...
-- Table structure for table `paiement_mode_table`
DROP TABLE IF EXISTS `paiement_mode_table`;
CREATE TABLE IF NOT EXISTS `paiement_mode_table` (
  `id` int NOT NULL AUTO_INCREMENT,
  `paiement_mode` varchar(60) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- Dumping data for table `paiement_mode_table`
INSERT INTO `paiement_mode_table` (`id`, `paiement_mode`) VALUES
(1, 'ESPECE'),
(2, 'CHEQUE'),
(3, 'EFFET'),
(4, 'VIREMENT BANCAIRE');

-- ...existing code...
-- Table structure for table `policy_type`
DROP TABLE IF EXISTS `policy_type`;
CREATE TABLE IF NOT EXISTS `policy_type` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `risque` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- Dumping data for table `policy_type`
INSERT INTO `policy_type` (`id`, `type`, `risque`) VALUES
(1, 'TRANSPORT MARCHANDISES', 'V'),
(2, 'TRANSPORT VOYAGEURS', 'V'),
(3, 'AUTOMOBILE', 'V'),
(4, 'MOTO', 'V'),
(5, 'MAISON', 'RD'),
(6, 'LOCAL COMMERCIAL', 'RD');

-- ...existing code...
-- Table structure for table `roles_table`
DROP TABLE IF EXISTS `roles_table`;
CREATE TABLE IF NOT EXISTS `roles_table` (
  `id` int NOT NULL AUTO_INCREMENT,
  `role_name` varchar(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- Dumping data for table `roles_table`
INSERT INTO `roles_table` (`id`, `role_name`) VALUES
(1, 'Super admin'),
(2, 'Admin'),
(3, 'Agent');

-- ...existing code...
-- Toutes les autres tables sont vides (structure uniquement)
-- ...existing code...
