ldc-gen-game-web/resources/views/bo/settings/manage.blade.php
Jérémy Munsch 1af96897f3
- Squash migration
- Normalize Model names and sql tables
- PHPCS clean up
- Change analytics form + field
2022-01-11 12:46:10 +01:00

401 lines
24 KiB
PHP

@extends('layouts.bo')
@section('content')
<div class="card">
<div class="card-header">
Règlages du jeu
</div>
<form action="{{route('bo.settings')}}" method="POST" enctype="multipart/form-data">
@method('PUT')
@csrf
<div class="card-body">
<div class="row">
<div class="col-md-10 offset-md-1 align-left">
<div class="form-group text-center">
<label class="col-form-label" for="name"><b>Nom du jeu <span class="required-asterisk">*</span></b></label>
<input class="form-control offset-md-3 col-md-6 game-name" type="text" name="name" placeholder="Nom du jeu *" value="{{$settings->name}}" required>
</div>
<hr/>
<h5 class="card-subtitle">
Générale<br/>
<small class="text-muted">Paramétres généraux du jeu</small>
</h5>
<br/>
<table class="table table-bordered">
<tbody>
<tr class="form-group">
<td class="w-50">
<label class="col-form-label" for="start_date">
Date de début <span class="required-asterisk">*</span><br/>
<small class="text-muted">Date d'activation du jeu</small>
</label>
</td>
<td class="align-middle">
<input class="form-control" type="datetime-local" name="start_date" value="{{\Carbon\Carbon::parse($settings->start_date)->format('Y-m-d\TH:i')}}" required>
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="start_date">
Date de fin <span class="required-asterisk">*</span><br/>
<small class="text-muted">Date de fermeture du jeu</small>
</label>
</td>
<td class="align-middle">
<input class="form-control" type="datetime-local" name="end_date" value="{{\Carbon\Carbon::parse($settings->end_date)->format('Y-m-d\TH:i')}}" required>
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="nb_participation_player">
Nombre de participation par joueur <span class="required-asterisk">*</span><br/>
<small class="text-muted">Si égale à 0, le nombre de participation est illimité.</small>
</label>
</td>
<td class="align-middle">
<input class="form-control" type="number" name="nb_participation_player" value="{{$settings->nb_participation_player}}" required>
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="nb_participation_ip">
Nombre de participation par adresse IP <span class="required-asterisk">*</span><br/>
<small class="text-muted">Si égale à 0, le nombre de participation est illimité.</small>
</label>
</td>
<td class="align-middle">
<input class="form-control" type="number" name="nb_participation_ip" value="{{$settings->nb_participation_ip}}" required>
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="nb_unique_code_use">
Nombre d'utilisation du code unique <span class="required-asterisk">*</span><br/>
<small class="text-muted">{{ __('Nombre d\'utilisations possible au total d\'un code unique.') }}</small>
</label>
</td>
<td class="align-middle">
<input class="form-control" type="number" name="nb_unique_code_use" value="{{$settings->nb_unique_code_use}}" required>
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="code_length">
{{ __('Longueur des code uniques') }}&nbsp;<span class="required-asterisk">*</span><br/>
<small class="text-muted">{{ __('!! Cette valeur ne doit pas varier en cour de jeu !!') }}</small>
</label>
</td>
<td class="align-middle">
<input class="form-control" type="number" name="code_length" value="{{$settings->code_length}}" readonly>
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="ean_codes">
Activer les codes EAN<br/>
<small class="text-muted">Active la vérification des codes barre des produits.</small>
</label>
</td>
<td class="align-middle">
<div class="onoffswitch">
@if ($settings->use_ean_codes === 1)
<input type="checkbox" name="use_ean_codes" class="onoffswitch-checkbox" id="ean_codes" checked>
@else
<input type="checkbox" name="use_ean_codes" class="onoffswitch-checkbox" id="ean_codes">
@endif
<label class="onoffswitch-label" for="ean_codes">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="activated_teaser">
Activation du teaser
</label>
</td>
<td class="align-middle">
<div class="onoffswitch">
@if ($settings->activated_teaser === 1)
<input type="checkbox" name="activated_teaser" class="onoffswitch-checkbox" id="activated_teaser" checked>
@else
<input type="checkbox" name="activated_teaser" class="onoffswitch-checkbox" id="activated_teaser">
@endif
<label class="onoffswitch-label" for="activated_teaser">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</td>
</tr>
<tr class="form-group" id="teaser_end_activity">
<td>
<label class="col-form-label" for="teaser_end_activity">
Teaser actif jusqu'au <span class="required-asterisk">*</span><br/>
</label>
</td>
<td class="align-middle">
<input class="form-control" type="datetime-local" name="teaser_end_activity" value="{{\Carbon\Carbon::parse($settings->teaser_end_activity)->format('Y-m-d\TH:i')}}" required>
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="activated_close_page">
Activation page de fermeture<br/>
<small class="text-muted">Active la page de fermeture indiquant aux participant(s) que le jeu est terminé.</small>
</label>
</td>
<td class="align-middle">
<div class="onoffswitch">
@if ($settings->activated_close_page === 1)
<input type="checkbox" name="activated_close_page" class="onoffswitch-checkbox" id="activated_close_page" checked>
@else
<input type="checkbox" name="activated_close_page" class="onoffswitch-checkbox" id="activated_close_page">
@endif
<label class="onoffswitch-label" for="activated_close_page">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</td>
</tr>
<tr class="form-group" id="close_page_active_date">
<td>
<label class="col-form-label" for="close_page_active_date">
Page active jusqu'au <span class="required-asterisk">*</span>
</label>
</td>
<td class="align-middle">
<input class="form-control" type="datetime-local" name="close_page_active_date" value="{{\Carbon\Carbon::parse($settings->close_page_active_date)->format('Y-m-d\TH:i')}}">
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="redirect_close">
URL de redirection après la date de fin du jeu <span class="required-asterisk">*</span><br/>
<small class="text-muted">L'URL doit commencer par "http://" ou "https://".</small>
</label>
</td>
<td class="align-middle">
<input class="form-control" type="text" name="redirect_close" value="{{$settings->redirect_close}}" required>
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="winning_proof">
Activer les preuves de gain<br/>
<small class="text-muted">Active l'affichage de la page de transmission des preuves de gain.</small>
</label>
</td>
<td class="align-middle">
<div class="onoffswitch">
@if ($settings->winning_proof === 1)
<input type="checkbox" name="winning_proof" class="onoffswitch-checkbox" id="winning_proof" checked>
@else
<input type="checkbox" name="winning_proof" class="onoffswitch-checkbox" id="winning_proof">
@endif
<label class="onoffswitch-label" for="winning_proof">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="redirect_close">
Nom de la société <span class="required-asterisk">*</span>
</label>
</td>
<td class="align-middle">
<input class="form-control" type="text" name="company" value="{{$settings->company}}" required>
</td>
</tr>
</tbody>
</table>
<hr/>
<h5 class="card-subtitle">
Les réductions<br/>
<small class="text-muted">Paramétrages des bons de réduction MLDC</small>
</h5>
<br/>
<table class="table table-bordered">
<tbody>
<tr class="form-group">
<td class="w-50">
<label class="col-form-label" for="reductions_activated">
Activer les bons de réduction<br/>
</label>
</td>
<td class="align-middle">
<div class="onoffswitch">
@if ($settings->reductions_activated === 1)
<input type="checkbox" name="reductions_activated" class="onoffswitch-checkbox" id="reductions_activated" checked>
@else
<input type="checkbox" name="reductions_activated" class="onoffswitch-checkbox" id="reductions_activated">
@endif
<label class="onoffswitch-label" for="reductions_activated">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</td>
</tr>
<tr class="form-group" id="reductions_site">
<td>
<label class="col-form-label" for="reductions_site">
Référence du site <span class="required-asterisk">*</span>
</label>
</td>
<td class="align-middle">
<input class="form-control" type="text" name="reductions_site" value="{{$settings->reductions_site}}">
</td>
</tr>
<tr class="form-group" id="reductions_campaign">
<td>
<label class="col-form-label" for="reductions_campaign">
Référence de la campagne <span class="required-asterisk">*</span>
</label>
</td>
<td class="align-middle">
<input class="form-control" type="text" name="reductions_campaign" value="{{$settings->reductions_campaign}}">
</td>
</tr>
<tr class="form-group" id="reductions_web_coupons">
<td colspan="2">
<web-coupons dbdatas='{{$settings->web_coupons}}' name="web_coupons"></web-coupons>
</td>
</tr>
</tbody>
</table>
<hr/>
<h5 class="card-subtitle">
Facebook Connect<br/>
<small class="text-muted">Paramétrage du Facebook Connect</small>
</h5>
<br/>
<table class="table table-bordered">
<tbody>
<tr class="form-group">
<td class="w-50">
<label class="col-form-label" for="facebook_activated">
Activer<br/>
<small class="text-muted">Activer ou désactiver la fonctionnalité</small>
</label>
</td>
<td class="align-middle">
<div class="onoffswitch">
@if ($settings->facebook_activated === 1)
<input type="checkbox" name="facebook_activated" class="onoffswitch-checkbox" id="facebook_activated" checked>
@else
<input type="checkbox" name="facebook_activated" class="onoffswitch-checkbox" id="facebook_activated">
@endif
<label class="onoffswitch-label" for="facebook_activated">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="facebook_app_id">
app_id
</label>
</td>
<td class="align-middle">
<input class="form-control" type="text" name="facebook_app_id" value="{{$settings->facebook_app_id}}">
</td>
</tr>
<tr class="form-group">
<td>
<label class="col-form-label" for="facebook_secret">
app_secret
</label>
</td>
<td class="align-middle">
<input class="form-control" type="text" name="facebook_secret" value="{{$settings->facebook_secret}}">
</td>
</tr>
</tbody>
</table>
<hr/>
<h5 class="card-subtitle">
Destinataires des notifications de gain<br/>
<small class="text-muted">Ces mails recevront toutes les notifications de gain.</small>
</h5>
<br/>
<win-notification name="notification_emails" dbdatas="{{$settings->notification_emails}}"></win-notification>
<hr>
<h5 class="card-subtitle">
Google analytics<br/>
<small class="text-muted">Insérer ici la clé analytics pour le jeu.</small>
</h5>
<table class="table table-bordered">
<tr class="form-group">
<td class="w-50 align-middle">Clé analytics (eg: UA-XX196604-1)</td>
<td class="align-middle"><input name="analytics" class="form-control" value="{{ $settings->analytics }}" type="text"/></td>
</tr>
</table>
</div>
</div>
</div>
<div class="card-footer text-center">
<input type="submit" class="btn btn-success" value="Enregistrer">
</div>
</form>
</div>
@endsection
@push('scripts')
<script type="text/javascript" defer>
// Gestion du tableau pour reduction
$("input[name=reductions_activated]").change(function() {
if (!$('input[name=reductions_activated]').is(':checked')) {
$("#reductions_site").hide();
$("#reductions_campaign").hide();
$("#reductions_web_coupons").hide();
} else {
$("#reductions_site").show();
$("#reductions_campaign").show();
$("#reductions_web_coupons").show();
}
});
$(document).ready(function() {
if (!$('input[name=reductions_activated]').is(':checked')) {
$("#reductions_site").hide();
$("#reductions_campaign").hide();
$("#reductions_web_coupons").hide();
}
if (!$("input[name=activated_teaser]").is(':checked')) {
$("#teaser_end_activity").hide();
}
if (!$("input[name=activated_close_page]").is(':checked')) {
$("#close_page_active_date").hide();
}
});
// Gère l'activation du teaser (champ date à affihcer ou non)
$("input[name=activated_teaser]").change(function() {
if ($(this).is(':checked')) {
$("#teaser_end_activity").show();
} else {
$("#teaser_end_activity").hide();
}
});
// Gère l'activation de la page de fermeture (champ date à afficher ou non)
$("input[name=activated_close_page]").change(function() {
if ($(this).is(':checked')) {
$("#close_page_active_date").show();
} else {
$("#close_page_active_date").hide();
}
});
</script>
@endpush