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

START TRANSACTION;



--
-- Database: `vopt`
--

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

--
-- Table structure for table `appointments`
--

CREATE TABLE IF NOT EXISTS `appointments` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `Trainee_ID` int DEFAULT NULL,
  `Trainer_ID` int DEFAULT NULL,
  `TV_ID` int DEFAULT NULL,
  `Status` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `Created_At` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`),
  KEY `Trainee_ID` (`Trainee_ID`),
  KEY `Trainer_ID` (`Trainer_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `sessions`
--

CREATE TABLE IF NOT EXISTS `sessions` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `Appointment_ID` int DEFAULT NULL,
  `Session_Start` datetime DEFAULT NULL,
  `Session_End` datetime DEFAULT NULL,
  `Duration_Minutes` int GENERATED ALWAYS AS (timestampdiff(MINUTE,`Session_Start`,`Session_End`)) STORED,
  `Session_Notes` text COLLATE utf8mb4_general_ci,
  `Total_Cost` decimal(5,2) NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `Appointment_ID` (`Appointment_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `trainees`
--

CREATE TABLE IF NOT EXISTS `trainees` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `Full_Name` varchar(200) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Email_Address` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Phone_Number` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `Date_Of_Birth` date DEFAULT NULL,
  `Gender` enum('Male','Female','Other') COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Picture` text COLLATE utf8mb4_general_ci NOT NULL,
  `Weight` decimal(5,2) DEFAULT NULL,
  `Height` decimal(5,2) DEFAULT NULL,
  `Target_Weight` decimal(5,2) DEFAULT NULL,
  `Backgrounds` text COLLATE utf8mb4_general_ci,
  `Activity_Level` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Nutrition_Style` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Strength_Training_Frequency` int DEFAULT NULL,
  `Cardio_Training_Frequency` int DEFAULT NULL,
  `Meals_Per_Day` int DEFAULT NULL,
  `Injuries` text COLLATE utf8mb4_general_ci,
  `Hobbies` text COLLATE utf8mb4_general_ci,
  `Allergies` text COLLATE utf8mb4_general_ci,
  `Country` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `City` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Occupation` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Latitude` decimal(9,6) DEFAULT NULL,
  `Longitude` decimal(9,6) DEFAULT NULL,
  `Password` varchar(250) COLLATE utf8mb4_general_ci NOT NULL,
  `Device_ID` varchar(250) COLLATE utf8mb4_general_ci NOT NULL,
  `U_ID` varchar(250) COLLATE utf8mb4_general_ci NOT NULL,
  `Phone_Type` varchar(250) COLLATE utf8mb4_general_ci NOT NULL,
  `Login_Status` varchar(250) COLLATE utf8mb4_general_ci NOT NULL,
  `Status` varchar(100) COLLATE utf8mb4_general_ci NOT NULL,
  `Created_At` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `trainees`
--

INSERT INTO `trainees` (`ID`, `Full_Name`, `Email_Address`, `Phone_Number`, `Date_Of_Birth`, `Gender`, `Picture`, `Weight`, `Height`, `Target_Weight`, `Backgrounds`, `Activity_Level`, `Nutrition_Style`, `Strength_Training_Frequency`, `Cardio_Training_Frequency`, `Meals_Per_Day`, `Injuries`, `Hobbies`, `Allergies`, `Country`, `City`, `Occupation`, `Latitude`, `Longitude`, `Password`, `Device_ID`, `U_ID`, `Phone_Type`, `Login_Status`, `Status`, `Created_At`) VALUES
(1, 'Test', 'test@live.com', '0000000000', '2000-01-01', 'Male', 'Trainees_Pictures/user.png', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Jordan', NULL, NULL, NULL, NULL, '123456789', '', '', 'IOS', 'True', 'Active', '2025-08-31 12:17:27');

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

--
-- Table structure for table `traineravailability`
--

CREATE TABLE IF NOT EXISTS `traineravailability` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `Trainer_ID` int DEFAULT NULL,
  `Date` date DEFAULT NULL,
  `From_Time` time DEFAULT NULL,
  `To_Time` time NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `Trainer_ID` (`Trainer_ID`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `traineravailability`
--

INSERT INTO `traineravailability` (`ID`, `Trainer_ID`, `Date`, `From_Time`, `To_Time`) VALUES
(1, 1, '2025-09-02', '10:00:00', '11:00:00');

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

--
-- Table structure for table `trainers`
--

CREATE TABLE IF NOT EXISTS `trainers` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `Full_Name` varchar(150) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Date_Of_Birth` date DEFAULT NULL,
  `Gender` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `National_ID` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Address` text COLLATE utf8mb4_general_ci,
  `Phone_Number` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Email_Address` varchar(150) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Profile_Photo` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Primary_Certification` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Issuing_Organization` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Certificate_ID_Number` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Certification_Expiry` date DEFAULT NULL,
  `CPR_Certified` tinyint(1) DEFAULT NULL,
  `Years_Experience` int DEFAULT NULL,
  `Specialty_Areas` text COLLATE utf8mb4_general_ci,
  `Languages_Spoken` text COLLATE utf8mb4_general_ci,
  `Preferred_Client_Types` text COLLATE utf8mb4_general_ci,
  `Insurance_Provider` varchar(150) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Policy_Number` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Insurance_Expiry` date DEFAULT NULL,
  `Indemnity_Insured` tinyint(1) DEFAULT NULL,
  `Account_Name` varchar(150) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `BSB` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Account_Number` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `IBAN_SWIFT` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Availability` text COLLATE utf8mb4_general_ci,
  `Working_Hours` text COLLATE utf8mb4_general_ci,
  `Travel_Radius_KM` int DEFAULT NULL,
  `Virtual_Available` tinyint(1) DEFAULT NULL,
  `Country` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `City` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL,
  `GPS_Consent` tinyint(1) DEFAULT NULL,
  `Bio` text COLLATE utf8mb4_general_ci,
  `Quote` text COLLATE utf8mb4_general_ci,
  `Video_Link` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `Latitude` decimal(9,6) DEFAULT NULL,
  `Longitude` decimal(9,6) DEFAULT NULL,
  `Password` varchar(250) COLLATE utf8mb4_general_ci NOT NULL,
  `Device_ID` varchar(250) COLLATE utf8mb4_general_ci NOT NULL,
  `U_ID` varchar(250) COLLATE utf8mb4_general_ci NOT NULL,
  `Phone_Type` varchar(250) COLLATE utf8mb4_general_ci NOT NULL,
  `Login_Status` varchar(250) COLLATE utf8mb4_general_ci NOT NULL,
  `Status` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `Created_At` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
COMMIT;

