26 lines
1.3 KiB
Python
26 lines
1.3 KiB
Python
import re
|
|
|
|
with open("includes/layout/footer.php", "r") as f:
|
|
content = f.read()
|
|
|
|
new_body = """<div class="mb-3">
|
|
<label class="form-label"><?php echo __("select_file"); ?></label>
|
|
<input type="file" name="file" class="form-control" accept=".csv,.xls,.xlsx" required>
|
|
<div class="form-text mt-2 text-muted">
|
|
<i class="bi bi-info-circle me-1"></i> <?php echo __("excel_format_info"); ?>
|
|
</div>
|
|
</div>
|
|
<div class="mt-3 text-center">
|
|
<a href="download_patient_template.php" class="btn btn-outline-success btn-sm">
|
|
<i class="bi bi-download me-1"></i> <?php echo __("download_sample_template") ?? "Download Sample Template"; ?>
|
|
</a>
|
|
</div>"""
|
|
|
|
content = re.sub(
|
|
r'<div class="mb-3">\s*<label class="form-label"><\?php echo __\("select_file"\); \?></label>\s*<input type="file" name="file" class="form-control" accept="\.xls,\.xlsx" required>\s*<div class="form-text mt-2 text-muted">\s*<i class="bi bi-info-circle me-1"></i> <\?php echo __\("excel_format_info"\); \?>\s*</div>\s*</div>',
|
|
new_body,
|
|
content
|
|
)
|
|
|
|
with open("includes/layout/footer.php", "w") as f:
|
|
f.write(content) |