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

START TRANSACTION;



--
-- Database: `Gestionnaire`
--

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

--
-- Table structure for table `mm_attendance`
--

CREATE TABLE `mm_attendance` (
  `id` int(11) NOT NULL,
  `staff_id` int(11) NOT NULL,
  `status` enum('present','absent','conge','holiday') NOT NULL DEFAULT 'present',
  `notes` text DEFAULT NULL,
  `holiday_name` varchar(255) DEFAULT NULL,
  `holiday_days` int(11) DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `year` year(4) NOT NULL DEFAULT 0000,
  `month` tinyint(4) NOT NULL DEFAULT 0,
  `day` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `mm_audit_log`
--

CREATE TABLE `mm_audit_log` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `action` varchar(50) NOT NULL,
  `table_name` varchar(50) DEFAULT NULL,
  `record_id` int(11) DEFAULT NULL,
  `old_values` text DEFAULT NULL,
  `new_values` text DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `mm_audit_log`
--

INSERT INTO `mm_audit_log` (`id`, `user_id`, `action`, `table_name`, `record_id`, `old_values`, `new_values`, `ip_address`, `created_at`) VALUES
(1, 1, 'create', 'mm_staff', NULL, NULL, '{\"code\":\"TEST002\",\"full_name\":\"Test Editor\",\"first_name\":\"Test\",\"last_name\":\"Editor\",\"email\":\"editor@example.com\",\"phone\":\"123456789\",\"position\":\"Tester\",\"department\":\"IT\",\"hire_date\":\"2026-03-26\",\"salary\":1000,\"contract_type\":null,\"company\":null,\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":null,\"rib\":null,\"cin\":null,\"cin_copy\":null,\"diploma\":null,\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":null,\"address\":null}', NULL, '2026-03-26 12:24:30'),
(2, 1, 'create', 'mm_staff', NULL, NULL, '{\"code\":\"TEST003\",\"full_name\":\"Test Editor 2\",\"first_name\":\"Test\",\"last_name\":\"Editor2\",\"email\":\"editor2@example.com\",\"phone\":\"123456789\",\"position\":\"Tester\",\"department\":\"IT\",\"hire_date\":\"2026-03-26\",\"salary\":1000,\"contract_type\":null,\"company\":null,\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":null,\"rib\":null,\"cin\":null,\"cin_copy\":null,\"diploma\":null,\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":null,\"address\":null}', NULL, '2026-03-26 12:26:15'),
(3, 1, 'reject', 'mm_staff', NULL, NULL, '{\"code\":\"TEST004\",\"full_name\":\"Test Editor 3\",\"first_name\":\"Test\",\"last_name\":\"Editor3\",\"email\":\"editor3@example.com\",\"phone\":\"123456789\",\"position\":\"Tester\",\"department\":\"IT\",\"hire_date\":\"2026-03-26\",\"salary\":1000,\"contract_type\":null,\"company\":null,\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":null,\"rib\":null,\"cin\":null,\"cin_copy\":null,\"diploma\":null,\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":null,\"address\":null}', NULL, '2026-03-26 12:31:39'),
(4, 1, 'delete', 'mm_staff', 262, '{\"id\":262,\"code\":\"33\",\"full_name\":\"HOUCEM  BOUALAGUI\",\"email\":null,\"phone\":null,\"position\":null,\"department\":null,\"hire_date\":null,\"salary\":\"0.00\",\"is_active\":1,\"created_at\":\"2026-03-13 15:47:15\",\"updated_at\":\"2026-03-13 15:47:15\",\"last_name\":\"BOUALAGUI \",\"first_name\":\"HOUCEM \",\"contract_type\":\"sans contrat\",\"company\":null,\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":null,\"rib\":null,\"cin\":null,\"cin_copy\":null,\"diploma\":null,\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":\"**\",\"address\":\"sbietla\"}', '{\"is_active\":0}', NULL, '2026-03-26 12:38:05'),
(5, 1, 'reject', 'mm_staff', NULL, NULL, '{\"code\":\"98888888888\",\"full_name\":\"test test\",\"first_name\":\"test\",\"last_name\":\"test\",\"email\":\"\",\"phone\":\"\",\"position\":\"techhhh\",\"department\":\"\",\"hire_date\":null,\"salary\":0,\"contract_type\":\"\",\"company\":\"\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"\",\"rib\":\"\",\"cin\":\"\",\"cin_copy\":\"\",\"diploma\":\"\",\"diploma_copy\":\"\",\"diploma_date\":null,\"photo\":\"\",\"cv\":\"\",\"address\":\"\"}', NULL, '2026-03-26 12:42:46'),
(6, 1, 'reject', 'mm_staff', NULL, '{\"id\":243,\"code\":\"11\",\"full_name\":\"ACHREF KORTLI\",\"email\":null,\"phone\":\"92405017\",\"position\":null,\"department\":null,\"hire_date\":null,\"salary\":\"0.00\",\"is_active\":1,\"created_at\":\"2026-03-13 15:47:15\",\"updated_at\":\"2026-03-13 15:47:15\",\"last_name\":\"KORTLI \",\"first_name\":\"ACHREF\",\"contract_type\":\"SIVP\",\"company\":\"TOPGEO\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"poste\",\"rib\":\"17 60 6000 000 366 786 805\",\"cin\":\"12694040\",\"cin_copy\":null,\"diploma\":\"BAC+3\",\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":null,\"address\":\"alayoun kasserine \"}', '{\"is_active\":0}', NULL, '2026-03-26 12:42:51'),
(7, 1, 'delete', 'mm_staff', 242, '{\"id\":242,\"code\":\"10\",\"full_name\":\"BADAIY KORTLI\",\"email\":null,\"phone\":\"95962272\",\"position\":null,\"department\":null,\"hire_date\":null,\"salary\":\"0.00\",\"is_active\":1,\"created_at\":\"2026-03-13 15:47:15\",\"updated_at\":\"2026-03-13 15:47:15\",\"last_name\":\"KORTLI \",\"first_name\":\"BADAIY\",\"contract_type\":\"CIAP\",\"company\":\"TOPGEO\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"POSTE\",\"rib\":\"17 60 6000 000 35 909 34 44\",\"cin\":\"12718533\",\"cin_copy\":null,\"diploma\":\"9 emme\",\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":null,\"address\":\"alayoun kasserine \"}', '{\"is_active\":0}', NULL, '2026-03-26 13:08:28'),
(8, 1, 'reject', 'mm_staff', NULL, '{\"id\":233,\"code\":\"1\",\"full_name\":\"saadaly ziedd\",\"email\":\"zied.saadli@topgeo.net\",\"phone\":\"98654321\",\"position\":\"Technicien Topography\",\"department\":\"Topography\",\"hire_date\":\"2026-03-01\",\"salary\":\"1000.00\",\"is_active\":1,\"created_at\":\"2026-03-13 15:47:14\",\"updated_at\":\"2026-03-23 13:43:04\",\"last_name\":\"ziedd\",\"first_name\":\"saadaly\",\"contract_type\":\"SIVP\",\"company\":\"TOPGEO\",\"contract_start\":\"2026-03-01\",\"contract_end\":\"2026-03-25\",\"real_salary\":\"1000.00\",\"declared_salary\":\"997.00\",\"bank\":\"atb\",\"rib\":\"9876543110\",\"cin\":\"12684689\",\"cin_copy\":\"\",\"diploma\":\"Topographie\",\"diploma_copy\":\"\",\"diploma_date\":\"2026-03-01\",\"photo\":\"\",\"cv\":\"\",\"address\":\"Tunis, Tunisie\"}', '{\"is_active\":0}', NULL, '2026-03-26 13:08:33'),
(9, 1, 'create', 'mm_staff', NULL, NULL, '{\"code\":\"9999999\",\"full_name\":\"tesssst\",\"first_name\":\"\",\"last_name\":\"tesssst\",\"email\":\"\",\"phone\":\"\",\"position\":\"\",\"department\":\"\",\"hire_date\":null,\"salary\":0,\"contract_type\":\"CDD\",\"company\":\"tweqwe\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"\",\"rib\":\"\",\"cin\":\"\",\"cin_copy\":\"\",\"diploma\":\"\",\"diploma_copy\":\"\",\"diploma_date\":null,\"photo\":\"\",\"cv\":\"\",\"address\":\"\"}', NULL, '2026-03-26 13:10:38'),
(10, 1, 'update', 'mm_staff', 278, '{\"is_active\":1}', '{\"is_active\":1}', NULL, '2026-03-26 13:30:23'),
(11, 1, 'update', 'mm_staff', 278, '{\"id\":278,\"code\":\"\",\"full_name\":\"\",\"email\":null,\"phone\":null,\"position\":\"\",\"department\":null,\"hire_date\":null,\"salary\":\"0.00\",\"is_active\":1,\"created_at\":\"2026-03-26 13:26:15\",\"updated_at\":\"2026-03-26 14:30:23\",\"last_name\":null,\"first_name\":null,\"contract_type\":null,\"company\":null,\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":null,\"rib\":null,\"cin\":null,\"cin_copy\":null,\"diploma\":null,\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":null,\"address\":null}', '{\"code\":\"TEST003\",\"full_name\":\"Test Editor 2 Modified\",\"first_name\":\"Test\",\"last_name\":\"Editor 2\",\"email\":\"editor2@example.com\",\"phone\":\"123456789\",\"position\":\"Tester\",\"department\":\"IT\",\"hire_date\":\"\",\"salary\":1500}', NULL, '2026-03-26 13:37:36'),
(12, 1, 'reject', 'mm_staff', NULL, '{\"id\":262,\"code\":\"33\",\"full_name\":\"HOUCEM  BOUALAGUI\",\"email\":null,\"phone\":null,\"position\":null,\"department\":null,\"hire_date\":null,\"salary\":\"0.00\",\"is_active\":0,\"created_at\":\"2026-03-13 15:47:15\",\"updated_at\":\"2026-03-26 13:38:05\",\"last_name\":\"BOUALAGUI \",\"first_name\":\"HOUCEM \",\"contract_type\":\"sans contrat\",\"company\":null,\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":null,\"rib\":null,\"cin\":null,\"cin_copy\":null,\"diploma\":null,\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":\"**\",\"address\":\"sbietla\"}', '{\"code\":\"33\",\"full_name\":\"HOUSSEM  BOUALAGUI\",\"first_name\":\"HOUSSEM \",\"last_name\":\"BOUALAGUI \",\"email\":\"\",\"phone\":\"29223440\",\"position\":\"\",\"department\":\"Informatique\",\"hire_date\":\"\",\"salary\":\"0\",\"contract_type\":\"sans contrat\",\"company\":\"\",\"contract_start\":\"\",\"contract_end\":\"\",\"real_salary\":\"\",\"declared_salary\":\"\",\"bank\":\"\",\"rib\":\"\",\"cin\":\"\",\"cin_copy\":\"\",\"diploma\":\"\",\"diploma_copy\":\"\",\"diploma_date\":\"\",\"photo\":\"\",\"cv\":\"\",\"address\":\"sbietla\"}', NULL, '2026-03-26 13:39:37'),
(13, 1, 'reject', 'mm_staff', NULL, NULL, '{\"code\":\"99988787879879\",\"full_name\":\"world hello\",\"first_name\":\"world\",\"last_name\":\"hello\",\"email\":\"\",\"phone\":\"\",\"position\":\"\",\"department\":\"toponomique\",\"hire_date\":null,\"salary\":0,\"contract_type\":\"CDI\",\"company\":\"\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"\",\"rib\":\"\",\"cin\":\"\",\"cin_copy\":\"\",\"diploma\":\"\",\"diploma_copy\":\"\",\"diploma_date\":null,\"photo\":\"\",\"cv\":\"\",\"address\":\"\"}', NULL, '2026-03-26 13:49:29'),
(14, 1, 'delete', 'mm_staff', 243, '{\"id\":243,\"code\":\"11\",\"full_name\":\"ACHREF KORTLI\",\"email\":null,\"phone\":\"92405017\",\"position\":null,\"department\":null,\"hire_date\":null,\"salary\":\"0.00\",\"is_active\":1,\"created_at\":\"2026-03-13 15:47:15\",\"updated_at\":\"2026-03-13 15:47:15\",\"last_name\":\"KORTLI \",\"first_name\":\"ACHREF\",\"contract_type\":\"SIVP\",\"company\":\"TOPGEO\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"poste\",\"rib\":\"17 60 6000 000 366 786 805\",\"cin\":\"12694040\",\"cin_copy\":null,\"diploma\":\"BAC+3\",\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":null,\"address\":\"alayoun kasserine \"}', '{\"is_active\":0}', NULL, '2026-03-26 13:49:35'),
(15, 1, 'update', 'mm_staff', 262, '{\"id\":262,\"code\":\"33\",\"full_name\":\"HOUCEM  BOUALAGUI\",\"email\":null,\"phone\":null,\"position\":null,\"department\":null,\"hire_date\":null,\"salary\":\"0.00\",\"is_active\":0,\"created_at\":\"2026-03-13 15:47:15\",\"updated_at\":\"2026-03-26 13:38:05\",\"last_name\":\"BOUALAGUI \",\"first_name\":\"HOUCEM \",\"contract_type\":\"sans contrat\",\"company\":null,\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":null,\"rib\":null,\"cin\":null,\"cin_copy\":null,\"diploma\":null,\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":\"**\",\"address\":\"sbietla\"}', '{\"code\":\"33\",\"full_name\":\"HOUSSEM  BOUALAGUI\",\"first_name\":\"HOUSSEM \",\"last_name\":\"BOUALAGUI \",\"email\":\"\",\"phone\":\"\",\"position\":\"\",\"department\":\"\",\"hire_date\":\"\",\"salary\":\"0\",\"contract_type\":\"sans contrat\",\"company\":\"\",\"contract_start\":\"\",\"contract_end\":\"\",\"real_salary\":\"\",\"declared_salary\":\"\",\"bank\":\"\",\"rib\":\"\",\"cin\":\"\",\"cin_copy\":\"\",\"diploma\":\"\",\"diploma_copy\":\"\",\"diploma_date\":\"\",\"photo\":\"\",\"cv\":\"\",\"address\":\"sbietla\"}', NULL, '2026-03-26 13:49:40'),
(16, 1, 'create', 'mm_staff', NULL, NULL, '{\"code\":\"TEST006\",\"full_name\":\"Test Display Fix\",\"first_name\":\"Test\",\"last_name\":\"Display\",\"email\":\"display@example.com\",\"phone\":\"123456789\",\"position\":\"Tester\",\"department\":\"IT\",\"hire_date\":\"2026-03-26\",\"salary\":1000,\"contract_type\":null,\"company\":null,\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":null,\"rib\":null,\"cin\":null,\"cin_copy\":null,\"diploma\":null,\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":null,\"address\":null}', NULL, '2026-03-26 14:06:39'),
(17, 1, 'reject', 'mm_staff', NULL, NULL, '{\"code\":\"98755555555555555555555555\",\"full_name\":\"abc abf\",\"first_name\":\"abc\",\"last_name\":\"abf\",\"email\":\"\",\"phone\":\"\",\"position\":\"\",\"department\":\"\",\"hire_date\":null,\"salary\":0,\"contract_type\":\"\",\"company\":\"\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"\",\"rib\":\"\",\"cin\":\"\",\"cin_copy\":\"\",\"diploma\":\"\",\"diploma_copy\":\"\",\"diploma_date\":null,\"photo\":\"\",\"cv\":\"\",\"address\":\"\"}', NULL, '2026-03-26 14:06:44'),
(18, 1, 'reject', 'mm_staff', NULL, '{\"is_active\":0}', '{\"is_active\":1}', NULL, '2026-03-26 14:06:47'),
(19, 1, 'reject', 'mm_staff', NULL, NULL, '{\"code\":\"98888888\",\"full_name\":\"test hello\",\"first_name\":\"test\",\"last_name\":\"hello\",\"email\":\"\",\"phone\":\"\",\"position\":\"\",\"department\":\"\",\"hire_date\":null,\"salary\":0,\"contract_type\":\"\",\"company\":\"\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"\",\"rib\":\"\",\"cin\":\"\",\"cin_copy\":\"\",\"diploma\":\"\",\"diploma_copy\":\"\",\"diploma_date\":null,\"photo\":\"\",\"cv\":\"\",\"address\":\"\"}', NULL, '2026-03-26 14:06:50'),
(20, 1, 'create', 'mm_staff', NULL, NULL, '{\"code\":\"987777\",\"full_name\":\"abc abc\",\"first_name\":\"abc\",\"last_name\":\"abc\",\"email\":\"\",\"phone\":\"\",\"position\":\"\",\"department\":\"\",\"hire_date\":null,\"salary\":0,\"contract_type\":\"\",\"company\":\"\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"\",\"rib\":\"\",\"cin\":\"\",\"cin_copy\":\"\",\"diploma\":\"\",\"diploma_copy\":\"\",\"diploma_date\":null,\"photo\":\"\",\"cv\":\"\",\"address\":\"\"}', NULL, '2026-03-26 14:08:25'),
(21, 1, 'update', 'mm_staff', 242, '{\"is_active\":0}', '{\"is_active\":1}', NULL, '2026-03-26 14:20:06'),
(22, 1, 'reject', 'mm_staff', NULL, '{\"is_active\":0}', '{\"is_active\":1}', NULL, '2026-03-26 14:20:10'),
(23, 1, 'reject', 'mm_staff', NULL, '{\"is_active\":0}', '{\"is_active\":1}', NULL, '2026-03-26 14:24:36'),
(24, 1, 'reject', 'mm_staff', NULL, '{\"id\":277,\"code\":\"TEST001\",\"full_name\":\"Test User\",\"email\":\"test@example.com\",\"phone\":\"123456789\",\"position\":\"Tester\",\"department\":\"IT\",\"hire_date\":\"2026-03-26\",\"salary\":\"1000.00\",\"is_active\":1,\"created_at\":\"2026-03-26 13:18:20\",\"updated_at\":\"2026-03-26 13:18:20\",\"last_name\":\"User\",\"first_name\":\"Test\",\"contract_type\":null,\"company\":null,\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":null,\"rib\":null,\"cin\":null,\"cin_copy\":null,\"diploma\":null,\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":null,\"address\":null}', '{\"is_active\":0}', NULL, '2026-03-26 14:24:39'),
(25, 1, 'reject', 'mm_staff', NULL, '{\"is_active\":0}', '{\"is_active\":1}', NULL, '2026-03-26 14:26:57'),
(26, 1, 'update', 'mm_staff', 282, '{\"is_active\":0}', '{\"is_active\":1}', NULL, '2026-03-26 14:34:56'),
(27, 1, 'update', 'mm_staff', 282, '{\"id\":282,\"code\":\"TEST007\",\"full_name\":\"Test Activation\",\"email\":\"test@example.com\",\"phone\":\"123456789\",\"position\":\"Tester\",\"department\":\"IT\",\"hire_date\":\"2026-03-26\",\"salary\":\"1000.00\",\"is_active\":1,\"created_at\":\"2026-03-26 15:30:44\",\"updated_at\":\"2026-03-26 15:34:56\",\"last_name\":\"Activation\",\"first_name\":\"Test\",\"contract_type\":null,\"company\":null,\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":null,\"rib\":null,\"cin\":null,\"cin_copy\":null,\"diploma\":null,\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":null,\"address\":null}', '{\"code\":\"TEST007\",\"full_name\":\"Test Activation Updated\",\"first_name\":\"Test\",\"last_name\":\"Activation Updated\",\"email\":\"test@example.com\",\"phone\":\"123456789\",\"position\":\"Tester\",\"department\":\"IT\",\"hire_date\":\"2026-03-26\",\"salary\":1500}', NULL, '2026-03-26 14:38:18'),
(28, 1, 'update', 'mm_staff', 262, '{\"is_active\":0}', '{\"is_active\":1}', NULL, '2026-03-26 14:41:49'),
(29, 1, 'update', 'mm_staff', 233, '{\"id\":233,\"code\":\"1\",\"full_name\":\"saadaly ziedd\",\"email\":\"zied.saadli@topgeo.net\",\"phone\":\"98654321\",\"position\":\"Technicien Topography\",\"department\":\"Topography\",\"hire_date\":\"2026-03-01\",\"salary\":\"1000.00\",\"is_active\":1,\"created_at\":\"2026-03-13 15:47:14\",\"updated_at\":\"2026-03-23 13:43:04\",\"last_name\":\"ziedd\",\"first_name\":\"saadaly\",\"contract_type\":\"SIVP\",\"company\":\"TOPGEO\",\"contract_start\":\"2026-03-01\",\"contract_end\":\"2026-03-25\",\"real_salary\":\"1000.00\",\"declared_salary\":\"997.00\",\"bank\":\"atb\",\"rib\":\"9876543110\",\"cin\":\"12684689\",\"cin_copy\":\"\",\"diploma\":\"Topographie\",\"diploma_copy\":\"\",\"diploma_date\":\"2026-03-01\",\"photo\":\"\",\"cv\":\"\",\"address\":\"Tunis, Tunisie\"}', '{\"code\":\"1\",\"full_name\":\"saadaly ziedd\",\"first_name\":\"saadaly\",\"last_name\":\"ziedd\",\"email\":\"zied.saadli@topgeo.net\",\"phone\":\"98654321\",\"position\":\"Technicien Topographyyy\",\"department\":\"Topography\",\"hire_date\":\"2026-03-01\",\"salary\":\"1000\",\"contract_type\":\"SIVP\",\"company\":\"TOPGEO\",\"contract_start\":\"2026-03-01\",\"contract_end\":\"2026-03-25\",\"real_salary\":\"1000\",\"declared_salary\":\"997\",\"bank\":\"atb\",\"rib\":\"9876543110\",\"cin\":\"12684689\",\"cin_copy\":\"\",\"diploma\":\"Topographie\",\"diploma_copy\":\"\",\"diploma_date\":\"2026-03-01\",\"photo\":\"\",\"cv\":\"\",\"address\":\"Tunis, Tunisie\"}', NULL, '2026-04-08 14:31:44'),
(30, 1, 'delete', 'mm_staff', 233, '{\"id\":233,\"code\":\"1\",\"full_name\":\"saadaly ziedd\",\"email\":\"zied.saadli@topgeo.net\",\"phone\":\"98654321\",\"position\":\"Technicien Topographyyy\",\"department\":\"Topography\",\"hire_date\":\"2026-03-01\",\"salary\":\"1000.00\",\"is_active\":1,\"created_at\":\"2026-03-13 15:47:14\",\"updated_at\":\"2026-04-08 15:31:44\",\"last_name\":\"ziedd\",\"first_name\":\"saadaly\",\"contract_type\":\"SIVP\",\"company\":\"TOPGEO\",\"contract_start\":\"2026-03-01\",\"contract_end\":\"2026-03-25\",\"real_salary\":\"1000.00\",\"declared_salary\":\"997.00\",\"bank\":\"atb\",\"rib\":\"9876543110\",\"cin\":\"12684689\",\"cin_copy\":\"\",\"diploma\":\"Topographie\",\"diploma_copy\":\"\",\"diploma_date\":\"2026-03-01\",\"photo\":\"\",\"cv\":\"\",\"address\":\"Tunis, Tunisie\"}', '{\"is_active\":0}', NULL, '2026-04-08 14:32:28'),
(31, 1, 'create', 'mm_staff', NULL, NULL, '{\"code\":\"8888888\",\"full_name\":\"jandouby lasaad\",\"first_name\":\"jandouby\",\"last_name\":\"lasaad\",\"email\":\"asad@gmail.com\",\"phone\":\"98754322\",\"position\":\"karwiya\",\"department\":\"IT\",\"hire_date\":\"2026-04-30\",\"salary\":100000,\"contract_type\":\"SIVP\",\"company\":\"TOPGEO\",\"contract_start\":\"2026-05-15\",\"contract_end\":\"2026-05-27\",\"real_salary\":988,\"declared_salary\":1000,\"bank\":\"ATB\",\"rib\":\"9865\",\"cin\":\"14586255\",\"cin_copy\":\"\",\"diploma\":\"license\",\"diploma_copy\":\"\",\"diploma_date\":\"2026-06-02\",\"photo\":\"\",\"cv\":\"\",\"address\":\"Rue Taieb Mhiri, Immeuble Saadli boite postale 50\"}', NULL, '2026-04-08 14:35:03'),
(32, 1, 'reject', 'mm_staff', NULL, NULL, '{\"code\":\"655\",\"full_name\":\"Missaoui Mohamed\",\"first_name\":\"Missaoui\",\"last_name\":\"Mohamed\",\"email\":\"root@gmail.com\",\"phone\":\"77467203\",\"position\":\"IT\",\"department\":\"IT\",\"hire_date\":null,\"salary\":0,\"contract_type\":\"CDD\",\"company\":\"ttt\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"\",\"rib\":\"\",\"cin\":\"\",\"cin_copy\":\"\",\"diploma\":\"\",\"diploma_copy\":\"\",\"diploma_date\":null,\"photo\":\"\",\"cv\":\"\",\"address\":\"Rue Taieb Mhiri, Immeuble Saadli boite postale 50\"}', NULL, '2026-04-08 14:41:04'),
(33, 1, 'delete', 'mm_staff', 243, '{\"id\":243,\"code\":\"11\",\"full_name\":\"ACHREF KORTLI\",\"email\":null,\"phone\":\"92405017\",\"position\":null,\"department\":null,\"hire_date\":null,\"salary\":\"0.00\",\"is_active\":1,\"created_at\":\"2026-03-13 15:47:15\",\"updated_at\":\"2026-03-30 11:12:19\",\"last_name\":\"KORTLI \",\"first_name\":\"ACHREF\",\"contract_type\":\"SIVP\",\"company\":\"TOPGEO\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"poste\",\"rib\":\"17 60 6000 000 366 786 805\",\"cin\":\"12694040\",\"cin_copy\":null,\"diploma\":\"BAC+3\",\"diploma_copy\":null,\"diploma_date\":null,\"photo\":null,\"cv\":null,\"address\":\"alayoun kasserine \"}', '{\"is_active\":0}', NULL, '2026-04-08 15:13:25'),
(34, 1, 'reject', 'mm_staff', NULL, '{\"id\":233,\"code\":\"1\",\"full_name\":\"saadaly ziedd\",\"email\":\"zied.saadli@topgeo.net\",\"phone\":\"98654321\",\"position\":\"Technicien Topographyyy\",\"department\":\"Topography\",\"hire_date\":\"2026-03-01\",\"salary\":\"1000.00\",\"is_active\":1,\"created_at\":\"2026-03-13 15:47:14\",\"updated_at\":\"2026-04-08 15:41:14\",\"last_name\":\"ziedd\",\"first_name\":\"saadaly\",\"contract_type\":\"SIVP\",\"company\":\"TOPGEO\",\"contract_start\":\"2026-03-01\",\"contract_end\":\"2026-03-25\",\"real_salary\":\"1000.00\",\"declared_salary\":\"997.00\",\"bank\":\"atb\",\"rib\":\"9876543110\",\"cin\":\"12684689\",\"cin_copy\":\"\",\"diploma\":\"Topographie\",\"diploma_copy\":\"\",\"diploma_date\":\"2026-03-01\",\"photo\":\"\",\"cv\":\"\",\"address\":\"Tunis, Tunisie\"}', '{\"is_active\":0}', NULL, '2026-04-08 15:13:32'),
(35, 1, 'reject', 'mm_staff', NULL, NULL, '{\"code\":\"999899\",\"full_name\":\"atat att\",\"first_name\":\"atat\",\"last_name\":\"att\",\"email\":\"aawt@gmail.com\",\"phone\":\"\",\"position\":\"\",\"department\":\"\",\"hire_date\":null,\"salary\":0,\"contract_type\":\"\",\"company\":\"\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"\",\"rib\":\"\",\"cin\":\"\",\"cin_copy\":\"\",\"diploma\":\"\",\"diploma_copy\":\"\",\"diploma_date\":null,\"photo\":\"\",\"cv\":\"\",\"address\":\"\"}', NULL, '2026-04-08 15:13:54'),
(36, 1, 'create', 'mm_staff', NULL, NULL, '{\"code\":\"99999\",\"full_name\":\"wrath sin\",\"first_name\":\"wrath\",\"last_name\":\"sin\",\"email\":\"sin@gmail.com\",\"phone\":\"89987854\",\"position\":\"ABC\",\"department\":\"AB\",\"hire_date\":null,\"salary\":0,\"contract_type\":\"CIAP\",\"company\":\"T\",\"contract_start\":null,\"contract_end\":null,\"real_salary\":null,\"declared_salary\":null,\"bank\":\"\",\"rib\":\"\",\"cin\":\"8774566\",\"cin_copy\":\"\",\"diploma\":\"\",\"diploma_copy\":\"\",\"diploma_date\":null,\"photo\":\"\",\"cv\":\"\",\"address\":\"89774987qweq\"}', NULL, '2026-04-08 15:13:57'),
(37, 1, 'update', 'mm_staff', 233, '{\"id\":233,\"code\":\"1\",\"full_name\":\"saadaly ziedd\",\"email\":\"zied.saadli@topgeo.net\",\"phone\":\"98654321\",\"position\":\"Technicien Topographyyy\",\"department\":\"Topography\",\"hire_date\":\"2026-03-01\",\"salary\":\"1000.00\",\"is_active\":1,\"created_at\":\"2026-03-13 15:47:14\",\"updated_at\":\"2026-04-08 15:41:14\",\"last_name\":\"ziedd\",\"first_name\":\"saadaly\",\"contract_type\":\"SIVP\",\"company\":\"TOPGEO\",\"contract_start\":\"2026-03-01\",\"contract_end\":\"2026-03-25\",\"real_salary\":\"1000.00\",\"declared_salary\":\"997.00\",\"bank\":\"atb\",\"rib\":\"9876543110\",\"cin\":\"12684689\",\"cin_copy\":\"\",\"diploma\":\"Topographie\",\"diploma_copy\":\"\",\"diploma_date\":\"2026-03-01\",\"photo\":\"\",\"cv\":\"\",\"address\":\"Tunis, Tunisie\"}', '{\"code\":\"1\",\"full_name\":\"saadaly ziedd\",\"first_name\":\"saadaly\",\"last_name\":\"ziedd\",\"email\":\"zied.saadli@topgeo.net\",\"phone\":\"98654321\",\"position\":\"Technicien Topographyyy\",\"department\":\"Topography\",\"hire_date\":\"2026-03-01\",\"salary\":\"1000\",\"contract_type\":\"SIVP\",\"company\":\"TOPGEO\",\"contract_start\":\"2026-03-01\",\"contract_end\":\"2026-03-25\",\"real_salary\":\"1000\",\"declared_salary\":\"997\",\"bank\":\"atb\",\"rib\":\"9876543110\",\"cin\":\"12684689\",\"cin_copy\":\"\",\"diploma\":\"Topographieee\",\"diploma_copy\":\"\",\"diploma_date\":\"2026-03-01\",\"photo\":\"\",\"cv\":\"\",\"address\":\"Tunis, Tunisie\"}', NULL, '2026-04-08 15:14:03');

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

--
-- Table structure for table `mm_caisses`
--

CREATE TABLE `mm_caisses` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `code` varchar(20) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mm_caisses`
--

INSERT INTO `mm_caisses` (`id`, `name`, `code`, `description`, `is_active`, `created_at`) VALUES
(1, 'Caisse Sbeitla', 'SBEITLA', 'Caisse principale de Sbeitla', 1, '2026-03-05 17:24:26'),
(2, 'Caisse Kasserine', 'KASSERINE', 'Caisse principale de Kasserine', 1, '2026-03-05 17:24:26'),
(3, 'Caisse Tunis', 'TUNIS', 'Caisse principale de Tunis', 1, '2026-04-08 14:17:34');

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

--
-- Table structure for table `mm_holidays`
--

CREATE TABLE `mm_holidays` (
  `id` int(11) NOT NULL,
  `date` date NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `status` enum('holiday','weekend') NOT NULL DEFAULT 'holiday',
  `is_recurring` tinyint(1) DEFAULT 0,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `mm_permissions`
--

CREATE TABLE `mm_permissions` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `module` varchar(50) NOT NULL,
  `can_view` tinyint(1) DEFAULT 0,
  `can_edit` tinyint(1) DEFAULT 0,
  `can_admin` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mm_permissions`
--

INSERT INTO `mm_permissions` (`id`, `user_id`, `module`, `can_view`, `can_edit`, `can_admin`, `created_at`) VALUES
(1, 1, 'caisse', 1, 1, 1, '2026-03-05 17:24:26'),
(3, 1, 'staff', 1, 1, 1, '2026-03-05 17:24:26'),
(5, 2, 'caisse', 1, 0, 0, '2026-03-18 11:29:07'),
(6, 2, 'staff', 1, 0, 0, '2026-03-18 11:29:22'),
(7, 3, 'staff', 1, 1, 0, '2026-03-23 13:13:23'),
(10, 3, 'caisse', 1, 1, 0, '2026-03-25 11:55:22');

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

--
-- Table structure for table `mm_staff`
--

CREATE TABLE `mm_staff` (
  `id` int(11) NOT NULL,
  `code` varchar(20) NOT NULL,
  `full_name` varchar(100) NOT NULL,
  `email` varchar(100) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `position` varchar(100) DEFAULT NULL,
  `department` varchar(100) DEFAULT NULL,
  `hire_date` date DEFAULT NULL,
  `salary` decimal(10,2) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `last_name` varchar(100) DEFAULT NULL,
  `first_name` varchar(100) DEFAULT NULL,
  `contract_type` varchar(50) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  `contract_start` date DEFAULT NULL,
  `contract_end` date DEFAULT NULL,
  `real_salary` decimal(10,2) DEFAULT NULL,
  `declared_salary` decimal(10,2) DEFAULT NULL,
  `bank` varchar(100) DEFAULT NULL,
  `rib` varchar(50) DEFAULT NULL,
  `cin` varchar(50) DEFAULT NULL,
  `cin_copy` varchar(10) DEFAULT NULL,
  `diploma` varchar(200) DEFAULT NULL,
  `diploma_copy` varchar(10) DEFAULT NULL,
  `diploma_date` date DEFAULT NULL,
  `photo` varchar(10) DEFAULT NULL,
  `cv` varchar(10) DEFAULT NULL,
  `address` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `mm_staff`
--

INSERT INTO `mm_staff` (`id`, `code`, `full_name`, `email`, `phone`, `position`, `department`, `hire_date`, `salary`, `is_active`, `created_at`, `updated_at`, `last_name`, `first_name`, `contract_type`, `company`, `contract_start`, `contract_end`, `real_salary`, `declared_salary`, `bank`, `rib`, `cin`, `cin_copy`, `diploma`, `diploma_copy`, `diploma_date`, `photo`, `cv`, `address`) VALUES
(233, '1', 'saadaly ziedd', 'zied.saadli@topgeo.net', '98654321', 'Technicien Topographyyy', 'Topography', '2026-03-01', 1000.00, 1, '2026-03-13 14:47:14', '2026-04-08 15:14:03', 'ziedd', 'saadaly', 'SIVP', 'TOPGEO', '2026-03-01', '2026-03-25', 1000.00, 997.00, 'atb', '9876543110', '12684689', '', 'Topographieee', '', '2026-03-01', '', '', 'Tunis, Tunisie'),
(234, '2', 'MANEL  TOUMI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'TOUMI ', 'MANEL ', 'CDI', 'TOPGEO', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(235, '3', 'AHLEM  ZERAI', 'ahlemzerai39@gmail.com', '95822598', NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'ZERAI', ' AHLEM ', 'SIVP', 'TOPGEO', NULL, NULL, NULL, NULL, 'poste', NULL, '12699516', NULL, 'master géophisique', NULL, NULL, NULL, NULL, 'al ayoun'),
(236, '4', 'YASSINE  MSAHLI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'MSAHLI ', 'YASSINE ', 'SIVP', 'TOPGEO', NULL, NULL, NULL, NULL, 'poste', '17  60 6000 000 37 15 61 43 6', '90094036', NULL, 'bac ', NULL, NULL, NULL, NULL, 'sbietla'),
(237, '5', 'ASSIL AOUINI', NULL, '22273315', NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'AOUINI', 'ASSIL', 'SIVP', 'TOPGEO', NULL, NULL, NULL, NULL, 'poste', '17  00 1000 000 364 622 606 ', '9530289', NULL, 'BAC+3 GEOMA', NULL, NULL, NULL, '**', 'BORJ ELAMRI'),
(238, '6', 'OUNALLAH RAYERN', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'RAYERN ', 'OUNALLAH', 'SIVP', 'TOPGEO', NULL, NULL, NULL, NULL, 'poste', '1700  2000  000  36 46 22 164', '14435822', NULL, 'TOPO BAC+3', NULL, NULL, NULL, '**', 'NABEUL'),
(239, '7', 'JALLALI ISLEM', NULL, '56144183', NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'ISLEM ', 'JALLALI', 'SIVP', 'TOPGEO', NULL, NULL, NULL, NULL, 'POSTE', '170  61 000 000 366 18 58 58 ', '14351933', NULL, 'carthographie ', NULL, NULL, NULL, NULL, 'TUNIS'),
(240, '8', 'ACHACH  ASMA', NULL, '28444718', NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'ASMA ', 'ACHACH ', 'SIVP', 'TOPGEO', NULL, NULL, NULL, NULL, 'poste', '17  90 1000 000 329  78 17 07', '13499178', NULL, 'Ing géeomatique ', NULL, NULL, NULL, NULL, 'mednin'),
(241, '9', 'CHOUIKHI HAMZA', NULL, '27049366', NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'HAMZA ', 'CHOUIKHI', 'SIVP', 'TOPGEO', NULL, NULL, NULL, NULL, 'poste', '17 00 1000  000 36  75 11 945', '13477169', NULL, 'CIVIL', NULL, NULL, NULL, '**', 'mednin'),
(243, '11', 'ACHREF KORTLI', NULL, '92405017', NULL, NULL, NULL, 0.00, 0, '2026-03-13 14:47:15', '2026-04-08 15:13:25', 'KORTLI ', 'ACHREF', 'SIVP', 'TOPGEO', NULL, NULL, NULL, NULL, 'poste', '17 60 6000 000 366 786 805', '12694040', NULL, 'BAC+3', NULL, NULL, NULL, NULL, 'alayoun kasserine '),
(244, '12', 'ANIS  KORTLI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'KORTLI ', 'ANIS ', 'CDI', 'TOPGEO', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(245, '26', 'MARIEM SADOUR', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'SADOUR ', 'MARIEM', 'CDI', 'TOPGEO INT', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(246, '36', 'AYOUB  JARBOUAI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'JARBOUAI ', 'AYOUB ', 'SIVP', 'TOPGEO', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(247, '13', 'tambohawet wided', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'wided ', 'tambohawet', 'en cours Bureau emploi', 'TOPGEO', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(248, '14', 'omar maram', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'maram ', 'omar', 'en cours Bureau emploi', 'TOPGEO', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(249, '15', 'SABRINNE  SAHRAOUI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'SAHRAOUI ', 'SABRINNE ', 'en cours karama', 'TOPGEO', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(250, '16', 'SAMAR GHAOUI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'GHAOUI', ' SAMAR', 'karama en cours', 'TOPGEO', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(251, '17', 'MOUNA BALTI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'BALTI ', 'MOUNA', 'contrat sivp a fini le 19 janvier 2026 nous att...', 'EDF', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(252, '20', 'AMANI  HAJJI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'ELHAJ', 'HAYET', 'contrat sivp a fini le 19 janvier 2026 nous att...', 'EDF', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(253, '32', 'OUMAYMA  AMRI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'AMRI ', 'OUMAYMA ', 'contrat sivp a fini le 23 janvier 2026 nous att...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(254, '18', '_ ZAINEB', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'ZAINEB ', '_', 'en attente de la réception du diplôme ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(255, '19', '_ NOUR', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'NOUR ', '_', 'en attente de la réception du diplôme ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(256, '21', 'BACHIR  SOUISSI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'SOUISSI ', 'BACHIR ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(257, '22', 'fakher klidi', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'klidi ', 'fakher', 'en cours', 'TOPGEO', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(258, '39', 'ZAKRANNI  RIMA', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'RIMA', 'ZAKRANNI ', 'karama  en cours manque attestation de solde ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(259, '23', 'MHREZ  HRIZI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'HRIZI ', 'MHREZ ', 'sans contrat', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(260, '24', 'LOUNICI  KORTLI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'KORTLI ', 'LOUNICI ', 'sans contrat', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(261, '25', 'HAMZA  CHEBBI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'CHEBBI ', 'HAMZA ', 'sans contrat', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(262, '33', 'HOUSSEM  BOUALAGUI', '', '', '', '', NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-26 14:41:49', 'BOUALAGUI', 'HOUSSEM', 'sans contrat', '', NULL, NULL, NULL, NULL, '', '', '', '', '', '', NULL, '', '', 'sbietla'),
(263, '34', 'FATMA RHILI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'RHILI ', 'FATMA', 'sans contrat', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(264, '35', 'MARAM MISSAOUI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'MISSAOUI ', 'MARAM', 'sans contrat', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(265, '37', 'HEDI SAADALI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'SAADALI ', 'HEDI', 'cdi le contrat est perdu', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(266, '38', 'KHALIL BOUZIDI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'BOUZIDI ', 'KHALIL', 'karama le contrat est perdu', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(267, '40', 'TAHA CHRAIET', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'CHRAIET', ' TAHA', 'karama le contrat est perdu', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(268, '41', '_ SAIEF', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'SAIEF ', '_', 'sivp', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(269, '43', '_ ASMA 2', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'ASMA 2', '_', 'elle est encore étudiante', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(270, '44', 'WAJDI AYADI', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'AYADI', ' WAJDI', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(271, '46', '_ ABDALLAH', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'ABDALLAH ', '_', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(272, '47', '_ YASSINE CNCT', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'YASSINE CNCT', '_', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(273, '48', '_ SOUMAYA', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'SOUMAYA ', '_', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(274, '49', '_ MOEZ', NULL, NULL, NULL, NULL, NULL, 0.00, 1, '2026-03-13 14:47:15', '2026-03-13 14:47:15', 'MOEZ ', '_', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `mm_staff_documents`
--

CREATE TABLE `mm_staff_documents` (
  `id` int(11) NOT NULL,
  `staff_id` int(11) NOT NULL,
  `document_type` varchar(50) NOT NULL,
  `file_name` varchar(255) NOT NULL,
  `file_path` varchar(255) NOT NULL,
  `file_size` int(11) DEFAULT NULL,
  `mime_type` varchar(100) DEFAULT NULL,
  `upload_date` timestamp NULL DEFAULT current_timestamp(),
  `uploaded_by` int(11) NOT NULL,
  `is_active` tinyint(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `mm_staff_pending_changes`
--

CREATE TABLE `mm_staff_pending_changes` (
  `id` int(11) NOT NULL,
  `staff_id` int(11) DEFAULT NULL,
  `changed_by` int(11) NOT NULL,
  `change_type` enum('create','update','delete') NOT NULL DEFAULT 'update',
  `old_data` text DEFAULT NULL,
  `new_data` text NOT NULL,
  `status` enum('pending','approved','rejected') DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `reviewed_by` int(11) DEFAULT NULL,
  `review_notes` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `mm_transactions`
--

CREATE TABLE `mm_transactions` (
  `id` int(11) NOT NULL,
  `caisse_id` int(11) NOT NULL,
  `type` enum('income','expense') NOT NULL,
  `amount` decimal(15,3) NOT NULL,
  `staff_id` int(11) DEFAULT NULL,
  `person_name` varchar(100) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `transaction_date` date NOT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

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

--
-- Table structure for table `mm_transactions_pending`
--

CREATE TABLE `mm_transactions_pending` (
  `id` int(11) NOT NULL,
  `caisse_id` int(11) NOT NULL,
  `transaction_id` int(11) DEFAULT NULL,
  `change_type` enum('create','update','delete') NOT NULL,
  `old_data` text DEFAULT NULL,
  `new_data` text NOT NULL,
  `status` enum('pending','approved','rejected') DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `reviewed_by` int(11) DEFAULT NULL,
  `review_notes` text DEFAULT NULL,
  `changed_by` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `mm_attendance`
--
ALTER TABLE `mm_attendance`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_staff_date_new` (`staff_id`,`year`,`month`,`day`,`status`),
  ADD KEY `created_by` (`created_by`),
  ADD KEY `idx_year` (`year`),
  ADD KEY `idx_month` (`month`),
  ADD KEY `idx_year_month` (`year`,`month`),
  ADD KEY `idx_staff_date_new` (`staff_id`,`year`,`month`,`day`),
  ADD KEY `idx_date_new` (`year`,`month`,`day`);

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

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

--
-- Indexes for table `mm_holidays`
--
ALTER TABLE `mm_holidays`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_date_status` (`date`,`status`),
  ADD KEY `created_by` (`created_by`),
  ADD KEY `idx_date` (`date`),
  ADD KEY `idx_status` (`status`);

--
-- Indexes for table `mm_permissions`
--
ALTER TABLE `mm_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_user_module` (`user_id`,`module`);

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

--
-- Indexes for table `mm_staff_documents`
--
ALTER TABLE `mm_staff_documents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `staff_id` (`staff_id`),
  ADD KEY `uploaded_by` (`uploaded_by`);

--
-- Indexes for table `mm_staff_pending_changes`
--
ALTER TABLE `mm_staff_pending_changes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `staff_id` (`staff_id`),
  ADD KEY `changed_by` (`changed_by`),
  ADD KEY `reviewed_by` (`reviewed_by`);

--
-- Indexes for table `mm_transactions`
--
ALTER TABLE `mm_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `caisse_id` (`caisse_id`),
  ADD KEY `created_by` (`created_by`),
  ADD KEY `staff_id` (`staff_id`);

--
-- Indexes for table `mm_transactions_pending`
--
ALTER TABLE `mm_transactions_pending`
  ADD PRIMARY KEY (`id`),
  ADD KEY `caisse_id` (`caisse_id`),
  ADD KEY `changed_by` (`changed_by`),
  ADD KEY `reviewed_by` (`reviewed_by`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `mm_attendance`
--
ALTER TABLE `mm_attendance`
  ADD CONSTRAINT `mm_attendance_ibfk_1` FOREIGN KEY (`staff_id`) REFERENCES `mm_staff` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `mm_attendance_ibfk_2` FOREIGN KEY (`created_by`) REFERENCES `mm_users` (`id`);

--
-- Constraints for table `mm_holidays`
--
ALTER TABLE `mm_holidays`
  ADD CONSTRAINT `mm_holidays_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `mm_users` (`id`);

--
-- Constraints for table `mm_permissions`
--
ALTER TABLE `mm_permissions`
  ADD CONSTRAINT `mm_permissions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `mm_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `mm_staff_documents`
--
ALTER TABLE `mm_staff_documents`
  ADD CONSTRAINT `mm_staff_documents_ibfk_1` FOREIGN KEY (`staff_id`) REFERENCES `mm_staff` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `mm_staff_documents_ibfk_2` FOREIGN KEY (`uploaded_by`) REFERENCES `mm_users` (`id`);

--
-- Constraints for table `mm_staff_pending_changes`
--
ALTER TABLE `mm_staff_pending_changes`
  ADD CONSTRAINT `mm_staff_pending_changes_ibfk_1` FOREIGN KEY (`staff_id`) REFERENCES `mm_staff` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `mm_staff_pending_changes_ibfk_2` FOREIGN KEY (`changed_by`) REFERENCES `mm_users` (`id`),
  ADD CONSTRAINT `mm_staff_pending_changes_ibfk_3` FOREIGN KEY (`reviewed_by`) REFERENCES `mm_users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `mm_transactions`
--
ALTER TABLE `mm_transactions`
  ADD CONSTRAINT `mm_transactions_ibfk_1` FOREIGN KEY (`caisse_id`) REFERENCES `mm_caisses` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `mm_transactions_ibfk_2` FOREIGN KEY (`created_by`) REFERENCES `mm_users` (`id`),
  ADD CONSTRAINT `mm_transactions_ibfk_3` FOREIGN KEY (`staff_id`) REFERENCES `mm_staff` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `mm_transactions_pending`
--
ALTER TABLE `mm_transactions_pending`
  ADD CONSTRAINT `mm_transactions_pending_ibfk_1` FOREIGN KEY (`caisse_id`) REFERENCES `mm_caisses` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `mm_transactions_pending_ibfk_2` FOREIGN KEY (`changed_by`) REFERENCES `mm_users` (`id`),
  ADD CONSTRAINT `mm_transactions_pending_ibfk_3` FOREIGN KEY (`reviewed_by`) REFERENCES `mm_users` (`id`) ON DELETE SET NULL;
COMMIT;

