diff --git a/.idea/misc.xml b/.idea/misc.xml
index 8978d23..f03e5ec 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,3 +1,4 @@
+
@@ -6,4 +7,11 @@
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index ecd309c..00c4ba4 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -47,5 +47,5 @@ dependencies {
implementation("com.google.firebase:firebase-analytics")
implementation ("com.google.firebase:firebase-firestore:24.11.1")
implementation("com.google.firebase:firebase-auth")
-
+ implementation ("com.google.android.material:material:1.4.0")
}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 1c1a538..4e564a8 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -8,36 +8,83 @@
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
- android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
- android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication"
tools:targetApi="31">
+ android:name=".DoctorProfile"
+ android:exported="false" />
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
-
-
+ android:exported="true" />
+
+
+
-
-
-
\ No newline at end of file
diff --git a/app/src/main/java/com/example/myapplication/AddDoctor.java b/app/src/main/java/com/example/myapplication/AddDoctor.java
new file mode 100644
index 0000000..bc006f0
--- /dev/null
+++ b/app/src/main/java/com/example/myapplication/AddDoctor.java
@@ -0,0 +1,83 @@
+package com.example.myapplication;
+
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.firestore.FirebaseFirestore;
+
+import java.util.Objects;
+
+public class AddDoctor extends AppCompatActivity {
+ private EditText etDoctorName, etDoctorEmail, etDoctorPhone, etDoctorQualification,
+ etDoctorExperience, etDoctorCategory, etDoctorPassword, etDoctorConfirmPassword,doctorFeeEditText;
+ private FirebaseFirestore db;
+ private FirebaseAuth auth;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_add_doctor);
+
+ db = FirebaseFirestore.getInstance();
+ auth = FirebaseAuth.getInstance();
+
+ etDoctorName = findViewById(R.id.et_doctor_name);
+ etDoctorEmail = findViewById(R.id.et_doctor_email);
+ etDoctorPhone = findViewById(R.id.et_doctor_phone);
+ etDoctorQualification = findViewById(R.id.et_doctor_qualification);
+ etDoctorExperience = findViewById(R.id.et_doctor_experience);
+ etDoctorCategory = findViewById(R.id.et_doctor_category);
+ etDoctorPassword = findViewById(R.id.et_doctor_password);
+ etDoctorConfirmPassword = findViewById(R.id.et_doctor_confirm_password);
+ doctorFeeEditText = findViewById(R.id.doctorFeeEditText);
+
+ Button btnAddDoctor = findViewById(R.id.btn_add_doctor);
+
+ btnAddDoctor.setOnClickListener(v -> {
+ String Name = etDoctorName.getText().toString().trim();
+ String Email = etDoctorEmail.getText().toString().trim();
+ String Phone = etDoctorPhone.getText().toString().trim();
+ String Qualification = etDoctorQualification.getText().toString().trim();
+ String Experience = etDoctorExperience.getText().toString().trim();
+ String Category = etDoctorCategory.getText().toString().trim();
+ String Password = etDoctorPassword.getText().toString().trim();
+ String ConfirmPassword = etDoctorConfirmPassword.getText().toString().trim();
+ String fee = doctorFeeEditText.getText().toString().trim();
+ if (Name.isEmpty() || Email.isEmpty() || Phone.isEmpty() || Qualification.isEmpty() ||
+ Experience.isEmpty() || Category.isEmpty() || Password.isEmpty() || !Password.equals(ConfirmPassword) || Password.length() < 6) {
+ Toast.makeText(AddDoctor.this, "Please ensure all fields are filled correctly and passwords match.", Toast.LENGTH_SHORT).show();
+ return;
+ }
+
+ auth.createUserWithEmailAndPassword(Email, Password)
+ .addOnCompleteListener(task -> {
+ if (task.isSuccessful()) {
+ Doctor doctor = new Doctor(Name, Email, Phone, Qualification, Experience, Category,Password,ConfirmPassword,fee);
+ addDoctorToFirestore(doctor);
+ } else {
+ Toast.makeText(AddDoctor.this, "Authentication failed: " + Objects.requireNonNull(task.getException()).getMessage(), Toast.LENGTH_SHORT).show();
+ }
+ });
+ });
+ }
+
+ private void addDoctorToFirestore(Doctor doctor) {
+ db.collection("doctors").add(doctor)
+ .addOnSuccessListener(documentReference -> {
+ Toast.makeText(AddDoctor.this, "Doctor added successfully", Toast.LENGTH_SHORT).show();
+ finish(); // Optional: Close the activity on success
+ })
+ .addOnFailureListener(e -> {
+ Log.e("AddDoctor", "Error adding doctor to Firestore", e);
+ Toast.makeText(AddDoctor.this, "Error adding doctor to Firestore: " + e.getMessage(), Toast.LENGTH_SHORT).show();
+ });
+ }
+}
diff --git a/app/src/main/java/com/example/myapplication/AdminProfile.java b/app/src/main/java/com/example/myapplication/AdminProfile.java
new file mode 100644
index 0000000..4d25032
--- /dev/null
+++ b/app/src/main/java/com/example/myapplication/AdminProfile.java
@@ -0,0 +1,60 @@
+package com.example.myapplication;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.widget.Button;
+import android.widget.TextView;
+import androidx.appcompat.app.AppCompatActivity;
+
+import java.util.ResourceBundle;
+
+public class AdminProfile extends AppCompatActivity {
+
+ private TextView txtAdminName;
+ private Button btnGenerateInvoice, btnViewReports, btnSettings;
+
+ private String adminEmail;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_admin_profile);
+
+ // Initialize views
+ txtAdminName = findViewById(R.id.txtAdminName);
+
+ btnGenerateInvoice = findViewById(R.id.btnGenerateInvoice);
+ btnViewReports = findViewById(R.id.btnViewReports);
+ btnSettings = findViewById(R.id.btnSettings);
+
+ // Get data from intent
+ Bundle extras = getIntent().getExtras();
+ if (extras != null) {
+ txtAdminName.setText("Name: " + extras.getString("name", "N/A"));
+ adminEmail = extras.getString("email");
+ }
+
+ // Set up button listeners
+ btnGenerateInvoice.setOnClickListener(v -> openGenerateInvoiceActivity());
+ btnViewReports.setOnClickListener(v -> openViewReportsActivity());
+ btnSettings.setOnClickListener(v -> openAddDoctor());
+ }
+
+ private void openGenerateInvoiceActivity() {
+ Intent intent = new Intent(AdminProfile.this, GenerateInvoice.class);
+ startActivity(intent);
+ finish();
+ }
+
+
+ private void openViewReportsActivity()
+ {
+
+ }
+
+ private void openAddDoctor() {
+ Intent intent = new Intent(AdminProfile.this, AddDoctor.class);
+ startActivity(intent);
+ finish();
+ }
+}
diff --git a/app/src/main/java/com/example/myapplication/AppointmentDetailActivity.java b/app/src/main/java/com/example/myapplication/AppointmentDetailActivity.java
new file mode 100644
index 0000000..5cfde37
--- /dev/null
+++ b/app/src/main/java/com/example/myapplication/AppointmentDetailActivity.java
@@ -0,0 +1,58 @@
+package com.example.myapplication;
+
+import android.os.Bundle;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+import androidx.appcompat.app.AppCompatActivity;
+
+public class AppointmentDetailActivity extends AppCompatActivity {
+
+ private TextView txtDate, txtDoctor, txtDescription;
+ private EditText feedbackInput;
+ private Button btnSubmitFeedback;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_appointment_detail);
+
+ // Initialize views
+ txtDate = findViewById(R.id.txtDate);
+ txtDoctor = findViewById(R.id.txtDoctor);
+ txtDescription = findViewById(R.id.txtDescription);
+ feedbackInput = findViewById(R.id.feedbackInput);
+ btnSubmitFeedback = findViewById(R.id.btnSubmitFeedback);
+
+ // Get data from intent
+ Bundle extras = getIntent().getExtras();
+ if (extras != null) {
+ String date = extras.getString("date", "No date provided");
+ String doctor = extras.getString("doctor", "No doctor specified");
+ String description = extras.getString("description", "No description provided");
+
+ // Set data to views
+ txtDate.setText("Date: " + date);
+ txtDoctor.setText("Doctor: " + doctor);
+ txtDescription.setText("Description: " + description);
+ }
+
+ // Handle feedback submission
+ btnSubmitFeedback.setOnClickListener(v -> submitFeedback());
+ }
+
+ private void submitFeedback() {
+ String feedback = feedbackInput.getText().toString();
+ if (!feedback.isEmpty()) {
+ // Handle the feedback submission logic here
+ // For example, sending feedback to a server or database
+ Toast.makeText(this, "Feedback submitted. Thank you!", Toast.LENGTH_LONG).show();
+
+ // Clear the input field after submission
+ feedbackInput.setText("");
+ } else {
+ Toast.makeText(this, "Please enter some feedback before submitting.", Toast.LENGTH_LONG).show();
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/myapplication/ApproveAppointmentActivity.java b/app/src/main/java/com/example/myapplication/ApproveAppointmentActivity.java
new file mode 100644
index 0000000..baa6d25
--- /dev/null
+++ b/app/src/main/java/com/example/myapplication/ApproveAppointmentActivity.java
@@ -0,0 +1,149 @@
+package com.example.myapplication;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.auth.FirebaseUser;
+import com.google.firebase.firestore.FirebaseFirestore;
+import com.google.firebase.firestore.QueryDocumentSnapshot;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ApproveAppointmentActivity extends AppCompatActivity {
+
+ private RecyclerView recyclerView;
+ private AppointmentAdapter adapter;
+ private List