Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @extends('layouts.main')
- @section('styles')
- <style>
- .match, .winnings {
- float: left;
- width: 100%;
- min-height: 75px;
- background-color: #BBB;
- background-repeat: no-repeat;
- background-position: right;
- border-radius: 5px;
- box-shadow: 1px 1px 2px #888;
- margin: 5px 0px;
- padding: 2px;
- }
- .match .oitm {
- width: 24%;
- }
- .matchheader {
- float: left;
- width: 100%;
- padding: 0.6em 1%;
- border-top: solid 1px #ccc;
- background: #e3e3e3;
- background: radial-gradient(ellipse at top, #eee 0%,#d7d7d7 70%);
- font-size: 100%;
- }
- .matchright {
- width: 28%;
- float: left;
- margin: 0.5em 1%;
- }
- .whenm, .eventm {
- font-size: 0.8rem;
- float: left;
- text-shadow: 1px 1px 0 #E5E5E5;
- }
- .eventm {
- float: right;
- }
- .tournament {
- width: 60%;
- float: right;
- }
- .betpoll {
- float: left;
- min-height: 10px;
- float: left;
- margin: 0.5em 1.5%;
- width: 97%;
- }
- .betpoll #active {
- min-height: 50px;
- display: block;
- }
- .betpoll .oitm {
- width: 24%;
- }
- .betpoll .left {
- margin: 0;
- }
- .betpoll .left::before {
- display: none;
- }
- .winsorloses {
- float: left;
- width: 98%;
- max-width: 400px;
- margin: 0.5em 1%;
- background: #BBB;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- }
- .winsorloses .oitm {
- width: 24%;
- }
- .betheader {
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- margin: 0.5em 2% 0 2%;
- width: 96%;
- float: left;
- }
- .team {
- width: 60px;
- height: 50px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- }
- .teamtext {
- background: rgba(187, 187, 187, 0.9);
- border-radius: 5px;
- padding: 5px;
- line-height: 1.4em;
- text-align: center;
- text-transform: none;
- }
- .teamtext i {
- font-style: normal;
- }
- .matchleft a {
- color: #333;
- text-decoration: none;
- cursor: pointer;
- }
- .format {
- font-size: 0.7em;
- font-weight: bold;
- }
- .tournament_bet {
- text-align: center;
- background-image: url({{asset('images/bg_03.jpg')}});
- position: relative;
- background-position: center;
- background-size: cover;
- background-repeat: no-repeat;
- /*min-height: 600px;*/
- padding: 10px;
- }
- .tournament_bet th {
- background-color: #717171;
- color: #ffffff;
- font-weight: normal;
- padding: 0;
- }
- .tournament_bet tbody tr td {
- vertical-align: middle;
- }
- .tournament_bet tbody tr td:first-child {
- padding: 0;
- position: relative;
- }
- .favorite_team {
- position: absolute;
- right: 0px;
- bottom: 0px;
- background-image: url({{asset('images/fav.png')}});
- width: 25px;
- height: 25px;
- }
- .sweet-alert {
- width: 850px !important;
- }
- /* Style the buttons */
- .btncategory, .img {
- border: none;
- outline: none;
- padding: 10px 16px;
- background-color: #f1f1f1;
- opacity: 0.5;
- }
- /* Style the active class (and buttons on mouse-over) */
- .btncategory:hover {
- background-color: #f1f1f1;
- border-bottom: 2px solid #F39C12;
- opacity: 1.0;
- /* color: #F39C12;*/
- }
- .focusbtn.selected{
- background-color: #f1f1f1;
- border-bottom: 2px solid #F39C12;
- opacity: 1.0;
- /* color: #F39C12;*/
- }
- .matchLabel {background: #fff; padding-left: 5px; padding-right: 5px}
- </style>
- <link rel="stylesheet" href="{{ asset('bower_components/bootstrap-sweetalert/dist/sweetalert.css') }}">
- @endsection
- @section('content')
- <div class="main-container dark-grey">
- <div class="m-container1" id="left">
- <div class="main-ct" style="margin-bottom: 0">
- <div class="title">EVENTS </div>
- <div class="clearfix"></div>
- <div class="col-md-12 tournament_bet">
- <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
- @foreach($leagues as $key => $league)
- <div class="panel panel-default">
- <div class="panel-heading" role="tab" id="heading{{$league->id}}">
- <h4 class="panel-title" style="text-align: left">
- @if($key == 0)
- <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{{$league->id}}" aria-expanded="true" aria-controls="collapse{{$league->id}}">
- {{$league->name}}
- </a>
- @else
- <a {{$league->betting_status == 1 ? '' : 'class="collapsed"'}} role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{{$league->id}}" aria-expanded="{{$league->betting_status == 1 ? 'true' : 'false'}}" aria-controls="collapse{{$league->id}}">
- {{$league->name}}
- </a>
- @endif
- @if($league->betting_status == 1)
- <span class="pull-right green"><strong>Open</strong></span>
- @elseif($league->betting_status == -1)
- <span class="pull-right">Settled: <strong class="green">{{$league->champion->name}}</strong> (Winner)</span>
- @else
- <span class="pull-right"><strong>Ongoing</strong></span>
- @endif
- </h4>
- </div>
- @if($key == 0)
- <div id="collapse{{$league->id}}" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading{{$league->id}}">
- @else
- <div id="collapse{{$league->id}}" class="panel-collapse collapse {{$league->betting_status == 1 ? 'in' : ''}}" role="tabpanel" aria-labelledby="heading{{$league->id}}">
- @endif
- <div class="panel-body" style="padding: 1px; background-image: url({{asset('/images/bg_03.jpg')}})">
- @foreach($league->teams as $index => $team)
- @if($index == 0)
- <div class="col-md-6" style="padding-left: 0; padding-right: 1px">
- <table border="1" class="table table-responsive table-border" style="text-align: center; margin-bottom: 0">
- <thead>
- <tr>
- <th style="text-align: center; width: 82px;">Team</th>
- <th style="text-align: center; font-size: 90%">% of Winning</th>
- <th style="text-align: center">Ratio</th>
- <th style="text-align: center; font-size: 90%">Possible win per 100</th>
- </tr>
- </thead>
- <tbody>
- @endif
- @if($index == intVal(round($league->teams->count()/2)))
- </tbody>
- </table>
- </div>
- <div class="col-md-6" style="padding-left: 1px; padding-right: 0">
- <table border="1" class="table table-responsive table-border" style="text-align: center; margin-bottom: 0">
- <thead>
- <tr>
- <th style="text-align: center; width: 82px;">Team</th>
- <th style="text-align: center; font-size: 90%">% of Winning</th>
- <th style="text-align: center">Ratio</th>
- <th style="text-align: center; font-size: 90%">Possible win per 100</th>
- </tr>
- </thead>
- <tbody>
- @endif
- <tr>
- <td style="position: relative">
- <img src="{{asset($team->image)}}" title="{{$team->name}}" style="width: 82px;">
- @if($team->pivot->is_favorite)
- <span class="favorite_team" title="Favorite team"></span>
- @endif
- </td>
- <td style="vertical-align: middle;">{{ round(tournamentWinPercentagePerTeam($league->id, $team->id), 2) }}%</td>
- <td style="vertical-align: middle;">{{ round(tournamentRatioPerTeam($league->id, $team->id), 2) }}</td>
- <td style="vertical-align: middle;">
- @if(tournamentRatioPerTeam($league->id, $team->id) > 0)
- <strong style="color: green">₱ {{ number_format((100 * tournamentRatioPerTeam($league->id, $team->id)), 2, '.', ',') }}</strong>
- @else
- ₱ 0
- @endif
- </td>
- </tr>
- @if($league->teams->count() == ($index+1))
- </tbody>
- </table>
- </div>
- @endif
- @endforeach
- <div style="position: relative">
- <img src="{{$league->bottom_image ? url('/') . '/' . $league->bottom_image : asset('images/bottom_tournament_bg.png')}}" style="width: 100%; max-height: 103px;">
- <a href="{{url('/tournament') . '/' . $league->id}}" style="position: absolute; bottom: 5px; right: 5px; font-weight: bold; color: black; background-color: orange" class="btn btn-warning">Place Bet</a>
- </div>
- </div>
- </div>
- </div>
- @endforeach
- </div>
- </div>
- </div>
- </div>
- <div class="m-container2" id="right">
- <div id="matchesHolder" class="main-ct">
- <div class="title">MATCHES </div>
- <!-- Category button -->
- <!-- <a href="{{ url('dota2') }}"><img src="../resources/assets/images/dota2icon.png"> DOTA2</a> -->
- <div id="myDIV" style="background-color: #f1f1f1;">
- <button class="btncategory allbtn focusbtn"> ALL</button>
- <button type="button" class="dota1btn btncategory focusbtn"><img src="../resources/assets/images/dota2icon.png"> DOTA2</button>
- <button class="csgobtn btncategory focusbtn"><img src="../resources/assets/images/csgoicon.png"> CSGO</button>
- <button class="sportsbtn btncategory focusbtn"><img src="../resources/assets/images/nbaicon.png"> SPORTS</button>
- </div>
- <div class="box">
- @foreach($matches as $index => $match)
- <div class="matchmain">
- <div class="infor">
- <div class="time">
- @if($match->status == 'ongoing')
- <span style="color: #72A326; text-shadow: 1px 1px 0px #4A7010; font-weight: bold; font-size: 16px"> LIVE</span>
- @elseif($match->status == 'settled')
- {{$match->schedule->diffForHumans()}} <span style="color: #606060; font-weight: bold; font-size: 16px"> SETTLED</span>
- @elseif($match->status == 'draw')
- {{$match->schedule->diffForHumans()}} <span style="color: #606060; font-weight: bold; font-size: 16px"> DRAW - CREDITS RETURNED</span>
- @else
- <strong class="match_countdown" data-schedule="{{$match->schedule}}">{{$match->schedule->diffForHumans()}}</strong>
- @endif
- </div>
- <div class="series">{{ $match->league->name }}</div>
- </div>
- @if(in_array($match->status, ['open','ongoing']))
- <div class="match " style="background-image: url({{ url('/public_image') . '/' . $match->league->image }})">
- @else
- <div class="match " style="background-image: url({{ url('/public_image') . '/' . $match->league->image }}); opacity: 0.5">
- @endif
- <div class="col-sm-10" style="text-align: center; font-weight: bold;">{!!$match->label ? '<span class="matchLabel">' . $match->label . '</span>': ''!!}</div>
- <div class="col-sm-10 matchleft">
- <a href="{{ url('/') . '/match/' . $match->id }}">
- <div style="width: 45%; float: left; text-align: right">
- <img class="team2_img" src="{{asset($match->teamA->image)}}" style="float: right;border-radius: 2px;">
- @if($match->status == 'settled' && $match->teamA->id == $match->team_winner)
- <img src="{{asset('images/won.png')}}" style="position: absolute; margin: -10px 0 0 -15px;">
- @endif
- <div class="teamtext">
- <b style="font-size: 0.9vw">{{$match->teamA->name}}</b><br>
- <i class="percent-coins">{{number_format($match->teamA->matchWinPercentage($match->id), 2)}}%</i>
- </div>
- </div>
- <div class="vs_div" style="float: left; text-align: center; margin-top: 0.6em">
- <span class="format" style="background: #fff;">{{$match->best_of}}</span><br><span style="background: #fff;">vs</span>
- </div>
- <div style="width: 45%; float: left; text-align: left">
- <img class="team2_img" src="{{asset($match->teamB->image)}}" style="float: left;border-radius: 2px;">
- @if($match->status == 'settled' && $match->teamB->id == $match->team_winner)
- <img src="{{asset('images/won.png')}}" style="position: absolute; margin: -10px 0 0 -15px;">
- @endif
- <div class="teamtext">
- <b style="font-size: 0.8vw">{{$match->teamB->name}}</b><br>
- <i class="percent-coins">{{number_format($match->teamB->matchWinPercentage($match->id), 2)}}%</i>
- </div>
- </div>
- </a>
- </div>
- </div>
- </div>
- @endforeach
- </div>
- </div>
- <div style="text-align: center; margin-bottom: 10px">
- <button id="loadMoreBtn" type="button" class="btn btn-default btn-sm hidebtn" data-pointer="0" data-loading-text="Loading ... <span class='glyphicon glyphicon-refresh fa-spin'></span>">Show more <i class="fa fa-angle-double-down"></i></button>
- </div>
- </div>
- </div>
- <div id="popupMessage" class="modal fade" role="dialog">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal">×</button>
- </div>
- <div class="modal-body">
- <img src="{{asset('/images/pupop_ti.png')}}" width="570" />
- </div>
- </div>
- </div>
- </div>
- @endsection
- @section('script')
- <script id="matches-template" class="hidemore" type="text/template">
- <div class="matchmain">
- <div class="infor">
- <div class="time">
- @{{& status}}
- </div>
- <div class="series">@{{league.name}}</div>
- </div>
- @{{#is_current}}
- <div class="match " style="background-image: url({{url('/public_image')}}/@{{league.image}})">
- @{{/is_current}}
- @{{^is_current}}
- <div class="match " style="background-image: url({{url('/public_image')}}/@{{league.image}}); opacity: 0.5">
- @{{/is_current}}
- @{{#label}}
- <div class="col-sm-10" style="text-align: center; font-weight: bold;"><span class="matchLabel">@{{label}}</span></div>
- @{{/label}}
- <div class="col-sm-10 matchleft">
- <a href="{{url('/')}}/match/@{{id}}">
- <div style="width: 45%; float: left; text-align: right">
- <img class="team2_img" src="{{url('/')}}/@{{team_a.image}}" style="float: right;border-radius: 2px;" />
- @{{#team_a_winner}}
- <img src="{{asset('images/won.png')}}" style="position: absolute; margin: -10px 0 0 -15px;">
- @{{/team_a_winner}}
- <div class="teamtext">
- <b style="font-size: 0.9vw">@{{team_a.name}}</b><br>
- <i class="percent-coins">@{{team_a_winPercentage}}%</i>
- </div>
- </div>
- <div class="vs_div" style="float: left; text-align: center; margin-top: 0.6em">
- <span class="format">@{{best_of}}</span><br>vs
- </div>
- <div style="width: 45%; float: left; text-align: left">
- <img class="team2_img" src="{{url('/')}}/@{{team_b.image}}" style="float: left;border-radius: 2px;" />
- @{{#team_b_winner}}
- <img src="{{asset('images/won.png')}}" style="position: absolute; margin: -10px 0 0 -15px;">
- @{{/team_b_winner}}
- <div class="teamtext">
- <b style="font-size: 0.8vw">@{{team_b.name}}</b><br>
- <i class="percent-coins">@{{team_b_winPercentage}}%</i>
- </div>
- </div>
- </a>
- </div>
- </div>
- </div>
- </script>
- <script type="text/javascript">
- $(document).ready(function(){
- // Hide displayed paragraphs
- $(".allbtn").click(function(){
- $(".box").load('{{ url('allmatch') }}');
- $(".hidebtn").hide();
- $(".matchmain").hide();
- $(".matches-template").hide();
- });
- $(".dota1btn").click(function(){
- $(".box").load('{{ url('dota2') }}');
- $(".hidebtn").hide();
- $(".matchmain").hide();
- });
- $(".csgobtn").click(function(){
- $(".box").load('{{ url('csgo') }}');
- $(".hidebtn").hide();
- $(".matchmain").hide();
- });
- $(".sportsbtn").click(function(){
- $(".box").load('{{ url('sports') }}');
- $(".hidebtn").hide();
- $(".matchmain").hide();
- });
- });
- </script>
- <script type="text/javascript">
- //Selected button category
- $('.focusbtn').on('click', function(){
- $('.focusbtn').removeClass('selected');
- $(this).addClass('selected');
- });
- </script>
- <script type="text/javascript" src="{{ asset('js/moment.min.js')}}"></script>
- <script type="text/javascript" src="{{ asset('bower_components/bootstrap-sweetalert/dist/sweetalert.min.js')}}"></script>
- <script src="{{ asset('js/mustache.min.js') }}"></script>
- <script>
- $(function(){
- var now = moment(moment().format('YYYY-MM-DD'));
- var to_tournament_date = moment("2017-08-03T00:00:00+08:00").fromNow();
- $('.tournament-winner-timer').html(to_tournament_date);
- })
- $(document).ready(function() {
- $.each($('.match_countdown'), function(key, index) {
- countdown(this, $(this).data('schedule'));
- });
- function countdown(element, time) {
- var countDownDate = parseInt(moment(time).format('x'));
- var x = setInterval(function() {
- // Get todays date and time
- var now = new Date().getTime();
- // Find the distance between now an the count down date
- var distance = countDownDate - now;
- // Time calculations for days, hours, minutes and seconds
- var days = Math.floor(distance / (1000 * 60 * 60 * 24));
- var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
- var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
- var seconds = Math.floor((distance % (1000 * 60)) / 1000);
- // Display the result in the element with id="demo"
- element.innerHTML = (days > 0 ? days + "d " : "") + (hours > 0 ? hours + "h " : "") + (minutes > 0 ? minutes + "m " : "") + seconds + "s from now";
- // If the count down is finished, write some text
- if (distance < 0) {
- clearInterval(x);
- element.innerHTML = "EXPIRED";
- }
- }, 1000);
- }
- // $('#popupMessage').modal('show');
- $('#loadMoreBtn').click(function() {
- $btn = $(this);
- $btn.button('loading');
- var currIndex = $('#matchesHolder .matchmain:last').index();
- var container = $("#matches-template").html();
- $.get("{{url('/match/load')}}/" + $btn.data('pointer'))
- .done(function(data) {
- $btn.button('reset');
- $new_contents = '';
- $.each(data.matches, function() {
- $new_contents += Mustache.render(container, this);
- });
- $('#matchesHolder').append($new_contents);
- // $('html, body').animate({
- // scrollTop: $($('#matchesHolder .matchmain')[currIndex]).offset().top
- // }, 'fast');
- $btn.data('pointer', data.pointer);
- });
- });
- });
- // $(window).scroll(function() {
- // if($(window).scrollTop() == $(document).height() - $(window).height()) {
- // console.log('loading more items...');
- // }
- // });
- </script>
- @endsection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement