diff --git a/check_appointments_schema.php b/check_appointments_schema.php deleted file mode 100644 index e600f56..0000000 --- a/check_appointments_schema.php +++ /dev/null @@ -1,6 +0,0 @@ -query("DESCRIBE appointments"); -$columns = $stmt->fetchAll(PDO::FETCH_COLUMN); -print_r($columns); diff --git a/check_data.php b/check_data.php deleted file mode 100644 index e234a30..0000000 --- a/check_data.php +++ /dev/null @@ -1,20 +0,0 @@ -query("SELECT id, name FROM patients LIMIT 1")->fetch(PDO::FETCH_ASSOC); -// Fetch one doctor (employee with position 'Doctor') -$doctor = $db->query(" - SELECT e.id, e.name_en - FROM employees e - JOIN positions p ON e.position_id = p.id - WHERE UPPER(p.name_en) = 'DOCTOR' - LIMIT 1")->fetch(PDO::FETCH_ASSOC); - -if ($patient && $doctor) { - echo "Found Patient: " . $patient['name'] . " (ID: " . $patient['id'] . ")\n"; - echo "Found Doctor: " . $doctor['name_en'] . " (ID: " . $doctor['id'] . ")\n"; -} else { - echo "Could not find patient or doctor.\n"; -} \ No newline at end of file diff --git a/check_details_schema.php b/check_details_schema.php deleted file mode 100644 index b24167e..0000000 --- a/check_details_schema.php +++ /dev/null @@ -1,16 +0,0 @@ -query("SHOW CREATE TABLE $table"); - $row = $stmt->fetch(PDO::FETCH_ASSOC); - echo $row['Create Table'] . "\n\n"; - } catch (Exception $e) { - echo "Table $table not found: " . $e->getMessage() . "\n\n"; - } -} - diff --git a/check_doctor_holidays_table.php b/check_doctor_holidays_table.php deleted file mode 100644 index fa4fd71..0000000 --- a/check_doctor_holidays_table.php +++ /dev/null @@ -1,19 +0,0 @@ -query("SHOW COLUMNS FROM doctor_holidays"); - if ($result) { - $columns = $result->fetchAll(PDO::FETCH_ASSOC); - echo "Table 'doctor_holidays' exists with columns:\n"; - foreach ($columns as $col) { - echo "- " . $col['Field'] . " (" . $col['Type'] . ")\n"; - } - } else { - echo "Table 'doctor_holidays' does not exist.\n"; - } -} catch (PDOException $e) { - echo "Error: " . $e->getMessage() . "\n"; -} - diff --git a/check_employees_schema.php b/check_employees_schema.php deleted file mode 100644 index 6a85ddc..0000000 --- a/check_employees_schema.php +++ /dev/null @@ -1,8 +0,0 @@ -query("DESCRIBE employees"); -$columns = $stmt->fetchAll(PDO::FETCH_COLUMN); -echo "Columns in employees table:\n"; -print_r($columns); -?> \ No newline at end of file diff --git a/check_nurses_schema.php b/check_nurses_schema.php deleted file mode 100644 index 0b48c62..0000000 --- a/check_nurses_schema.php +++ /dev/null @@ -1,6 +0,0 @@ -query("DESCRIBE nurses"); -$columns = $stmt->fetchAll(PDO::FETCH_COLUMN); -print_r($columns); diff --git a/check_pharmacy_schema.php b/check_pharmacy_schema.php deleted file mode 100644 index f317829..0000000 --- a/check_pharmacy_schema.php +++ /dev/null @@ -1,24 +0,0 @@ -query("DESCRIBE $table"); - $columns = $stmt->fetchAll(PDO::FETCH_ASSOC); - foreach ($columns as $col) { - echo "{$col['Field']} ({$col['Type']}) -"; - } - } catch (PDOException $e) { - echo "Error describing $table: " . $e->getMessage() . " -"; - } - echo " -"; -} - diff --git a/check_prices_schema.php b/check_prices_schema.php deleted file mode 100644 index 4a4c7d9..0000000 --- a/check_prices_schema.php +++ /dev/null @@ -1,16 +0,0 @@ -query("SHOW CREATE TABLE $table"); - $row = $stmt->fetch(PDO::FETCH_ASSOC); - echo $row['Create Table'] . "\n\n"; - } catch (Exception $e) { - echo "Table $table not found or error: " . $e->getMessage() . "\n\n"; - } -} - diff --git a/check_schema_billing.php b/check_schema_billing.php deleted file mode 100644 index 9494a4c..0000000 --- a/check_schema_billing.php +++ /dev/null @@ -1,16 +0,0 @@ -query("SHOW CREATE TABLE $table"); - $row = $stmt->fetch(PDO::FETCH_ASSOC); - echo $row['Create Table'] . "\n\n"; - } catch (Exception $e) { - echo "Table $table not found or error: " . $e->getMessage() . "\n\n"; - } -} - diff --git a/db/migrations/20260329_change_payment_method_type.sql b/db/migrations/20260329_change_payment_method_type.sql new file mode 100644 index 0000000..57ee251 --- /dev/null +++ b/db/migrations/20260329_change_payment_method_type.sql @@ -0,0 +1 @@ +ALTER TABLE bills MODIFY COLUMN payment_method VARCHAR(50) DEFAULT 'Cash'; \ No newline at end of file diff --git a/includes/actions.php b/includes/actions.php index f8794ae..e89fe71 100644 --- a/includes/actions.php +++ b/includes/actions.php @@ -386,6 +386,15 @@ $sick_leave_start_date = !empty($_POST['sick_leave_start_date']) ? $_POST['sick_ $_SESSION['flash_message'] = __('delete') . ' ' . __('successfully'); $redirect = true; } + } elseif ($_POST['action'] === 'mark_paid') { + $bill_id = $_POST['bill_id'] ?? 0; + $payment_method = $_POST['payment_method'] ?? 'Cash'; + if ($bill_id > 0) { + $stmt = $db->prepare("UPDATE bills SET status = 'Paid', payment_method = ? WHERE id = ?"); + $stmt->execute([$payment_method, $bill_id]); + $_SESSION['flash_message'] = __('mark_as_paid') . ' ' . __('successfully'); + $redirect = true; + } } elseif ($_POST['action'] === 'create_bill') { $patient_id = $_POST['patient_id'] ?? ''; $visit_id = $_POST['visit_id'] ?: null; diff --git a/includes/pages/billing.php b/includes/pages/billing.php index d7d90b9..147e579 100644 --- a/includes/pages/billing.php +++ b/includes/pages/billing.php @@ -92,10 +92,23 @@ $bills = $stmt->fetchAll(); -
+ -
diff --git a/includes/pages/dashboard.php b/includes/pages/dashboard.php index 1b386a1..4ab2e5a 100644 --- a/includes/pages/dashboard.php +++ b/includes/pages/dashboard.php @@ -575,11 +575,16 @@ $appointments = $db->query($appointments_sql)->fetchAll();
+
diff --git a/includes/pages/insurance.php b/includes/pages/insurance.php index 686fadd..d51ff04 100644 --- a/includes/pages/insurance.php +++ b/includes/pages/insurance.php @@ -711,11 +711,16 @@ if (isset($_GET['ajax_search'])) {
+
@@ -774,11 +779,16 @@ if (isset($_GET['ajax_search'])) {
+
diff --git a/includes/pages/pharmacy_pos.php b/includes/pages/pharmacy_pos.php index 574fae6..67a2cd6 100644 --- a/includes/pages/pharmacy_pos.php +++ b/includes/pages/pharmacy_pos.php @@ -98,14 +98,21 @@ try {
- - - - - - - - + + > + +
diff --git a/includes/pages/settings.php b/includes/pages/settings.php index 467dea9..1fa1d99 100644 --- a/includes/pages/settings.php +++ b/includes/pages/settings.php @@ -136,6 +136,17 @@
+ + +

+
+
+
+
+ + +
+

diff --git a/lang.php b/lang.php index e48918d..7f1a074 100644 --- a/lang.php +++ b/lang.php @@ -366,6 +366,9 @@ $translations = array ( 'timezone' => 'Timezone', 'working_hours_start' => 'Working Hours Start', 'working_hours_end' => 'Working Hours End', + 'payment_settings' => 'Payment Settings', + 'payment_types' => 'Payment Types', + 'payment_types_desc' => 'Comma separated list of payment types (e.g. Cash, Card, Insurance, Online, Other)', 'currency_settings' => 'Currency Settings', 'currency_symbol' => 'Currency Symbol', 'decimal_digits' => 'Decimal Digits', @@ -897,6 +900,9 @@ $translations = array ( 'timezone' => 'المنطقة الزمنية', 'working_hours_start' => 'بداية ساعات العمل', 'working_hours_end' => 'نهاية ساعات العمل', + 'payment_settings' => 'إعدادات الدفع', + 'payment_types' => 'طرق الدفع', + 'payment_types_desc' => 'قائمة مفصولة بفواصل لطرق الدفع (مثل: نقدي، بطاقة، تأمين، عبر الإنترنت، أخرى)', 'currency_settings' => 'إعدادات العملة', 'currency_symbol' => 'رمز العملة', 'decimal_digits' => 'الخانات العشرية', diff --git a/p.php b/p.php deleted file mode 100644 index 5a63240..0000000 --- a/p.php +++ /dev/null @@ -1 +0,0 @@ - 'Timezone',\n 'working_hours_start' => 'Working Hours Start',\n 'working_hours_end' => 'Working Hours End',"; $ar_add = "'timezone' => 'المنطقة الزمنية',\n 'working_hours_start' => 'بداية ساعات العمل',\n 'working_hours_end' => 'نهاية ساعات العمل',"; $content = str_replace("'company_vat_no' => 'VAT No',", "'company_vat_no' => 'VAT No',\n " . $en_add, $content); $content = str_replace("'vat_no' => 'الرقم الضريبي',", "'vat_no' => 'الرقم الضريبي',\n " . $ar_add, $content); file_put_contents('lang.php', $content); echo 'patched'; diff --git a/p2.php b/p2.php deleted file mode 100644 index 63f1d33..0000000 --- a/p2.php +++ /dev/null @@ -1 +0,0 @@ -\n

\n
\n \n \n
\n
\n \n \">\n
\n
\n \n \">\n
"; $c = str_replace('', $new_fields . "\n\n ", $c); file_put_contents('includes/pages/settings.php', $c); echo 'patched settings UI'; diff --git a/patch_final.php b/patch_final.php deleted file mode 100644 index f2d2a4f..0000000 --- a/patch_final.php +++ /dev/null @@ -1,12 +0,0 @@ - \ No newline at end of file diff --git a/test_query.php b/test_query.php deleted file mode 100644 index 0980ed5..0000000 --- a/test_query.php +++ /dev/null @@ -1,15 +0,0 @@ -query($sql)->fetchAll(); - print_r($scheduled_appointments); -} catch (PDOException $e) { - echo "Error: " . $e->getMessage(); -}