Files
2026-03-26 09:28:14 +07:00

247 lines
15 KiB
PHP

@extends('frontend.layout')
@section('content')
<div class="container page_container">
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-4">
@if(Session::has('success'))
<div class="alert alert-success">
{{ Session::get('success') }}
@php
Session::forget('success');
@endphp
</div>
@endif
@if(Session::has('error'))
<div class="alert alert-danger">
{{ Session::get('error') }}
@php
Session::forget('error');
@endphp
</div>
@endif
@if(Session::has('errors'))
<div class="alert alert-danger">
{{ 'Có lỗi xảy ra'}}
@php
Session::forget('errors');
@endphp
</div>
@endif
<div class="customer_form">
@if (Auth::check())
<div class="title">Cập nhật thông tin nhân</div>
<form action="{{ route('updateaccount') }}" method="POST">
{{ csrf_field() }}
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="name">Tên người dùng:</label>
@php
$name = Auth::user()->name ?? '';
if (old('name') != '') {
$name = old('name');
}
@endphp
<input class="form-control" name="name" id="name" value="{{ $name ?? '' }}" />
@if ($errors->has('name'))
<span class="text-danger">{{ $errors->first('name') }}</span>
@endif
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="phone">Số điện thoại:</label>
@php
$phone = Auth::user()->phone ?? '';
if (old('phone') != '') {
$phone = old('phone');
}
@endphp
<input class="form-control" name="phone" id="phone" value="{{ $phone ?? '' }}" />
@if ($errors->has('phone'))
<span class="text-danger">{{ $errors->first('phone') }}</span>
@endif
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="address">Nơi sinh sống:</label>
@php
$address = Auth::user()->address ?? '';
if (old('address') != '') {
$address = old('address');
}
@endphp
<input class="form-control" name="address" id="address" value="{{ $address ?? '' }}" />
@if ($errors->has('address'))
<span class="text-danger">{{ $errors->first('address') }}</span>
@endif
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label>Nếu trước đó đã biết Bệnh viện ĐKQT S.I.S Cần Thơ?</label>
@php
$known_sis = old('known_sis', Auth::user()->known_sis ?? '');
@endphp
<div class="form-check">
<input class="form-check-input" type="radio" name="known_sis" id="known_sis_yes" value="1" {{ $known_sis === '1' ? 'checked' : '' }}>
<label class="form-check-label" for="known_sis_yes"></label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="known_sis" id="known_sis_no" value="0" {{ $known_sis === '0' ? 'checked' : '' }}>
<label class="form-check-label" for="known_sis_no">Không</label>
</div>
@if ($errors->has('known_sis'))
<span class="text-danger">{{ $errors->first('known_sis') }}</span>
@endif
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="job">Nghề nghiệp:</label>
@php
$job = Auth::user()->job ?? '';
if (old('job') != '') {
$job = old('job');
}
@endphp
<input class="form-control" name="job" id="job" value="{{ $job ?? '' }}" />
@if ($errors->has('job'))
<span class="text-danger">{{ $errors->first('job') }}</span>
@endif
</div>
</div>
<div class="col-md-12" style="display: none;">
<div class="form-group">
<label for="password">Mật khẩu:</label>
<input class="form-control" name="password" id="password" value="" />
@if ($errors->has('password'))
<span class="text-danger">{{ $errors->first('password') }}</span>
@endif
</div>
</div>
<div class="col-md-12">
<button type="submit" class="custom_btn align-right">Cập nhật</button>
<a href="{{ route('logout') }}" type="button" class="custom_btn red_btn align-right">Đăng
xuất</a>
</div>
</div>
</form>
@else
<div class="title">Nhập thông tin nhân</div>
<div class="alert alert-danger">
(*) Nhập thông tin nhân trước khi quay số
</div>
<form action="{{ route('createaccount') }}" method="POST">
{{ csrf_field() }}
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="name">Tên người dùng:</label>
@php
$name = '';
if (old('name') != '') {
$name = old('name');
}
@endphp
<input class="form-control" name="name" id="name" value="{{ $name ?? '' }}" />
@if ($errors->has('name'))
<span class="text-danger">{{ $errors->first('name') }}</span>
@endif
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="phone">Số điện thoại:</label>
@php
$phone = '';
if (old('phone') != '') {
$phone = old('phone');
}
@endphp
<input class="form-control" name="phone" id="phone" value="{{ $phone ?? '' }}" />
@if ($errors->has('phone'))
<span class="text-danger">{{ $errors->first('phone') }}</span>
@endif
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="address">Nơi sinh sống:</label>
@php
$address = '';
if (old('address') != '') {
$address = old('address');
}
@endphp
<input class="form-control" name="address" id="address" value="{{ $address ?? '' }}" />
@if ($errors->has('address'))
<span class="text-danger">{{ $errors->first('address') }}</span>
@endif
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label>Nếu trước đó đã biết Bệnh viện ĐKQT S.I.S Cần Thơ?</label>
@php
$known_sis = old('known_sis', '');
@endphp
<div class="form-check">
<input class="form-check-input" type="radio" name="known_sis" id="known_sis_yes" value="1" {{ $known_sis === '1' ? 'checked' : '' }}>
<label class="form-check-label" for="known_sis_yes"></label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="known_sis" id="known_sis_no" value="0" {{ $known_sis === '0' ? 'checked' : '' }}>
<label class="form-check-label" for="known_sis_no">Không</label>
</div>
@if ($errors->has('known_sis'))
<span class="text-danger">{{ $errors->first('known_sis') }}</span>
@endif
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="job">Nghề nghiệp:</label>
@php
$job = '';
if (old('job') != '') {
$job = old('job');
}
@endphp
<input class="form-control" name="job" id="job" value="{{ $job ?? '' }}" />
@if ($errors->has('job'))
<span class="text-danger">{{ $errors->first('job') }}</span>
@endif
</div>
</div>
<div class="col-md-12">
<button type="submit" class="custom_btn align-right">Gửi thông tin</button>
</div>
</div>
</form>
@endif
</div>
</div>
<div class="col-md-4">
<div class="prize_history">
<a class="blinking-border-button mx-auto" href="{{route('game')}}">Quay lại chức năng quay số</a>
<div class="title">LỊCH SỬ HOẠT ĐỘNG</div>
<ul class="list-group">
@if (isset($history_data))
@foreach ($history_data as $history_item)
<li class="list-group-item">
Trúng thưởng {{ $history_item->prize_name ?? '' }} vào lúc
{{ date_format(date_create($history_item->created_at), "d/m/Y H:i") }}
</li>
@endforeach
@endif
</ul>
</div>
</div>
<div class="col-md-2"></div>
</div>
</div>
@endsection