staffmanager/resources/views/dashboard/administration/settings.blade.php

77 lines
2.8 KiB
PHP
Raw Normal View History

2020-08-30 22:06:01 +00:00
@extends('adminlte::page')
@section('title', config('app.name') . ' | ' . __('messages.settings.settings'))
2020-08-30 22:06:01 +00:00
@section('content_header')
@if (Auth::user()->hasAnyRole('admin'))
<h4>{{__('messages.adm')}} / {{__('messages.settings.settings')}}</h4>
2020-08-30 22:06:01 +00:00
@else
<h4>{{__('messages.reusable.no_access')}}</h4>
2020-08-30 22:06:01 +00:00
@endif
@stop
@section('js')
@if (session()->has('success'))
<script>
toastr.success("{{session('success')}}")
</script>
@endif
@if (session()->has('error'))
<script>
toastr.error("{{session('error')}}")
</script>
@endif
2020-08-30 22:06:01 +00:00
@if($errors->any())
@foreach ($errors->all() as $error)
<script>toastr.error('{{$error}}', 'Validation error!')</script>
@endforeach
@endif
@stop
@section('content')
<div class="row">
<div class="col">
<div class="card">
<div class="card-header">
<h3>{{__('messages.settings.settings_header')}}</h3>
<p>{{__('messages.settings.settings_p')}}</p>
2020-08-30 22:06:01 +00:00
</div>
<div class="card-body">
<form name="settings" id="settings" method="post" action="{{route('saveSettings')}}">
2020-08-31 17:34:09 +00:00
@csrf
2020-08-31 17:03:20 +00:00
@foreach($options as $option)
2020-08-31 17:13:44 +00:00
<div class="form-group form-check">
2020-08-31 17:32:08 +00:00
<!-- Unchecked checkbox hack: This only works for serverside languages that process the last duplicate element, since the browser sends both the hidden and checkbox values. -->
<!-- This "hack" is necessary because browsers don't send, by default, unchecked checkboxes to the server, so we would have no way to know if X checkbox was unchecked. -->
<input type="hidden" name="{{$option->option_name}}" value="0">
<input type="checkbox" name="{{$option->option_name}}" value="1" id="{{$option->option_name}}" class="form-check-input" {{ ($option->option_value == 1) ? 'checked' : '' }}>
2020-08-31 17:13:44 +00:00
<label for="{{$option->option_name}}">{{$option->friendly_name}}</label>
2020-08-30 22:06:01 +00:00
</div>
@endforeach
</form>
</div>
<div class="card-footer">
<button type="button" class="btn btn-success" onclick="$('#settings').submit()"><i class="fa fa-save"></i> {{__('messages.vacancy.save')}}</button>
<button type="button" class="btn btn-warning" onclick="window.location.href='{{route('dashboard')}}'"><i class="fa fa-arrow-circle-o-left"></i> {{__('messages.settings.back_btn')}}</button>
</div>
2020-08-30 22:06:01 +00:00
</div>
</div>
</div>
@stop