@extends('layouts.master') @section('title', $title) {{-- System settings → Backup & data (BackupController): backups to email / download, and clearing demo data (admin). --}} @section('content')
@can('system-backup')
{{-- backups --}}
Database backups
@if ($s['last_status'])
Last scheduled backup: {{ $s['last_status'] }}
@endif @if (empty($files))

No backups yet — click "Back up now".

@else
@foreach ($files as $f) @endforeach
FileSizeMade
{{ $f['name'] }} {{ number_format($f['size'] / 1048576, 1) }} MB {{ local_time(\Illuminate\Support\Carbon::createFromTimestamp($f['time']), 'd M Y, h:i A') }}
@endif Kept on the server: the newest {{ $s['keep'] }}. To restore one: unzip it and import the .sql into an empty database (phpMyAdmin → Import).
{{-- schedule --}}
Email a backup automatically
@unless ($mailReady)
Set up the email account (SMTP) first in SMS & Email Reports — backups are sent with it.
@endunless
@csrf
Server time · now {{ now()->format('H:i') }}
newest backups
One or more emails, separated by commas. Big backups (over ~18 MB) come as a download link valid 7 days.

The schedule needs the server's cron to run Laravel's scheduler every minute:
* * * * * cd {{ base_path() }} && php artisan schedule:run >> /dev/null 2>&1
@endcan @can('system-reset') {{-- clear system data --}}
Clear system data

Removes the records entered while trying the system (demo data), so the hospital starts clean. Always kept: users, roles & permissions, settings, chart of accounts, lab tests, imaging & service lists, operations, rooms, stores, reports. Numbering (patient no., invoice no. …) starts again from 1. This can't be undone — keep "Make a backup first" ticked.

@csrf
@foreach ($groups as $g)
@endforeach
@endcan
@endsection @section('page_js') @endsection