File: /var/www/vhost/disk-apps/teamdemo.sports-crowd.com/resources/views/statistics/statistics.blade.php
@extends('modules.head') @section('contenido')
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ Lang::get('messages.statistics.title') }}</h3>
<!-- /.box-tools -->
</div>
<!-- /.box-header -->
<div class="box-body">
<form role="form" id="edit" data-toggle="validator">
<!-- CONFIG GENERAL -->
<div class="row">
<div class="col-4 col-md-4">
<div class="row">
<div class="col-xs-12">
<label for="">{{ Lang::get('messages.statistics.active')}}</label>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
@if(isset($teamStatistic) && $teamStatistic->active == 0)
<div class="checkbox checbox-switch switch-success">
<label> No
<input type="checkbox" class="form-control" id="chkActive" name="active" />
<span></span>
Si
</label>
</div>
@else
<div class="checkbox checbox-switch switch-success">
<label> No
<input type="checkbox" class="form-control" id="chkActive" name="active" checked="" />
<span></span>
Si
</label>
</div>
@endif
</div>
</div>
</div>
</div>
<div class="col-4 col-md-4">
<div class="form-group">
<label for="synchronization_frequency">{{ Lang::get('messages.statistics.synchronization_frequency') }}</label>
<input type="number" class="form-control" maxlength="10" name="synchronization_frequency" value="{{ $teamStatistic->synchronization_frequency ?? old('synchronization_frequency') }}" required>
</div>
</div>
<div class="col-4 col-md-4">
<div class="form-group">
<label for="last_load_date">{{ Lang::get('messages.statistics.last_load_date') }} </label>
<input type="text" class="form-control" name="last_load_date" value="{{ $teamStatistic->last_load_date ?? old('last_load_date') }}" disabled>
</div>
</div>
</div>
<!-- CONFIG SERPAPI -->
<div class="box collapsed-box">
<div class="box-header with-border">
<h3 class="box-title">{{ Lang::get('messages.statistics.title_serp_api') }}</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-plus"></i>
</button>
</div>
</div>
<div class="box-body">
<div class="row">
<div class="col-4 col-md-4">
<div class="form-group">
<label for="team_name">{{ Lang::get('messages.statistics.team_name') }}</label>
<input type="text" class="form-control" maxlength="100" name="team_name" value="{{ $teamStatistic->team_name ?? old('team_name') }}" required>
</div>
</div>
<div class="col-4 col-md-4">
<div class="form-group">
<label for="api_key">{{ Lang::get('messages.statistics.api_key') }}</label>
<input type="text" class="form-control" maxlength="100" name="api_key" value="{{ $teamStatistic->api_key ?? old('api_key') }}" required>
</div>
</div>
</div>
@if(isset($teamStatistic->api_key))
<div class="row">
<button type="button" onClick="syncData()" class="btn btnBox" style="margin-left: 10px">{{ Lang::get('messages.statistics.sync') }}</button>
</div>
@endif
</div>
</div>
<!-- CONFIG API-FOOTBALL -->
<div class="box collapsed-box">
<div class="box-header with-border">
<h3 class="box-title">{{ Lang::get('messages.statistics.title_football_api') }}</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-plus"></i>
</button>
</div>
</div>
<div class="box-body">
<div class="row">
<div class="col-4 col-md-4">
<div class="form-group">
<label for="team_league">{{ Lang::get('messages.statistics.team_league') }}
<a href="https://dashboard.api-football.com/soccer/ids" target="_blank">Listado torneos ➜</a>
</label>
<input type="number" class="form-control" maxlength="100" name="team_league" value="{{ $teamStatistic->team_league ?? old('team_league') }}" required>
</div>
</div>
<div class="col-4 col-md-4">
<div class="form-group">
<label for="team_season">{{ Lang::get('messages.statistics.team_season') }}</label>
<input type="number" class="form-control" maxlength="100" name="team_season" value="{{ $teamStatistic->team_season ?? old('team_season') }}" required>
</div>
</div>
<div class="col-4 col-md-4">
<div class="form-group">
<label for="api_key_standings">{{ Lang::get('messages.statistics.api_key') }}</label>
<input type="text" class="form-control" maxlength="100" name="api_key_standings" value="{{ $teamStatistic->api_key_standings ?? old('api_key_standings') }}" required>
</div>
</div>
</div>
@if(isset($teamStatistic->api_key_standings))
<div class="row">
<button type="button" onClick="javascript:window.open('../statistics/syncDataApiFootball');" class="btn btnBox" style="margin-left: 10px">{{ Lang::get('messages.statistics.sync') }}</button>
</div>
@endif
</div>
</div>
<!-- CONFIG API-DATAFACTORY -->
<div class="box collapsed-box">
<div class="box-header with-border">
<h3 class="box-title">{{ Lang::get('messages.statistics.title_datafactory_api') }}</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-plus"></i>
</button>
</div>
</div>
<div class="box-body">
<div class="row">
<div class="col-6 col-md-6">
<div class="form-group">
<label for="carousel_matches">{{ Lang::get('messages.statistics.carousel_matches') }}</label>
<textarea class="form-control" rows="4" name="carousel_matches">{{ $teamStatistic->carousel_matches ?? old('carousel_matches') }}</textarea>
</div>
</div>
<div class="col-6 col-md-6">
<div class="form-group">
<label for="carousel_results">{{ Lang::get('messages.statistics.carousel_results') }}</label>
<textarea class="form-control" rows="4" name="carousel_results">{{ $teamStatistic->carousel_results ?? old('carousel_results') }}</textarea>
</div>
</div>
</div>
</div>
</div>
<button onClick="update()" class="btn btnBox pull-right">{{ Lang::get('messages.statistics.update') }}</button>
<input type="hidden" class="form-control" name="id" value="{{ $teamStatistic->id ?? old('id') }}">
{{ csrf_field() }}
</form>
<br><br>
@if(isset($teamStatistic->id))
<div class="row" style="display: flex; flex-flow: column; align-items: center;">
<h1>Vista Previa</h1>
<div style="display: flex; width: 90%;">
<div style="display: flex; flex-flow: column; width: -webkit-fill-available; align-items: center;">
<h3>HOME</h3>
<iframe frameborder="0" scrolling="no" width="100%" src="../statistics/showData/only/"></iframe>
</div>
<div style="margin: 10px; border-left: 1px solid lightgray;"></div>
<div style="display: flex; flex-flow: column; width: -webkit-fill-available; align-items: center;">
<h3>ESTADÍSTICAS</h3>
<iframe frameborder="0" scrolling="yes" width="100%" height="1000px" src="../statistics/showData/all/"></iframe>
</div>
</div>
</div>
@endif
</div>
</div>
@endsection
<script src="{{ asset('js/jQuery/jquery-2.2.3.min.js') }}"></script>
<script src="{{ asset('js/bootstrap/js/bootstrap.min.js') }}"></script>
<script src="{{ asset('js/statistics.js') . '?v=' . time() }}"></script>