adding ai generation
This commit is contained in:
parent
c6904a9a5e
commit
c8679068a9
@ -5,28 +5,53 @@ require_once __DIR__ . '/../ai/LocalAIApi.php';
|
|||||||
// Get JSON input
|
// Get JSON input
|
||||||
$input = json_decode(file_get_contents('php://input'), true);
|
$input = json_decode(file_get_contents('php://input'), true);
|
||||||
|
|
||||||
|
$target = $input['target'] ?? 'treatment_plan'; // symptoms, diagnosis, treatment_plan
|
||||||
$symptoms = $input['symptoms'] ?? '';
|
$symptoms = $input['symptoms'] ?? '';
|
||||||
$diagnosis = $input['diagnosis'] ?? '';
|
$diagnosis = $input['diagnosis'] ?? '';
|
||||||
|
$currentValue = $input['current_value'] ?? ''; // For expanding symptoms
|
||||||
|
|
||||||
if (empty($symptoms) && empty($diagnosis)) {
|
$systemPrompt = 'You are a professional medical assistant.';
|
||||||
echo json_encode(['success' => false, 'error' => 'No symptoms or diagnosis provided.']);
|
$userPrompt = "";
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$prompt = "You are a professional medical assistant. Based on the following symptoms and diagnosis, please generate a concise treatment plan and medical report for the patient.\n\n";
|
switch ($target) {
|
||||||
if (!empty($symptoms)) {
|
case 'symptoms':
|
||||||
$prompt .= "Symptoms:\n" . strip_tags($symptoms) . "\n\n";
|
if (empty($currentValue)) {
|
||||||
|
$userPrompt = "Generate a list of common clinical symptoms for a general checkup in a professional medical format (HTML lists).";
|
||||||
|
} else {
|
||||||
|
$userPrompt = "Rewrite and expand the following patient symptoms into a professional clinical description using HTML (bullet points or paragraph). Maintain the original meaning but make it clearer and more detailed:\n\n" . strip_tags($currentValue);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'diagnosis':
|
||||||
|
if (empty($symptoms)) {
|
||||||
|
echo json_encode(['success' => false, 'error' => 'Please enter symptoms first to get a diagnosis suggestion.']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$userPrompt = "Based on the following symptoms, suggest a list of potential differential diagnoses. Provide the response in a clear HTML list format.\n\nSymptoms:\n" . strip_tags($symptoms);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'treatment_plan':
|
||||||
|
default:
|
||||||
|
if (empty($symptoms) && empty($diagnosis)) {
|
||||||
|
echo json_encode(['success' => false, 'error' => 'No symptoms or diagnosis provided.']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$userPrompt = "Based on the following symptoms and diagnosis, please generate a concise treatment plan and medical report for the patient.\n\n";
|
||||||
|
if (!empty($symptoms)) {
|
||||||
|
$userPrompt .= "Symptoms:\n" . strip_tags($symptoms) . "\n\n";
|
||||||
|
}
|
||||||
|
if (!empty($diagnosis)) {
|
||||||
|
$userPrompt .= "Diagnosis:\n" . strip_tags($diagnosis) . "\n\n";
|
||||||
|
}
|
||||||
|
$userPrompt .= "Please provide the report in a clear, professional format using HTML tags (like <ul>, <li>, <strong>, etc.) for better readability.";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (!empty($diagnosis)) {
|
|
||||||
$prompt .= "Diagnosis:\n" . strip_tags($diagnosis) . "\n\n";
|
|
||||||
}
|
|
||||||
$prompt .= "Please provide the report in a clear, professional format using HTML tags (like <ul>, <li>, <strong>, etc.) for better readability.";
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$response = LocalAIApi::createResponse([
|
$response = LocalAIApi::createResponse([
|
||||||
'input' => [
|
'input' => [
|
||||||
['role' => 'system', 'content' => 'You are a helpful medical assistant.'],
|
['role' => 'system', 'content' => $systemPrompt],
|
||||||
['role' => 'user', 'content' => $prompt],
|
['role' => 'user', 'content' => $userPrompt],
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -38,5 +63,4 @@ try {
|
|||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo json_encode(['success' => false, 'error' => $e->getMessage()]);
|
echo json_encode(['success' => false, 'error' => $e->getMessage()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,47 +1,83 @@
|
|||||||
async function generateAIReport(button) {
|
async function generateAISuggestion(button) {
|
||||||
|
const target = button.dataset.target || 'treatment_plan';
|
||||||
const modal = button.closest(".modal");
|
const modal = button.closest(".modal");
|
||||||
|
|
||||||
|
// Get editor instances or DOM elements
|
||||||
const symptomsEditor = $(modal.querySelector('textarea[name="symptoms"]'));
|
const symptomsEditor = $(modal.querySelector('textarea[name="symptoms"]'));
|
||||||
const diagnosisEditor = $(modal.querySelector('textarea[name="diagnosis"]'));
|
const diagnosisEditor = $(modal.querySelector('textarea[name="diagnosis"]'));
|
||||||
const treatmentPlanEditor = $(modal.querySelector('textarea[name="treatment_plan"]'));
|
const treatmentPlanEditor = $(modal.querySelector('textarea[name="treatment_plan"]'));
|
||||||
|
|
||||||
const symptomsText = symptomsEditor.length && symptomsEditor.summernote ? symptomsEditor.summernote('code') : (modal.querySelector('textarea[name="symptoms"]') ? modal.querySelector('textarea[name="symptoms"]').value : '');
|
// Helper to get value from Summernote or textarea
|
||||||
const diagnosisText = diagnosisEditor.length && diagnosisEditor.summernote ? diagnosisEditor.summernote('code') : (modal.querySelector('textarea[name="diagnosis"]') ? modal.querySelector('textarea[name="diagnosis"]').value : '');
|
const getValue = (editor, selector) => {
|
||||||
|
if (editor.length && editor.summernote) return editor.summernote('code');
|
||||||
|
const el = modal.querySelector(selector);
|
||||||
|
return el ? el.value : '';
|
||||||
|
};
|
||||||
|
|
||||||
// Check if actually empty beyond HTML tags
|
const symptomsText = getValue(symptomsEditor, 'textarea[name="symptoms"]');
|
||||||
|
const diagnosisText = getValue(diagnosisEditor, 'textarea[name="diagnosis"]');
|
||||||
|
|
||||||
|
// Helper to set value
|
||||||
|
const setValue = (editor, selector, val) => {
|
||||||
|
if (editor.length && editor.summernote) {
|
||||||
|
editor.summernote('code', val);
|
||||||
|
} else {
|
||||||
|
const el = modal.querySelector(selector);
|
||||||
|
if (el) el.value = val;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Validation
|
||||||
const cleanSymptoms = symptomsText.replace(/<[^>]*>/g, "").trim();
|
const cleanSymptoms = symptomsText.replace(/<[^>]*>/g, "").trim();
|
||||||
const cleanDiagnosis = diagnosisText.replace(/<[^>]*>/g, "").trim();
|
const cleanDiagnosis = diagnosisText.replace(/<[^>]*>/g, "").trim();
|
||||||
|
|
||||||
if (!cleanSymptoms && !cleanDiagnosis) {
|
if (target === 'diagnosis' && !cleanSymptoms) {
|
||||||
alert("Please enter symptoms or diagnosis first.");
|
alert("Please enter symptoms first.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (target === 'treatment_plan' && (!cleanSymptoms && !cleanDiagnosis)) {
|
||||||
|
alert("Please enter symptoms or diagnosis first.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const originalHTML = button.innerHTML;
|
const originalHTML = button.innerHTML;
|
||||||
button.disabled = true;
|
button.disabled = true;
|
||||||
button.innerHTML = '<span class="spinner-border spinner-border-sm me-1"></span> AI generating...';
|
button.innerHTML = '<span class="spinner-border spinner-border-sm me-1"></span> AI...';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const payload = {
|
||||||
|
target: target,
|
||||||
|
symptoms: symptomsText,
|
||||||
|
diagnosis: diagnosisText,
|
||||||
|
current_value: (target === 'symptoms' ? symptomsText : (target === 'diagnosis' ? diagnosisText : ''))
|
||||||
|
};
|
||||||
|
|
||||||
const response = await fetch("api/ai_report.php", {
|
const response = await fetch("api/ai_report.php", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({ symptoms: symptomsText, diagnosis: diagnosisText })
|
body: JSON.stringify(payload)
|
||||||
});
|
});
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
if (treatmentPlanEditor.length && treatmentPlanEditor.summernote) {
|
if (target === 'symptoms') {
|
||||||
treatmentPlanEditor.summernote('code', data.report);
|
setValue(symptomsEditor, 'textarea[name="symptoms"]', data.report);
|
||||||
|
} else if (target === 'diagnosis') {
|
||||||
|
setValue(diagnosisEditor, 'textarea[name="diagnosis"]', data.report);
|
||||||
} else {
|
} else {
|
||||||
modal.querySelector('textarea[name="treatment_plan"]').value = data.report;
|
setValue(treatmentPlanEditor, 'textarea[name="treatment_plan"]', data.report);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
alert("AI Error: " + (data.error || "Unknown error"));
|
alert("AI Error: " + (data.error || "Unknown error"));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("AI Report generation failed:", error);
|
console.error("AI Suggestion failed:", error);
|
||||||
alert("Failed to generate AI suggestion.");
|
alert("Failed to generate AI suggestion.");
|
||||||
} finally {
|
} finally {
|
||||||
button.disabled = false;
|
button.disabled = false;
|
||||||
button.innerHTML = originalHTML;
|
button.innerHTML = originalHTML;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Alias for backward compatibility
|
||||||
|
window.generateAIReport = generateAISuggestion;
|
||||||
22
helpers.php
22
helpers.php
@ -46,4 +46,26 @@ function calculate_age($dob) {
|
|||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return '-';
|
return '-';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!function_exists('mb_strimwidth')) {
|
||||||
|
function mb_strimwidth($string, $start, $width, $trimmarker = '...', $encoding = null) {
|
||||||
|
// Simple polyfill using substr
|
||||||
|
// 1. Handle start offset
|
||||||
|
$string = (string)$string;
|
||||||
|
if ($start > 0) {
|
||||||
|
$string = substr($string, $start);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Check length
|
||||||
|
if (strlen($string) <= $width) {
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. Truncate
|
||||||
|
$targetLen = $width - strlen($trimmarker);
|
||||||
|
if ($targetLen < 0) $targetLen = 0;
|
||||||
|
|
||||||
|
return substr($string, 0, $targetLen) . $trimmarker;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1269,17 +1269,27 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label"><?php echo __('symptoms'); ?></label>
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
|
<label class="form-label mb-0"><?php echo __('symptoms'); ?></label>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-info" onclick="generateAISuggestion(this)" data-target="symptoms">
|
||||||
|
<i class="bi bi-stars"></i> AI Suggestion
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<textarea name="symptoms" class="form-control rich-editor" rows="2"></textarea>
|
<textarea name="symptoms" class="form-control rich-editor" rows="2"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label"><?php echo __('diagnosis'); ?></label>
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
|
<label class="form-label mb-0"><?php echo __('diagnosis'); ?></label>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-info" onclick="generateAISuggestion(this)" data-target="diagnosis">
|
||||||
|
<i class="bi bi-stars"></i> AI Suggestion
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<textarea name="diagnosis" class="form-control rich-editor" rows="2"></textarea>
|
<textarea name="diagnosis" class="form-control rich-editor" rows="2"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
<label class="form-label mb-0"><?php echo __("treatment_plan"); ?></label>
|
<label class="form-label mb-0"><?php echo __("treatment_plan"); ?></label>
|
||||||
<button type="button" class="btn btn-sm btn-outline-info" onclick="generateAIReport(this)">
|
<button type="button" class="btn btn-sm btn-outline-info" onclick="generateAISuggestion(this)" data-target="treatment_plan">
|
||||||
<i class="bi bi-stars"></i> AI Suggestion
|
<i class="bi bi-stars"></i> AI Suggestion
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -1349,17 +1359,27 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label"><?php echo __('symptoms'); ?></label>
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
|
<label class="form-label mb-0"><?php echo __('symptoms'); ?></label>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-info" onclick="generateAISuggestion(this)" data-target="symptoms">
|
||||||
|
<i class="bi bi-stars"></i> AI Suggestion
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<textarea name="symptoms" id="edit_visit_symptoms" class="form-control rich-editor" rows="2"></textarea>
|
<textarea name="symptoms" id="edit_visit_symptoms" class="form-control rich-editor" rows="2"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label"><?php echo __('diagnosis'); ?></label>
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
|
<label class="form-label mb-0"><?php echo __('diagnosis'); ?></label>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-info" onclick="generateAISuggestion(this)" data-target="diagnosis">
|
||||||
|
<i class="bi bi-stars"></i> AI Suggestion
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<textarea name="diagnosis" id="edit_visit_diagnosis" class="form-control rich-editor" rows="2"></textarea>
|
<textarea name="diagnosis" id="edit_visit_diagnosis" class="form-control rich-editor" rows="2"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
<label class="form-label mb-0"><?php echo __("treatment_plan"); ?></label>
|
<label class="form-label mb-0"><?php echo __("treatment_plan"); ?></label>
|
||||||
<button type="button" class="btn btn-sm btn-outline-info" onclick="generateAIReport(this)">
|
<button type="button" class="btn btn-sm btn-outline-info" onclick="generateAISuggestion(this)" data-target="treatment_plan">
|
||||||
<i class="bi bi-stars"></i> AI Suggestion
|
<i class="bi bi-stars"></i> AI Suggestion
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -1821,8 +1841,8 @@
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-lite.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-lite.min.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.ALL_XRAYS_DATA = <?php echo json_encode($all_xrays, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE); ?>;
|
window.ALL_XRAYS_DATA = <?php echo json_encode($all_xrays, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
window.ALL_TESTS_DATA = <?php echo json_encode($all_tests, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE); ?>;
|
window.ALL_TESTS_DATA = <?php echo json_encode($all_tests, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
|
||||||
// Global error handler to help debugging
|
// Global error handler to help debugging
|
||||||
window.onerror = function(message, source, lineno, colno, error) {
|
window.onerror = function(message, source, lineno, colno, error) {
|
||||||
|
|||||||
@ -40,7 +40,7 @@ $departments = $stmt->fetchAll();
|
|||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
onclick="showEditDepartmentModal(<?php echo htmlspecialchars(json_encode($dept, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showEditDepartmentModal(<?php echo htmlspecialchars(json_encode($dept, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -100,7 +100,7 @@ $doctors = $stmt->fetchAll();
|
|||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
onclick="showEditDoctorModal(<?php echo htmlspecialchars(json_encode($d, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showEditDoctorModal(<?php echo htmlspecialchars(json_encode($d, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -98,7 +98,7 @@ $employees = $stmt->fetchAll();
|
|||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
onclick="showEditEmployeeModal(<?php echo htmlspecialchars(json_encode($emp, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showEditEmployeeModal(<?php echo htmlspecialchars(json_encode($emp, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -130,12 +130,12 @@ unset($inquiry);
|
|||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-link text-dark py-1 px-2 border-end"
|
<button class="btn btn-link text-dark py-1 px-2 border-end"
|
||||||
onclick="printInquiry(<?php echo htmlspecialchars(json_encode($inquiry, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="printInquiry(<?php echo htmlspecialchars(json_encode($inquiry, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('print'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('print'); ?>">
|
||||||
<i class="bi bi-printer"></i>
|
<i class="bi bi-printer"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
onclick="showEditInquiryModal(<?php echo htmlspecialchars(json_encode($inquiry, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showEditInquiryModal(<?php echo htmlspecialchars(json_encode($inquiry, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -110,7 +110,7 @@ $tests = $stmt->fetchAll();
|
|||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
onclick="showEditTestModal(<?php echo htmlspecialchars(json_encode($test, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showEditTestModal(<?php echo htmlspecialchars(json_encode($test, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -98,7 +98,7 @@ $nurses = $stmt->fetchAll();
|
|||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
onclick="showEditNurseModal(<?php echo htmlspecialchars(json_encode($nurse, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showEditNurseModal(<?php echo htmlspecialchars(json_encode($nurse, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -94,7 +94,7 @@ $patients = $stmt->fetchAll();
|
|||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
onclick="showEditPatientModal(<?php echo htmlspecialchars(json_encode($p, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showEditPatientModal(<?php echo htmlspecialchars(json_encode($p, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
@ -104,12 +104,12 @@ $patients = $stmt->fetchAll();
|
|||||||
<i class="bi bi-clipboard2-plus"></i>
|
<i class="bi bi-clipboard2-plus"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-link text-success py-1 px-2 border-end"
|
<button class="btn btn-link text-success py-1 px-2 border-end"
|
||||||
onclick="showBillModal(null, <?php echo $p['id']; ?>, <?php echo htmlspecialchars(json_encode($p['name'], JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showBillModal(null, <?php echo $p['id']; ?>, <?php echo htmlspecialchars(json_encode($p['name'], JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('add_bill'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('add_bill'); ?>">
|
||||||
<i class="bi bi-receipt"></i>
|
<i class="bi bi-receipt"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-link text-danger py-1 px-2"
|
<button class="btn btn-link text-danger py-1 px-2"
|
||||||
onclick="showDeletePatientModal(<?php echo $p['id']; ?>, <?php echo htmlspecialchars(json_encode($p['name'], JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showDeletePatientModal(<?php echo $p['id']; ?>, <?php echo htmlspecialchars(json_encode($p['name'], JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('delete'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('delete'); ?>">
|
||||||
<i class="bi bi-trash3"></i>
|
<i class="bi bi-trash3"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -71,7 +71,7 @@ $poisons = $stmt->fetchAll();
|
|||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
onclick="showEditPoisonModal(<?php echo htmlspecialchars(json_encode($poison, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showEditPoisonModal(<?php echo htmlspecialchars(json_encode($poison, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -40,7 +40,7 @@ $groups = $stmt->fetchAll();
|
|||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
onclick="showEditTestGroupModal(<?php echo htmlspecialchars(json_encode($group, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showEditTestGroupModal(<?php echo htmlspecialchars(json_encode($group, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -35,7 +35,6 @@ foreach ($raw_visits as $v) {
|
|||||||
$v['lab_inquiries'] = $db->query("SELECT li.* FROM laboratory_inquiries li WHERE li.visit_id = " . (int)$v['id'])->fetchAll();
|
$v['lab_inquiries'] = $db->query("SELECT li.* FROM laboratory_inquiries li WHERE li.visit_id = " . (int)$v['id'])->fetchAll();
|
||||||
foreach($v['lab_inquiries'] as &$li) {
|
foreach($v['lab_inquiries'] as &$li) {
|
||||||
$li['items'] = $db->query("SELECT it.*, lt.name_$lang as test_name FROM inquiry_tests it JOIN laboratory_tests lt ON it.test_id = lt.id WHERE it.inquiry_id = " . (int)$li['id'])->fetchAll();
|
$li['items'] = $db->query("SELECT it.*, lt.name_$lang as test_name FROM inquiry_tests it JOIN laboratory_tests lt ON it.test_id = lt.id WHERE it.inquiry_id = " . (int)$li['id'])->fetchAll();
|
||||||
// Maintain a string summary for backward compatibility or simple display
|
|
||||||
$li['results'] = implode(', ', array_map(function($item) { return $item['test_name'] . ': ' . ($item['result'] ?: '-'); }, $li['items']));
|
$li['results'] = implode(', ', array_map(function($item) { return $item['test_name'] . ': ' . ($item['result'] ?: '-'); }, $li['items']));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,18 +89,21 @@ foreach ($raw_visits as $v) {
|
|||||||
<table class="table table-hover align-middle mb-0">
|
<table class="table table-hover align-middle mb-0">
|
||||||
<thead class="table-light text-secondary">
|
<thead class="table-light text-secondary">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="px-4 py-3"><?php echo __('date'); ?></th>
|
<th class="px-4 py-3">#</th>
|
||||||
|
<th class="py-3"><?php echo __('date'); ?></th>
|
||||||
<th class="py-3"><?php echo __('patient'); ?></th>
|
<th class="py-3"><?php echo __('patient'); ?></th>
|
||||||
<th class="py-3"><?php echo __('doctor'); ?></th>
|
<th class="py-3"><?php echo __('doctor'); ?></th>
|
||||||
<th class="py-3"><?php echo __('diagnosis'); ?></th>
|
<th class="py-3"><?php echo __('diagnosis'); ?></th>
|
||||||
<th class="py-3"><?php echo __('results'); ?></th>
|
<th class="py-3"><?php echo __('vitals'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('treatment'); ?></th>
|
||||||
|
<th class="py-3"><?php echo __('inquiries'); ?></th>
|
||||||
<th class="py-3 text-end px-4"><?php echo __('actions'); ?></th>
|
<th class="py-3 text-end px-4"><?php echo __('actions'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php if (empty($visits)): ?>
|
<?php if (empty($visits)): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6" class="text-center py-5 text-muted">
|
<td colspan="9" class="text-center py-5 text-muted">
|
||||||
<i class="bi bi-clipboard2-pulse display-4 d-block mb-3"></i>
|
<i class="bi bi-clipboard2-pulse display-4 d-block mb-3"></i>
|
||||||
No visits found.
|
No visits found.
|
||||||
</td>
|
</td>
|
||||||
@ -109,71 +111,83 @@ foreach ($raw_visits as $v) {
|
|||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php foreach ($visits as $v): ?>
|
<?php foreach ($visits as $v): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="px-4 text-secondary"><?php echo date('Y-m-d H:i', strtotime($v['visit_date'])); ?></td>
|
<td class="px-4 text-muted small"><?php echo $v['id']; ?></td>
|
||||||
<td class="fw-semibold text-dark"><?php echo htmlspecialchars($v['patient_name']); ?></td>
|
<td class="text-secondary"><?php echo date('Y-m-d H:i', strtotime($v['visit_date'])); ?></td>
|
||||||
<td class="text-secondary"><?php echo htmlspecialchars($v['doctor_name']); ?></td>
|
<td class="fw-semibold text-dark"><?php echo htmlspecialchars($v['patient_name'] ?? ''); ?></td>
|
||||||
|
<td class="text-secondary"><?php echo htmlspecialchars($v['doctor_name'] ?? ''); ?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
$diagnosis_plain = strip_tags($v['diagnosis']);
|
$diagnosis_plain = strip_tags($v['diagnosis'] ?? '');
|
||||||
$snippet = mb_strimwidth($diagnosis_plain, 0, 50, "...");
|
$snippet = mb_strimwidth($diagnosis_plain, 0, 30, "...");
|
||||||
?>
|
?>
|
||||||
<small class="text-muted" title="<?php echo htmlspecialchars($diagnosis_plain); ?>"><?php echo htmlspecialchars($snippet); ?></small>
|
<small class="text-muted" title="<?php echo htmlspecialchars($diagnosis_plain); ?>"><?php echo htmlspecialchars($snippet); ?></small>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php if (!empty($v['lab_inquiries'])): ?>
|
<?php
|
||||||
<span class="badge bg-info text-white me-1" title="<?php echo __('laboratory'); ?>" data-bs-toggle="tooltip">
|
$vitals = [];
|
||||||
<i class="bi bi-flask"></i> <?php echo count($v['lab_inquiries']); ?>
|
if(!empty($v['blood_pressure'])) $vitals[] = '<i class="bi bi-heart-pulse me-1"></i>' . htmlspecialchars($v['blood_pressure'] ?? '');
|
||||||
<?php
|
if(!empty($v['weight'])) $vitals[] = '<i class="bi bi-speedometer2 me-1"></i>' . htmlspecialchars($v['weight'] ?? '') . 'kg';
|
||||||
$lab_has_attachment = false;
|
if(!empty($v['temperature'])) $vitals[] = '<i class="bi bi-thermometer-half me-1"></i>' . htmlspecialchars($v['temperature'] ?? '') . '°C';
|
||||||
foreach($v['lab_inquiries'] as $li) {
|
echo implode('<br>', $vitals);
|
||||||
foreach($li['items'] as $item) {
|
?>
|
||||||
if(!empty($item['attachment'])) $lab_has_attachment = true;
|
</td>
|
||||||
}
|
<td>
|
||||||
}
|
<?php
|
||||||
if($lab_has_attachment) echo ' <i class="bi bi-image"></i>';
|
$treatment_plain = strip_tags($v['treatment_plan'] ?? '');
|
||||||
?>
|
$t_snippet = mb_strimwidth($treatment_plain, 0, 30, "...");
|
||||||
</span>
|
?>
|
||||||
<?php endif; ?>
|
<small class="text-muted" title="<?php echo htmlspecialchars($treatment_plain); ?>"><?php echo htmlspecialchars($t_snippet); ?></small>
|
||||||
<?php if (!empty($v['xray_inquiries'])): ?>
|
</td>
|
||||||
<span class="badge bg-dark text-white" title="<?php echo __('xray'); ?>" data-bs-toggle="tooltip">
|
<td>
|
||||||
<i class="bi bi-camera"></i> <?php echo count($v['xray_inquiries']); ?>
|
<div class="d-flex gap-1">
|
||||||
<?php
|
<?php if (!empty($v['lab_inquiries'])): ?>
|
||||||
$has_attachment = false;
|
<span class="badge bg-info text-white" title="<?php echo count($v['lab_inquiries']); ?> <?php echo __('laboratory'); ?>" data-bs-toggle="tooltip">
|
||||||
foreach($v['xray_inquiries'] as $xi) {
|
<i class="bi bi-flask"></i> <?php echo count($v['lab_inquiries']); ?>
|
||||||
foreach($xi['items'] as $item) {
|
</span>
|
||||||
if(!empty($item['attachment'])) $has_attachment = true;
|
<?php endif; ?>
|
||||||
}
|
<?php if (!empty($v['xray_inquiries'])): ?>
|
||||||
}
|
<span class="badge bg-dark text-white" title="<?php echo count($v['xray_inquiries']); ?> <?php echo __('xray'); ?>" data-bs-toggle="tooltip">
|
||||||
if($has_attachment) echo ' <i class="bi bi-image"></i>';
|
<i class="bi bi-camera"></i> <?php echo count($v['xray_inquiries']); ?>
|
||||||
?>
|
</span>
|
||||||
</span>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="d-flex justify-content-end gap-1">
|
||||||
<button class="btn btn-link text-success py-1 px-2 border-end" onclick="showVisitResultsModal(<?php echo htmlspecialchars(json_encode($v, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)" data-bs-toggle="tooltip" title="<?php echo __('view_results'); ?>"><i class="bi bi-eye"></i></button>
|
<?php
|
||||||
<button class="btn btn-link text-warning py-1 px-2 border-end"
|
// Encode safely for attribute
|
||||||
onclick="showEditVisitModal(<?php echo htmlspecialchars(json_encode($v, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
$json_v = htmlspecialchars(json_encode($v, JSON_UNESCAPED_UNICODE) ?: '{}', ENT_QUOTES, 'UTF-8');
|
||||||
|
$patient_name_json = htmlspecialchars(json_encode($v['patient_name'] ?? '', JSON_UNESCAPED_UNICODE) ?: '""', ENT_QUOTES, 'UTF-8');
|
||||||
|
?>
|
||||||
|
<button class="btn btn-sm btn-outline-success"
|
||||||
|
onclick="showVisitResultsModal(JSON.parse(this.getAttribute('data-visit')))"
|
||||||
|
data-visit="<?php echo $json_v; ?>"
|
||||||
|
data-bs-toggle="tooltip" title="<?php echo __('view_results'); ?>">
|
||||||
|
<i class="bi bi-eye"></i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-sm btn-outline-warning"
|
||||||
|
onclick="showEditVisitModal(JSON.parse(this.getAttribute('data-visit')))"
|
||||||
|
data-visit="<?php echo $json_v; ?>"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-link text-info py-1 px-2 border-end"
|
<button class="btn btn-sm btn-outline-info"
|
||||||
onclick="showLabInquiryModalFromVisit(<?php echo $v['id']; ?>, <?php echo $v['patient_id']; ?>, <?php echo htmlspecialchars(json_encode($v['patient_name'], JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showLabInquiryModalFromVisit(<?php echo $v['id']; ?>, <?php echo $v['patient_id']; ?>, <?php echo $patient_name_json; ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('add_inquiry'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('add_inquiry'); ?>">
|
||||||
<i class="bi bi-flask"></i>
|
<i class="bi bi-flask"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-link text-dark py-1 px-2 border-end"
|
<button class="btn btn-sm btn-outline-dark"
|
||||||
onclick="showXrayInquiryModalFromVisit(<?php echo $v['id']; ?>, <?php echo $v['patient_id']; ?>, <?php echo htmlspecialchars(json_encode($v['patient_name'], JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showXrayInquiryModalFromVisit(<?php echo $v['id']; ?>, <?php echo $v['patient_id']; ?>, <?php echo $patient_name_json; ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('add_xray_inquiry'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('add_xray_inquiry'); ?>">
|
||||||
<i class="bi bi-camera"></i>
|
<i class="bi bi-camera"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-sm btn-outline-primary"
|
||||||
onclick="showReportModal(<?php echo $v['id']; ?>)"
|
onclick="showReportModal(<?php echo $v['id']; ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('new_report'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('new_report'); ?>">
|
||||||
<i class="bi bi-file-earmark-plus"></i>
|
<i class="bi bi-file-earmark-plus"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-link text-success py-1 px-2"
|
<button class="btn btn-sm btn-outline-success"
|
||||||
onclick="showBillModal(<?php echo $v['id']; ?>, <?php echo $v['patient_id']; ?>, <?php echo htmlspecialchars(json_encode($v['patient_name'], JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showBillModal(<?php echo $v['id']; ?>, <?php echo $v['patient_id']; ?>, <?php echo $patient_name_json; ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('create_bill'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('create_bill'); ?>">
|
||||||
<i class="bi bi-receipt"></i>
|
<i class="bi bi-receipt"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -40,7 +40,7 @@ $groups = $stmt->fetchAll();
|
|||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
onclick="showEditXrayGroupModal(<?php echo htmlspecialchars(json_encode($group, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showEditXrayGroupModal(<?php echo htmlspecialchars(json_encode($group, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -143,12 +143,12 @@ $all_xrays_list = $db->query("SELECT id, name_$lang as name FROM xray_tests ORDE
|
|||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-link text-info py-1 px-2 border-end"
|
<button class="btn btn-link text-info py-1 px-2 border-end"
|
||||||
onclick="printXrayInquiry(<?php echo htmlspecialchars(json_encode($inquiry, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="printXrayInquiry(<?php echo htmlspecialchars(json_encode($inquiry, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('print'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('print'); ?>">
|
||||||
<i class="bi bi-printer"></i>
|
<i class="bi bi-printer"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
onclick="showEditXrayInquiryModal(<?php echo htmlspecialchars(json_encode($inquiry, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showEditXrayInquiryModal(<?php echo htmlspecialchars(json_encode($inquiry, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -107,7 +107,7 @@ $all_xray_groups_list = $db->query("SELECT id, name_$lang as name FROM xray_grou
|
|||||||
<td class="text-end px-4">
|
<td class="text-end px-4">
|
||||||
<div class="btn-group shadow-sm border rounded bg-white">
|
<div class="btn-group shadow-sm border rounded bg-white">
|
||||||
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
<button class="btn btn-link text-primary py-1 px-2 border-end"
|
||||||
onclick="showEditXrayTestModal(<?php echo htmlspecialchars(json_encode($test, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)); ?>)"
|
onclick="showEditXrayTestModal(<?php echo htmlspecialchars(json_encode($test, JSON_UNESCAPED_UNICODE)); ?>)"
|
||||||
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
data-bs-toggle="tooltip" title="<?php echo __('edit'); ?>">
|
||||||
<i class="bi bi-pencil-square"></i>
|
<i class="bi bi-pencil-square"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user