chore: remove APAW from tracking; gitignore agent-generated files
This commit is contained in:
111
resources/views/auth/login.blade.php
Normal file
111
resources/views/auth/login.blade.php
Normal file
@@ -0,0 +1,111 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="login-box">
|
||||
<!-- /.login-logo -->
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header text-center">
|
||||
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="h1">
|
||||
<b>{{ config('app.name', 'Laravel') }}</b>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="login-box-msg">
|
||||
{{ __('messages.login_to_start_your_session') }}
|
||||
</p>
|
||||
<form method="POST" action="{{ route('login') }}">
|
||||
@csrf
|
||||
|
||||
@if(config('app.env') == 'demo')
|
||||
@php
|
||||
$email = 'admin@admin.com';
|
||||
$pwd = '12345678';
|
||||
@endphp
|
||||
@else
|
||||
@php
|
||||
$email = '';
|
||||
$pwd = '';
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<input type="email" id="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{old('email') ?? $email}}" required autocomplete="email" autofocus placeholder="{{ __('E-Mail Address') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope"></span>
|
||||
</div>
|
||||
</div>
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="input-group mb-3">
|
||||
<input type="password" id="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password" value="{{$pwd}}" placeholder="{{ __('Password') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="remember" name="remember" {{ old('remember') ? 'checked' : '' }}>
|
||||
<label class="custom-control-label" for="remember">
|
||||
{{ __('Remember Me') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
<div class="col-4">
|
||||
<button type="submit" class="btn btn-primary btn-block">
|
||||
{{ __('Login') }}
|
||||
</button>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
</form>
|
||||
<!-- /.social-auth-links -->
|
||||
|
||||
<div class="social-auth-links text-center mt-2 mb-3">
|
||||
<p>- {{ __('OR') }} -</p>
|
||||
@if (Route::has('password.request'))
|
||||
<a class="btn btn-link" href="{{ route('password.request') }}">
|
||||
{{ __('messages.forgot_password') }} <b>@lang('messages.reset')</b>
|
||||
</a>
|
||||
@endif
|
||||
@if (Route::has('register'))
|
||||
<a class="btn btn-link" href="{{ route('register') }}">
|
||||
{{ __('messages.dont_have_an_account') }} <b>@lang('messages.register')</b>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
@if (!empty(session('status')) && session('status')['success'] == false)
|
||||
var msg = '{!!session('status')['msg']!!}';
|
||||
toastr.error(msg);
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
63
resources/views/auth/passwords/email.blade.php
Normal file
63
resources/views/auth/passwords/email.blade.php
Normal file
@@ -0,0 +1,63 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="login-box">
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header text-center">
|
||||
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="h1">
|
||||
<b>
|
||||
{{ config('app.name', 'Laravel') }}
|
||||
</b>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body login-card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
<p class="login-box-msg">
|
||||
{{ __('messages.request_password_heading') }}
|
||||
</p>
|
||||
<form method="POST" action="{{ route('password.email') }}">
|
||||
@csrf
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<input type="email" id="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus placeholder="{{ __('E-Mail Address') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope"></span>
|
||||
</div>
|
||||
</div>
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="social-auth-links text-center mb-3">
|
||||
<button type="submit" class="btn btn-block btn-primary">
|
||||
{{ __('Send Password Reset Link') }}
|
||||
</button>
|
||||
</div>
|
||||
<p class="text-center mt-3">
|
||||
- {{ __('OR') }} -
|
||||
<br>
|
||||
<a href="{{ route('login') }}" class="btn btn-link">
|
||||
{{ __('messages.already_have_an_account') }} <b>{{ __('Login') }}</b>
|
||||
</a>
|
||||
@if (Route::has('register'))
|
||||
<a class="btn btn-link" href="{{ route('register') }}">
|
||||
{{ __('messages.dont_have_an_account') }} <b>@lang('messages.register')</b>
|
||||
</a>
|
||||
@endif
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
84
resources/views/auth/passwords/reset.blade.php
Normal file
84
resources/views/auth/passwords/reset.blade.php
Normal file
@@ -0,0 +1,84 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="login-box">
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header text-center">
|
||||
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="h1">
|
||||
<b>
|
||||
{{ config('app.name', 'Laravel') }}
|
||||
</b>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body login-card-body">
|
||||
<p class="login-box-msg">
|
||||
{{ __('messages.password_reset_heading') }}
|
||||
</p>
|
||||
<form method="POST" action="{{ route('password.update') }}">
|
||||
@csrf
|
||||
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<input type="email" id="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ $email ?? old('email') }}" required autocomplete="email" autofocus placeholder="{{ __('E-Mail Address') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope"></span>
|
||||
</div>
|
||||
</div>
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<input type="password" id="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password" placeholder="{{ __('Password') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password" placeholder="{{ __('Confirm Password') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="social-auth-links text-center mb-3">
|
||||
<button type="submit" class="btn btn-block btn-primary">
|
||||
{{ __('Reset Password') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<p class="text-center mt-3">
|
||||
- {{ __('OR') }} -
|
||||
<br>
|
||||
<a href="{{ route('login') }}" class="btn btn-link">
|
||||
{{ __('messages.already_have_an_account') }} <b>{{ __('Login') }}</b>
|
||||
</a>
|
||||
@if (Route::has('register'))
|
||||
<a class="btn btn-link" href="{{ route('register') }}">
|
||||
{{ __('messages.dont_have_an_account') }} <b>@lang('messages.register')</b>
|
||||
</a>
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
201
resources/views/auth/register.blade.php
Normal file
201
resources/views/auth/register.blade.php
Normal file
@@ -0,0 +1,201 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-9">
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header text-center">
|
||||
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="h1">
|
||||
<b>
|
||||
{{ config('app.name', 'Laravel') }}
|
||||
</b>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body register-card-body">
|
||||
<p class="login-box-msg">
|
||||
{{ __('messages.register_a_new_membership') }}
|
||||
</p>
|
||||
<form method="POST" action="{{action([\App\Http\Controllers\RegistrationController::class, 'store'])}}">
|
||||
@csrf
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-md-6 offset-md-3">
|
||||
<div class="input-group mb-3">
|
||||
<input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus placeholder="{{__('Name')}}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-user"></span>
|
||||
</div>
|
||||
</div>
|
||||
@error('name')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-md-6 offset-md-3">
|
||||
<div class="input-group mb-3">
|
||||
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" placeholder="{{ __('E-Mail Address') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope"></span>
|
||||
</div>
|
||||
</div>
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-md-6 offset-md-3">
|
||||
<div class="input-group mb-3">
|
||||
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password" placeholder="{{ __('Password') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-md-6 offset-md-3">
|
||||
<div class="input-group mb-3">
|
||||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password" placeholder="{{ __('Confirm Password') }}">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($__enable_saas)
|
||||
<div class="form-row">
|
||||
@foreach($packages as $package)
|
||||
<div class="col-md-4">
|
||||
<label>
|
||||
<input type="radio" class="d-none" name="package_id" value="{{$package->id}}">
|
||||
<div class="card card-outline card-info on_hover pointer choosen_pack">
|
||||
<div class="card-header">
|
||||
<div class="text-center">
|
||||
<h5>
|
||||
{{$package->name}}
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
@if($package->no_of_active_forms != 0)
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.no_of_forms',[
|
||||
'active_form' => $package->no_of_active_forms])
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.unlimited_forms')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
@if($package->is_form_downloadable)
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-times-circle text-danger"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
@php
|
||||
$price_interval = __('messages.'.$package->price_interval);
|
||||
@endphp
|
||||
@if($package->price != 0)
|
||||
<h5>
|
||||
<span class="currency">
|
||||
{{$package->price}}
|
||||
</span>
|
||||
<small class="text-muted">
|
||||
@lang('messages.subscription_price',[
|
||||
'interval' => $package->interval,
|
||||
'price_interval' => $price_interval
|
||||
])
|
||||
</small>
|
||||
</h5>
|
||||
@else
|
||||
<h5>
|
||||
@lang('messages.free_for_interval', [
|
||||
'interval' => $package->interval,
|
||||
'price_interval' => $price_interval
|
||||
])
|
||||
</h5>
|
||||
@endif
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
{{$package->description}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
@if($loop->iteration%3 == 0)
|
||||
<div class="clearfix"></div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="form-group row mb-0">
|
||||
<div class="col-md-6 offset-md-3">
|
||||
<button type="submit" class="btn btn-block btn-primary">
|
||||
{{ __('Register') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<p class="text-center mt-3">
|
||||
- {{ __('OR') }} -
|
||||
<br>
|
||||
<a href="{{ route('login') }}" class="btn btn-link">
|
||||
{{ __('messages.already_have_an_account') }} <b>{{ __('Login') }}</b>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('span.currency').each(function(index, element){
|
||||
var money = __formatCurrency($(this).text());
|
||||
$(this).text(money);
|
||||
});
|
||||
|
||||
$(document).on('click', '.choosen_pack', function(){
|
||||
$('.choosen_pack').removeClass('border-success subscribed');
|
||||
$(this).closest('.card').addClass('border-success subscribed');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
32
resources/views/auth/verify.blade.php
Normal file
32
resources/views/auth/verify.blade.php
Normal file
@@ -0,0 +1,32 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="login-box">
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="h1">
|
||||
<b>{{ config('app.name', 'Laravel') }}</b>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body login-card-body">
|
||||
@if (session('resent'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ __('A fresh verification link has been sent to your email address.') }}
|
||||
</div>
|
||||
@endif
|
||||
<p class="login-box-msg">
|
||||
{{ __('Verify Your Email Address') }}
|
||||
</p>
|
||||
|
||||
{{ __('Before proceeding, please check your email for a verification link.') }}
|
||||
{{ __('If you did not receive the email') }}, <a href="{{ route('verification.resend') }}">{{ __('click here to request another') }}</a>.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
1
resources/views/emails/exception.blade.php
Normal file
1
resources/views/emails/exception.blade.php
Normal file
@@ -0,0 +1 @@
|
||||
{!! $content !!}
|
||||
1
resources/views/emails/form_submitted.blade.php
Normal file
1
resources/views/emails/form_submitted.blade.php
Normal file
@@ -0,0 +1 @@
|
||||
{!! $body !!}
|
||||
125
resources/views/form/collaborate.blade.php
Normal file
125
resources/views/form/collaborate.blade.php
Normal file
@@ -0,0 +1,125 @@
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<form id="collaborate_form" action="{{action([\App\Http\Controllers\FormController::class, 'postCollab'])}}" method="POST">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">
|
||||
@lang('messages.collaborate') ({{$form->name}})
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@if($form->assignedTo->count() > 0)
|
||||
<h5>@lang('messages.assigned_users'):</h5>
|
||||
@foreach($form->assignedTo as $key => $assigned_to)
|
||||
<div class="card edit-assigned-form mb-2 p-3">
|
||||
<label>
|
||||
<i class="fas fa-user-tie"></i>
|
||||
{{$assigned_to->user->name}}
|
||||
<small>
|
||||
<code>({{$assigned_to->user->email}})</code>
|
||||
</small>
|
||||
</label>
|
||||
<div class="row">
|
||||
<input type="hidden" name="edit_assigned_id[]" value="{{$assigned_to->id}}">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="edit_permissions[{{$assigned_to->id}}][]" id="form_design_{{$key}}" value="can_design_form"
|
||||
@if(in_array('can_design_form', $assigned_to->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="form_design_{{$key}}">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="edit_permissions[{{$assigned_to->id}}][]" id="form_data_{{$key}}" value="can_view_data"
|
||||
@if(in_array('can_view_data', $assigned_to->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="form_data_{{$key}}">
|
||||
@lang('messages.can_view_data')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="edit_permissions[{{$assigned_to->id}}][]" id="can_view_form_{{$key}}" value="can_view_form"
|
||||
@if(in_array('can_view_form', $assigned_to->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="can_view_form_{{$key}}">
|
||||
@lang('messages.can_view_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<input type="hidden" name="form_id" value="{{$form->id}}">
|
||||
<div class="card assign-form mt-4 p-3">
|
||||
<h5 class="text-secondary">
|
||||
@lang('messages.invite_to_collaborate'):
|
||||
</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="email">
|
||||
@lang('messages.email'):
|
||||
</label>
|
||||
|
||||
<input type="email" class="form-control"
|
||||
name="email" id="email">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h5>@lang('messages.permissions'):</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_design" value="can_design_form">
|
||||
<label class="form-check-label" for="form_design">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_data" value="can_view_data">
|
||||
<label class="form-check-label" for="form_data">
|
||||
@lang('messages.can_view_data')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_view" value="can_view_form">
|
||||
<label class="form-check-label" for="form_view">
|
||||
@lang('messages.can_view_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip" title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-sm btn-primary submit_btn">
|
||||
@lang('messages.save')
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
93
resources/views/form/copy_form.blade.php
Normal file
93
resources/views/form/copy_form.blade.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">
|
||||
@lang('messages.copy_form') ({{$form->name}})
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@if(!isset($subscription_info['success']))
|
||||
<form id="copy_form" action="{{action([\App\Http\Controllers\FormController::class, 'store'])}}" method="POST">
|
||||
{{ csrf_field() }}
|
||||
<div class="form-row pb-4">
|
||||
<div class="col-md-4">
|
||||
<label for="name">
|
||||
@lang('messages.form_name')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
<input type="text" class="form-control"
|
||||
name="name" id="name" required>
|
||||
<input type="hidden" name="id" value="{{$form->id}}">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="form_slug">
|
||||
@lang('messages.form_slug')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
|
||||
<input type="text" class="form-control"
|
||||
name="slug" id="form_slug" required readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="description">
|
||||
@lang('messages.form_description')
|
||||
</label>
|
||||
<input type="text" name="description" id="description" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<button type="submit" class="btn btn-primary btn-sm float-right">
|
||||
@lang('messages.copy_form')
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary btn-sm float-right mr-2" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
{!!$subscription_info['msg']!!}
|
||||
</div>
|
||||
@if($subscription_info['subscribe_btn'])
|
||||
<div class="col-md-2">
|
||||
<a href="{{action([\App\Http\Controllers\SubscriptionsController::class, 'index'])}}" class="btn btn-primary text-deco-none float-right btn-sm">
|
||||
@lang('messages.subscribe')
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-secondary btn-sm float-right mr-2" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('form#copy_form').validate({
|
||||
submitHandler: function(form) {
|
||||
$('#modal_div').modal('hide')
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('change', 'input#name',function() {
|
||||
var name = $('form#copy_form input#name').val();
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/generate-form-slug',
|
||||
dataType: 'json',
|
||||
data: {'name' : name},
|
||||
success: function(response) {
|
||||
$('form#copy_form input#form_slug').val(response);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
112
resources/views/form/create.blade.php
Normal file
112
resources/views/form/create.blade.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">
|
||||
@lang('messages.create_form')
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@if(!isset($subscription_info['success']))
|
||||
<form id="create_form" action="{{action([\App\Http\Controllers\FormController::class, 'store'])}}" method="POST">
|
||||
{{ csrf_field() }}
|
||||
<div class="form-row pb-4">
|
||||
<div class="col-md-4">
|
||||
<label for="name">
|
||||
@lang('messages.form_name')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
|
||||
<input type="text" class="form-control"
|
||||
name="name" id="name" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="form_slug">
|
||||
@lang('messages.form_slug')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
|
||||
<input type="text" class="form-control"
|
||||
name="slug" id="form_slug" required readonly>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="description">
|
||||
@lang('messages.form_description')
|
||||
</label>
|
||||
<input type="text" name="description" id="description" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@if(!empty($templates))
|
||||
<div class="form-row pb-4">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="template">
|
||||
@lang('messages.template')
|
||||
</label>
|
||||
<select class="form-control" id="template" name="template_id">
|
||||
<option value="">
|
||||
@lang('messages.choose_template')
|
||||
</option>
|
||||
@foreach($templates as $id => $name)
|
||||
<option value="{{$id}}">{{$name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<hr>
|
||||
<button type="submit" class="btn btn-primary btn-sm float-right">
|
||||
@lang('messages.create_form')
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary btn-sm float-right mr-2" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
{!!$subscription_info['msg']!!}
|
||||
</div>
|
||||
@if($subscription_info['subscribe_btn'])
|
||||
<div class="col-md-2">
|
||||
<a href="{{action([\App\Http\Controllers\SubscriptionsController::class, 'index'])}}" class="btn btn-primary text-deco-none float-right btn-sm">
|
||||
@lang('messages.subscribe')
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-secondary btn-sm float-right mr-2" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('form#create_form').validate({
|
||||
submitHandler: function(form) {
|
||||
$('#modal_div').modal('hide')
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('change', 'input#name',function() {
|
||||
var name = $('form#create_form input#name').val();
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/generate-form-slug',
|
||||
dataType: 'json',
|
||||
data: {'name' : name},
|
||||
success: function(response) {
|
||||
$('form#create_form input#form_slug').val(response);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
168
resources/views/form/download.blade.php
Normal file
168
resources/views/form/download.blade.php
Normal file
@@ -0,0 +1,168 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>{{ $form->name }}</title>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="dns-prefetch" href="//fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
|
||||
@php
|
||||
$bg_color = $form->schema['settings']['color']['background'];
|
||||
$additional_js = $form->schema['additional_js_css']['js'];
|
||||
$additional_css = $form->schema['additional_js_css']['css'];
|
||||
$bg_type = $form->schema['settings']['background']['bg_type'];
|
||||
$bg_image = $form->schema['settings']['color']['image_path'];
|
||||
$form_attributes = isset($form->schema['form_attributes']) ? $form->schema['form_attributes'] : [];
|
||||
@endphp
|
||||
<!-- Styles -->
|
||||
@include('layouts.partials.css', ['is_download' => true, 'error_msg_color' => $form->schema['settings']['color']['error_msg'], 'additional_css' => $additional_css])
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<main class="py-4">
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-body" style="@if(!empty($bg_image) && $bg_type == 'bg_image')background-image: url(./asset/{{$bg_image}}); background-repeat: no-repeat;background-size: cover;background-position: right top;@else background-color: {{$bg_color}}; @endif">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<form id="{{$form->id}}"
|
||||
action="{{'./' . $form_slug . '.php'}}" @includeIf('form.partials.custom_attribute_generator', ['attributes' => $form_attributes])>
|
||||
@include('form.partials.fields_generator')
|
||||
|
||||
@if($form->schema['settings']['recaptcha']['is_enable'])
|
||||
<div class="g-recaptcha"
|
||||
data-sitekey="{{$form->schema['settings']['recaptcha']['site_key']}}"></div>
|
||||
<br/>
|
||||
@endif
|
||||
|
||||
@php
|
||||
$submit_btn_setting = $form->schema['settings']['submit'];
|
||||
@endphp
|
||||
<button type="submit" class="btn mt-5 {{$submit_btn_setting['btn_alignment']}} {{$submit_btn_setting['btn_size']}} {{$submit_btn_setting['btn_color']}}"
|
||||
data-btn_loading="{{$submit_btn_setting['loading_text']}}"
|
||||
data-btn_text="{{$submit_btn_setting['text']}}">
|
||||
@if((!empty($submit_btn_setting['btn_icon']) && $submit_btn_setting['btn_icon'] != 'none') && $submit_btn_setting['icon_position'] == 'left')
|
||||
<i class="fas {{$submit_btn_setting['btn_icon']}}">
|
||||
</i>
|
||||
@endif
|
||||
{{$submit_btn_setting['text']}}
|
||||
@if((!empty($submit_btn_setting['btn_icon']) && $submit_btn_setting['btn_icon'] != 'none') && $submit_btn_setting['icon_position'] == 'right')
|
||||
<i class="fas {{$submit_btn_setting['btn_icon']}}">
|
||||
</i>
|
||||
@endif
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@include('layouts.partials.javascript', ['is_download' => true])
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
@if(!empty($form->schema['form']))
|
||||
@foreach($form->schema['form'] as $element)
|
||||
@if($element['type'] == 'calendar')
|
||||
@php
|
||||
$enable_time_picker = ($element['enable_time_picker'] == 1) ? 'true' : 'false';
|
||||
|
||||
$time_picker_inline = ($element['time_picker_inline'] == 1) ? 'true' : 'false';
|
||||
@endphp
|
||||
|
||||
initialize_datetimepicker('{{$element['name']}}', '{{$element['start_date']}}', '{{$element['end_date']}}', '{{$element['format']}}', '{{$element['time_format']}}', {!!json_encode($element['disabled_days'])!!}, {{$enable_time_picker}}, {{$time_picker_inline}});
|
||||
@elseif($element['type'] == 'range')
|
||||
initialize_rangeslider('{{$element['name']}}');
|
||||
@elseif($element['type'] == 'file_upload')
|
||||
initialize_dropzone('{{$element['name']}}', '{{$element['upload_text']}}', '{{$element['no_of_files']}}', '{{$element['file_size_limit']}}', '{{$element['allowed_file_type']}}', 'library/upload.php');
|
||||
@elseif($element['type'] == 'text_editor')
|
||||
initialize_text_editor('{{$element['name']}}', '{{$element['placeholder']}}', '{{$element['editor_height']}}');
|
||||
@elseif($element['type'] == 'rating')
|
||||
initialize_star_rating('{{$element['name']}}');
|
||||
@elseif($element['type'] == 'signature')
|
||||
initialize_signature_pad('{{$element['name']}}');
|
||||
@elseif($element['type'] == 'countdown')
|
||||
initialize_countdowntimer({!!json_encode($element)!!});
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@php
|
||||
$toastr_position = isset($form->schema['settings']['notification']['position']) ? $form->schema['settings']['notification']['position'] : '';
|
||||
@endphp
|
||||
initializeToastrSettingsForForm("{{$toastr_position}}");
|
||||
@endif
|
||||
|
||||
$('form#{{$form->id}}').validate({
|
||||
ignore: ".note-editor *",
|
||||
submitHandler: function(form, e) {
|
||||
e.preventDefault();
|
||||
|
||||
var form_data = $('form#{{$form->id}}').serialize();
|
||||
|
||||
var form_submit_btn = $(form).find('button[type="submit"]');
|
||||
form_submit_btn.attr('disabled', 'disabled');
|
||||
form_submit_btn.text(form_submit_btn.data('btn_loading'));
|
||||
var dropzoneCount = $('.dropzone').length;
|
||||
var textEditor = $('.summer_note').length;
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: $(form).attr('action'),
|
||||
dataType: 'json',
|
||||
data: form_data,
|
||||
success: function(result) {
|
||||
form_submit_btn.text(form_submit_btn.data('btn_text'));
|
||||
form_submit_btn.removeAttr('disabled', 'disabled');
|
||||
|
||||
$(form)[0].reset();
|
||||
|
||||
window.onbeforeunload = null;
|
||||
|
||||
if(result.success == 1){
|
||||
if(result.redirect == 1){
|
||||
window.location = result.url;
|
||||
} else {
|
||||
toastr.success(result.msg);
|
||||
if (textEditor > 0) {
|
||||
$('.summer_note').each(function(){
|
||||
$(this).summernote("code", "");
|
||||
});
|
||||
}
|
||||
if (dropzoneCount > 0) {
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
toastr.error(result.msg);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//show aleart before page reloading
|
||||
var form_obj = $('form#{{$form->id}}');
|
||||
var orig_forn_data = form_obj.serialize();
|
||||
window.onbeforeunload = function() {
|
||||
if($('form#{{$form->id}}').length == 1){
|
||||
if (form_obj.serialize() != orig_forn_data) {
|
||||
return 'Are you sure?';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!-- Form additional JS -->
|
||||
@if(!empty($additional_js))
|
||||
{!!$additional_js!!}
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
||||
12
resources/views/form/edit.blade.php
Normal file
12
resources/views/form/edit.blade.php
Normal file
@@ -0,0 +1,12 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<create-form form-data="{{json_encode($form)}}" :placeholder-img="{{json_encode($placeholder_img)}}" :save-template="{{json_encode($save_as_template)}}">
|
||||
</create-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
39
resources/views/form/generate_widget.blade.php
Normal file
39
resources/views/form/generate_widget.blade.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">
|
||||
@lang('messages.generate_widget')
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="widget">
|
||||
@lang('messages.iframe_code')
|
||||
</label>
|
||||
<textarea class="form-control form-control-sm" id="widget" rows="4" aria-describedby="widget_help" readonly>{{$widget}}</textarea>
|
||||
<small id="widget_help" class="form-text text-muted">
|
||||
@lang('messages.widget_help_text')
|
||||
</small>
|
||||
<textarea class="form-control form-control-sm" id="widget" rows="4" aria-describedby="widget_script_help" readonly>{{$widget_script}}</textarea>
|
||||
<small id="widget_script_help" class="form-text text-muted">
|
||||
@lang('messages.widget_script_help_text')
|
||||
</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>@lang('messages.new_window')</label>
|
||||
<textarea class="form-control form-control-sm" id="new_window" rows="4" aria-describedby="new_window_help" readonly>{{$form}}</textarea>
|
||||
<small id="widget_help" class="form-text text-muted">
|
||||
@lang('messages.new_window_help_text')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
@foreach($attributes as $attribute)
|
||||
{{$attribute['key']}} = "{{$attribute['value']}}"
|
||||
@endforeach
|
||||
499
resources/views/form/partials/fields_generator.blade.php
Normal file
499
resources/views/form/partials/fields_generator.blade.php
Normal file
@@ -0,0 +1,499 @@
|
||||
@if(!empty($form->schema['form']))
|
||||
<div class="row">
|
||||
@foreach($form->schema['form'] as $key => $element)
|
||||
@php
|
||||
$custom_attributes = isset($element['custom_attributes']) ? $element['custom_attributes'] : [];
|
||||
@endphp
|
||||
<div class="@if(!empty($element['col'])) {{$element['col']}} @else col-md-12 @endif mt-25 mb-25">
|
||||
@if($element['type'] == 'text')
|
||||
<div class="form-group">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">
|
||||
{{$element['label']}}
|
||||
</span>
|
||||
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="input-group">
|
||||
|
||||
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas {{$element['prefix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<input type="{{$element['subtype']}}"
|
||||
name="fields[{{$element['name']}}]"
|
||||
placeholder="{{$element['placeholder']}}"
|
||||
class="form-control {{$element['size']}} {{$element['custom_class']}}"
|
||||
id="{{$element['name']}}"
|
||||
@foreach ($validation_rules[$key] as $validation)
|
||||
{{$validation['rule']}} = "{{$validation['value']}}"
|
||||
{{$validation['error']}} = "{{$validation['msg']}}"
|
||||
@endforeach
|
||||
@if($element['required']) required @endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])
|
||||
>
|
||||
|
||||
@if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
<i class="fas {{$element['suffix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif($element['type'] == 'range')
|
||||
<div class="form-group mb-4 mt-3">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">
|
||||
{{$element['label']}}
|
||||
</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="row">
|
||||
<div class="col-sm-1">{{$element['min']}}</div>
|
||||
<div class="col-sm-10">
|
||||
<input type="range"
|
||||
name="fields[{{$element['name']}}]"
|
||||
@if($element['required']) required @endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
id="{{$element['name']}}"
|
||||
min="{{$element['min']}}"
|
||||
max="{{$element['max']}}"
|
||||
step="{{$element['step']}}"
|
||||
data-orientation="{{$element['data_orientation']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])>
|
||||
</div>
|
||||
<div class="col-sm-1">{{$element['max']}}</div>
|
||||
</div>
|
||||
<b><output class="{{$element['name']}}" style="display: block;text-align:center;" for="{{$element['name']}}"></output></b>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@elseif($element['type'] == 'calendar')
|
||||
<div class="form-group">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">
|
||||
{{$element['label']}}
|
||||
</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="input-group date" id="{{$element['name']}}" data-target-input="nearest">
|
||||
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" data-target="#{{$element['name']}}" data-toggle="datetimepicker">
|
||||
<i class="fas {{$element['prefix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
<input type="text"
|
||||
name="fields[{{$element['name']}}]"
|
||||
data-toggle="datetimepicker"
|
||||
id="{{$element['name']}}"
|
||||
class="form-control datetimepicker-input {{$element['custom_class']}}"
|
||||
readonly
|
||||
data-target="#{{$element['name']}}"
|
||||
@if($element['required']) required @endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])
|
||||
>
|
||||
@if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text" data-target="#{{$element['name']}}" data-toggle="datetimepicker">
|
||||
<i class="fas {{$element['suffix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif($element['type'] == 'textarea')
|
||||
|
||||
<div class="form-group">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">
|
||||
{{$element['label']}}
|
||||
</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="input-group">
|
||||
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas {{$element['prefix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
<textarea
|
||||
rows="{{$element['rows']}}"
|
||||
name="fields[{{$element['name']}}]"
|
||||
cols="{{$element['columns']}}"
|
||||
placeholder="{{$element['placeholder']}}"
|
||||
class="form-control {{$element['custom_class']}}"
|
||||
id="{{$element['name']}}"
|
||||
@foreach ($validation_rules[$key] as $validation)
|
||||
{{$validation['rule']}} = "{{$validation['value']}}"
|
||||
{{$validation['error']}} = "{{$validation['msg']}}"
|
||||
@endforeach
|
||||
@if($element['required']) required @endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])
|
||||
></textarea>
|
||||
@if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
<i class="fas {{$element['suffix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@elseif(in_array($element['type'], ['radio', 'checkbox']))
|
||||
<div class="form-group">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
@foreach(explode(PHP_EOL, $element['options']) as $option)
|
||||
<div class="custom-control @if($element['type'] == 'radio') custom-radio @else custom-checkbox @endif">
|
||||
<input class="custom-control-input"
|
||||
type="{{$element['type']}}"
|
||||
value="{{$option}}"
|
||||
name="fields[{{$element['name']}}][]"
|
||||
id="{{$element['name']}}_{{$loop->index}}"
|
||||
@foreach ($validation_rules[$key] as $validation)
|
||||
{{$validation['rule']}} = "{{$validation['value']}}"
|
||||
{{$validation['error']}} = "{{$validation['msg']}}"
|
||||
@endforeach
|
||||
@if($element['required'])
|
||||
required
|
||||
@endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])
|
||||
>
|
||||
<label class="custom-control-label" for="{{$element['name']}}_{{$loop->index}}">
|
||||
{{$option}}
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@elseif($element['type'] == 'dropdown')
|
||||
|
||||
<div class="form-group">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<div class="input-group">
|
||||
@if(!empty($element['prefix_icon']) && $element['prefix_icon'] !== 'none')
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas {{$element['prefix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
<select class="custom-select {{$element['size']}} {{$element['custom_class']}}" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}" id="{{$element['name']}}"
|
||||
@if($element['multiselect'])
|
||||
multiple
|
||||
name="fields[{{$element['name']}}][]"
|
||||
@else
|
||||
name="fields[{{$element['name']}}]"
|
||||
@endif
|
||||
@foreach ($validation_rules[$key] as $validation)
|
||||
{{$validation['rule']}} = "{{$validation['value']}}"
|
||||
{{$validation['error']}} = "{{$validation['msg']}}"
|
||||
@endforeach
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])>
|
||||
@foreach(explode(PHP_EOL, $element['options']) as $option)
|
||||
<option>
|
||||
{{$option}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@if(!empty($element['suffix_icon']) && $element['suffix_icon'] !== 'none')
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
<i class="fas {{$element['suffix_icon']}}"></i>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif($element['type'] == 'heading')
|
||||
|
||||
<div class="{{$element['custom_class'] ?? ''}}">
|
||||
@php
|
||||
echo '<' . $element['tag'] . ' style="color:' . $element['text_color'] . '">' . $element['content'] .'</' . $element['tag'] . '>';
|
||||
@endphp
|
||||
</div>
|
||||
@elseif($element['type'] == 'file_upload')
|
||||
<div class="mb-2">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="dropzone {{$element['custom_class']}}"
|
||||
id="{{$element['name']}}" @includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])></div>
|
||||
<input type="hidden" name="fields[{{$element['name']}}][]" id="{{$element['name']}}" value="" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}">
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif($element['type'] == 'text_editor')
|
||||
<div class="mb-2">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<textarea class="form-control summer_note" id="{{$element['name']}}" name="fields[{{$element['name']}}]" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}"
|
||||
@includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])></textarea>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif($element['type'] == 'terms_and_condition')
|
||||
<div class="pt-2 mb-2">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input {{$element['custom_class']}}" type="checkbox" name="fields[{{$element['name']}}]" id="terms_and_condition" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}" @includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])>
|
||||
<label class="custom-control-label" for="terms_and_condition">
|
||||
@if(!empty($element['link']))
|
||||
<a href="{{$element['link']}}" target="_blank"> {{$element['label']}}
|
||||
</a>
|
||||
@else
|
||||
{{$element['label']}}
|
||||
@endif
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@elseif($element['type'] == 'hr')
|
||||
<hr style="
|
||||
@if(!empty($element['padding_top']))
|
||||
padding-top: {{$element['padding_top']}}px;
|
||||
@endif
|
||||
@if(!empty($element['padding_bottom']))
|
||||
padding-bottom:{{$element['padding_bottom']}}px;
|
||||
@endif
|
||||
@if(!empty($element['border_size']) && !empty($element['border_color']))
|
||||
border-top:{{$element['border_size']}}px {{$element['border_type']}} {{$element['border_color']}};
|
||||
@endif">
|
||||
@elseif($element['type'] == 'html_text')
|
||||
<div class="{{$element['custom_class'] ?? ''}}">
|
||||
{!!$element['html_text']!!}
|
||||
</div>
|
||||
@elseif($element['type'] == 'rating')
|
||||
<div class="form-group pt-2">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<input id="{{$element['name']}}" name="fields[{{$element['name']}}]"
|
||||
data-stars="{{$element['stars_to_display']}}"
|
||||
data-min="{{$element['min_rating']}}"
|
||||
data-max="{{$element['max_rating']}}"
|
||||
data-step="{{$element['increment']}}"
|
||||
dir="{{$element['direction']}}"
|
||||
data-size="{{$element['size']}}"
|
||||
class="star_rating"
|
||||
@if($element['required']) required @endif
|
||||
data-msg-required="{{$element['required_error_msg']}}"
|
||||
>
|
||||
</div>
|
||||
@elseif($element['type'] == 'switch')
|
||||
<div class="form-group pt-2">
|
||||
<span class="switch @if(!empty($element['size'])) {{$element['size']}} @endif">
|
||||
<input type="checkbox" class="switch" name="fields[{{$element['name']}}]" id="{{$element['name']}}"" @if($element['required']) required @endif @includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes]) data-msg-required="{{$element['required_error_msg']}}">
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}" class="ml-2">
|
||||
{{$element['label']}}
|
||||
</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
</span>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif($element['type'] == 'signature')
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="form-group">
|
||||
<canvas id="{{$element['name']}}" width="300" height="200" class="signature-pad" @includeIf('form.partials.custom_attribute_generator', ['attributes' => $custom_attributes])></canvas>
|
||||
<input type="hidden" class="signature" name="fields[{{$element['name']}}]" id="output_{{$element['name']}}" value="" @if($element['required']) required @endif data-msg-required="{{$element['required_error_msg']}}">
|
||||
</div>
|
||||
<div class="form-text">
|
||||
<span class="pointer mr-4" id="clear_{{$element['name']}}" title="@lang('messages.clear_signature_pad')" data-name="{{$element['name']}}">
|
||||
<i class="far fa-times-circle"></i>
|
||||
{{__('messages.clear')}}
|
||||
</span>
|
||||
<span class="pointer" id="undo_{{$element['name']}}" title="@lang('messages.undo')" data-name="{{$element['name']}}">
|
||||
<i class="fas fa-undo"></i>
|
||||
{{__('messages.undo')}}
|
||||
</span>
|
||||
@if(!empty($element['help_text']))
|
||||
<small class="form-text text-muted">
|
||||
{{$element['help_text']}}
|
||||
</small>
|
||||
@endif
|
||||
</div>
|
||||
@elseif(($element['type'] == 'youtube') && !empty($element['iframe_url']))
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
@php
|
||||
$video_id = '';
|
||||
$url = $element['iframe_url'];
|
||||
if (str_contains($url, 'watch')) {
|
||||
$video_id = str_replace('https://www.youtube.com/watch?v=', '', $url);
|
||||
} else if (str_contains($url, 'youtu.be')) {
|
||||
$video_id = str_replace('https://youtu.be/', '', $url);
|
||||
} else if (str_contains($url, 'embed')) {
|
||||
$video_id = str_replace('https://www.youtube.com/embed/', '', $url);
|
||||
}
|
||||
$yt_embed_url = "https://www.youtube.com/embed/{$video_id}";
|
||||
@endphp
|
||||
<div class="col-md-12">
|
||||
<iframe src="{{$yt_embed_url}}"
|
||||
id="{{$element['name']}}"
|
||||
name="{{$element['label']}}"
|
||||
title="{{$element['label']}}"
|
||||
class="{{$element['custom_class']}}"
|
||||
width="{{$element['width']}}%"
|
||||
height="{{$element['height']}}"
|
||||
frameborder="0"
|
||||
style="max-width: 100%;"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
|
||||
</iframe>
|
||||
</div>
|
||||
@elseif(($element['type'] == 'iframe') && !empty($element['iframe_url']))
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="col-md-12">
|
||||
<iframe src="{{$element['iframe_url']}}"
|
||||
id="{{$element['name']}}"
|
||||
name="{{$element['label']}}"
|
||||
title="{{$element['label']}}"
|
||||
class="{{$element['custom_class']}}"
|
||||
width="{{$element['width']}}%"
|
||||
height="{{$element['height']}}"
|
||||
frameborder="0"
|
||||
style="max-width: 100%;"
|
||||
>
|
||||
</iframe>
|
||||
</div>
|
||||
@elseif(($element['type'] == 'pdf') && !empty($element['pdf']))
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="col-md-12">
|
||||
<iframe src="{{$form->media_url.'/'.$element['pdf']}}"
|
||||
id="{{$element['name']}}"
|
||||
name="{{$element['label']}}"
|
||||
title="{{$element['label']}}"
|
||||
class="{{$element['custom_class']}}"
|
||||
width="{{$element['width']}}%"
|
||||
height="{{$element['height']}}"
|
||||
frameborder="0"
|
||||
style="max-width: 100%;"
|
||||
>
|
||||
</iframe>
|
||||
</div>
|
||||
@elseif($element['type'] == 'countdown')
|
||||
<label for="{{$element['name']}}">
|
||||
<span style="color:{{$form->schema['settings']['color']['label']}}">{{$element['label']}}</span>
|
||||
@if($element['required'])
|
||||
<span style="color:{{$form->schema['settings']['color']['required_asterisk_color']}}">*</span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="col-md-12">
|
||||
<div class="{{$element['custom_class']}}">
|
||||
<span id="{{$element['name']}}" class="max-width-100">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
29
resources/views/form/partials/form_card.blade.php
Normal file
29
resources/views/form/partials/form_card.blade.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<div class="card">
|
||||
@php
|
||||
$bg_color = $form->schema['settings']['color']['background'];
|
||||
$error_msg_color = $form->schema['settings']['color']['error_msg'];
|
||||
$bg_type = $form->schema['settings']['background']['bg_type'];
|
||||
$bg_image = $form->schema['settings']['color']['image_path'];
|
||||
$action = '';
|
||||
|
||||
switch (request()->route()->getName()) {
|
||||
case 'form-data.edit':
|
||||
$action = 'edit';
|
||||
break;
|
||||
case 'forms.show':
|
||||
$action = 'show';
|
||||
break;
|
||||
}
|
||||
@endphp
|
||||
<div class="tab-content card-body"
|
||||
id="" role="tabpanel" style='@if(!empty($bg_image) && $bg_type == 'bg_image')background-image: url("{{Storage::url(config('constants.doc_path').'/'.$bg_image)}}"); background-repeat: no-repeat;background-size: cover;background-position: right top;@else background-color: {{$bg_color}}; @endif'>
|
||||
|
||||
@if(!empty($is_form_closed) && $is_form_closed)
|
||||
<div class="card-text">
|
||||
{!! $form_closed_msg !!}
|
||||
</div>
|
||||
@else
|
||||
<show-form form="{{json_encode($form)}}" action-by="{{$action_by ?? ''}}" action="{{ $action }}"></show-form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
40
resources/views/form/show.blade.php
Normal file
40
resources/views/form/show.blade.php
Normal file
@@ -0,0 +1,40 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$bg_color = $form->schema['settings']['color']['background'];
|
||||
$error_msg_color = $form->schema['settings']['color']['error_msg'];
|
||||
$additional_css = $form->schema['additional_js_css']['css'];
|
||||
$additional_js = $form->schema['additional_js_css']['js'];
|
||||
$page_color = $form->schema['settings']['color']['page_color'] ?? '#f4f6f9';
|
||||
@endphp
|
||||
|
||||
<div class="@if(!empty($iframe_enabled) && $iframe_enabled) container-fluid @else container @endif">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
|
||||
@include('form.partials.form_card')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('footer')
|
||||
<!-- form theme -->
|
||||
@if(isset($form->schema['settings']['theme']) && $form->schema['settings']['theme'] != 'default')
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/{{$form->schema['settings']['theme']}}/bootstrap.min.css" rel="stylesheet">
|
||||
@endif
|
||||
<style type="text/css">
|
||||
.error {
|
||||
color:{{$error_msg_color}}
|
||||
}
|
||||
.content-wrapper {
|
||||
background-color: {{$page_color}} !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Form additional JS -->
|
||||
@if(!empty($additional_js))
|
||||
{!!$additional_js!!}
|
||||
@endif
|
||||
|
||||
@endsection
|
||||
78
resources/views/form/validate_password.blade.php
Normal file
78
resources/views/form/validate_password.blade.php
Normal file
@@ -0,0 +1,78 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container mt-5">
|
||||
<div class="col-md-6 offset-md-3 mt-5">
|
||||
<div class="card card-outline card-primary card-widget widget-user shadow pb-5">
|
||||
<div class="card-body">
|
||||
<form id="password-form" action="{{route('post.validate.protected.form', ['id' => $id])}}"
|
||||
method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h4 class="text-center">
|
||||
<i class="far fa-file-archive fa-5x"></i>
|
||||
</h4>
|
||||
<h4 class="text-center">
|
||||
@lang('messages.this_form_is_password_protected')
|
||||
</h4>
|
||||
<p class="text-center form-text text-muted">
|
||||
{{__('messages.enter_your_password_to_view_the_form')}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas fa-key"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="password" class="form-control"
|
||||
placeholder="@lang('messages.password')"
|
||||
required
|
||||
id="password">
|
||||
<div class="input-group-append">
|
||||
<button type="submit" class="btn btn-sm bg-primary">
|
||||
@lang('messages.continue')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="error-msg text-danger"></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("form#password-form").validate({
|
||||
submitHandler: function(form, e) {
|
||||
e.preventDefault();
|
||||
if ($('form#password-form').valid()) {
|
||||
$(".error-msg").html('');
|
||||
$.ajax({
|
||||
method:"POST",
|
||||
url: $("form#password-form").attr("action"),
|
||||
data: {
|
||||
password: $("#password").val()
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if(response.success == true){
|
||||
window.location = response.redirect;
|
||||
} else {
|
||||
$(".error-msg").html(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
26
resources/views/form_data/file_view.blade.php
Normal file
26
resources/views/form_data/file_view.blade.php
Normal file
@@ -0,0 +1,26 @@
|
||||
@php
|
||||
$datas = implode(',', $form_upload);
|
||||
$files = explode(',', $datas);
|
||||
@endphp
|
||||
@foreach($files as $file)
|
||||
@php
|
||||
$url = Storage::url(config('constants.doc_path').'/'.$file);
|
||||
$path = public_path('uploads/'.config('constants.doc_path').'/'.$file);
|
||||
@endphp
|
||||
@if(file_exists($path))
|
||||
@php
|
||||
$media = explode('_', $file, 2);
|
||||
$file_name = !empty($media[1]) ? $media[1]: $media[0];
|
||||
@endphp
|
||||
@if(in_array(mime_content_type($path), ['image/jpeg', 'image/png', 'image/webp']))
|
||||
<a target="_blank" href="{{$url}}" download="{{$file_name}}">
|
||||
<img src="{{$url}}" alt="{{$file_name}}" style="width:100px;height: 90px;object-fit: contain;max-width: 100%;">
|
||||
</a>
|
||||
@else
|
||||
<a target="_blank" href="{{$url}}" download="{{$file_name}}">
|
||||
{{$file_name}}
|
||||
</a>
|
||||
@endif
|
||||
<br>
|
||||
@endif
|
||||
@endforeach
|
||||
22
resources/views/form_data/partials/comment.blade.php
Normal file
22
resources/views/form_data/partials/comment.blade.php
Normal file
@@ -0,0 +1,22 @@
|
||||
@foreach($comments as $comment)
|
||||
<div class="direct-chat-msg">
|
||||
<div class="direct-chat-info clearfix">
|
||||
<span class="direct-chat-name pull-left">
|
||||
{{$comment->commentedBy->name}}
|
||||
</span>
|
||||
<span class="direct-chat-timestamp pull-right">
|
||||
{{\Carbon\Carbon::parse($comment->created_at)->isoFormat("D/M/YY HH:mm A")}}
|
||||
</span>
|
||||
</div>
|
||||
<!-- /.direct-chat-info -->
|
||||
<img class="direct-chat-img" src="https://ui-avatars.com/api/?name={{$comment->commentedBy->name}}">
|
||||
<!-- /.direct-chat-img -->
|
||||
<div class="direct-chat-text">
|
||||
{!! $comment->comment !!}
|
||||
@if(Auth::user()->id == $comment->user_id)
|
||||
<i class="delete-comment fa fa-trash float-right text-danger cursor-pointer" data-comment_id="{{$comment->id}}" data-form_data_id="{{$comment->form_data_id}}"></i>
|
||||
@endif
|
||||
</div>
|
||||
<!-- /.direct-chat-text -->
|
||||
</div>
|
||||
@endforeach
|
||||
75
resources/views/form_data/partials/form_data_pdf.blade.php
Normal file
75
resources/views/form_data/partials/form_data_pdf.blade.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ucFirst($form_data->form->name)}}</title>
|
||||
<style type="text/css">
|
||||
th, td {
|
||||
padding: 15px;
|
||||
text-align: left;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="width: 100% !important;text-align: center;margin-bottom: 20px;">
|
||||
@if(!empty($pdf_header))
|
||||
{!! $pdf_header !!}
|
||||
@else
|
||||
<div style="width: 50% !important;">
|
||||
<h3>
|
||||
{{ucFirst($form_data->form->name)}}
|
||||
@if(!empty($form_data->submittedBy))
|
||||
<small>
|
||||
(
|
||||
@lang('messages.submitted_by'):
|
||||
{{$form_data->submittedBy->name}}
|
||||
)
|
||||
</small>
|
||||
@endif
|
||||
</h3>
|
||||
</div>
|
||||
<div style="width: 50% !important;">
|
||||
@if(isset($form_data->form->schema['settings']['form_submision_ref']['is_enabled']) && $form_data->form->schema['settings']['form_submision_ref']['is_enabled'] && !empty($form_data->submission_ref))
|
||||
<b>@lang('messages.submission_numbering'):</b>
|
||||
{{$form_data->submission_ref}}
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<table style="width:100%">
|
||||
<tbody>
|
||||
@foreach($form_data->form->schema['form'] as $element)
|
||||
@isset($form_data->data[$element['name']])
|
||||
<tr>
|
||||
<td style="width: 50% !important;">
|
||||
<strong>{{$element['label']}}</strong>
|
||||
</td>
|
||||
<td style="width: 50% !important;">
|
||||
@if($element['type'] == 'file_upload')
|
||||
@include('form_data.file_view', ['form_upload' => $form_data->data[$element['name']]])
|
||||
@elseif($element['type'] == 'signature')
|
||||
@if(!empty($form_data->data[$element['name']]))
|
||||
<a target="_blank" href="{{$form_data->data[$element['name']]}}"
|
||||
download="Signature">
|
||||
<img src="{{$form_data->data[$element['name']]}}" class="signature">
|
||||
</a>
|
||||
@endif
|
||||
@elseif(is_array($form_data->data[$element['name']]) && $element['type'] != 'file_upload')
|
||||
|
||||
{{implode(', ', $form_data->data[$element['name']])}}
|
||||
|
||||
@else
|
||||
{!! nl2br($form_data->data[$element['name']]) !!}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endisset
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
69
resources/views/form_data/partials/submission_msg.blade.php
Normal file
69
resources/views/form_data/partials/submission_msg.blade.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Запускаем обратный отсчет
|
||||
var timeLeft = 3;
|
||||
var countdown = setInterval(function() {
|
||||
timeLeft--;
|
||||
$('#countdown').text(timeLeft);
|
||||
|
||||
// Если обратный отсчет закончился, закрываем вкладку
|
||||
if (timeLeft <= 0) {
|
||||
clearInterval(countdown);
|
||||
window.close();
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
</script>
|
||||
<div class="row">
|
||||
<div class="col-md-6 offset-md-3 text-center mt-3">
|
||||
<div class="alert alert-success">
|
||||
<h5>
|
||||
<i class="far fa-check-circle"></i>
|
||||
{!!$form->schema['settings']['notification']['success_msg']!!}
|
||||
<span id="countdown">3</span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
@if(isset($data['sub_ref_qr_code']) && !empty($data['sub_ref_qr_code']))
|
||||
<div class="col-md-4 text-center">
|
||||
<img src="{!!$data['sub_ref_qr_code']!!}"
|
||||
alt="{{$form->name}} Ref Num Qr Code"
|
||||
style="padding: 2.5rem;"/>
|
||||
<a href="{!!$data['sub_ref_qr_code']!!}"
|
||||
class="btn btn-outline-primary btn-block mt-2"
|
||||
role="button"
|
||||
download="{{$form->name}} Ref Num Qr Code">
|
||||
<i class="far fa-arrow-alt-circle-down fa-fw fa-lg"></i>
|
||||
{{__('messages.download_qr_code')}}
|
||||
</a>
|
||||
</div>
|
||||
@elseif(isset($data['sub_ref_bar_code']) && !empty($data['sub_ref_bar_code']))
|
||||
<div class="col-md-4 text-center">
|
||||
<img src="{!!$data['sub_ref_bar_code']!!}" alt="{{$form->name}} Ref Num Bar Code"
|
||||
style="padding: 2.5rem;"/>
|
||||
<a href="{!!$data['sub_ref_bar_code']!!}"
|
||||
class="btn btn-outline-primary btn-block mt-2"
|
||||
role="button"
|
||||
download="{{$form->name}} Ref Num Bar Code">
|
||||
<i class="far fa-arrow-alt-circle-down fa-fw fa-lg"></i>
|
||||
{{__('messages.download_bar_code')}}
|
||||
</a>
|
||||
</div>
|
||||
@elseif(!in_array($form->schema['settings']['notification']['post_submit_action'], ['redirect']) &&
|
||||
isset($form->schema['settings']['is_qr_code_enabled']) &&
|
||||
$form->schema['settings']['is_qr_code_enabled'])
|
||||
<div class="col-md-4 text-center">
|
||||
<div id="qrcode" style="padding: 1.2rem;"></div>
|
||||
<a href=""
|
||||
class="btn btn-outline-primary btn-block mt-2"
|
||||
role="button"
|
||||
download="{{$form->name}} Qr Code"
|
||||
id="download_qrcode">
|
||||
<i class="far fa-arrow-alt-circle-down fa-fw fa-lg"></i>
|
||||
{{__('messages.download_qr_code')}}
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
204
resources/views/form_data/report.blade.php
Normal file
204
resources/views/form_data/report.blade.php
Normal file
@@ -0,0 +1,204 @@
|
||||
@extends('layouts.app')
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
@page {
|
||||
size: A4 landscape;
|
||||
max-height:100%;
|
||||
max-width:100%;
|
||||
margin-top: 1.2cm;
|
||||
margin-bottom: 1.2cm;
|
||||
margin-left: 1cm;
|
||||
margin-right: 1cm;
|
||||
size: 210mm 287mm;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<h5>
|
||||
<i class="fab fa-wpforms"></i>
|
||||
@lang('messages.reports_for_form', ['form_name' => $form->name])
|
||||
</h5>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card card-outline card-info">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chart-line"></i>
|
||||
@lang('messages.analytics')
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row mb-5">
|
||||
<div class="col-md-12">
|
||||
<div id="visitors_chart"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="referrers_chart"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="card card-outline card-info">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-chart-pie"></i>
|
||||
@lang('messages.reports')
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
@forelse($charts as $key => $chart)
|
||||
<div class="col-md-6 mb-5">
|
||||
<div id="{{$key}}"></div>
|
||||
</div>
|
||||
@empty
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info" role="alert">
|
||||
@lang('messages.no_report_found')
|
||||
</div>
|
||||
</div>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script src="https://code.highcharts.com/highcharts.js"></script>
|
||||
<script src="https://code.highcharts.com/modules/exporting.js"></script>
|
||||
<script src="https://code.highcharts.com/modules/export-data.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
@if(!empty($charts))
|
||||
@foreach($charts as $key => $chart)
|
||||
@php
|
||||
$chart_data = [];
|
||||
foreach($chart['values'] as $label => $data) {
|
||||
$chart_data[]= ['name' => $label, 'y' => $data];
|
||||
}
|
||||
@endphp
|
||||
|
||||
//initializing highchart.js
|
||||
var high_chart_data = {!!json_encode($chart_data)!!};
|
||||
|
||||
Highcharts.chart('{{$key}}', {
|
||||
chart: {
|
||||
plotBackgroundColor: null,
|
||||
plotBorderWidth: null,
|
||||
plotShadow: true,
|
||||
type: 'pie',
|
||||
events: {
|
||||
beforePrint: function() {
|
||||
this.orgChartWidth = this.chartWidth;
|
||||
this.orgChartHeight = this.chartHeight;
|
||||
this.setSize(8500, this.orgChartHeight);
|
||||
},
|
||||
afterPrint: function() {
|
||||
this.setSize(this.orgChartWidth, this.orgChartHeight);
|
||||
}
|
||||
}
|
||||
},
|
||||
title: {
|
||||
text: '{{$chart["name"]}}'
|
||||
},
|
||||
tooltip: {
|
||||
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b> <i>({point.y})</i>'
|
||||
},
|
||||
plotOptions: {
|
||||
pie: {
|
||||
allowPointSelect: true,
|
||||
cursor: 'pointer',
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
format: '<b>{point.name}</b>: {point.percentage:.1f} % <i>({point.y})</i>'
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '{{$chart["name"]}}',
|
||||
colorByPoint: true,
|
||||
data: high_chart_data
|
||||
}
|
||||
]
|
||||
});
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
//vistors chart
|
||||
Highcharts.chart('visitors_chart', {
|
||||
xAxis: {
|
||||
categories: {!!json_encode($visitors_chart['labels'])!!}
|
||||
},
|
||||
chart: {
|
||||
type: 'line',
|
||||
events: {
|
||||
beforePrint: function() {
|
||||
this.orgChartWidth = this.chartWidth;
|
||||
this.orgChartHeight = this.chartHeight;
|
||||
this.setSize(8500, this.orgChartHeight);
|
||||
},
|
||||
afterPrint: function() {
|
||||
this.setSize(this.orgChartWidth, this.orgChartHeight);
|
||||
}
|
||||
}
|
||||
},
|
||||
title: {
|
||||
text: "{{$visitors_chart['title']}}"
|
||||
},
|
||||
series: [{
|
||||
name: "{{$visitors_chart['total_visits_label']}}",
|
||||
data: {!!json_encode($visitors_chart['total_visits'])!!}
|
||||
}, {
|
||||
name: "{{$visitors_chart['unique_visits_label']}}",
|
||||
data: {!!json_encode($visitors_chart['unique_visits'])!!}
|
||||
}]
|
||||
});
|
||||
|
||||
//referrers chart
|
||||
Highcharts.chart('referrers_chart', {
|
||||
chart: {
|
||||
type: 'pie',
|
||||
events: {
|
||||
beforePrint: function() {
|
||||
this.orgChartWidth = this.chartWidth;
|
||||
this.orgChartHeight = this.chartHeight;
|
||||
this.setSize(8500, this.orgChartHeight);
|
||||
},
|
||||
afterPrint: function() {
|
||||
this.setSize(this.orgChartWidth, this.orgChartHeight);
|
||||
}
|
||||
}
|
||||
},
|
||||
title: {
|
||||
text: "{{$referrers_chart['name']}}"
|
||||
},
|
||||
tooltip: {
|
||||
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b> <i>({point.y})</i>'
|
||||
},
|
||||
plotOptions: {
|
||||
pie: {
|
||||
allowPointSelect: true,
|
||||
cursor: 'pointer',
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
format: '<b>{point.name}</b>: {point.percentage:.1f} % <i>({point.y})</i>'
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "{{$referrers_chart['name']}}",
|
||||
colorByPoint: true,
|
||||
data: {!!json_encode($referrers_chart['values'])!!}
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
298
resources/views/form_data/show.blade.php
Normal file
298
resources/views/form_data/show.blade.php
Normal file
@@ -0,0 +1,298 @@
|
||||
@extends('layouts.app')
|
||||
@section('css')
|
||||
<style type="text/css">
|
||||
.no-print {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media screen {
|
||||
#printSection {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media print {
|
||||
body * {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
#printSection, #printSection * {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
#printSection {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.no-print {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center no-print">
|
||||
<div class="col-md-12">
|
||||
@php
|
||||
$date_format = config('constants.APP_DATE_FORMAT');
|
||||
if (config('constants.APP_TIME_FORMAT') == '12') {
|
||||
$date_format .= ' h:i A';
|
||||
} else if (config('constants.APP_TIME_FORMAT') == '24') {
|
||||
$date_format .= ' H:i';
|
||||
} else {
|
||||
$date_format = 'm/d/Y h:i A';
|
||||
}
|
||||
@endphp
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{$form->name}}
|
||||
</div>
|
||||
|
||||
<form action="{{ @route('form-data.show', ['id' => $form->id]) }}" class="form row mt-3 mx-2 mb-0">
|
||||
<div class="form-group mb-0 col-1">
|
||||
<input type="date" class="form-control" name="start_date" value="{{ request()->get('start_date') ?? \Carbon\Carbon::now()->subDays(7)->toDateString() }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-0 col-1">
|
||||
<input type="date" class="form-control" name="end_date" value="{{ request()->get('end_date') ?? \Carbon\Carbon::now()->toDateString() }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-0 col-2 d-flex">
|
||||
<button class="btn btn-primary mx-1" type="submit">@lang('messages.search_without_dots')</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@php
|
||||
$is_enabled_sub_ref_no = false;
|
||||
if(isset($form->schema['settings']['form_submision_ref']['is_enabled']) && $form->schema['settings']['form_submision_ref']['is_enabled']) {
|
||||
$is_enabled_sub_ref_no = true;
|
||||
}
|
||||
|
||||
@endphp
|
||||
<div class="tab-content card-body table-responsive" role="tabpanel">
|
||||
@if(!empty($form->schema))
|
||||
@php
|
||||
$schema = $form->schema['form'];
|
||||
$col_visible = $form['schema']['settings']['form_data']['col_visible'];
|
||||
$btn_enabled = $form['schema']['settings']['form_data']['btn_enabled'];
|
||||
@endphp
|
||||
<table class="table" id="submitted_data_table" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('messages.action')</th>
|
||||
|
||||
@if($is_enabled_sub_ref_no)
|
||||
<th>@lang('messages.submission_numbering')</th>
|
||||
@endif
|
||||
<th>@lang('messages.username')</th>
|
||||
@foreach($schema as $element)
|
||||
@if(in_array($element['name'], $col_visible))
|
||||
<th>
|
||||
{{$element['label']}}
|
||||
</th>
|
||||
@endif
|
||||
@endforeach
|
||||
<th>@lang('messages.submitted_on')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($data as $k => $row)
|
||||
<tr>
|
||||
<td>
|
||||
{{-- Кнопка просмотра для всех, у кого есть права --}}
|
||||
@if(in_array('view', $btn_enabled) && $has_permission)
|
||||
<button type="button" class="btn btn-info btn-sm view_form_data m-1"
|
||||
data-href="{{action([\App\Http\Controllers\FormDataController::class, 'viewData'], [$row->id])}}"
|
||||
data-toggle="modal">
|
||||
<i class="fa fa-eye" aria-hidden="true"></i>
|
||||
@lang('messages.view')
|
||||
</button>
|
||||
@endif
|
||||
|
||||
{{-- Кнопки только для админов/супервайзеров --}}
|
||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
||||
@if(in_array('delete', $btn_enabled))
|
||||
<button type="button"
|
||||
class="btn btn-danger btn-sm delete_form_data m-1"
|
||||
data-href="{{action([\App\Http\Controllers\FormDataController::class, 'destroy'], [$row->id])}}">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
@lang('messages.delete')
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@php
|
||||
$form_id = !empty($form->slug) ? $form->slug : $form->id;
|
||||
@endphp
|
||||
<a class="btn btn-dark btn-sm m-1"
|
||||
href="{{action([\App\Http\Controllers\FormDataController::class, 'getEditformData'], ['slug' => $form_id,'id' => $row->id])}}">
|
||||
<i class="far fa-edit" aria-hidden="true"></i>
|
||||
@lang('messages.edit')
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
@if($is_enabled_sub_ref_no)
|
||||
<td>
|
||||
{{$row['submission_ref']}}
|
||||
</td>
|
||||
@endif
|
||||
|
||||
<td>{{ $row->submittedBy?->name }}</td>
|
||||
|
||||
@foreach($schema as $row_element)
|
||||
@if(in_array($row_element['name'], $col_visible))
|
||||
<td>
|
||||
@isset($row->data[$row_element['name']])
|
||||
@if($row_element['type'] == 'file_upload')
|
||||
|
||||
@include('form_data.file_view', ['form_upload' => $row->data[$row_element['name']]])
|
||||
@elseif($row_element['type'] == 'signature')
|
||||
@if(!empty($row->data[$row_element['name']]))
|
||||
<a target="_blank"
|
||||
href="{{$row->data[$row_element['name']]}}"
|
||||
download="Signature">
|
||||
<img src="{{$row->data[$row_element['name']]}}"
|
||||
class="signature">
|
||||
</a>
|
||||
@endif
|
||||
@elseif(is_array($row->data[$row_element['name']]) && $row_element['type'] != 'file_upload')
|
||||
{{implode(', ', $row->data[$row_element['name']])}}
|
||||
@else
|
||||
{!! nl2br($row->data[$row_element['name']]) !!}
|
||||
@endif
|
||||
|
||||
@endisset
|
||||
</td>
|
||||
@endif
|
||||
@endforeach
|
||||
<td>
|
||||
{{\Carbon\Carbon::createFromTimestamp(strtotime($row->updated_at))->format($date_format)}}
|
||||
<br/>
|
||||
<small>
|
||||
{{$row->updated_at->diffForHumans()}}
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<p>Form Not found</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('#submitted_data_table').DataTable({
|
||||
scrollY: "600px",
|
||||
scrollX: true,
|
||||
scrollCollapse: true,
|
||||
paging: true,
|
||||
fixedColumns: {
|
||||
leftColumns: 2
|
||||
}
|
||||
});
|
||||
// view form data
|
||||
$(document).on('click', '.view_form_data', function () {
|
||||
var url = $(this).data("href");
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
dataType: "html",
|
||||
url: url,
|
||||
success: function (result) {
|
||||
$("#modal_div").html(result).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//delete form data
|
||||
$(document).on('click', '.delete_form_data', function () {
|
||||
var url = $(this).data("href");
|
||||
var result = confirm('Are You Sure?');
|
||||
if (result == true) {
|
||||
$.ajax({
|
||||
method: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
if (result.success == true) {
|
||||
toastr.success(result.msg);
|
||||
setTimeout(function () {
|
||||
location.reload();
|
||||
}, 1000);
|
||||
} else {
|
||||
toastr.error(result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//print form data on btn click
|
||||
$(document).on('click', '.formDataPrintBtn', function () {
|
||||
printElement(document.getElementById("print_form_data"));
|
||||
});
|
||||
|
||||
$("#modal_div").on('shown.bs.modal', function () {
|
||||
if ($("form#add_comment_form").length) {
|
||||
$("form#add_comment_form").validate();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form#add_comment_form', function (e) {
|
||||
e.preventDefault();
|
||||
var data = $("form#add_comment_form").serialize();
|
||||
var url = $("form#add_comment_form").attr('action');
|
||||
var ladda = Ladda.create(document.querySelector('.add_comment_btn'));
|
||||
ladda.start();
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: data,
|
||||
success: function (response) {
|
||||
ladda.stop();
|
||||
if (response.success) {
|
||||
$("#comment").val('');
|
||||
$('.direct-chat-messages').prepend(response.comment);
|
||||
toastr.success(response.msg);
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.delete-comment', function (e) {
|
||||
e.preventDefault();
|
||||
var element = $(this);
|
||||
var comment_id = $(this).data('comment_id');
|
||||
var form_data_id = $(this).data('form_data_id');
|
||||
if (confirm('Are you sure.?')) {
|
||||
$.ajax({
|
||||
method: 'DELETE',
|
||||
dataType: 'json',
|
||||
url: '/form-data-comment/' + comment_id + '?form_data_id=' + form_data_id,
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
toastr.success(response.msg);
|
||||
element.closest('.direct-chat-msg').remove();
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
113
resources/views/form_data/view_form_data.blade.php
Normal file
113
resources/views/form_data/view_form_data.blade.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<div class="modal-dialog modal-xl" role="document">
|
||||
<div class="modal-content" id="print_form_data">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">
|
||||
{{ucFirst($form_data->form->name)}}
|
||||
@if(!empty($form_data->submittedBy))
|
||||
<small>
|
||||
(
|
||||
<b>@lang('messages.submitted_by'): </b>
|
||||
{{$form_data->submittedBy->name}}
|
||||
)
|
||||
</small>
|
||||
@endif
|
||||
</h5>
|
||||
<button type="button" class="ml-auto btn btn-info no-print btn-sm formDataPrintBtn">
|
||||
<i class="fas fa-print"></i>
|
||||
@lang('messages.print')
|
||||
</button>
|
||||
<button type="button" class="close ml-0 no-print" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-6">
|
||||
@if(isset($form_data->form->schema['settings']['form_submision_ref']['is_enabled']) && $form_data->form->schema['settings']['form_submision_ref']['is_enabled'] && !empty($form_data->submission_ref))
|
||||
<b>@lang('messages.submission_numbering'):</b>
|
||||
{{$form_data->submission_ref}}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>@lang('messages.field')</th>
|
||||
<th>@lang('messages.value')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($form_data->form->schema['form'] as $element)
|
||||
@isset($form_data->data[$element['name']])
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{{$element['label']}}</strong>
|
||||
</td>
|
||||
<td>
|
||||
@if($element['type'] == 'file_upload')
|
||||
|
||||
@include('form_data.file_view', ['form_upload' => $form_data->data[$element['name']]])
|
||||
@elseif($element['type'] == 'signature')
|
||||
@if(!empty($form_data->data[$element['name']]))
|
||||
<a target="_blank" href="{{$form_data->data[$element['name']]}}"
|
||||
download="Signature">
|
||||
<img src="{{$form_data->data[$element['name']]}}" class="signature">
|
||||
</a>
|
||||
@endif
|
||||
@elseif(is_array($form_data->data[$element['name']]) && $element['type'] != 'file_upload')
|
||||
|
||||
{{implode(', ', $form_data->data[$element['name']])}}
|
||||
|
||||
@else
|
||||
{!! nl2br($form_data->data[$element['name']]) !!}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endisset
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="no-print mt-4">
|
||||
<hr>
|
||||
<form id="add_comment_form" action="{{action([\App\Http\Controllers\FormDataCommentController::class, 'store'])}}" method="POST">
|
||||
{{ csrf_field() }}
|
||||
<!-- hiden fields -->
|
||||
<input type="hidden" name="form_data_id" id="form_data_id" value="{{$form_data->id}}">
|
||||
<div class="form-group">
|
||||
<label for="comment">
|
||||
@lang('messages.comment'):
|
||||
</label>
|
||||
<textarea class="form-control" name="comment" id="comment" rows="3" required></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success add_comment_btn">
|
||||
@lang('messages.add_comment')
|
||||
</button>
|
||||
</form>
|
||||
<div class="row mt-5">
|
||||
<div class="col-md-12">
|
||||
<h5>
|
||||
<i class="fas fa-comments"></i>
|
||||
@lang('messages.comments')
|
||||
</h5>
|
||||
<div class="direct-chat-messages" style="max-height: 500px;height: auto;">
|
||||
@includeIf('form_data.partials.comment', ['comments' => $form_data->comments])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer no-print">
|
||||
<button type="button" class="float-right m-1 btn btn-secondary btn-sm" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
<button type="button" class="float-right m-1 btn btn-info btn-sm formDataPrintBtn">
|
||||
<i class="fas fa-print"></i>
|
||||
@lang('messages.print')
|
||||
</button>
|
||||
<a class="btn float-right btn-primary btn-sm m-1" target="_blank" href="{{action([\App\Http\Controllers\FormDataController::class, 'downloadPdf'], [$form_data->id])}}">
|
||||
<i class="far fa-file-pdf" aria-hidden="true"></i>
|
||||
@lang('messages.download_pdf')
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
432
resources/views/home.blade.php
Normal file
432
resources/views/home.blade.php
Normal file
@@ -0,0 +1,432 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@include('layouts/partials/status')
|
||||
</div>
|
||||
</div>
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
|
||||
<div class="row mb-5">
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-info elevation-1"><i class="fas fa-file-alt"></i></span>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">@lang('messages.forms')</span>
|
||||
<span class="info-box-number">{{$form_count}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::ADMIN->value))
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-danger elevation-1"><i
|
||||
class="fas fa-align-justify"></i></span>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">@lang('messages.templates')</span>
|
||||
<span class="info-box-number">{{$template_count}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-green elevation-1"><i class="fas fa-hand-pointer"></i></span>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">@lang('messages.submissions')</span>
|
||||
<span class="info-box-number">{{$submission_count}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<button type="button"
|
||||
data-href="{{action([\App\Http\Controllers\FormController::class, 'create'])}}"
|
||||
class="btn btn-primary float-right col-md-9 createForm mt-3">
|
||||
<i class="fas fa-plus" aria-hidden="true"></i> @lang('messages.new_form')</button>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12">
|
||||
<div class="card card-primary card-outline card-outline-tabs">
|
||||
<div class="card-header p-0 border-bottom-0">
|
||||
<ul class="nav nav-tabs
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
|
||||
nav-justified
|
||||
@endif"
|
||||
id="custom-tabs-four-tab" role="tablist">
|
||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value]) || auth()->user()->can_create_form)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="custome-tabs-all-forms" data-toggle="pill"
|
||||
href="#custome-tabs-forms" role="tab" aria-controls="custome-tabs-forms"
|
||||
aria-selected="true">
|
||||
<i class="fas fa-file-alt" aria-hidden="true"></i> @lang('messages.all_forms')
|
||||
</a>
|
||||
</li>
|
||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::ADMIN->value))
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="custome-tabs-all-templates" data-toggle="pill"
|
||||
href="#custome-tabs-templates" role="tab"
|
||||
aria-controls="custome-tabs-templates">
|
||||
<i class="fas fa-align-justify"
|
||||
aria-hidden="true"></i> @lang('messages.all_templates')
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@endif
|
||||
<li class="nav-item">
|
||||
<a class="nav-link
|
||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) && !auth()->user()->can_create_form)
|
||||
active
|
||||
@endif
|
||||
" id="custome-tabs-shared-forms" data-toggle="pill"
|
||||
href="#custome-tabs-shared-forms-assigned" role="tab"
|
||||
aria-controls="custome-tabs-shared-forms-assigned"
|
||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) && !auth()->user()->can_create_form)
|
||||
aria-selected="true"
|
||||
@endif>
|
||||
<i class="fas fa-file-alt"
|
||||
aria-hidden="true"></i> @lang('messages.assigned_forms')
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="tab-content" id="custom-tabs-four-tabContent">
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
|
||||
<div class="tab-pane fade active show" id="custome-tabs-forms" role="tabpanel"
|
||||
aria-labelledby="custome-tabs-all-forms">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="form_table" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('messages.description')</th>
|
||||
<th>@lang('messages.name')</th>
|
||||
<th>@lang('messages.created_at')</th>
|
||||
<th>@lang('messages.submissions')</th>
|
||||
<th>@lang('messages.action')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="custome-tabs-templates" role="tabpanel"
|
||||
aria-labelledby="custome-tabs-all-templates">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="template_table" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('messages.description')</th>
|
||||
<th>@lang('messages.name')</th>
|
||||
@if(auth()->user()->can('superadmin'))
|
||||
<th>
|
||||
@lang('messages.is_global_template')
|
||||
<i class="fas fa-info-circle"
|
||||
data-toggle="tooltip"
|
||||
title="@lang('messages.is_global_template_tooltip')"></i>
|
||||
</th>
|
||||
@endif
|
||||
<th>@lang('messages.action')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="tab-pane fade
|
||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || !auth()->user()->can_create_form)
|
||||
active show
|
||||
@endif
|
||||
" id="custome-tabs-shared-forms-assigned" role="tabpanel"
|
||||
aria-labelledby="custome-tabs-shared-forms">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="assigned_form_table" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('messages.description')</th>
|
||||
<th>@lang('messages.name')</th>
|
||||
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<th>@lang('messages.created_by')</th>
|
||||
@endif
|
||||
<th>@lang('messages.action')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="collab_modal" role="dialog" aria-hidden="true"></div>
|
||||
@endsection
|
||||
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
||||
// form dataTable
|
||||
var form_table = $('#form_table').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '/home',
|
||||
buttons: [],
|
||||
dom: 'lfrtip',
|
||||
fixedHeader: false,
|
||||
aaSorting: [[2, 'desc']],
|
||||
"columnDefs": [
|
||||
{"width": "22%", "targets": 0},
|
||||
{"width": "40%", "targets": 1},
|
||||
{"width": "15%", "targets": 2},
|
||||
{"width": "3%", "targets": 3},
|
||||
{"width": "20%", "targets": 4}
|
||||
],
|
||||
columns: [
|
||||
{data: 'name', name: 'name'},
|
||||
{data: 'description', name: 'description'},
|
||||
{data: 'created_at', name: 'created_at'},
|
||||
{data: 'data_count', name: 'data_count', searchable: false},
|
||||
{data: 'action', name: 'action', sortable: false}
|
||||
]
|
||||
});
|
||||
|
||||
// template dataTable
|
||||
var template_table = $('#template_table').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '/home-template',
|
||||
buttons: [],
|
||||
dom: 'lfrtip',
|
||||
fixedHeader: false,
|
||||
columns: [
|
||||
{data: 'name', name: 'name'},
|
||||
{data: 'description', name: 'description'},
|
||||
@if(auth()->user()->can('superadmin'))
|
||||
{
|
||||
data: 'is_global_template', name: 'is_global_template', sortable: false, searchable: false
|
||||
},
|
||||
@endif
|
||||
{
|
||||
data: 'action', name: 'action', sortable: false
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
//delete form
|
||||
$(document).on('click', '.delete_form', function () {
|
||||
var url = $(this).data("href");
|
||||
var result = confirm('Are You Sure?');
|
||||
if (result == true) {
|
||||
$.ajax({
|
||||
method: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
if (result.success == true) {
|
||||
toastr.success(result.msg);
|
||||
form_table.ajax.reload();
|
||||
} else {
|
||||
toastr.error(result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//delete template
|
||||
$(document).on('click', '.delete_template', function () {
|
||||
var url = $(this).data("href");
|
||||
var result = confirm('Are You Sure?');
|
||||
if (result == true) {
|
||||
$.ajax({
|
||||
method: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (result) {
|
||||
if (result.success == true) {
|
||||
toastr.success(result.msg);
|
||||
template_table.ajax.reload();
|
||||
} else {
|
||||
toastr.error(result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// create form
|
||||
$(document).on('click', '.createForm', function () {
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#modal_div").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// create widget
|
||||
$(document).on('click', '.generate_widget', function () {
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#modal_div").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//copy form
|
||||
$(document).on('click', '.copy_form', function () {
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#modal_div").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//assigned form to user
|
||||
var assigned_form_table = $('#assigned_form_table').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '/home-assigned-forms',
|
||||
buttons: [],
|
||||
dom: 'lfrtip',
|
||||
fixedHeader: false,
|
||||
aaSorting: [[0, 'desc']],
|
||||
"columnDefs": [
|
||||
{"width": "25%", "targets": 0},
|
||||
{"width": "40%", "targets": 1},
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
{
|
||||
"width": "15%", "targets": 2
|
||||
},
|
||||
@endif
|
||||
{
|
||||
"width": "20%",
|
||||
"targets": @php echo auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) ? 3 : 2 @endphp }
|
||||
],
|
||||
columns: [
|
||||
{data: 'name', name: 'forms.name'},
|
||||
{data: 'description', name: 'forms.description'},
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
{
|
||||
data: 'created_by', name: 'forms.created_by'
|
||||
},
|
||||
@endif
|
||||
{
|
||||
data: 'action', name: 'action', sortable: false
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
//form collaborate
|
||||
$(document).on('click', '.collab_btn', function () {
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#collab_modal").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#collab_modal").on('shown.bs.modal', function () {
|
||||
if ($("#form_design").length) {
|
||||
$(document).on('change', '#form_design', function () {
|
||||
if ($("#form_design").is(":checked")) {
|
||||
$("#form_view").attr('checked', true);
|
||||
} else {
|
||||
$("#form_view").attr('checked', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form#collaborate_form', function (e) {
|
||||
e.preventDefault();
|
||||
var data = $("form#collaborate_form").serialize();
|
||||
var url = $("form#collaborate_form").attr('action');
|
||||
var ladda = Ladda.create(document.querySelector('.submit_btn'));
|
||||
ladda.start();
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: data,
|
||||
success: function (response) {
|
||||
ladda.stop();
|
||||
if (response.success) {
|
||||
$("#collab_modal").modal('hide');
|
||||
toastr.success(response.msg);
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('a[data-toggle="pill"]').on('shown.bs.tab', function (e) {
|
||||
var target = $(e.target).attr('href');
|
||||
if (target == '#custome-tabs-forms') {
|
||||
if (typeof form_table != 'undefined') {
|
||||
form_table.ajax.reload();
|
||||
}
|
||||
} else if (target == '#custome-tabs-templates') {
|
||||
if (typeof template_table != 'undefined') {
|
||||
template_table.ajax.reload();
|
||||
}
|
||||
} else if (target == '#custome-tabs-shared-forms-assigned') {
|
||||
if (typeof assigned_form_table != 'undefined') {
|
||||
assigned_form_table.ajax.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@if(auth()->user()->can('superadmin'))
|
||||
$(document).on('click', '.toggle_global_template', function () {
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{route('toggle.global.template')}}",
|
||||
dataType: "json",
|
||||
data: {
|
||||
is_checked: $(this).is(":checked") ? 1 : 0,
|
||||
form_id: $(this).data("form_id"),
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
template_table.ajax.reload();
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
146
resources/views/ic/details.blade.php
Normal file
146
resources/views/ic/details.blade.php
Normal file
@@ -0,0 +1,146 @@
|
||||
@extends('layouts.app', ['nav' => false])
|
||||
@section('title', 'Welcome - Installation')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<h3 class="text-center">{{ config('app.name', 'POS') }} Installation <small>Step 2 of 3</small></h3>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="card">
|
||||
@include('ic.partials.nav', ['active' => 'app_details'])
|
||||
<div class="card-body">
|
||||
|
||||
@if(session('error'))
|
||||
<div class="alert alert-danger">
|
||||
{!! session('error') !!}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form id="details_form" method="post"
|
||||
action="{{route('install.postDetails')}}">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<h4>Application Details</h4>
|
||||
<hr/>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="app_name">Application Name:*</label>
|
||||
<input type="text" class="form-control" name="APP_NAME" id="app_name" placeholder="" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="app_title">Application Title:</label>
|
||||
<input type="text" name="APP_TITLE" class="form-control" id="app_title">
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<h4> License Details <small class="text-danger">Make sure to provide correct information from Envato/codecanyon</small></h4>
|
||||
<hr/>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="envato_purchase_code">Envato Purchase Code:*</label>
|
||||
<input type="password" name="ENVATO_PURCHASE_CODE" required class="form-control" id="envato_purchase_code">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="envato_username">Envato Username:*</label>
|
||||
<input type="text" name="ENVATO_USERNAME" required class="form-control" id="envato_username">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="envato_email">Your Email:</label>
|
||||
<input type="email" name="ENVATO_EMAIL" class="form-control" id="envato_email" placeholder="optional">
|
||||
<p class="help-block">For Newsletter & support</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<h4> Database Details <small class="text-muted">Make sure to provide correct information</small></h4>
|
||||
<hr/>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="db_host">Database Host:*</label>
|
||||
<input type="text" class="form-control" id="db_host" name="DB_HOST" required placeholder="localhost / 127.0.0.1">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="db_port">Database Port:*</label>
|
||||
<input type="text" class="form-control" id="db_port" name="DB_PORT" required value="3306">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="db_database">Database Name:*</label>
|
||||
<input type="text" class="form-control" id="db_database" name="DB_DATABASE" required>
|
||||
<p class="help-block text-danger"><small>Name of empty database</small></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="db_username">Database Username:*</label>
|
||||
<input type="text" class="form-control" id="db_username" name="DB_USERNAME" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="db_password">Database Password:*</label>
|
||||
<input type="password" class="form-control" id="db_password" name="DB_PASSWORD" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
<div class="col-md-12">
|
||||
<a href="{{route('install.index')}}" class="btn btn-default pull-left back_button" tabindex="-1">Back</a>
|
||||
<button type="submit" id="install_button" class="btn btn-primary float-md-right">Install</button>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 text-center text-danger install_msg d-none">
|
||||
<strong>Installation in progress, Please do not refresh, go back or close the browser.</strong>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('select#MAIL_MAILER').change(function(){
|
||||
var driver = $(this).val();
|
||||
|
||||
if(driver == 'smtp'){
|
||||
$('div.smtp').removeClass('d-none');
|
||||
$('input.smtp_input').attr('disabled', false);
|
||||
} else {
|
||||
$('div.smtp').addClass('d-none');
|
||||
$('input.smtp_input').attr('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
$('form#details_form').submit(function(){
|
||||
$('button#install_button').attr('disabled', true).text('Installing...');
|
||||
$('div.install_msg').removeClass('d-none');
|
||||
$('.back_button').d-none();
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
@endsection
|
||||
59
resources/views/ic/envText.blade.php
Normal file
59
resources/views/ic/envText.blade.php
Normal file
@@ -0,0 +1,59 @@
|
||||
@extends('layouts.app', ['nav' => false])
|
||||
@section('title', 'Welcome - Installation')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<h3 class="text-center">{{ config('app.name', 'POS') }} Installation <small>Step 2 of 3</small></h3>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="card">
|
||||
@include('ic.partials.nav', ['active' => 'app_details'])
|
||||
<div class="card-body">
|
||||
<form class="form" method="post"
|
||||
action="{{route('install.installAlternate')}}"
|
||||
id="env_details_form">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<h4 class="install_instuction">Hey, I need your help. </h4>
|
||||
<p class="install_instuction">
|
||||
Please create a file with name <code>.env</code> in application folder with <code>read & write permission</code> and paste the below content. <br/> Press install after it.
|
||||
</p>
|
||||
<hr/>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<textarea rows="25" cols="50">{{$envContent}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-primary float-md-right" id="install_button">Install</button>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 text-center text-danger install_msg d-none">
|
||||
<h3>Installation in progress, Please do not refresh, go back or close the browser.</strong>
|
||||
</h3>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
$('form#env_details_form').submit(function(){
|
||||
$('button#install_button').attr('disabled', true).text('Installing...');
|
||||
$(".install_instuction").addClass('d-none');
|
||||
$('div.install_msg').removeClass('d-none');
|
||||
$('textarea').addClass('d-none');
|
||||
$('.back_button').d-none();
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
@endsection
|
||||
50
resources/views/ic/index.blade.php
Normal file
50
resources/views/ic/index.blade.php
Normal file
@@ -0,0 +1,50 @@
|
||||
@extends('layouts.app', ['nav' => false])
|
||||
@section('title', 'Welcome - Installation')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<h3 class="text-center">{{ config('app.name', 'MPFG') }} Installation <small>Step 1 of 3</small></h3>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="card">
|
||||
@include('ic.partials.nav', ['active' => 'install'])
|
||||
<div class="card-body">
|
||||
<h3 class="text-success">
|
||||
Welcome to MPFG Installation!
|
||||
</h3>
|
||||
<p><strong class="text-danger">[IMPORTANT]</strong> Before you start installing make sure you have following information ready with you:</p>
|
||||
|
||||
<ol>
|
||||
<li>
|
||||
<b>Application Name</b> - Something short & Meaningful.
|
||||
</li>
|
||||
<li>
|
||||
<b>Database informations:</b>
|
||||
<ul>
|
||||
<li>Username</li>
|
||||
<li>Password</li>
|
||||
<li>Database Name</li>
|
||||
<li>Database Host</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<b>Envato or Codecanyon Details:</b>
|
||||
<ul>
|
||||
<li><b>Envato purchase code.</b> (<a href="https://help.market.envato.com/hc/en-us/articles/202822600-Where-Is-My-Purchase-Code-" target="_blank">Where Is My Purchase Code?</a>)</li>
|
||||
<li>
|
||||
<b>Envato Username.</b> (Your envato username)
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
@include('ic.partials.e_license')
|
||||
|
||||
<a href="{{route('install.details')}}" class="btn btn-danger float-right">I Agree, Let's Go!</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
15
resources/views/ic/partials/e_license.blade.php
Normal file
15
resources/views/ic/partials/e_license.blade.php
Normal file
File diff suppressed because one or more lines are too long
13
resources/views/ic/partials/nav.blade.php
Normal file
13
resources/views/ic/partials/nav.blade.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<div class="card-header">
|
||||
<ul class="nav nav-tabs card-header-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if($active == 'install') active @endif" href="#">Instructions</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if($active == 'app_details') active @endif" href="#">Application Details</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if($active == 'success') active @endif" href="#">Success</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
24
resources/views/ic/success.blade.php
Normal file
24
resources/views/ic/success.blade.php
Normal file
@@ -0,0 +1,24 @@
|
||||
@extends('layouts.app', ['nav' => false])
|
||||
@section('title', 'Welcome - Installation')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<h3 class="text-center">{{ config('app.name', 'POS') }} Installation <small>Step 3 of 3</small></h3>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="card">
|
||||
@include('ic.partials.nav', ['active' => 'success'])
|
||||
<div class="card-body">
|
||||
<!-- /.box-header -->
|
||||
<h1 class="card-title">{{ config('app.name') }}</h1>
|
||||
|
||||
<h3 class="text-success card-title">Great!, Your application is succesfully installed.</h3>
|
||||
<p><br><b>Username:</b> admin@admin.com<br/> <b>Password:</b> 12345678</p>
|
||||
<p><br>Login link <a href="{{route('login')}}" target="_blank">here</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
92
resources/views/ic/update_confirmation.blade.php
Normal file
92
resources/views/ic/update_confirmation.blade.php
Normal file
@@ -0,0 +1,92 @@
|
||||
@extends('layouts.app', ['nav' => false])
|
||||
@section('title', 'Welcome - Installation')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@if(session('error'))
|
||||
<div class="alert alert-danger">
|
||||
{!! session('error') !!}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form class="form" id="details_form" method="post"
|
||||
action="{{route('install.update')}}">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<h4> License Details <small class="text-danger">Make sure to provide correct information from Envato/codecanyon</small></h4>
|
||||
<hr/>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="envato_purchase_code">Envato Purchase Code:*</label>
|
||||
<input type="text" name="ENVATO_PURCHASE_CODE" required class="form-control" id="envato_purchase_code">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="envato_username">Envato Username:*</label>
|
||||
<input type="text" name="ENVATO_USERNAME" required class="form-control" id="envato_username">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="envato_email">Your Email:</label>
|
||||
<input type="email" name="ENVATO_EMAIL" class="form-control" id="envato_email" placeholder="optional">
|
||||
<p class="help-block">For Newsletter & support</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<strong class=''>💫 Book Update Service <a target='_blank' href='https://ultimatefosters.com/product/installation-update-service/'>Update Service</a></strong><br/><small><i>👉 Get updated by expert engineer within 24 hours</i><small>
|
||||
|
||||
@include('ic.partials.e_license')
|
||||
|
||||
<div class="col-md-12">
|
||||
<button type="submit" id="install_button" class="btn btn-primary float-right">I Agree, Update</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('javascript')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('select#MAIL_MAILER').change(function(){
|
||||
var driver = $(this).val();
|
||||
|
||||
if(driver == 'smtp'){
|
||||
$('div.smtp').removeClass('hide');
|
||||
$('input.smtp_input').attr('disabled', false);
|
||||
} else {
|
||||
$('div.smtp').addClass('hide');
|
||||
$('input.smtp_input').attr('disabled', true);
|
||||
}
|
||||
})
|
||||
|
||||
$('form#details_form').submit(function(){
|
||||
$('button#install_button').attr('disabled', true).text('Installing...');
|
||||
$('div.install_msg').removeClass('hide');
|
||||
$('.back_button').hide();
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
@endsection
|
||||
74
resources/views/layouts/app.blade.php
Normal file
74
resources/views/layouts/app.blade.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- CSRF Token -->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<title>{{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="dns-prefetch" href="//fonts.gstatic.com">
|
||||
<link href="//fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
|
||||
|
||||
<!-- Styles -->
|
||||
@include('layouts.partials.css')
|
||||
@yield('css')
|
||||
</head>
|
||||
<body class="layout-top-nav">
|
||||
<div id="app" class="wrapper">
|
||||
|
||||
@if(!isset($nav) || $nav === true)
|
||||
@include('layouts.partials.top-nav')
|
||||
@endif
|
||||
|
||||
<div class="content-wrapper">
|
||||
@if(!isset($iframe_enabled) || !$iframe_enabled)
|
||||
<div class="content-header">
|
||||
<div class="container">
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-6">
|
||||
<h1 class="m-0 text-dark"> @yield('heading')</h1>
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<section class="content">
|
||||
|
||||
<div class="container">
|
||||
<div col-md-12>
|
||||
<!-- @include('layouts.partials.status') -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@yield('content')
|
||||
</section>
|
||||
|
||||
<div class="modal fade" id="modal_div" tabindex="-1" role="dialog"
|
||||
aria-labelledby="gridSystemModalLabel">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<aside class="control-sidebar control-sidebar-dark">
|
||||
<!-- Control sidebar content goes here -->
|
||||
<div class="p-3">
|
||||
<h5>Title</h5>
|
||||
<p>Sidebar content</p>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
@if(!isset($nav) || $nav === true)
|
||||
@include('layouts.partials.footer')
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@include('layouts.partials.javascript')
|
||||
@yield('footer')
|
||||
|
||||
</body>
|
||||
</html>
|
||||
214
resources/views/layouts/partials/css.blade.php
Normal file
214
resources/views/layouts/partials/css.blade.php
Normal file
@@ -0,0 +1,214 @@
|
||||
@php
|
||||
$is_download = isset($is_download) ? $is_download : false;
|
||||
$error_msg_color = isset($error_msg_color) ? $error_msg_color : 'red';
|
||||
@endphp
|
||||
|
||||
@if(!$is_download)
|
||||
<link href="{{asset(mix('css/app.css'))}}" rel="stylesheet">
|
||||
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-colvis-1.5.6/b-flash-1.5.6/b-html5-1.5.6/b-print-1.5.6/fc-3.3.1/fh-3.1.4/datatables.min.css?v={{$asset_version}}"/>
|
||||
<!-- ladda.js -->
|
||||
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/ladda-themeless.min.css?v={{$asset_version}}">
|
||||
<!-- intro.js -->
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.9.3/introjs.min.css?v={{$asset_version}}">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/intro.js@2.9.3/themes/introjs-nassim.min.css?v={{$asset_version}}">
|
||||
<link href="https://cdn.jsdelivr.net/npm/animate.css@3.5.1?v={{$asset_version}}" rel="stylesheet" type="text/css">
|
||||
@else
|
||||
<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css?v={{$asset_version}}">
|
||||
@endif
|
||||
|
||||
<!-- form theme -->
|
||||
@if($is_download && isset($form->schema['settings']['theme']) && $form->schema['settings']['theme'] != 'default')
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.4.1/{{$form->schema['settings']['theme']}}/bootstrap.min.css" rel="stylesheet">
|
||||
@endif
|
||||
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.css?v={{$asset_version}}" rel="stylesheet">
|
||||
<link href="//cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.css?v={{$asset_version}}" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css?v={{$asset_version}}">
|
||||
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/rangeslider.js/2.3.2/rangeslider.min.css?v={{$asset_version}}">
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.1.2/css/tempusdominus-bootstrap-4.min.css?v={{$asset_version}}" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/min/dropzone.min.css?v={{$asset_version}}">
|
||||
|
||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.10/css/bootstrap-select.min.css?v={{$asset_version}}"/>
|
||||
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.css?v={{$asset_version}}" rel="stylesheet">
|
||||
|
||||
<!-- bootstrap star rating -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/css/star-rating.min.css?v={{$asset_version}}" media="all" rel="stylesheet" type="text/css" />
|
||||
<!-- if you need to use a theme, then include the theme CSS file -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/themes/krajee-svg/theme.css?v={{$asset_version}}" media="all" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{{asset('/plugins/countdowntimer/countdowntimer.css').'?v='.$asset_version}}">
|
||||
|
||||
<style type="text/css">
|
||||
.xs{
|
||||
font-size: 0.575rem !important;
|
||||
}
|
||||
.error {
|
||||
color:{!!$error_msg_color!!}
|
||||
}
|
||||
|
||||
@if(!$is_download)
|
||||
body {
|
||||
margin: 0; /* If not already reset */
|
||||
}
|
||||
|
||||
.content {
|
||||
min-height: calc(100vh - 80px);
|
||||
}
|
||||
|
||||
footer {
|
||||
height: 50px;
|
||||
}
|
||||
@endif
|
||||
/*custom css for switch*/
|
||||
.switch {
|
||||
font-size: 1rem;
|
||||
position: relative;
|
||||
}
|
||||
.switch input {
|
||||
position: absolute;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
background: none;
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
clip-path: inset(50%);
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
}
|
||||
.switch input + label {
|
||||
position: relative;
|
||||
min-width: calc(calc(2.375rem * .8) * 2);
|
||||
border-radius: calc(2.375rem * .8);
|
||||
height: calc(2.375rem * .8);
|
||||
line-height: calc(2.375rem * .8);
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
user-select: none;
|
||||
vertical-align: middle;
|
||||
text-indent: calc(calc(calc(2.375rem * .8) * 2) + .5rem);
|
||||
}
|
||||
.switch input + label::before,
|
||||
.switch input + label::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: calc(calc(2.375rem * .8) * 2);
|
||||
bottom: 0;
|
||||
display: block;
|
||||
}
|
||||
.switch input + label::before {
|
||||
right: 0;
|
||||
background-color: #dee2e6;
|
||||
border-radius: calc(2.375rem * .8);
|
||||
transition: 0.2s all;
|
||||
}
|
||||
.switch input + label::after {
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
width: calc(calc(2.375rem * .8) - calc(2px * 2));
|
||||
height: calc(calc(2.375rem * .8) - calc(2px * 2));
|
||||
border-radius: 50%;
|
||||
background-color: white;
|
||||
transition: 0.2s all;
|
||||
}
|
||||
.switch input:checked + label::before {
|
||||
background-color: #08d;
|
||||
}
|
||||
.switch input:checked + label::after {
|
||||
margin-left: calc(2.375rem * .8);
|
||||
}
|
||||
.switch input:focus + label::before {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 0.2rem rgba(0, 136, 221, 0.25);
|
||||
}
|
||||
.switch input:disabled + label {
|
||||
color: #868e96;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.switch input:disabled + label::before {
|
||||
background-color: #e9ecef;
|
||||
}
|
||||
.switch.switch-sm {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
.switch.switch-sm input + label {
|
||||
min-width: calc(calc(1.9375rem * .8) * 2);
|
||||
height: calc(1.9375rem * .8);
|
||||
line-height: calc(1.9375rem * .8);
|
||||
text-indent: calc(calc(calc(1.9375rem * .8) * 2) + .5rem);
|
||||
}
|
||||
.switch.switch-sm input + label::before {
|
||||
width: calc(calc(1.9375rem * .8) * 2);
|
||||
}
|
||||
.switch.switch-sm input + label::after {
|
||||
width: calc(calc(1.9375rem * .8) - calc(2px * 2));
|
||||
height: calc(calc(1.9375rem * .8) - calc(2px * 2));
|
||||
}
|
||||
.switch.switch-sm input:checked + label::after {
|
||||
margin-left: calc(1.9375rem * .8);
|
||||
}
|
||||
.switch.switch-lg {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
.switch.switch-lg input + label {
|
||||
min-width: calc(calc(3rem * .8) * 2);
|
||||
height: calc(3rem * .8);
|
||||
line-height: calc(3rem * .8);
|
||||
text-indent: calc(calc(calc(3rem * .8) * 2) + .5rem);
|
||||
}
|
||||
.switch.switch-lg input + label::before {
|
||||
width: calc(calc(3rem * .8) * 2);
|
||||
}
|
||||
.switch.switch-lg input + label::after {
|
||||
width: calc(calc(3rem * .8) - calc(2px * 2));
|
||||
height: calc(calc(3rem * .8) - calc(2px * 2));
|
||||
}
|
||||
.switch.switch-lg input:checked + label::after {
|
||||
margin-left: calc(3rem * .8);
|
||||
}
|
||||
.switch + .switch {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
margin-top: .75rem;
|
||||
}
|
||||
.signature-pad {
|
||||
background: aliceblue;
|
||||
}
|
||||
.pointer{
|
||||
cursor: pointer;
|
||||
}
|
||||
/* Scrollbar design css*/
|
||||
::-webkit-scrollbar-track
|
||||
{
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar
|
||||
{
|
||||
width: 6px;
|
||||
background-color: #F5F5F5;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb
|
||||
{
|
||||
background-color: #9ca3af;
|
||||
}
|
||||
</style>
|
||||
<!-- Form additional css -->
|
||||
@if(!empty($additional_css))
|
||||
{!!$additional_css!!}
|
||||
@endif
|
||||
<!-- Application additional css -->
|
||||
@if(!$is_download && !isset($nav))
|
||||
@if(!empty($__additional_css))
|
||||
{!!$__additional_css!!}
|
||||
@endif
|
||||
@endif
|
||||
12
resources/views/layouts/partials/footer.blade.php
Normal file
12
resources/views/layouts/partials/footer.blade.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<footer class="main-footer no-print">
|
||||
<div class="float-right d-none d-sm-inline">
|
||||
@lang('messages.application_copyright',[
|
||||
'name' => config('app.name', 'Laravel'),
|
||||
'version' => config('author.app_version'),
|
||||
'year' => date('Y')
|
||||
])
|
||||
</div>
|
||||
|
||||
<!-- Default to the left -->
|
||||
<!-- <strong>Copyright © 2014-2019 <a href="https://adminlte.io">AdminLTE.io</a>.</strong> All rights reserved. -->
|
||||
</footer>
|
||||
474
resources/views/layouts/partials/javascript.blade.php
Normal file
474
resources/views/layouts/partials/javascript.blade.php
Normal file
@@ -0,0 +1,474 @@
|
||||
@php
|
||||
$is_download = isset($is_download) ? $is_download : false;
|
||||
$form = !empty($form) ? $form : '';
|
||||
@endphp
|
||||
|
||||
<!-- reCaptcha -->
|
||||
<script src="//www.google.com/recaptcha/api.js?v={{$asset_version}}" async defer></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
if (typeof jQuery == 'undefined') {
|
||||
document.write('<script src="//code.jquery.com/jquery-3.4.1.min.js?v={{$asset_version}}"></' + 'script>');
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Bootstrap Js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js?v={{$asset_version}}"></script>
|
||||
|
||||
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js?v={{$asset_version}}"></script>
|
||||
|
||||
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js?v={{$asset_version}}"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.js?v={{$asset_version}}"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/jquery-validation@1.17.0/dist/jquery.validate.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/rangeslider.js/2.3.2/rangeslider.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.1.2/js/tempusdominus-bootstrap-4.min.js?v={{$asset_version}}"></script>
|
||||
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/min/dropzone.min.js?v={{$asset_version}}"></script>
|
||||
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.10/js/bootstrap-select.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote-bs4.min.js?v={{$asset_version}}"></script>
|
||||
|
||||
<!-- Boostrap star rating -->
|
||||
<script
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/star-rating.min.js?v={{$asset_version}}"
|
||||
type="text/javascript"></script>
|
||||
<!-- if you need to use a theme, then include the theme Js file -->
|
||||
<script
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/themes/krajee-svg/theme.js?v={{$asset_version}}"></script>
|
||||
<!-- optionally if you need translation for your language then include locale file as mentioned below -->
|
||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-star-rating/4.0.6/js/locales/<lang>.js"></script> -->
|
||||
<!-- signature pad (https://github.com/szimek/signature_pad)-->
|
||||
<script src="https://cdn.jsdelivr.net/npm/signature_pad@2.3.2/dist/signature_pad.min.js?v={{$asset_version}}"></script>
|
||||
|
||||
<script src="{{asset('/plugins/countdowntimer/countdowntimer.min.js').'?v='.$asset_version}}"></script>
|
||||
|
||||
@if(!$is_download)
|
||||
|
||||
<!-- app js values -->
|
||||
<script type="application/javascript">
|
||||
var APP = {};
|
||||
APP.APP_URL = "{{config('app.url')}}";
|
||||
APP.CURRENCY_SYMBOL = "{{env('CURRENCY_SYMBOL')}}";
|
||||
APP.ACELLE_MAIL_NAME = "{{config('constants.ACELLE_MAIL_NAME')}}";
|
||||
APP.ACELLE_MAIL_ENABLED = false;
|
||||
APP.APP_MEDIA_URL = "{{asset('/uploads/'.config('constants.doc_path').'/')}}";
|
||||
APP.PDF_PLACEHOLDER = "{{asset('/img/pdf_placeholder.png')}}";
|
||||
APP.MAX_UPLOAD_SIZE = "{{config('constants.max_upload_size')}}";
|
||||
APP.MAX_PDF_UPLOAD_SIZE = "{{config('constants.pdf_upload_size')}}";
|
||||
@if(!empty(config('constants.ACELLE_MAIL_NAME')) && !empty(config('constants.ACELLE_MAIL_API')))
|
||||
APP.ACELLE_MAIL_ENABLED = true;
|
||||
@endif
|
||||
$.ajaxSetup({
|
||||
beforeSend: function (jqXHR, settings) {
|
||||
if (settings.url.indexOf('http') === -1) {
|
||||
settings.url = APP.APP_URL + settings.url;
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
//function to print page
|
||||
function printElement(elem) {
|
||||
var domClone = elem.cloneNode(true);
|
||||
var printSection = document.getElementById("printSection");
|
||||
|
||||
if (!printSection) {
|
||||
var printSection = document.createElement("div");
|
||||
printSection.id = "printSection";
|
||||
document.body.appendChild(printSection);
|
||||
}
|
||||
|
||||
printSection.innerHTML = "";
|
||||
printSection.appendChild(domClone);
|
||||
window.print();
|
||||
}
|
||||
</script>
|
||||
|
||||
<script
|
||||
src="//cdn.jsdelivr.net/npm/jquery-validation-unobtrusive@3.2.10/dist/jquery.validate.unobtrusive.min.js?v={{$asset_version}}"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-colvis-1.5.6/b-flash-1.5.6/b-html5-1.5.6/b-print-1.5.6/fc-3.3.1/fh-3.1.4/datatables.min.js?v={{$asset_version}}"></script>
|
||||
|
||||
<!-- ladda.js -->
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/spin.min.js?v={{$asset_version}}"></script>
|
||||
<script type="text/javascript"
|
||||
src="//cdnjs.cloudflare.com/ajax/libs/Ladda/1.0.6/ladda.min.js?v={{$asset_version}}"></script>
|
||||
<!-- localization -->
|
||||
<script src="{{ url('/js/lang.js') . '?v=' . $asset_version }}"></script>
|
||||
<script src="{{ asset(mix('js/app.js')) }}" defer></script>
|
||||
<!-- intro.js -->
|
||||
<script type="text/javascript"
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/intro.js/2.9.3/intro.min.js?v={{$asset_version}}"></script>
|
||||
<script src="{{ asset('js/iframeResizercontentWindow.js') }}"></script>
|
||||
@endif
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
jQuery.validator.setDefaults({
|
||||
errorPlacement: function (error, element) {
|
||||
if (element.hasClass('select2') && element.parent().hasClass('input-group')) {
|
||||
error.insertAfter(element.parent());
|
||||
} else if (element.hasClass('select2')) {
|
||||
error.insertAfter(element.next('span.select2-container'));
|
||||
} else if (element.parent().hasClass('input-group')) {
|
||||
error.insertAfter(element.parent());
|
||||
} else if (element.parent().hasClass('multi-input')) {
|
||||
error.insertAfter(element.closest('.multi-input'));
|
||||
} else if (element.hasClass('summer_note')) {
|
||||
error.insertAfter(element.next('.note-editor'));
|
||||
} else if (element.hasClass('custom-control-input')) {
|
||||
error.insertAfter(element.parent().parent().parent());
|
||||
} else if (element.hasClass('star_rating')) {
|
||||
error.insertAfter(element.parent().parent());
|
||||
} else if (element.hasClass('switch')) {
|
||||
error.insertAfter(element.parent().parent());
|
||||
} else if (element.hasClass('signature')) {
|
||||
error.insertAfter(element.parent());
|
||||
} else {
|
||||
error.insertAfter(element);
|
||||
}
|
||||
},
|
||||
invalidHandler: function () {
|
||||
toastr.error("{{ __('messages.some_error_in_input_field') }}");
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
@if(!$is_download)
|
||||
jQuery.extend($.fn.dataTable.defaults, {
|
||||
fixedHeader: false,
|
||||
aLengthMenu: [
|
||||
[25, 50, 100, 200, 500, 1000, -1], [25, 50, 100, 200, 500, 1000, "{{__('messages.all')}}"]
|
||||
],
|
||||
iDisplayLength: 25,
|
||||
dom: 'lfrtip',
|
||||
"language": {
|
||||
"emptyTable": "{{__('messages.emptyTable')}}",
|
||||
"info": "{{__('messages.dt_info')}}",
|
||||
"infoEmpty": "{{__('messages.infoEmpty')}}",
|
||||
"infoFiltered": "{{__('messages.infoFiltered')}}",
|
||||
"lengthMenu": "{{__('messages.lengthMenu')}}",
|
||||
"loadingRecords": "{{__('messages.loadingRecords')}}",
|
||||
"processing": "{{__('messages.processing')}}",
|
||||
"search": "{{__('messages.search')}}",
|
||||
"zeroRecords": "{{__('messages.zeroRecords')}}",
|
||||
"paginate": {
|
||||
"first": "{{__('messages.first')}}",
|
||||
"last": "{{__('messages.last')}}",
|
||||
"next": "{{__('messages.next')}}",
|
||||
"previous": "{{__('messages.previous')}}"
|
||||
},
|
||||
buttons: {
|
||||
copyTitle: "{{__('messages.copy_to_clipboard')}}",
|
||||
copySuccess: {
|
||||
_: "{{__('messages.copied_n_rows_to_clipboard')}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}
|
||||
});
|
||||
@endif
|
||||
|
||||
$('button[type=reset]').on('click', function () {
|
||||
$(this).parents('form').find('input').val('');
|
||||
window.location.href = $(this).parents('form').attr('action');
|
||||
});
|
||||
});
|
||||
|
||||
function initialize_datetimepicker(element_name, element_date, start_date, end_date, date_format, time_format, disabled_days, enable_time_picker, time_picker_inline) {
|
||||
var start = null;
|
||||
var end = null;
|
||||
var format = '';
|
||||
var display_time = null;
|
||||
var disabled_week_days = '';
|
||||
var side_by_side = time_picker_inline;
|
||||
|
||||
if (disabled_days.length > 0) {
|
||||
disabled_week_days = disabled_days.join(',');
|
||||
}
|
||||
//format
|
||||
if (date_format != null) {
|
||||
format = date_format.toUpperCase();
|
||||
}
|
||||
|
||||
if (enable_time_picker) {
|
||||
display_time = 'hh:mm A';
|
||||
if (time_format == '24') {
|
||||
display_time = 'HH:mm';
|
||||
}
|
||||
format += ' ' + display_time;
|
||||
}
|
||||
|
||||
// start date
|
||||
if (start_date == 'none') {
|
||||
start = false;
|
||||
} else if (start_date == 'today') {
|
||||
start = moment();
|
||||
} else if (start_date == 'current_year') {
|
||||
start = moment().startOf('year');
|
||||
} else if (start_date == 'current_month') {
|
||||
start = moment().startOf('month');
|
||||
}
|
||||
//end date
|
||||
if (end_date == 'none') {
|
||||
end = false;
|
||||
} else if (end_date == 'today') {
|
||||
end = moment().add(0, 'd');
|
||||
} else if (end_date == 'current_year') {
|
||||
end = moment().endOf('year');
|
||||
} else if (end_date == 'current_month') {
|
||||
end = moment().endOf('month');
|
||||
}
|
||||
|
||||
$('#' + element_name).datetimepicker({
|
||||
icons: {
|
||||
time: 'far fa-clock',
|
||||
},
|
||||
format: format,
|
||||
minDate: start,
|
||||
maxDate: end,
|
||||
daysOfWeekDisabled: [disabled_week_days],
|
||||
showClear: true,
|
||||
ignoreReadonly: true,
|
||||
sideBySide: side_by_side,
|
||||
defaultDate: element_date.length ? moment(element_date, format) : ''
|
||||
});
|
||||
}
|
||||
|
||||
function initialize_rangeslider(element_name) {
|
||||
$('#' + element_name).rangeslider({
|
||||
polyfill: false,
|
||||
//Callback function
|
||||
onInit: function () {
|
||||
},
|
||||
// Callback function
|
||||
onSlide: function (position, value) {
|
||||
$('.' + element_name).text(value);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Dropzone.autoDiscover = false;
|
||||
|
||||
function initialize_dropzone(element_name, file_upload_msg, no_of_files_can_be_uploaded, max_file_size, allowed_file_type, url = null) {
|
||||
|
||||
var file_remove_url = "library/delete_file.php";
|
||||
if (url == null) {
|
||||
url = "{{ url('/file-upload')}}";
|
||||
file_remove_url = "{{ url('/file-delete')}}";
|
||||
}
|
||||
|
||||
var file_names = [];
|
||||
|
||||
if ($('input#' + element_name).val().length > 0) {
|
||||
file_names.push($('input#' + element_name).val());
|
||||
}
|
||||
|
||||
$('#' + element_name).dropzone({
|
||||
paramName: "file",
|
||||
addRemoveLinks: true,
|
||||
url: url,
|
||||
maxFilesize: max_file_size,
|
||||
dictDefaultMessage: file_upload_msg,
|
||||
maxFiles: no_of_files_can_be_uploaded,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
acceptedFiles: allowed_file_type,
|
||||
init: function () {
|
||||
//function to be use on editing a form, to display existing files
|
||||
if ($('input#' + element_name).val().length > 0) {
|
||||
window[`${element_name}_myDropzone`] = this;
|
||||
var file_obj = {files: $('input#' + element_name).val()};
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: '/existing-file-display',
|
||||
dataType: "json",
|
||||
data: file_obj,
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
$.each(result.files, function (key, file) {
|
||||
var mockFile = {name: file.name, uploaded_as: file.uploaded_as, size: file.size};
|
||||
window[`${element_name}_myDropzone`].emit("addedfile", mockFile);
|
||||
window[`${element_name}_myDropzone`].emit("thumbnail", mockFile, file.path);
|
||||
window[`${element_name}_myDropzone`].emit("complete", mockFile);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//function to be use on removeing a file
|
||||
this.on("removedfile", function (file) {
|
||||
$.ajax({
|
||||
url: file_remove_url,
|
||||
data: {"file_name": file.uploaded_as},
|
||||
type: "POST",
|
||||
success: function (result) {
|
||||
if (typeof (result) == 'string') {
|
||||
var result = JSON.parse(result);
|
||||
}
|
||||
|
||||
if (result.success == 1) {
|
||||
toastr.success(result.msg);
|
||||
var index = file_names.indexOf(file.uploaded_as);
|
||||
|
||||
if (index != -1) {
|
||||
file_names.splice(index, 1);
|
||||
}
|
||||
|
||||
var elementVal = $('input#' + element_name).val();
|
||||
var oldVal = elementVal.split(",");
|
||||
|
||||
index = oldVal.indexOf(file.uploaded_as);
|
||||
|
||||
if (index != -1) {
|
||||
oldVal.splice(index, 1);
|
||||
}
|
||||
|
||||
var newVal = oldVal.join(",");
|
||||
$('input#' + element_name).val(newVal);
|
||||
} else {
|
||||
toastr.error(result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
success: function (file, response) {
|
||||
if (typeof (response) == 'string') {
|
||||
var response = JSON.parse(response);
|
||||
}
|
||||
if (response.success == true) {
|
||||
toastr.success(response.msg);
|
||||
file_names.push(response.path);
|
||||
file.uploaded_as = response.path;
|
||||
$('input#' + element_name).val(file_names); //store file_names
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initialize_text_editor(element_name, placeholder, height) {
|
||||
|
||||
$('#' + element_name).summernote({
|
||||
placeholder: placeholder,
|
||||
height: height
|
||||
});
|
||||
}
|
||||
|
||||
function initialize_star_rating(element_name) {
|
||||
$("#" + element_name).rating({
|
||||
theme: 'krajee-fas',
|
||||
filledStar: '<i class="fas fa-star"></i>',
|
||||
emptyStar: '<i class="fas fa-star"></i>'
|
||||
});
|
||||
}
|
||||
|
||||
function initialize_datetimepicker_for_form_scheduling() {
|
||||
|
||||
$('div#start_date_time').datetimepicker({
|
||||
icons: {
|
||||
time: 'far fa-clock',
|
||||
},
|
||||
format: 'YYYY-MM-DD hh:mm A',
|
||||
minDate: moment(),
|
||||
showClear: true,
|
||||
ignoreReadonly: true
|
||||
});
|
||||
|
||||
$('div#end_date_time').datetimepicker({
|
||||
icons: {
|
||||
time: 'far fa-clock',
|
||||
},
|
||||
format: 'YYYY-MM-DD hh:mm A',
|
||||
minDate: moment(),
|
||||
showClear: true,
|
||||
ignoreReadonly: true
|
||||
});
|
||||
}
|
||||
|
||||
function initialize_signature_pad(element) {
|
||||
var signaturePad = element;
|
||||
var canvas = document.getElementById(element);
|
||||
signaturePad = new SignaturePad(canvas, {
|
||||
onEnd: function (event) {
|
||||
var element = $(this)[0]._canvas.id
|
||||
var signature = $(this)[0].toDataURL();
|
||||
$('#output_' + element).val(signature);
|
||||
}
|
||||
});
|
||||
|
||||
if ($('#output_' + element).val().length > 0) {
|
||||
|
||||
signaturePad.fromDataURL($('#output_' + element).val());
|
||||
}
|
||||
|
||||
$(document).on('click', '#clear_' + element, function () {
|
||||
signaturePad.clear();
|
||||
$('#output_' + $(this).data('name')).val('');
|
||||
});
|
||||
|
||||
$(document).on('click', '#undo_' + element, function () {
|
||||
var data = signaturePad.toData();
|
||||
if (data) {
|
||||
data.pop(); // remove the last dot or line
|
||||
signaturePad.fromData(data); //draw signature from array of data
|
||||
if (data.length > 0) {
|
||||
var signature = signaturePad.toDataURL();
|
||||
$('#output_' + $(this).data('name')).val(signature);
|
||||
} else {
|
||||
$('#output_' + $(this).data('name')).val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initializeToastrSettingsForForm(position) {
|
||||
var toastr_position = 'toast-top-right';
|
||||
if (position) {
|
||||
toastr_position = position;
|
||||
}
|
||||
toastr.options = {
|
||||
"positionClass": toastr_position
|
||||
}
|
||||
}
|
||||
|
||||
function initialize_countdowntimer(element) {
|
||||
$("#" + element.name).countdowntimer({
|
||||
hours: element.hours,
|
||||
minutes: element.minutes,
|
||||
seconds: element.seconds,
|
||||
size: element.size,
|
||||
labelsFormat: element.labels_format,
|
||||
borderColor: element.border_color,
|
||||
fontColor: element.font_color,
|
||||
backgroundColor: element.bg_color,
|
||||
timeSeparator: element.time_separator,
|
||||
displayFormat: element.display_format
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<!-- Application additional js -->
|
||||
@if(!$is_download && !isset($nav))
|
||||
@if(!empty($__additional_js))
|
||||
{!!$__additional_js!!}
|
||||
@endif
|
||||
@endif
|
||||
17
resources/views/layouts/partials/status.blade.php
Normal file
17
resources/views/layouts/partials/status.blade.php
Normal file
@@ -0,0 +1,17 @@
|
||||
@if (session('status') && isset(session('status')['success']))
|
||||
@if(session('status')['success'] == 1)
|
||||
<div class="alert alert-success" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
{!!session('status')['msg']!!}
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
{!!session('status')['msg']!!}
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
143
resources/views/layouts/partials/top-nav.blade.php
Normal file
143
resources/views/layouts/partials/top-nav.blade.php
Normal file
@@ -0,0 +1,143 @@
|
||||
<!-- Navbar -->
|
||||
<nav class="main-header navbar navbar-expand navbar-light @guest navbar-laravel @else navbar-white @endguest">
|
||||
<div class="container">
|
||||
@auth
|
||||
<a href="{{action([\App\Http\Controllers\HomeController::class, 'index'])}}" class="navbar-brand">
|
||||
<!-- <img src="dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"
|
||||
style="opacity: .8"> -->
|
||||
<span class="brand-text font-weight-light">{{ config('app.name', 'Laravel') }}</span>
|
||||
</a>
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item d-none d-sm-inline-block">
|
||||
<a class="nav-link" href="{{ action([\App\Http\Controllers\HomeController::class, 'index']) }}">
|
||||
<i class="fas fa-home"></i>
|
||||
{{ __('messages.home') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
@endauth
|
||||
|
||||
<!-- Right Side Of Navbar -->
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<!-- Authentication Links -->
|
||||
@guest
|
||||
<li class="nav-item d-none d-sm-inline-block">
|
||||
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
|
||||
</li>
|
||||
@if (Route::has('register'))
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
|
||||
</li>
|
||||
@endif
|
||||
@else
|
||||
<!-- superadmin menu -->
|
||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
||||
<li class="nav-item dropdown">
|
||||
<a id="superadminDropdown" href="#" data-toggle="dropdown" aria-haspopup="true"
|
||||
aria-expanded="false" class="nav-link dropdown-toggle">
|
||||
<i class="fas fa-universal-access"></i>
|
||||
@lang('messages.' . auth()->user()->roles->first()->name)
|
||||
</a>
|
||||
|
||||
<ul aria-labelledby="superadminDropdown" class="dropdown-menu border-0 shadow">
|
||||
<li>
|
||||
@if($__enable_saas)
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\PackageController::class, 'index'])}}"
|
||||
class="dropdown-item">
|
||||
<i class="fas fa-money-check"></i>
|
||||
@lang('messages.packages')
|
||||
</a>
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\PackageSubscriptionsController::class, 'index'])}}"
|
||||
class="dropdown-item">
|
||||
<i class="fas fa-sync"></i>
|
||||
@lang('messages.package_subscription')
|
||||
</a>
|
||||
@endif
|
||||
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'index'])}}"
|
||||
class="dropdown-item">
|
||||
<i class="fas fa-users"></i>
|
||||
@lang('messages.users')
|
||||
</a>
|
||||
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<a class="dropdown-item"
|
||||
href="{{action([\App\Http\Controllers\Superadmin\SuperadminSettingsController::class, 'create'])}}">
|
||||
<i class="fa fa-cogs"></i>
|
||||
@lang('messages.system_settings')
|
||||
</a>
|
||||
@endif
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
<!-- /superadmin menu -->
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a id="navbarDropdown" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
|
||||
class="nav-link dropdown-toggle">
|
||||
<i class="fas fa-user-tie"></i>
|
||||
{{ ucfirst(Auth::user()->name) }}
|
||||
</a>
|
||||
|
||||
<ul aria-labelledby="navbarDropdown" class="dropdown-menu border-0 shadow">
|
||||
<li>
|
||||
<a class="dropdown-item"
|
||||
href="{{action([\App\Http\Controllers\ManageProfileController::class, 'getProfile'])}}">
|
||||
<i class="fas fa-user-edit"></i>
|
||||
@lang('messages.profile')
|
||||
</a>
|
||||
@if($__enable_saas)
|
||||
<a class="dropdown-item"
|
||||
href="{{action([\App\Http\Controllers\SubscriptionsController::class, 'index'])}}">
|
||||
<i class="fas fa-sync"></i>
|
||||
@lang('messages.my_subscription')
|
||||
</a>
|
||||
@endif
|
||||
<a class="dropdown-item"
|
||||
href="{{action([\App\Http\Controllers\ManageSettingsController::class, 'getSettings'])}}">
|
||||
<i class="fas fa-user-cog"></i>
|
||||
@lang('messages.my_settings')
|
||||
</a>
|
||||
<a class="dropdown-item"
|
||||
href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">
|
||||
<i class="fas fa-sign-out-alt"></i>
|
||||
{{ __('Logout') }}
|
||||
</a>
|
||||
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
|
||||
@csrf
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endguest
|
||||
</ul>
|
||||
|
||||
<!-- Left navbar links -->
|
||||
<!-- <ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
</li>
|
||||
<li class="nav-item d-none d-sm-inline-block">
|
||||
<a href="index3.html" class="nav-link">Home</a>
|
||||
</li>
|
||||
<li class="nav-item d-none d-sm-inline-block">
|
||||
<a href="#" class="nav-link">Contact</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Help
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="#">FAQ</a>
|
||||
<a class="dropdown-item" href="#">Support</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#">Contact</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul> -->
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
<!-- /.navbar -->
|
||||
110
resources/views/payments/create.blade.php
Normal file
110
resources/views/payments/create.blade.php
Normal file
@@ -0,0 +1,110 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="card card-outline card-info">
|
||||
<div class="card-header mb-2">
|
||||
<h4>
|
||||
@lang('messages.pay_n_subscribe')
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5>
|
||||
{{$package->name}}
|
||||
|
||||
@php
|
||||
$price_interval = __('messages.'.$package->price_interval);
|
||||
@endphp
|
||||
@if($package->price != 0)
|
||||
(<span class="currency">
|
||||
{{$package->price}}
|
||||
</span>
|
||||
<small class="text-muted">
|
||||
@lang('messages.subscription_price',[
|
||||
'interval' => $package->interval,
|
||||
'price_interval' => $price_interval
|
||||
])
|
||||
</small>)
|
||||
@else
|
||||
(<span class="currency">
|
||||
0000
|
||||
</span>)
|
||||
@endif
|
||||
</h5>
|
||||
<ul>
|
||||
<li>
|
||||
@if($package->no_of_active_forms != 0)
|
||||
<span>
|
||||
@lang('messages.no_of_forms',['active_form' => $package->no_of_active_forms])
|
||||
<i class="far fa-check-circle text-success small"></i>
|
||||
</span>
|
||||
@else
|
||||
@lang('messages.unlimited_forms')
|
||||
<i class="far fa-check-circle text-success small"></i>
|
||||
@endif
|
||||
</li>
|
||||
<li>
|
||||
@if($package->is_form_downloadable)
|
||||
@lang('messages.form_code_download')
|
||||
<i class="far fa-check-circle text-success small"></i>
|
||||
@else
|
||||
@lang('messages.form_code_download')
|
||||
<i class="far fa-times-circle text-danger small"></i>
|
||||
@endif
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="list-group">
|
||||
@foreach($payment_gateways as $k => $v)
|
||||
<div class="list-group-item">
|
||||
<b>@lang('messages.pay_via', ['method' => $v])</b>
|
||||
|
||||
<div class="row" id="paymentdiv_{{$k}}">
|
||||
@php
|
||||
$view = 'payments.partials.pay_'.$k;
|
||||
@endphp
|
||||
@includeIf($view)
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
//notification after payment failure
|
||||
@if (!empty(session('status')) && session('status')['success'] == 1)
|
||||
var msg = '{!!session('status')['msg']!!}';
|
||||
toastr.success(msg);
|
||||
@elseif(!empty(session('status')) && session('status')['success'] == 0)
|
||||
var msg = '{!!session('status')['msg']!!}';
|
||||
toastr.error(msg);
|
||||
@endif
|
||||
$('span.currency').each(function(index, element){
|
||||
var money = __formatCurrency($(this).text());
|
||||
$(this).text(money);
|
||||
});
|
||||
// stripe payment integration
|
||||
var stripe = Stripe('{{config("constants.STRIPE_PUB_KEY")}}');
|
||||
var stripe_payment_session_id = ''
|
||||
@if(!empty($stripe_payment_session))
|
||||
stripe_payment_session_id = '{{$stripe_payment_session->id}}';
|
||||
@endif
|
||||
$(document).on('click', '#checkout-stripe', function() {
|
||||
stripe.redirectToCheckout({
|
||||
// Make the id field from the Checkout Session creation API response
|
||||
// available to this file, so you can provide it as parameter here
|
||||
// instead of the CHECKOUT_SESSION_ID placeholder.
|
||||
sessionId: stripe_payment_session_id
|
||||
}).then(function (result) {
|
||||
// If `redirectToCheckout` fails due to a browser or network
|
||||
// error, display the localized error message to your customer
|
||||
// using `result.error.message`.
|
||||
toastr.error(result.error.message);
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
14
resources/views/payments/partials/pay_offline.blade.php
Normal file
14
resources/views/payments/partials/pay_offline.blade.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<div class="col-md-12">
|
||||
<form action="{{action([\App\Http\Controllers\Superadmin\SubscriptionPaymentController::class, 'confirmPayment'], [$package->id])}}" method="POST">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" name="paid_via" value="{{$k}}">
|
||||
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
<i class="fas fa-hand-holding-usd"></i>
|
||||
{{$v}}
|
||||
</button>
|
||||
<small class="form-text text-muted">
|
||||
@lang('messages.offline_pay_helptext')
|
||||
</small>
|
||||
</form>
|
||||
</div>
|
||||
8
resources/views/payments/partials/pay_paypal.blade.php
Normal file
8
resources/views/payments/partials/pay_paypal.blade.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="col-md-12">
|
||||
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\SubscriptionPaymentController::class, 'paypalExpressCheckout'], [$package->id])}}" class="btn btn-primary btn-sm">
|
||||
<i class="fab fa-paypal"></i>
|
||||
PayPal
|
||||
</a>
|
||||
|
||||
</div>
|
||||
6
resources/views/payments/partials/pay_stripe.blade.php
Normal file
6
resources/views/payments/partials/pay_stripe.blade.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-info btn-sm" id="checkout-stripe">
|
||||
<i class="fab fa-cc-stripe"></i>
|
||||
{{$v}}
|
||||
</button>
|
||||
</div>
|
||||
146
resources/views/superadmin/packages/create.blade.php
Normal file
146
resources/views/superadmin/packages/create.blade.php
Normal file
@@ -0,0 +1,146 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="col-md-12">
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<h3>@lang('messages.create_package')</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="create_package_form">
|
||||
<div class="form-row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="name">
|
||||
@lang('messages.name') *
|
||||
</label>
|
||||
<input type="text" name="name" class="form-control" id="name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="description">
|
||||
@lang('messages.description') *
|
||||
</label>
|
||||
<input type="text" name="description" class="form-control" id="description" maxlength="100" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="price_interval">
|
||||
@lang('messages.price_interval') *
|
||||
</label>
|
||||
<select class="form-control" name="price_interval" id="price_interval" required>
|
||||
<option value="">
|
||||
@lang('messages.select_price_interval')
|
||||
</option>
|
||||
@foreach($lists as $key => $value)
|
||||
<option value="{{$key}}">
|
||||
{{$value}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="interval">
|
||||
@lang('messages.interval') *
|
||||
</label>
|
||||
<input type="number" name="interval" class="form-control" id="interval" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="price">
|
||||
@lang('messages.price')
|
||||
</label>
|
||||
<input type="number" name="price" class="form-control" id="price" aria-describedby="price_help_text">
|
||||
<small id="price_help_text" class="form-text text-muted">
|
||||
@lang('messages.free_package_help_text')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="no_of_active_forms">
|
||||
@lang('messages.no_of_active_forms')
|
||||
</label>
|
||||
<input type="number" name="no_of_active_forms" class="form-control" id="no_of_active_forms" aria-describedby="no_of_active_forms_help">
|
||||
<small id="no_of_active_forms_help" class="form-text text-muted">
|
||||
@lang('messages.unlimited_form_help_text')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="sort_order">
|
||||
@lang('messages.sort_order') *
|
||||
</label>
|
||||
<input type="number" name="sort_order" class="form-control" id="sort_order" required>
|
||||
<small class="form-text text-muted">
|
||||
@lang('messages.sort_order_help_text')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" name="is_form_downloadable" id="is_form_downloadable" value="1">
|
||||
<label class="custom-control-label" for="is_form_downloadable">
|
||||
@lang('messages.allow_form_code_downloading')
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" name="is_active" id="is_active" value="1">
|
||||
<label class="custom-control-label" for="is_active">
|
||||
@lang('messages.activate')
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success float-right submit_btn">
|
||||
@lang('messages.save')
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('form#create_package_form').validate({
|
||||
submitHandler: function(form, e) {
|
||||
e.preventDefault();
|
||||
var data = $('form#create_package_form').serialize();
|
||||
if ($('form#create_package_form').valid()) {
|
||||
$.ajax({
|
||||
method:"POST",
|
||||
url: "/superadmin/packages",
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success:function(response) {
|
||||
if(response.success == true){
|
||||
window.location = response.redirect;
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
151
resources/views/superadmin/packages/edit.blade.php
Normal file
151
resources/views/superadmin/packages/edit.blade.php
Normal file
@@ -0,0 +1,151 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="col-md-12">
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<h3>@lang('messages.edit_package')</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="edit_package_form" action="{{action([\App\Http\Controllers\Superadmin\PackageController::class, 'update'], ['package' => $package->id])}}">
|
||||
<div class="form-row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="name">
|
||||
@lang('messages.name') *
|
||||
</label>
|
||||
<input type="text" name="name" class="form-control" id="name" value="{{$package->name}}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="description">
|
||||
@lang('messages.description') *
|
||||
</label>
|
||||
<input type="text" name="description" class="form-control" id="description" value="{{$package->description}}" maxlength="100" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="price_interval">
|
||||
@lang('messages.price_interval') *
|
||||
</label>
|
||||
<select class="form-control" name="price_interval" id="price_interval" required>
|
||||
<option value="">
|
||||
@lang('messages.select_price_interval')
|
||||
</option>
|
||||
@foreach($lists as $key => $value)
|
||||
<option value="{{$key}}"
|
||||
@if($key == $package->price_interval)
|
||||
selected
|
||||
@endif
|
||||
>
|
||||
{{$value}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="interval">
|
||||
@lang('messages.interval') *
|
||||
</label>
|
||||
<input type="number" name="interval" class="form-control" id="interval" required value="{{$package->interval}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="price">
|
||||
@lang('messages.price')
|
||||
</label>
|
||||
<input type="number" name="price" class="form-control" id="price" value="{{$package->price}}" aria-describedby="price_help_text">
|
||||
<small id="price_help_text" class="form-text text-muted">
|
||||
@lang('messages.free_package_help_text')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="no_of_active_forms">
|
||||
@lang('messages.no_of_active_forms')
|
||||
</label>
|
||||
<input type="number" name="no_of_active_forms" class="form-control" id="no_of_active_forms" value="{{$package->no_of_active_forms}}" aria-describedby="no_of_active_forms_help">
|
||||
<small id="no_of_active_forms_help" class="form-text text-muted">
|
||||
@lang('messages.unlimited_form_help_text')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="sort_order">
|
||||
@lang('messages.sort_order') *
|
||||
</label>
|
||||
<input type="number" name="sort_order" class="form-control" id="sort_order" value="{{$package->sort_order}}" required>
|
||||
<small class="form-text text-muted">
|
||||
@lang('messages.sort_order_help_text')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" name="is_form_downloadable" id="is_form_downloadable" value="1" @if($package->is_form_downloadable) checked @endif>
|
||||
<label class="custom-control-label" for="is_form_downloadable">
|
||||
@lang('messages.allow_form_code_downloading')
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" name="is_active" id="is_active" value="1" @if($package->is_active) checked @endif>
|
||||
<label class="custom-control-label" for="is_active">
|
||||
@lang('messages.activate')
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success submit_btn float-right">
|
||||
@lang('messages.update')
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('form#edit_package_form').validate({
|
||||
submitHandler: function(form, e) {
|
||||
e.preventDefault();
|
||||
var data = $('form#edit_package_form').serialize();
|
||||
var url = $('form#edit_package_form').attr('action');
|
||||
if ($('form#edit_package_form').valid()) {
|
||||
$.ajax({
|
||||
method:"PUT",
|
||||
url: url,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success:function(response) {
|
||||
if(response.success == true){
|
||||
window.location = response.redirect;
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
150
resources/views/superadmin/packages/index.blade.php
Normal file
150
resources/views/superadmin/packages/index.blade.php
Normal file
@@ -0,0 +1,150 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="card card-outline card-info">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<h4>
|
||||
<i class="fas fa-money-check"></i>
|
||||
@lang('messages.all_packages')
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\PackageController::class, 'create'])}}" class="btn btn-primary btn-sm float-right">
|
||||
<i class="fas fa-plus"></i>
|
||||
@lang('messages.create')
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if(count($packages) <= 0)
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<span class="text-white">@lang('messages.no_packages_found')</span>
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
@foreach($packages as $package)
|
||||
<div class="col-md-4">
|
||||
<div class="card card-outline card-success on_hover">
|
||||
<div class="card-header">
|
||||
<div class="text-center">
|
||||
{{$package->name}}
|
||||
</div>
|
||||
<div class="text-center">
|
||||
@if($package->is_active)
|
||||
<span class="badge badge-pill badge-success">
|
||||
@lang('messages.active')
|
||||
</span>
|
||||
@else
|
||||
<span class="badge badge-pill badge-danger">
|
||||
@lang('messages.inactive')
|
||||
</span>
|
||||
@endif
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\PackageController::class, 'edit'], ['package' => $package->id])}}" class="btn btn-link text-info">
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
<a href="#" class="btn btn-link delete_package text-danger" data-url="{{action([\App\Http\Controllers\Superadmin\PackageController::class, 'destroy'], ['package' => $package->id])}}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
@if($package->no_of_active_forms != 0)
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.no_of_forms',[
|
||||
'active_form' => $package->no_of_active_forms])
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.unlimited_forms')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
@if($package->is_form_downloadable)
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-times-circle text-danger"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
@php
|
||||
$price_interval = __('messages.'.$package->price_interval);
|
||||
@endphp
|
||||
@if($package->price != 0)
|
||||
<h3>
|
||||
<span class="currency">
|
||||
{{$package->price}}
|
||||
</span>
|
||||
<small class="text-muted">
|
||||
@lang('messages.subscription_price',[
|
||||
'interval' => $package->interval,
|
||||
'price_interval' => $price_interval
|
||||
])
|
||||
</small>
|
||||
</h3>
|
||||
@else
|
||||
<h3>
|
||||
@lang('messages.free_for_interval', [
|
||||
'interval' => $package->interval,
|
||||
'price_interval' => $price_interval
|
||||
])
|
||||
</h3>
|
||||
@endif
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
{{$package->description}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if($loop->iteration%3 == 0)
|
||||
<div class="clearfix"></div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
{{ $packages->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
$('span.currency').each(function(index, element){
|
||||
var money = __formatCurrency($(this).text());
|
||||
$(this).text(money);
|
||||
});
|
||||
|
||||
$(document).on('click', '.delete_package', function(){
|
||||
var url = $(this).data('url');
|
||||
var is_confirmed = confirm('Are You Sure?');
|
||||
if (is_confirmed) {
|
||||
$.ajax({
|
||||
method: "DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function(result){
|
||||
if(result.success == true){
|
||||
toastr.success(result.msg);
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 1100);
|
||||
} else {
|
||||
toastr.error(result.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
572
resources/views/superadmin/settings/create.blade.php
Normal file
572
resources/views/superadmin/settings/create.blade.php
Normal file
@@ -0,0 +1,572 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
@lang('messages.system_settings')
|
||||
</h1>
|
||||
</section>
|
||||
<div class="col-md-12">
|
||||
<form id="settings_form" action="{{action([\App\Http\Controllers\Superadmin\SuperadminSettingsController::class, 'store'])}}" method="POST">
|
||||
@csrf
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="APP_NAME">
|
||||
@lang('messages.app_name') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fa fa-suitcase"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="APP_NAME" id="APP_NAME" placeholder="{{__('messages.enter_app_name')}}" value="{{$settings['APP_NAME']}}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="APP_TITLE">
|
||||
@lang('messages.app_title') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas fa-tag"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="APP_TITLE" id="APP_TITLE" placeholder="{{__('messages.enter_app_title')}}" value="{{$settings['APP_TITLE']}}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="language">
|
||||
@lang('messages.language') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas fa-language"></i>
|
||||
</span>
|
||||
</div>
|
||||
<select id="language" class="form-control" name="APP_LOCALE" required>
|
||||
@foreach($settings['APP_LOCALE'] as $key => $language)
|
||||
<option value="{{$key}}"
|
||||
@if($key == env('APP_LOCALE'))
|
||||
selected
|
||||
@endif>
|
||||
{{$language['full_name']}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="APP_TIMEZONE">
|
||||
@lang('messages.timezone') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="far fa-hourglass"></i>
|
||||
</span>
|
||||
</div>
|
||||
<select class="form-control" name="APP_TIMEZONE" required id="APP_TIMEZONE">
|
||||
<option value="">
|
||||
@lang('messages.choose_timezone')
|
||||
</option>
|
||||
@foreach($settings['timezones'] as $timezone)
|
||||
<option value="{{$timezone}}"
|
||||
@if($timezone == $settings['APP_TIMEZONE'])
|
||||
selected
|
||||
@endif>
|
||||
{{$timezone}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="CURRENCY_NAME">
|
||||
@lang('messages.currency_name') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="far fa-money-bill-alt"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="text" name="CURRENCY_NAME" id="CURRENCY_NAME" class="form-control" value="{{$settings['CURRENCY_NAME']}}" required placeholder="{{__('messages.enter_currency_name')}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="CURRENCY_CODE">
|
||||
@lang('messages.currency_code') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="far fa-money-bill-alt"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="text" name="CURRENCY_CODE" id="CURRENCY_CODE" class="form-control" value="{{$settings['CURRENCY_CODE']}}" required
|
||||
placeholder="{{__('messages.enter_currency_code')}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="CURRENCY_SYMBOL">
|
||||
@lang('messages.currency_symbol') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="far fa-money-bill-alt"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="text" name="CURRENCY_SYMBOL" id="CURRENCY_SYMBOL" class="form-control" value="{{$settings['CURRENCY_SYMBOL']}}" required
|
||||
placeholder="{{__('messages.enter_currency_symbol')}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="APP_DATE_FORMAT">
|
||||
@lang('messages.date_format') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas fa-calendar-day"></i>
|
||||
</span>
|
||||
</div>
|
||||
<select class="form-control" name="APP_DATE_FORMAT" required id="APP_DATE_FORMAT">
|
||||
@foreach($date_formats as $key => $value)
|
||||
<option value="{{$key}}"
|
||||
@if($key == config('constants.APP_DATE_FORMAT'))
|
||||
selected
|
||||
@endif>
|
||||
{{$value}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group">
|
||||
<label for="APP_TIME_FORMAT">
|
||||
@lang('messages.time_format') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="far fa-clock"></i>
|
||||
</span>
|
||||
</div>
|
||||
<select class="form-control" name="APP_TIME_FORMAT" required id="APP_TIME_FORMAT">
|
||||
<option value="12"
|
||||
@if(config('constants.APP_TIME_FORMAT') == '12')
|
||||
selected
|
||||
@endif>
|
||||
@lang('messages.12_hour')
|
||||
</option>
|
||||
<option value="24"
|
||||
@if(config('constants.APP_TIME_FORMAT') == '24')
|
||||
selected
|
||||
@endif>
|
||||
@lang('messages.24_hour')
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" name="ENABLE_REGISTRATION" id="ENABLE_REGISTRATION" value="1" @if($settings['ENABLE_REGISTRATION']) checked @endif>
|
||||
<label class="custom-control-label" for="ENABLE_REGISTRATION">
|
||||
@lang('messages.enable_registration')
|
||||
<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" title="{{__('messages.resgistration_will_be_enabled')}}"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@if($__type_e)
|
||||
<div class="col-md-4">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" name="ENABLE_SAAS_MODULE" id="ENABLE_SAAS_MODULE" value="1" @if($settings['ENABLE_SAAS_MODULE']) checked @endif>
|
||||
<label class="custom-control-label" for="ENABLE_SAAS_MODULE">
|
||||
@lang('messages.enable_saas_module')
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if($__enable_saas)
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<h4>
|
||||
@lang('messages.payment_api_settings')
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="col-md-12">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" name="ENABLE_OFFLINE_PAYMENT" id="ENABLE_OFFLINE_PAYMENT" value="1" @if($settings['ENABLE_OFFLINE_PAYMENT']) checked @endif>
|
||||
<label class="custom-control-label" for="ENABLE_OFFLINE_PAYMENT">
|
||||
@lang('messages.enable_ofline_payment')
|
||||
<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" title="{{__('messages.offline_pay_helptext')}}"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h4 class="mb-2">Paypal</h4>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="PAYPAL_MODE">
|
||||
PAYPAL MODE *
|
||||
</label>
|
||||
<select class="form-control" name="PAYPAL_MODE" id="PAYPAL_MODE" required>
|
||||
<option value="sandbox"
|
||||
@if($settings['PAYPAL_MODE'] == 'sandbox')
|
||||
selected
|
||||
@endif
|
||||
>
|
||||
Sandbox
|
||||
</option>
|
||||
<option value="live"
|
||||
@if($settings['PAYPAL_MODE'] == 'live')
|
||||
selected
|
||||
@endif
|
||||
>
|
||||
Live
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<!-- live mode -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="PAYPAL_LIVE_API_USERNAME">
|
||||
PAYPAL LIVE API USERNAME
|
||||
</label>
|
||||
<input type="text" class="form-control" name="PAYPAL_LIVE_API_USERNAME" id="PAYPAL_LIVE_API_USERNAME" placeholder="PAYPAL LIVE API USERNAME" value="{{$settings['PAYPAL_LIVE_API_USERNAME']}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="PAYPAL_LIVE_API_PASSWORD">
|
||||
PAYPAL LIVE API PASSWORD
|
||||
</label>
|
||||
<input type="text" class="form-control" name="PAYPAL_LIVE_API_PASSWORD" id="PAYPAL_LIVE_API_PASSWORD" placeholder="PAYPAL LIVE API PASSWORD" value="{{$settings['PAYPAL_LIVE_API_PASSWORD']}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="PAYPAL_LIVE_API_SECRET">
|
||||
PAYPAL LIVE API SECRET
|
||||
</label>
|
||||
<input type="text" class="form-control" name="PAYPAL_LIVE_API_SECRET" id="PAYPAL_LIVE_API_SECRET" placeholder="PAYPAL LIVE API SECRET" value="{{$settings['PAYPAL_LIVE_API_SECRET']}}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- sandbox mode -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="PAYPAL_SANDBOX_API_USERNAME">
|
||||
PAYPAL SANDBOX API USERNAME
|
||||
</label>
|
||||
<input type="text" class="form-control" name="PAYPAL_SANDBOX_API_USERNAME" id="PAYPAL_SANDBOX_API_USERNAME" placeholder="PAYPAL SANDBOX API USERNAME" value="{{$settings['PAYPAL_SANDBOX_API_USERNAME']}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="PAYPAL_SANDBOX_API_PASSWORD">
|
||||
PAYPAL SANDBOX API PASSWORD
|
||||
</label>
|
||||
<input type="text" class="form-control" name="PAYPAL_SANDBOX_API_PASSWORD" id="PAYPAL_SANDBOX_API_PASSWORD" placeholder="PAYPAL SANDBOX API PASSWORD" value="{{$settings['PAYPAL_SANDBOX_API_PASSWORD']}}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="PAYPAL_SANDBOX_API_SECRET">
|
||||
PAYPAL SANDBOX API SECRET
|
||||
</label>
|
||||
<input type="text" class="form-control" name="PAYPAL_SANDBOX_API_SECRET" id="PAYPAL_SANDBOX_API_SECRET" placeholder="PAYPAL SANDBOX API SECRET" value="{{$settings['PAYPAL_SANDBOX_API_SECRET']}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h4 class="mb-2">Stripe</h4>
|
||||
<div class="form-row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="STRIPE_PUB_KEY">
|
||||
STRIPE PUBLISHABLE KEY
|
||||
</label>
|
||||
<input type="text" class="form-control" name="STRIPE_PUB_KEY" id="STRIPE_PUB_KEY" placeholder="STRIPE PUBLISHABLE KEY" value="{{$settings['STRIPE_PUB_KEY']}}">
|
||||
<small id="help_text" class="form-text text-muted">
|
||||
{{trans('messages.to_see_supported_curreny')}}
|
||||
<a href="https://stripe.com/docs/currencies" target="_blank">{{trans('messages.click_here')}}.</a>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="STRIPE_SECRET_KEY">
|
||||
STRIPE SECRET KEY
|
||||
</label>
|
||||
<input type="text" class="form-control" name="STRIPE_SECRET_KEY" id="STRIPE_SECRET_KEY" placeholder="STRIPE SECRET KEY" value="{{$settings['STRIPE_SECRET_KEY']}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<h4>
|
||||
@lang('messages.smtp_email_settings')
|
||||
<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" data-html="true" title="{{__('messages.system_settings_smtp_tooltips')}}"></i>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_HOST">
|
||||
@lang('messages.mail_host') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_HOST" id="MAIL_HOST" placeholder="{{__('messages.enter_mail_host')}}" value="{{$settings['MAIL_HOST']}}" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_PORT">
|
||||
@lang('messages.mail_port') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_PORT" id="MAIL_PORT" placeholder="{{__('messages.enter_mail_port')}}" value="{{$settings['MAIL_PORT']}}" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_USERNAME">
|
||||
@lang('messages.mail_username') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_USERNAME" id="MAIL_USERNAME" placeholder="{{__('messages.enter_mail_username')}}" value="{{$settings['MAIL_USERNAME']}}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_FROM_ADDRESS">
|
||||
@lang('messages.mail_from_address') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_FROM_ADDRESS" id="MAIL_FROM_ADDRESS" placeholder="{{__('messages.mail_from_address')}}" value="{{$settings['MAIL_FROM_ADDRESS']}}" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_FROM_NAME">
|
||||
@lang('messages.mail_from_name') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_FROM_NAME" id="MAIL_FROM_NAME" placeholder="{{__('messages.mail_from_name')}}" value="{{$settings['MAIL_FROM_NAME']}}" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_PASSWORD">
|
||||
@lang('messages.mail_password') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_PASSWORD" id="MAIL_PASSWORD" placeholder="{{__('messages.enter_mail_password')}}" value="{{$settings['MAIL_PASSWORD']}}" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_ENCRYPTION">
|
||||
@lang('messages.mail_encryption') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_ENCRYPTION" id="MAIL_ENCRYPTION" placeholder="{{__('messages.enter_mail_encryption')}}" value="{{$settings['MAIL_ENCRYPTION']}}" required>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-outline-primary ladda-button btn-test-smtp float-right m-1"
|
||||
data-style="expand-right"
|
||||
data-spinner-color="blue"
|
||||
>
|
||||
<span class="ladda-label">
|
||||
{{trans('messages.test_smtp_details')}}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Acelle Mail -->
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<h4>
|
||||
@lang('messages.integration')
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-row mb-4">
|
||||
<div class="col-md-12">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="enable_acelle_mail" value="1" @if(!empty($settings['ACELLE_MAIL_NAME']) && !empty($settings['ACELLE_MAIL_API'])) checked @endif>
|
||||
<label class="custom-control-label" for="enable_acelle_mail">
|
||||
@lang('messages.enable') Acelle Mail
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row acelle_mail_details"
|
||||
@if(empty($settings['ACELLE_MAIL_NAME']) && empty($settings['ACELLE_MAIL_API']))
|
||||
style="display:none;"
|
||||
@endif>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="acelle_name">
|
||||
@lang('messages.name') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="ACELLE_MAIL_NAME" id="acelle_name" placeholder="{{__('messages.name')}}" value="{{$settings['ACELLE_MAIL_NAME']}}" required>
|
||||
<small id="acelle_name_help" class="form-text text-muted">
|
||||
@lang('messages.acelle_mail_name_help_text')
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="acelle_url">
|
||||
@lang('messages.api_endpoint') *
|
||||
</label>
|
||||
<input type="url" class="form-control" name="ACELLE_MAIL_API" id="acelle_url" placeholder="{{__('messages.api_endpoint')}}" value="{{$settings['ACELLE_MAIL_API']}}" required>
|
||||
<small id="acelle_url_help" class="form-text text-muted">
|
||||
@lang('messages.acelle_mail_api_url_help_text')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Acelle Mail -->
|
||||
<!-- additional js/css -->
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<h4>
|
||||
@lang('messages.additional_js_css')
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<label for="additional_js">
|
||||
@lang('messages.additional_js')
|
||||
</label>
|
||||
<textarea class="form-control" name="system[additional_js]" id="additional_js" rows="8" aria-describedby="additional_jsHelp">@if(!empty($additional_js)){{$additional_js}}@endif</textarea>
|
||||
<small id="additional_jsHelp" class="form-text text-muted">
|
||||
@lang('messages.additional_js_help')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-12">
|
||||
<label for="additional_css">
|
||||
@lang('messages.additional_css')
|
||||
</label>
|
||||
<textarea class="form-control" name="system[additional_css]" id="additional_css" rows="8" aria-describedby="additional_css_Help">@if(!empty($additional_css)){{$additional_css}}@endif</textarea>
|
||||
<small id="additional_css_Help" class="form-text text-muted">
|
||||
@lang('messages.additional_css_help')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-success btn-lg submit_btn float-right">
|
||||
@lang('messages.save')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
$('form#settings_form').validate();
|
||||
|
||||
$(document).on('click', '.btn-test-smtp', function(){
|
||||
|
||||
var smtpdata = {
|
||||
'host': $("input[name=MAIL_HOST]").val(),
|
||||
'port' : $("input[name=MAIL_PORT]").val(),
|
||||
'from_address' : $("input[name=MAIL_FROM_ADDRESS]").val(),
|
||||
'from_name' : $("input[name=MAIL_FROM_NAME]").val(),
|
||||
'encryption' : $("input[name=MAIL_ENCRYPTION]").val(),
|
||||
'username' : $("input[name=MAIL_USERNAME]").val(),
|
||||
'password' : $("input[name=MAIL_PASSWORD]").val(),
|
||||
};
|
||||
|
||||
var isValid = true;
|
||||
_.forEach(smtpdata, function(smtp){
|
||||
|
||||
if (!_.isEmpty(smtp)) {
|
||||
isValid = true && isValid;
|
||||
} else {
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
|
||||
if (isValid) {
|
||||
var ladda = Ladda.create($('.btn-test-smtp')[0]);
|
||||
ladda.start();
|
||||
$.ajax({
|
||||
method:"GET",
|
||||
url: "/test-smtp",
|
||||
data: smtpdata,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
ladda.stop();
|
||||
if(response.success == true){
|
||||
toastr.success(response.msg);
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
isValid = true;
|
||||
alert('Please fill all the SMTP details.');
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('change', "#enable_acelle_mail", function(){
|
||||
if ($(this).is(":checked")) {
|
||||
$(".acelle_mail_details").show();
|
||||
} else {
|
||||
$(".acelle_mail_details").hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
61
resources/views/superadmin/subscription/edit.blade.php
Normal file
61
resources/views/superadmin/subscription/edit.blade.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">
|
||||
@lang('messages.edit_subscription')
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="edit_subscription" action="{{action([\App\Http\Controllers\Superadmin\PackageSubscriptionsController::class, 'update'], [$subscription['id']])}}" method="PUT">
|
||||
<div class="form-group">
|
||||
<label for="start_date">
|
||||
@lang('messages.start_date')
|
||||
</label>
|
||||
<input type="date" name="start_date" id="start_date" class="form-control" value="{{$subscription['start_date']}}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="end_date">
|
||||
@lang('messages.end_date')
|
||||
</label>
|
||||
<input type="date" name="end_date" id="end_date" class="form-control" value="{{$subscription['end_date']}}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="status">
|
||||
@lang('messages.status')
|
||||
</label>
|
||||
<select name="status" id="status" class="form-control">
|
||||
@foreach($status_list as $key=>$value)
|
||||
<option value="{{$key}}"
|
||||
@if($key == $subscription['status'])
|
||||
selected
|
||||
@endif
|
||||
>
|
||||
{{$value}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="transaction_id">
|
||||
@lang('messages.transaction_id')
|
||||
</label>
|
||||
<input type="text" name="payment_transaction_id" id="transaction_id" class="form-control" value="{{$subscription['payment_transaction_id']}}">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-sm float-right m-1">
|
||||
@lang('messages.update')
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary btn-sm float-right m-1" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('form#edit_subscription').validate();
|
||||
});
|
||||
</script>
|
||||
203
resources/views/superadmin/subscription/index.blade.php
Normal file
203
resources/views/superadmin/subscription/index.blade.php
Normal file
@@ -0,0 +1,203 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card card-outline card-info">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<h3>
|
||||
<i class="fas fa-sync-alt"></i>
|
||||
@lang('messages.package_subscription')
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-12">
|
||||
<div class="box-group" id="accordion">
|
||||
<div class="panel box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h4 class="box-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
|
||||
<i class="fas fa-filter"></i>
|
||||
@lang('messages.filter')
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseTwo" class="panel-collapse collapse">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="filter_by_package">
|
||||
@lang('messages.package')
|
||||
</label>
|
||||
<select name="filter_by_package" id="filter_by_package" class="form-control">
|
||||
<option value="">
|
||||
@lang('messages.all')
|
||||
</option>
|
||||
@if(!empty($packages))
|
||||
@foreach($packages as $id => $package)
|
||||
<option value="{{$id}}">
|
||||
{{$package}}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="filter_by_status">
|
||||
@lang('messages.status')
|
||||
</label>
|
||||
<select name="filter_by_status" id="filter_by_status" class="form-control">
|
||||
<option value="">
|
||||
@lang('messages.all')
|
||||
</option>
|
||||
@if(!empty($subscription_status))
|
||||
@foreach($subscription_status as $id => $status)
|
||||
<option value="{{$id}}">
|
||||
{{$status}}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<div id="export-btns" class="float-right"></div>
|
||||
<table class="table" id="package_subscription_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('messages.name')</th>
|
||||
<th>@lang('messages.email')</th>
|
||||
<th>@lang('messages.package_name')</th>
|
||||
<th>@lang('messages.status')</th>
|
||||
<th>@lang('messages.start_date')</th>
|
||||
<th>@lang('messages.end_date')</th>
|
||||
<th>@lang('messages.price')</th>
|
||||
<th>@lang('messages.paid_via')</th>
|
||||
<th>@lang('messages.transaction_id')</th>
|
||||
<th>@lang('messages.action')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var package_subscription_table = $("#package_subscription_table").DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax:{
|
||||
url: '/superadmin/package-subscription',
|
||||
data: function(d) {
|
||||
d.package_id = $('#filter_by_package').val();
|
||||
d.status = $('#filter_by_status').val();
|
||||
}
|
||||
},
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
footer: true,
|
||||
exportOptions: {
|
||||
columns: [0,1,2,3,4,5,6,7,8]
|
||||
},
|
||||
title: '{{config("app.name") ."-". __("messages.package_subscription")}}'
|
||||
},
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
footer: false,
|
||||
exportOptions: {
|
||||
columns: [0,1,2,3,4,5,6,7,8]
|
||||
},
|
||||
title: '{{config("app.name") ."-". __("messages.package_subscription")}}'
|
||||
}
|
||||
],
|
||||
fixedHeader: false,
|
||||
columnDefs: [
|
||||
{
|
||||
targets: [2],
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
{ data: 'user' , name: 'users.name'},
|
||||
{ data: 'user_email' , name: 'users.email'},
|
||||
{ data: 'package' , name: 'package'},
|
||||
{ data: 'status' , name: 'status'},
|
||||
{ data: 'start_date' , name: 'start_date'},
|
||||
{ data: 'end_date', name: 'end_date'},
|
||||
{ data: 'package_price' , name: 'package_price'},
|
||||
{ data: 'paid_via', name: 'paid_via'},
|
||||
{ data: 'payment_transaction_id' , name: 'payment_transaction_id'},
|
||||
{ data: 'action', name: 'action', sortable:false }
|
||||
],
|
||||
"fnDrawCallback": function (oSettings) {
|
||||
__convert_currency_in_datatable($('#package_subscription_table'));
|
||||
}
|
||||
});
|
||||
|
||||
package_subscription_table.buttons().container().appendTo($('#export-btns'));
|
||||
|
||||
$(document).on('click', '.edit_subscription', function(){
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function(response) {
|
||||
$("#modal_div").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form#edit_subscription', function(e){
|
||||
e.preventDefault();
|
||||
var data = $('form#edit_subscription').serialize();
|
||||
var url = $('form#edit_subscription').attr('action');
|
||||
$.ajax({
|
||||
method:"PUT",
|
||||
url: url,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success:function(response) {
|
||||
if(response.success == true){
|
||||
toastr.success(response.msg);
|
||||
package_subscription_table.ajax.reload();
|
||||
$("#modal_div").modal("hide");
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('change', '#filter_by_package, #filter_by_status', function() {
|
||||
package_subscription_table.ajax.reload();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
39
resources/views/superadmin/users/confirm_upgrade.blade.php
Normal file
39
resources/views/superadmin/users/confirm_upgrade.blade.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<form data-type="form" action="{{action([\App\Http\Controllers\Superadmin\SubscriptionPaymentController::class, 'adminSubscription'], [$package_id, $user_id])}}" method="PUT">
|
||||
{{ csrf_field() }}
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
@lang('messages.confirm_upgrade_account')
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="disable_all_packages" name="disable_all_packages" value="1" class="form-check-input" aria-describedby="disable_all_packagesHelp" checked>
|
||||
<label class="form-check-label" for="disable_all_packages">
|
||||
@lang('messages.disable_current_packages')
|
||||
</label>
|
||||
</div>
|
||||
<p>
|
||||
<small id="disable_all_packagesHelp" class="form-text text-muted">
|
||||
@lang('messages.disable_current_packages_help_text')
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
<button type='submit' class="btn btn-sm btn-success btn-sm submit_btn">
|
||||
@lang('messages.upgrade_account')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
173
resources/views/superadmin/users/create.blade.php
Normal file
173
resources/views/superadmin/users/create.blade.php
Normal file
@@ -0,0 +1,173 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<form id="add_user_form"
|
||||
action="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'store'])}}" method="POST">
|
||||
{{ csrf_field() }}
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
@lang('messages.add_user')
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="name">
|
||||
@lang('messages.name')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
|
||||
<input type="text" class="form-control"
|
||||
name="name" id="name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="email">
|
||||
@lang('messages.email')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
|
||||
<input type="email" class="form-control"
|
||||
name="email" id="email" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="password">
|
||||
@lang('messages.password')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
|
||||
<input type="password" class="form-control"
|
||||
name="password" id="password" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" id="is_active" name="is_active" value="1"
|
||||
checked>
|
||||
<label class="form-check-label" for="is_active">
|
||||
@lang('messages.is_active')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.is_active_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value]))
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" id="is_admin" name="is_admin">
|
||||
<label class="form-check-label" for="is_admin">
|
||||
@lang('messages.is_admin')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.is_admin_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="send_email" id="send_email"
|
||||
value="1">
|
||||
<label class="form-check-label" for="send_email">
|
||||
@lang('messages.send_email')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.send_email_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="can_create_form"
|
||||
id="can_create_form" value="1">
|
||||
<label class="form-check-label" for="can_create_form">
|
||||
@lang('messages.can_create_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_create_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="card assign-form p-3">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="assign_form">
|
||||
@lang('messages.assign_forms'):
|
||||
</label>
|
||||
<select multiple class="form-control" id="assign_form" name="form_id[]">
|
||||
@foreach($forms as $key => $value)
|
||||
<option value="{{$key}}">
|
||||
{{$value}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h5>@lang('messages.permission_for_forms'):</h5>
|
||||
<div class="row">
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]"
|
||||
id="form_design"
|
||||
value="can_design_form">
|
||||
<label class="form-check-label" for="form_design">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_data"
|
||||
value="can_view_data">
|
||||
<label class="form-check-label" for="form_data">
|
||||
@lang('messages.can_view_data')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_view"
|
||||
value="can_view_form">
|
||||
<label class="form-check-label" for="form_view">
|
||||
@lang('messages.can_view_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-sm btn-primary submit_btn">
|
||||
@lang('messages.save')
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
241
resources/views/superadmin/users/edit.blade.php
Normal file
241
resources/views/superadmin/users/edit.blade.php
Normal file
@@ -0,0 +1,241 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<form id="edit_user_form"
|
||||
action="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'update'], [$user->id])}}"
|
||||
method="PUT">
|
||||
{{ csrf_field() }}
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
@lang('messages.edit_user')
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<input type="hidden" id="user_id" value="{{$user->id}}">
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="name">
|
||||
@lang('messages.name')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
|
||||
<input type="text" class="form-control"
|
||||
name="name" id="name" value="{{$user->name}}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="email">
|
||||
@lang('messages.email')
|
||||
<span class="error">*</span>
|
||||
</label>
|
||||
|
||||
<input type="email" class="form-control"
|
||||
name="email" id="email" value="{{$user->email}}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="password">
|
||||
@lang('messages.password')
|
||||
</label>
|
||||
<input type="password" class="form-control"
|
||||
name="password" id="password" aria-describedby="passwordHelp">
|
||||
<small id="passwordHelp" class="form-text text-muted">
|
||||
@lang('messages.dont_want_to_change_keep_it_blank')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" id="is_active" name="is_active" value="1"
|
||||
@if($user->is_active) checked @endif>
|
||||
<label class="form-check-label" for="is_active">
|
||||
@lang('messages.is_active')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.is_active_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" id="is_admin" name="is_admin"
|
||||
@if($user->hasRole(\App\Enums\User\RoleEnum::ADMIN->value)) checked @endif>
|
||||
<label class="form-check-label" for="is_admin">
|
||||
@lang('messages.is_admin')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.is_admin_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="send_email" id="send_email"
|
||||
value="1">
|
||||
<label class="form-check-label" for="send_email">
|
||||
@lang('messages.send_email')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.send_email_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="can_create_form"
|
||||
id="can_create_form" value="1" @if($user->can_create_form) checked @endif>
|
||||
<label class="form-check-label" for="can_create_form">
|
||||
@lang('messages.can_create_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_create_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@php
|
||||
$form_ids = $assigned_forms->pluck('form_id')->toArray();
|
||||
@endphp
|
||||
@if($assigned_forms->count() > 0)
|
||||
<h5>@lang('messages.assigned_forms'):</h5>
|
||||
@foreach($assigned_forms as $key => $assigned_form)
|
||||
<div class="card edit-assigned-form mb-4 p-3">
|
||||
<label>
|
||||
<i class="fab fa-wpforms"></i>
|
||||
{{$assigned_form->form->name}}
|
||||
</label>
|
||||
<div class="row">
|
||||
<input type="hidden" name="edit_assigned_form_id[]" value="{{$assigned_form->id}}">
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input"
|
||||
name="edit_permissions[{{$assigned_form->id}}][]"
|
||||
id="form_design_{{$key}}" value="can_design_form"
|
||||
@if(in_array('can_design_form', $assigned_form->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="form_design_{{$key}}">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input"
|
||||
name="edit_permissions[{{$assigned_form->id}}][]"
|
||||
id="form_data_{{$key}}" value="can_view_data"
|
||||
@if(in_array('can_view_data', $assigned_form->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="form_data_{{$key}}">
|
||||
@lang('messages.can_view_data')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input"
|
||||
name="edit_permissions[{{$assigned_form->id}}][]"
|
||||
id="can_view_form_{{$key}}" value="can_view_form"
|
||||
@if(in_array('can_view_form', $assigned_form->permissions))
|
||||
checked
|
||||
@endif>
|
||||
<label class="form-check-label" for="can_view_form_{{$key}}">
|
||||
@lang('messages.can_view_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="card assign-form p-3">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="assign_form">
|
||||
@lang('messages.assign_forms'):
|
||||
</label>
|
||||
<select multiple class="form-control" id="assign_form" name="form_id[]">
|
||||
@foreach($forms as $key => $value)
|
||||
@if(!in_array($key, $form_ids))
|
||||
<option value="{{$key}}">
|
||||
{{$value}}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h5>@lang('messages.permission_for_forms'):</h5>
|
||||
<div class="row">
|
||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]"
|
||||
id="form_design" value="can_design_form">
|
||||
<label class="form-check-label" for="form_design">
|
||||
@lang('messages.can_design_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_design_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_data"
|
||||
value="can_view_data">
|
||||
<label class="form-check-label" for="form_data">
|
||||
@lang('messages.can_view_data')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_data_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" name="permissions[]" id="form_view"
|
||||
value="can_view_form">
|
||||
<label class="form-check-label" for="form_view">
|
||||
@lang('messages.can_view_form')
|
||||
<i class="fas fa-info-circle text-info" data-toggle="tooltip"
|
||||
title="@lang('messages.can_view_form_tooltip')"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-sm btn-primary submit_btn">
|
||||
@lang('messages.update')
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
354
resources/views/superadmin/users/index.blade.php
Normal file
354
resources/views/superadmin/users/index.blade.php
Normal file
@@ -0,0 +1,354 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card card-outline card-info">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<h3>
|
||||
<i class="fas fa-users-cog"></i>
|
||||
@lang('messages.all_users')
|
||||
</h3>
|
||||
</div>
|
||||
<button type="button" class="btn btn-sm btn-primary float-right" data-href="{{action([\App\Http\Controllers\Superadmin\ManageUsersController::class, 'create'])}}" id="add_user">
|
||||
<i class="fas fa-user-plus"></i>
|
||||
@lang('messages.add')
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-12">
|
||||
<div class="box-group" id="accordion">
|
||||
<div class="panel box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h4 class="box-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
|
||||
<i class="fas fa-filter"></i>
|
||||
@lang('messages.filter')
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseTwo" class="panel-collapse collapse">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="filter_by_status">
|
||||
@lang('messages.status')
|
||||
</label>
|
||||
<select name="filter_by_status" id="filter_by_status" class="form-control">
|
||||
<option value="">
|
||||
@lang('messages.all')
|
||||
</option>
|
||||
<option value="active">
|
||||
@lang('messages.active')
|
||||
</option>
|
||||
<option value="inactive">
|
||||
@lang('messages.inactive')
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="users_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('messages.name')</th>
|
||||
<th>@lang('messages.email')</th>
|
||||
<th>
|
||||
@lang('messages.is_active')
|
||||
</th>
|
||||
<th>
|
||||
@lang('messages.created_at')
|
||||
</th>
|
||||
<th>@lang('messages.action')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal" id="user_modal" tabindex="-1" role="dialog"></div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var users_table = $('#users_table').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax:{
|
||||
url: '/superadmin/users',
|
||||
data: function(d) {
|
||||
d.status = $('#filter_by_status').val();
|
||||
}
|
||||
},
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
footer: true,
|
||||
exportOptions: {
|
||||
columns: [0,1,2,3]
|
||||
},
|
||||
title: '{{config("app.name") ."-". __("messages.all_users")}}'
|
||||
},
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
footer: false,
|
||||
exportOptions: {
|
||||
columns: [0,1,2,3]
|
||||
},
|
||||
title: '{{config("app.name") ."-". __("messages.all_users")}}'
|
||||
}
|
||||
],
|
||||
dom: 'lfrtip',
|
||||
fixedHeader: false,
|
||||
columns: [
|
||||
{ data: 'name' , name: 'name'},
|
||||
{ data: 'email' , name: 'email'},
|
||||
{ data: 'is_active' , name: 'is_active'},
|
||||
{ data: 'created_at', name: 'created_at'},
|
||||
{ data: 'action', name: 'action', sortable:false }
|
||||
]
|
||||
});
|
||||
|
||||
users_table.buttons().container().appendTo($('#export-btns'));
|
||||
|
||||
$(document).on('click', '.toggle_is_active', function(){
|
||||
url = $(this).data('href');
|
||||
$.ajax({
|
||||
method:"GET",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success:function(response) {
|
||||
if(response.success == true){
|
||||
toastr.success(response.msg);
|
||||
users_table.ajax.reload();
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.delete_user', function () {
|
||||
var url = $(this).data('href');
|
||||
|
||||
if (confirm('Are you sure?')) {
|
||||
$.ajax({
|
||||
method:"DELETE",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success:function(response) {
|
||||
if(response.success == true){
|
||||
toastr.success(response.msg);
|
||||
users_table.ajax.reload();
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#add_user', function () {
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#user_modal").html(response).modal('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.edit_user', function () {
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#user_modal").html(response).modal('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.upgrade_account', function () {
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#user_modal").html(response).modal('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#user_modal").on('shown.bs.modal', function () {
|
||||
if ($("form#add_user_form").length) {
|
||||
$("form#add_user_form").validate({
|
||||
rules: {
|
||||
email: {
|
||||
email: true,
|
||||
remote: {
|
||||
url: "/superadmin/users/check-email-exist",
|
||||
type: "post",
|
||||
data: {
|
||||
email: function() {
|
||||
return $( "#email" ).val();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
email: {
|
||||
remote: '{{ __("validation.unique", ["attribute" => __("messages.email")]) }}'
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($("form#edit_user_form").length) {
|
||||
$("form#edit_user_form").validate({
|
||||
rules: {
|
||||
email: {
|
||||
email: true,
|
||||
remote: {
|
||||
url: "/superadmin/users/check-email-exist",
|
||||
type: "post",
|
||||
data: {
|
||||
email: function() {
|
||||
return $( "#email" ).val();
|
||||
},
|
||||
user_id: $('input#user_id').val()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
email: {
|
||||
remote: '{{ __("validation.unique", ["attribute" => __("messages.email")]) }}'
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#form_design").length) {
|
||||
$(document).on('change', '#form_design', function(){
|
||||
if ($("#form_design").is(":checked")) {
|
||||
$("#form_view").attr('checked', true);
|
||||
} else {
|
||||
$("#form_view").attr('checked', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form#add_user_form', function (e) {
|
||||
e.preventDefault();
|
||||
var data = $("form#add_user_form").serialize();
|
||||
var url = $("form#add_user_form").attr('action');
|
||||
var ladda = Ladda.create(document.querySelector('.submit_btn'));
|
||||
ladda.start();
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: data,
|
||||
success: function (response) {
|
||||
ladda.stop();
|
||||
if (response.success) {
|
||||
$("#user_modal").modal('hide');
|
||||
toastr.success(response.msg);
|
||||
users_table.ajax.reload();
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form#edit_user_form', function (e) {
|
||||
e.preventDefault();
|
||||
var data = $("form#edit_user_form").serialize();
|
||||
var url = $("form#edit_user_form").attr('action');
|
||||
var ladda = Ladda.create(document.querySelector('.submit_btn'));
|
||||
ladda.start();
|
||||
$.ajax({
|
||||
method: "PUT",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: data,
|
||||
success: function (response) {
|
||||
ladda.stop();
|
||||
if (response.success) {
|
||||
$("#user_modal").modal('hide');
|
||||
toastr.success(response.msg);
|
||||
users_table.ajax.reload();
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form[data-type="form"]', function (e) {
|
||||
e.preventDefault();
|
||||
var data = $(this).serialize();
|
||||
var url = $(this).attr('action');
|
||||
var ladda = Ladda.create(this.querySelector('.submit_btn'));
|
||||
ladda.start();
|
||||
$.ajax({
|
||||
method: "PUT",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: data,
|
||||
success: function (response) {
|
||||
ladda.stop();
|
||||
if (response.success) {
|
||||
$("#user_modal").modal('hide');
|
||||
toastr.success(response.msg);
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('change', '#filter_by_status', function() {
|
||||
users_table.ajax.reload();
|
||||
});
|
||||
|
||||
$(document).on('click', '.confirm-subscription', function(e){
|
||||
let url = $(this).data('href');
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: url,
|
||||
dataType: "html",
|
||||
success: function (response) {
|
||||
$("#user_modal").html(response).modal('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
101
resources/views/superadmin/users/upgrade.blade.php
Normal file
101
resources/views/superadmin/users/upgrade.blade.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
@lang('messages.upgrade_account')
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
@if(count($active_packages) <= 0)
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<span class="text-white">@lang('messages.no_packages_found')</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
@foreach($active_packages as $package)
|
||||
<div class="col-md-6">
|
||||
<div class="card card-outline card-success on_hover">
|
||||
<div class="card-header">
|
||||
<div class="text-center">
|
||||
<h5>
|
||||
{{$package->name}}
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
@if($package->no_of_active_forms != 0)
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.no_of_forms',[
|
||||
'active_form' => $package->no_of_active_forms])
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.unlimited_forms')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
@if($package->is_form_downloadable)
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-times-circle text-danger"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
@php
|
||||
$price_interval = __('messages.'.$package->price_interval);
|
||||
@endphp
|
||||
@if($package->price != 0)
|
||||
<h4>
|
||||
<span class="currency">
|
||||
{{ number_format((float)$package->price, 2, '.', '')}}
|
||||
</span>
|
||||
<small class="text-muted">
|
||||
@lang('messages.subscription_price',[
|
||||
'interval' => $package->interval,
|
||||
'price_interval' => $price_interval
|
||||
])
|
||||
</small>
|
||||
</h4>
|
||||
@else
|
||||
<h4>
|
||||
@lang('messages.free_for_interval', [
|
||||
'interval' => $package->interval,
|
||||
'price_interval' => $price_interval
|
||||
])
|
||||
</h4>
|
||||
@endif
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<button type="button" class="btn btn-block btn-success btn-sm confirm-subscription"
|
||||
data-href="{{action([\App\Http\Controllers\Superadmin\SubscriptionPaymentController::class, 'confirmAdminSubscription'], [$package->id, $user->id])}}">
|
||||
@lang('messages.subscribe')
|
||||
</button>
|
||||
{{$package->description}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if($loop->iteration%3 == 0)
|
||||
<div class="clearfix"></div>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
95
resources/views/user/profile/edit.blade.php
Normal file
95
resources/views/user/profile/edit.blade.php
Normal file
@@ -0,0 +1,95 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="col-md-12">
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<h3>@lang('messages.edit_profile')</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="edit_profile" action="{{action([\App\Http\Controllers\ManageProfileController::class, 'postProfile'], [$user['id']])}}">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="name">
|
||||
@lang('messages.name') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas fa-user-tie"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" id="name" placeholder="{{__('messages.enter_name')}}" value="{{$user['name']}}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="email">
|
||||
@lang('messages.email') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas fa-envelope"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="email" id="email" placeholder="{{__('messages.enter_email')}}" value="{{$user['email']}}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="password">
|
||||
@lang('messages.password')
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas fa-user-lock"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="password" class="form-control" name="password" id="password" placeholder="{{__('messages.enter_password')}}" value="" aria-describedby="passwordHelp">
|
||||
</div>
|
||||
<small id="passwordHelp" class="form-text text-muted">
|
||||
@lang('messages.password_edit_help')
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success float-right submit_btn">
|
||||
@lang('messages.update')
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('form#edit_profile').validate({
|
||||
submitHandler: function(form, e) {
|
||||
var data = $('form#edit_profile').serialize();
|
||||
var url = $('form#edit_profile').attr('action');
|
||||
if ($('form#edit_profile').valid()) {
|
||||
$.ajax({
|
||||
method:"PUT",
|
||||
url: url,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if(response.success == true){
|
||||
window.location = response.redirect;
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
215
resources/views/user/settings/edit.blade.php
Normal file
215
resources/views/user/settings/edit.blade.php
Normal file
@@ -0,0 +1,215 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
@lang('messages.my_settings')
|
||||
</h1>
|
||||
</section>
|
||||
<div class="col-md-12">
|
||||
<form id="settings_form">
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="language">
|
||||
@lang('messages.language') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="fas fa-language"></i>
|
||||
</span>
|
||||
</div>
|
||||
<select id="language" class="form-control" name="language" required>
|
||||
@foreach($settings['languages'] as $key => $language)
|
||||
<option value="{{$key}}"
|
||||
@if($key == $settings['language'])
|
||||
selected
|
||||
@endif>
|
||||
{{$language['full_name']}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="APP_TIMEZONE">
|
||||
@lang('messages.timezone') *
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="far fa-hourglass"></i>
|
||||
</span>
|
||||
</div>
|
||||
<select class="form-control" name="timezone" required id="APP_TIMEZONE">
|
||||
<option value="">
|
||||
@lang('messages.choose_timezone')
|
||||
</option>
|
||||
@foreach($settings['timezones'] as $timezone)
|
||||
<option value="{{$timezone}}"
|
||||
@if($timezone == $settings['timezone'])
|
||||
selected
|
||||
@endif>
|
||||
{{$timezone}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<h4>
|
||||
@lang('messages.smtp_email_settings')
|
||||
<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" data-html="true" title="{{__('messages.my_settings_smtp_tooltips')}}"></i>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_HOST">
|
||||
@lang('messages.mail_host') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_HOST" id="MAIL_HOST" placeholder="{{__('messages.enter_mail_host')}}" required value="{{$settings['smtp']['MAIL_HOST']}}">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_PORT">
|
||||
@lang('messages.mail_port') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_PORT" id="MAIL_PORT" placeholder="{{__('messages.enter_mail_port')}}" required value="{{$settings['smtp']['MAIL_PORT']}}">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_USERNAME">
|
||||
@lang('messages.mail_username') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_USERNAME" id="MAIL_USERNAME" placeholder="{{__('messages.enter_mail_username')}}" required value="{{$settings['smtp']['MAIL_USERNAME']}}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_FROM_ADDRESS">
|
||||
@lang('messages.mail_from_address') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_FROM_ADDRESS" id="MAIL_FROM_ADDRESS" placeholder="{{__('messages.mail_from_address')}}" value="{{$settings['smtp']['MAIL_FROM_ADDRESS']}}" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_FROM_NAME">
|
||||
@lang('messages.mail_from_name') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_FROM_NAME" id="MAIL_FROM_NAME" placeholder="{{__('messages.mail_from_name')}}" value="{{$settings['smtp']['MAIL_FROM_NAME']}}" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_PASSWORD">
|
||||
@lang('messages.mail_password') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_PASSWORD" id="MAIL_PASSWORD" placeholder="{{__('messages.enter_mail_password')}}" required value="{{$settings['smtp']['MAIL_PASSWORD']}}">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="MAIL_ENCRYPTION">
|
||||
@lang('messages.mail_encryption') *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="MAIL_ENCRYPTION" id="MAIL_ENCRYPTION" placeholder="{{__('messages.enter_mail_encryption')}}" required value="{{$settings['smtp']['MAIL_ENCRYPTION']}}">
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-sm btn-success submit_btn float-right m-1">
|
||||
@lang('messages.update')
|
||||
</button>
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-outline-primary ladda-button btn-test-smtp float-right m-1"
|
||||
data-style="expand-right"
|
||||
data-spinner-color="blue"
|
||||
>
|
||||
<span class="ladda-label">
|
||||
{{trans('messages.test_smtp_details')}}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('form#settings_form').validate({
|
||||
submitHandler: function(form, e) {
|
||||
var data = $('form#settings_form').serialize();
|
||||
if ($('form#settings_form').valid()) {
|
||||
$.ajax({
|
||||
method:"POST",
|
||||
url: "/post-user-settings",
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if(response.success == true){
|
||||
window.location = response.redirect;
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-test-smtp', function(){
|
||||
|
||||
var smtpdata = {
|
||||
'host': $("input[name=MAIL_HOST]").val(),
|
||||
'port' : $("input[name=MAIL_PORT]").val(),
|
||||
'from_address' : $("input[name=MAIL_FROM_ADDRESS]").val(),
|
||||
'from_name' : $("input[name=MAIL_FROM_NAME]").val(),
|
||||
'encryption' : $("input[name=MAIL_ENCRYPTION]").val(),
|
||||
'username' : $("input[name=MAIL_USERNAME]").val(),
|
||||
'password' : $("input[name=MAIL_PASSWORD]").val(),
|
||||
};
|
||||
|
||||
var isValid = true;
|
||||
_.forEach(smtpdata, function(smtp){
|
||||
|
||||
if (!_.isEmpty(smtp)) {
|
||||
isValid = true && isValid;
|
||||
} else {
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
|
||||
if (isValid) {
|
||||
var ladda = Ladda.create($('.btn-test-smtp')[0]);
|
||||
ladda.start();
|
||||
$.ajax({
|
||||
method:"GET",
|
||||
url: "/test-smtp",
|
||||
data: smtpdata,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
ladda.stop();
|
||||
if(response.success == true){
|
||||
toastr.success(response.msg);
|
||||
} else {
|
||||
toastr.error(response.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
isValid = true;
|
||||
alert('Please fill all the SMTP detials.');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
365
resources/views/user/subscription/index.blade.php
Normal file
365
resources/views/user/subscription/index.blade.php
Normal file
@@ -0,0 +1,365 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="card card-outline card-info">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
@lang('messages.active_subscription')
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if(!empty($active_subscription))
|
||||
<div class="col-md-4">
|
||||
<div class="card card card-outline card-success">
|
||||
<div class="card-header">
|
||||
<div class="text-center">
|
||||
{{$active_subscription->package_details['name']}}
|
||||
<span class="badge badge-pill badge-success float-right">
|
||||
@lang('messages.running')
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
@if($active_subscription->package_details['no_of_active_forms'] == 0)
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.unlimited_forms')
|
||||
</span>
|
||||
<hr>
|
||||
@endif
|
||||
@if($active_subscription->package_details['is_form_downloadable'])
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-times-circle text-danger"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.package_activated_on', ['date' => \Carbon\Carbon::parse($active_subscription->start_date)->isoFormat("D/M/YY")])
|
||||
</span>
|
||||
<hr>
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.remaining_days', ['days' => \Carbon\Carbon::today()->diffInDays($active_subscription->end_date)])
|
||||
</span>
|
||||
<hr>
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.package_expire_on', ['date' => \Carbon\Carbon::parse($active_subscription->end_date)->isoFormat("D/M/YY")])
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<h3 class="text-danger text-center">
|
||||
@lang('messages.no_active_subscription')
|
||||
</h3>
|
||||
@endif
|
||||
|
||||
@if(!empty($upcoming_subscriptions))
|
||||
<div class="row">
|
||||
@foreach($upcoming_subscriptions as $upcoming_subscription)
|
||||
<div class="col-md-4">
|
||||
<div class="card card card-outline card-success">
|
||||
<div class="card-header">
|
||||
<div class="text-center">
|
||||
{{$upcoming_subscription->package_details['name']}}
|
||||
<span class="badge badge-pill badge-info float-right">
|
||||
@lang('messages.upcoming')
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
@if($upcoming_subscription->package_details['no_of_active_forms'] != 0)
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.no_of_forms',[
|
||||
'active_form' => $upcoming_subscription->package_details['no_of_active_forms']])
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.unlimited_forms')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
@if($upcoming_subscription->package_details['is_form_downloadable'])
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-times-circle text-danger"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.package_starts_on', ['date' => \Carbon\Carbon::parse($upcoming_subscription->start_date)->isoFormat("D/M/YY")])
|
||||
</span>
|
||||
<!-- @lang('messages.start_date') : {{\Carbon\Carbon::parse($upcoming_subscription->start_date)->isoFormat("D/M/YY")}} -->
|
||||
<hr>
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.package_expire_on', ['date' => \Carbon\Carbon::parse($upcoming_subscription->end_date)->isoFormat("D/M/YY")])
|
||||
</span>
|
||||
<!-- @lang('messages.end_date') : {{\Carbon\Carbon::parse($upcoming_subscription->end_date)->isoFormat("D/M/YY")}} -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if($loop->iteration%3 == 0)
|
||||
<div class="clearfix"></div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
@if(!empty($waiting_subscriptions))
|
||||
<div class="row">
|
||||
@foreach($waiting_subscriptions as $waiting_subscription)
|
||||
<div class="col-md-4">
|
||||
<div class="card card card-outline card-success">
|
||||
<div class="card-header">
|
||||
<div class="text-center">
|
||||
{{$waiting_subscription->package_details['name']}}
|
||||
<span class="badge badge-pill badge-warning float-right text-white">
|
||||
@lang('messages.waiting')
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
@if($waiting_subscription->package_details['no_of_active_forms'] != 0)
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.no_of_forms',[
|
||||
'active_form' => $waiting_subscription->package_details['no_of_active_forms']])
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.unlimited_forms')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
@if($waiting_subscription->package_details['is_form_downloadable'])
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-times-circle text-danger"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.package_starts_on', ['date' => \Carbon\Carbon::parse($waiting_subscription->start_date)->isoFormat("D/M/YY")])
|
||||
</span>
|
||||
<!-- @lang('messages.start_date') : {{\Carbon\Carbon::parse($waiting_subscription->start_date)->isoFormat("D/M/YY")}} -->
|
||||
<hr>
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.package_expire_on', ['date' => \Carbon\Carbon::parse($waiting_subscription->end_date)->isoFormat("D/M/YY")])
|
||||
</span>
|
||||
<!-- @lang('messages.end_date') : {{\Carbon\Carbon::parse($waiting_subscription->end_date)->isoFormat("D/M/YY")}} -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if($loop->iteration%3 == 0)
|
||||
<div class="clearfix"></div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-outline card-info">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
@lang('messages.all_subscriptions')
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table" id="package_subscription_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('messages.package_name')</th>
|
||||
<th>@lang('messages.start_date')</th>
|
||||
<th>@lang('messages.end_date')</th>
|
||||
<th>@lang('messages.price')</th>
|
||||
<th>@lang('messages.paid_via')</th>
|
||||
<th>@lang('messages.transaction_id')</th>
|
||||
<th>@lang('messages.status')</th>
|
||||
<th>@lang('messages.created_at')</th>
|
||||
<th>@lang('messages.action')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@if($__enable_saas)
|
||||
<div class="card card-outline card-info">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
@lang('messages.packages')
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if(count($active_packages) <= 0)
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<span class="text-white">@lang('messages.no_packages_found')</span>
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
@foreach($active_packages as $package)
|
||||
<div class="col-md-4">
|
||||
<div class="card card-outline card-success on_hover">
|
||||
<div class="card-header">
|
||||
<div class="text-center">
|
||||
<h5>
|
||||
{{$package->name}}
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
@if($package->no_of_active_forms != 0)
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.no_of_forms',[
|
||||
'active_form' => $package->no_of_active_forms])
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.unlimited_forms')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
@if($package->is_form_downloadable)
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-times-circle text-danger"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@endif
|
||||
<hr>
|
||||
@php
|
||||
$price_interval = __('messages.'.$package->price_interval);
|
||||
@endphp
|
||||
@if($package->price != 0)
|
||||
<h4>
|
||||
<span class="currency">
|
||||
{{$package->price}}
|
||||
</span>
|
||||
<small class="text-muted">
|
||||
@lang('messages.subscription_price',[
|
||||
'interval' => $package->interval,
|
||||
'price_interval' => $price_interval
|
||||
])
|
||||
</small>
|
||||
</h4>
|
||||
@else
|
||||
<h4>
|
||||
@lang('messages.free_for_interval', [
|
||||
'interval' => $package->interval,
|
||||
'price_interval' => $price_interval
|
||||
])
|
||||
</h4>
|
||||
@endif
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<a href="{{action([\App\Http\Controllers\Superadmin\SubscriptionPaymentController::class, 'pay'], [$package->id])}}" class="btn btn-block btn-success btn-sm">
|
||||
@lang('messages.subscribe')
|
||||
</a>
|
||||
{{$package->description}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if($loop->iteration%3 == 0)
|
||||
<div class="clearfix"></div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
{{ $active_packages->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
@section('footer')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
//notification after payment
|
||||
@if (!empty(session('status')) && session('status')['success'] == 1)
|
||||
var msg = '{!!session('status')['msg']!!}';
|
||||
toastr.success(msg);
|
||||
@elseif(!empty(session('status')) && session('status')['success'] == 0)
|
||||
var msg = '{!!session('status')['msg']!!}';
|
||||
toastr.error(msg);
|
||||
@endif
|
||||
var package_subscription_table = $("#package_subscription_table").DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '/all-subscriptions',
|
||||
buttons: [],
|
||||
dom: 'lfrtip',
|
||||
fixedHeader: false,
|
||||
columnDefs: [
|
||||
{
|
||||
targets: [0],
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
{ data: 'package' , name: 'package'},
|
||||
{ data: 'start_date' , name: 'start_date'},
|
||||
{ data: 'end_date', name: 'end_date'},
|
||||
{ data: 'package_price' , name: 'package_price'},
|
||||
{ data: 'paid_via', name: 'paid_via'},
|
||||
{ data: 'payment_transaction_id' , name: 'payment_transaction_id'},
|
||||
{ data: 'status' , name: 'status'},
|
||||
{ data: 'created_at', name: 'created_at'},
|
||||
{ data: 'action', name: 'action', sortable:false}
|
||||
],
|
||||
"fnDrawCallback": function (oSettings) {
|
||||
__convert_currency_in_datatable($('#package_subscription_table'));
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.view_subscription', function(){
|
||||
var url = $(this).data('href');
|
||||
$.ajax({
|
||||
url:url,
|
||||
dataType:'html',
|
||||
method:'GET',
|
||||
success: function(response){
|
||||
$("#modal_div").html(response).modal("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('span.currency').each(function(index, element){
|
||||
var money = __formatCurrency($(this).text());
|
||||
$(this).text(money);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
113
resources/views/user/subscription/show.blade.php
Normal file
113
resources/views/user/subscription/show.blade.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">
|
||||
@lang('messages.view_package')
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="col-md-7 offset-md-2">
|
||||
<div class="card card-outline card-success">
|
||||
<div class="card-header">
|
||||
<div class="text-center">
|
||||
{{$subscription->package_details['name']}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
@if($subscription->package_details['no_of_active_forms'] != 0)
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.no_of_forms',[
|
||||
'active_form' => $subscription->package_details['no_of_active_forms']])
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.unlimited_forms')
|
||||
</span>
|
||||
@endif
|
||||
<br>
|
||||
@if($subscription->package_details['is_form_downloadable'])
|
||||
<span>
|
||||
<i class="far fa-check-circle text-success"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@else
|
||||
<span>
|
||||
<i class="far fa-times-circle text-danger"></i>
|
||||
@lang('messages.form_code_download')
|
||||
</span>
|
||||
@endif
|
||||
<br><br>
|
||||
@php
|
||||
$price_interval = __('messages.'.$subscription->package_details['price_interval']);
|
||||
@endphp
|
||||
@if($subscription->package_price != 0)
|
||||
<h4>
|
||||
<span class="convert_currency">
|
||||
{{$subscription->package_price}}
|
||||
</span>
|
||||
<small class="text-muted">
|
||||
@lang('messages.subscription_price',[
|
||||
'interval' => $subscription->package_details['interval'],
|
||||
'price_interval' => $price_interval
|
||||
])
|
||||
</small>
|
||||
</h4>
|
||||
@else
|
||||
<h4>
|
||||
@lang('messages.free_for_interval', [
|
||||
'interval' => $subscription->package_details['interval'],
|
||||
'price_interval' => $price_interval
|
||||
])
|
||||
</h4>
|
||||
@endif
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
{{$subscription->package_details['description']}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<strong>@lang('messages.start_date'): </strong> {{\Carbon\Carbon::parse($subscription->start_date)->isoFormat("D/M/YY")}}
|
||||
</div>
|
||||
<div class="col">
|
||||
<strong>@lang('messages.end_date'): </strong>{{\Carbon\Carbon::parse($subscription->end_date)->isoFormat("D/M/YY")}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<strong>@lang('messages.paid_via'): </strong>
|
||||
@if($subscription->paid_via == "offline")
|
||||
@lang("messages.offline")
|
||||
@else
|
||||
{{ucfirst($subscription->paid_via)}}
|
||||
@endif
|
||||
</div>
|
||||
<div class="col">
|
||||
<strong>@lang('messages.transaction_id'): </strong>
|
||||
{{$subscription->payment_transaction_id}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<strong>@lang('messages.status'): </strong>
|
||||
{{__('messages.'.$subscription->status)}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">
|
||||
@lang('messages.close')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var money = $(document).find('span.convert_currency');
|
||||
money.text(__formatCurrency(money.text()));
|
||||
</script>
|
||||
216
resources/views/welcome.blade.php
Normal file
216
resources/views/welcome.blade.php
Normal file
@@ -0,0 +1,216 @@
|
||||
<!doctype html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>{{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
|
||||
|
||||
<!-- Styles -->
|
||||
<style>
|
||||
html, body {
|
||||
background-color: #fff;
|
||||
color: #636b6f;
|
||||
font-family: 'Nunito', sans-serif;
|
||||
font-weight: 200;
|
||||
height: 100vh;
|
||||
margin: 0;
|
||||
background: rgb(9,9,121);
|
||||
background: linear-gradient(90deg, rgba(9,9,121,1) 100%, rgba(0,212,255,1) 100%);
|
||||
}
|
||||
|
||||
.full-height {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.flex-center {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.position-ref {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.top-right {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 18px;
|
||||
}
|
||||
|
||||
.content {
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 84px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #636b6f;
|
||||
padding: 0 25px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
letter-spacing: .1rem;
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.m-b-md {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.links{
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flex-center position-ref full-height" id="particles_js">
|
||||
@if (Route::has('login'))
|
||||
<div class="top-right links">
|
||||
@auth
|
||||
<a class="links" href="{{ url('/home') }}">Home</a>
|
||||
@else
|
||||
<a class="links" href="{{ route('login') }}">Login</a>
|
||||
|
||||
@if (Route::has('register'))
|
||||
<a class="links" href="{{ route('register') }}">Register</a>
|
||||
@endif
|
||||
@endauth
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="content">
|
||||
<div class="links">
|
||||
<h1>{{ config('app.name', 'Laravel') }}</h1>
|
||||
<h4>{{ config('app.title', 'Laravel') }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/particles.js@2.0.0/particles.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
particlesJS('particles_js', {
|
||||
"particles": {
|
||||
"number": {
|
||||
"value": 80,
|
||||
"density": {
|
||||
"enable": true,
|
||||
"value_area": 800
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"value": "#ffffff"
|
||||
},
|
||||
"shape": {
|
||||
"type": "circle",
|
||||
"stroke": {
|
||||
"width": 0,
|
||||
"color": "#000000"
|
||||
},
|
||||
"polygon": {
|
||||
"nb_sides": 5
|
||||
},
|
||||
"image": {
|
||||
"src": "img/github.svg",
|
||||
"width": 100,
|
||||
"height": 100
|
||||
}
|
||||
},
|
||||
"opacity": {
|
||||
"value": 0.5,
|
||||
"random": false,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 1,
|
||||
"opacity_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"size": {
|
||||
"value": 5,
|
||||
"random": true,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 40,
|
||||
"size_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"line_linked": {
|
||||
"enable": true,
|
||||
"distance": 150,
|
||||
"color": "#ffffff",
|
||||
"opacity": 0.4,
|
||||
"width": 1
|
||||
},
|
||||
"move": {
|
||||
"enable": true,
|
||||
"speed": 6,
|
||||
"direction": "none",
|
||||
"random": false,
|
||||
"straight": false,
|
||||
"out_mode": "out",
|
||||
"attract": {
|
||||
"enable": false,
|
||||
"rotateX": 600,
|
||||
"rotateY": 1200
|
||||
}
|
||||
}
|
||||
},
|
||||
"interactivity": {
|
||||
"detect_on": "canvas",
|
||||
"events": {
|
||||
"onhover": {
|
||||
"enable": true,
|
||||
"mode": "repulse"
|
||||
},
|
||||
"onclick": {
|
||||
"enable": true,
|
||||
"mode": "push"
|
||||
},
|
||||
"resize": true
|
||||
},
|
||||
"modes": {
|
||||
"grab": {
|
||||
"distance": 400,
|
||||
"line_linked": {
|
||||
"opacity": 1
|
||||
}
|
||||
},
|
||||
"bubble": {
|
||||
"distance": 400,
|
||||
"size": 40,
|
||||
"duration": 2,
|
||||
"opacity": 8,
|
||||
"speed": 3
|
||||
},
|
||||
"repulse": {
|
||||
"distance": 200
|
||||
},
|
||||
"push": {
|
||||
"particles_nb": 4
|
||||
},
|
||||
"remove": {
|
||||
"particles_nb": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"retina_detect": true,
|
||||
"config_demo": {
|
||||
"hide_card": false,
|
||||
"background_color": "#b61924",
|
||||
"background_image": "",
|
||||
"background_position": "50% 50%",
|
||||
"background_repeat": "no-repeat",
|
||||
"background_size": "cover"
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user