Advertisement
Guest User

school

a guest
Jan 9th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.92 KB | None | 0 0
  1. @extends('layouts.main')
  2.  
  3. @section('styles')
  4. <style>
  5. .match, .winnings {
  6. float: left;
  7. width: 100%;
  8. min-height: 75px;
  9. background-color: #BBB;
  10. background-repeat: no-repeat;
  11. background-position: right;
  12. border-radius: 5px;
  13. box-shadow: 1px 1px 2px #888;
  14. margin: 5px 0px;
  15. padding: 2px;
  16. }
  17. .match .oitm {
  18. width: 24%;
  19. }
  20. .matchheader {
  21. float: left;
  22. width: 100%;
  23. padding: 0.6em 1%;
  24. border-top: solid 1px #ccc;
  25. background: #e3e3e3;
  26. background: radial-gradient(ellipse at top, #eee 0%,#d7d7d7 70%);
  27. font-size: 100%;
  28. }
  29. .matchright {
  30. width: 28%;
  31. float: left;
  32. margin: 0.5em 1%;
  33. }
  34. .whenm, .eventm {
  35. font-size: 0.8rem;
  36. float: left;
  37. text-shadow: 1px 1px 0 #E5E5E5;
  38. }
  39. .eventm {
  40. float: right;
  41. }
  42. .tournament {
  43. width: 60%;
  44. float: right;
  45. }
  46. .betpoll {
  47. float: left;
  48. min-height: 10px;
  49. float: left;
  50. margin: 0.5em 1.5%;
  51. width: 97%;
  52. }
  53. .betpoll #active {
  54. min-height: 50px;
  55. display: block;
  56. }
  57. .betpoll .oitm {
  58. width: 24%;
  59. }
  60. .betpoll .left {
  61. margin: 0;
  62. }
  63. .betpoll .left::before {
  64. display: none;
  65. }
  66. .winsorloses {
  67. float: left;
  68. width: 98%;
  69. max-width: 400px;
  70. margin: 0.5em 1%;
  71. background: #BBB;
  72. -webkit-border-radius: 5px;
  73. border-radius: 5px;
  74. }
  75. .winsorloses .oitm {
  76. width: 24%;
  77. }
  78. .betheader {
  79. text-overflow: ellipsis;
  80. white-space: nowrap;
  81. overflow: hidden;
  82. margin: 0.5em 2% 0 2%;
  83. width: 96%;
  84. float: left;
  85. }
  86. .team {
  87. width: 60px;
  88. height: 50px;
  89. -webkit-border-radius: 5px;
  90. border-radius: 5px;
  91. }
  92. .teamtext {
  93. background: rgba(187, 187, 187, 0.9);
  94. border-radius: 5px;
  95. padding: 5px;
  96. line-height: 1.4em;
  97. text-align: center;
  98. text-transform: none;
  99. }
  100. .teamtext i {
  101. font-style: normal;
  102. }
  103.  
  104. .matchleft a {
  105. color: #333;
  106. text-decoration: none;
  107. cursor: pointer;
  108. }
  109.  
  110. .format {
  111. font-size: 0.7em;
  112. font-weight: bold;
  113. }
  114. .tournament_bet {
  115. text-align: center;
  116. background-image: url({{asset('images/bg_03.jpg')}});
  117. position: relative;
  118. background-position: center;
  119. background-size: cover;
  120. background-repeat: no-repeat;
  121. /*min-height: 600px;*/
  122. padding: 10px;
  123. }
  124. .tournament_bet th {
  125. background-color: #717171;
  126. color: #ffffff;
  127. font-weight: normal;
  128. padding: 0;
  129. }
  130. .tournament_bet tbody tr td {
  131. vertical-align: middle;
  132. }
  133. .tournament_bet tbody tr td:first-child {
  134. padding: 0;
  135. position: relative;
  136. }
  137. .favorite_team {
  138. position: absolute;
  139. right: 0px;
  140. bottom: 0px;
  141. background-image: url({{asset('images/fav.png')}});
  142. width: 25px;
  143. height: 25px;
  144. }
  145. .sweet-alert {
  146. width: 850px !important;
  147. }
  148. /* Style the buttons */
  149. .btncategory, .img {
  150. border: none;
  151. outline: none;
  152. padding: 10px 16px;
  153. background-color: #f1f1f1;
  154. opacity: 0.5;
  155. }
  156. /* Style the active class (and buttons on mouse-over) */
  157. .btncategory:hover {
  158. background-color: #f1f1f1;
  159. border-bottom: 2px solid #F39C12;
  160. opacity: 1.0;
  161. /* color: #F39C12;*/
  162. }
  163. .focusbtn.selected{
  164. background-color: #f1f1f1;
  165. border-bottom: 2px solid #F39C12;
  166. opacity: 1.0;
  167. /* color: #F39C12;*/
  168. }
  169.  
  170. .matchLabel {background: #fff; padding-left: 5px; padding-right: 5px}
  171. </style>
  172. <link rel="stylesheet" href="{{ asset('bower_components/bootstrap-sweetalert/dist/sweetalert.css') }}">
  173. @endsection
  174.  
  175. @section('content')
  176. <div class="main-container dark-grey">
  177. <div class="m-container1" id="left">
  178. <div class="main-ct" style="margin-bottom: 0">
  179. <div class="title">EVENTS </div>
  180. <div class="clearfix"></div>
  181. <div class="col-md-12 tournament_bet">
  182.  
  183. <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
  184. @foreach($leagues as $key => $league)
  185. <div class="panel panel-default">
  186. <div class="panel-heading" role="tab" id="heading{{$league->id}}">
  187. <h4 class="panel-title" style="text-align: left">
  188. @if($key == 0)
  189. <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{{$league->id}}" aria-expanded="true" aria-controls="collapse{{$league->id}}">
  190. {{$league->name}}
  191. </a>
  192. @else
  193. <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}}">
  194. {{$league->name}}
  195. </a>
  196. @endif
  197. @if($league->betting_status == 1)
  198. <span class="pull-right green"><strong>Open</strong></span>
  199. @elseif($league->betting_status == -1)
  200. <span class="pull-right">Settled: <strong class="green">{{$league->champion->name}}</strong> (Winner)</span>
  201. @else
  202. <span class="pull-right"><strong>Ongoing</strong></span>
  203. @endif
  204. </h4>
  205. </div>
  206. @if($key == 0)
  207. <div id="collapse{{$league->id}}" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading{{$league->id}}">
  208. @else
  209. <div id="collapse{{$league->id}}" class="panel-collapse collapse {{$league->betting_status == 1 ? 'in' : ''}}" role="tabpanel" aria-labelledby="heading{{$league->id}}">
  210. @endif
  211. <div class="panel-body" style="padding: 1px; background-image: url({{asset('/images/bg_03.jpg')}})">
  212. @foreach($league->teams as $index => $team)
  213. @if($index == 0)
  214. <div class="col-md-6" style="padding-left: 0; padding-right: 1px">
  215. <table border="1" class="table table-responsive table-border" style="text-align: center; margin-bottom: 0">
  216. <thead>
  217. <tr>
  218. <th style="text-align: center; width: 82px;">Team</th>
  219. <th style="text-align: center; font-size: 90%">% of Winning</th>
  220. <th style="text-align: center">Ratio</th>
  221. <th style="text-align: center; font-size: 90%">Possible win per 100</th>
  222. </tr>
  223. </thead>
  224. <tbody>
  225. @endif
  226. @if($index == intVal(round($league->teams->count()/2)))
  227. </tbody>
  228. </table>
  229. </div>
  230. <div class="col-md-6" style="padding-left: 1px; padding-right: 0">
  231. <table border="1" class="table table-responsive table-border" style="text-align: center; margin-bottom: 0">
  232. <thead>
  233. <tr>
  234. <th style="text-align: center; width: 82px;">Team</th>
  235. <th style="text-align: center; font-size: 90%">% of Winning</th>
  236. <th style="text-align: center">Ratio</th>
  237. <th style="text-align: center; font-size: 90%">Possible win per 100</th>
  238. </tr>
  239. </thead>
  240. <tbody>
  241. @endif
  242. <tr>
  243. <td style="position: relative">
  244. <img src="{{asset($team->image)}}" title="{{$team->name}}" style="width: 82px;">
  245. @if($team->pivot->is_favorite)
  246. <span class="favorite_team" title="Favorite team"></span>
  247. @endif
  248. </td>
  249. <td style="vertical-align: middle;">{{ round(tournamentWinPercentagePerTeam($league->id, $team->id), 2) }}%</td>
  250. <td style="vertical-align: middle;">{{ round(tournamentRatioPerTeam($league->id, $team->id), 2) }}</td>
  251. <td style="vertical-align: middle;">
  252. @if(tournamentRatioPerTeam($league->id, $team->id) > 0)
  253. <strong style="color: green">&#8369; {{ number_format((100 * tournamentRatioPerTeam($league->id, $team->id)), 2, '.', ',') }}</strong>
  254. @else
  255. &#8369; 0
  256. @endif
  257. </td>
  258. </tr>
  259. @if($league->teams->count() == ($index+1))
  260. </tbody>
  261. </table>
  262. </div>
  263. @endif
  264. @endforeach
  265. <div style="position: relative">
  266. <img src="{{$league->bottom_image ? url('/') . '/' . $league->bottom_image : asset('images/bottom_tournament_bg.png')}}" style="width: 100%; max-height: 103px;">
  267. <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>
  268. </div>
  269. </div>
  270. </div>
  271. </div>
  272. @endforeach
  273. </div>
  274.  
  275. </div>
  276. </div>
  277. </div>
  278.  
  279. <div class="m-container2" id="right">
  280. <div id="matchesHolder" class="main-ct">
  281. <div class="title">MATCHES </div>
  282. <!-- Category button -->
  283. <!-- <a href="{{ url('dota2') }}"><img src="../resources/assets/images/dota2icon.png"> DOTA2</a> -->
  284. <div id="myDIV" style="background-color: #f1f1f1;">
  285. <button class="btncategory allbtn focusbtn"> ALL</button>
  286. <button type="button" class="dota1btn btncategory focusbtn"><img src="../resources/assets/images/dota2icon.png"> DOTA2</button>
  287. <button class="csgobtn btncategory focusbtn"><img src="../resources/assets/images/csgoicon.png"> CSGO</button>
  288. <button class="sportsbtn btncategory focusbtn"><img src="../resources/assets/images/nbaicon.png"> SPORTS</button>
  289. </div>
  290. <div class="box">
  291. @foreach($matches as $index => $match)
  292. <div class="matchmain">
  293. <div class="infor">
  294. <div class="time">
  295. @if($match->status == 'ongoing')
  296. <span style="color: #72A326; text-shadow: 1px 1px 0px #4A7010; font-weight: bold; font-size: 16px">&nbsp;LIVE</span>
  297. @elseif($match->status == 'settled')
  298. {{$match->schedule->diffForHumans()}} <span style="color: #606060; font-weight: bold; font-size: 16px">&nbsp;SETTLED</span>
  299. @elseif($match->status == 'draw')
  300. {{$match->schedule->diffForHumans()}} <span style="color: #606060; font-weight: bold; font-size: 16px">&nbsp;DRAW - CREDITS RETURNED</span>
  301. @else
  302. <strong class="match_countdown" data-schedule="{{$match->schedule}}">{{$match->schedule->diffForHumans()}}</strong>
  303. @endif
  304. </div>
  305. <div class="series">{{ $match->league->name }}</div>
  306. </div>
  307. @if(in_array($match->status, ['open','ongoing']))
  308. <div class="match " style="background-image: url({{ url('/public_image') . '/' . $match->league->image }})">
  309. @else
  310. <div class="match " style="background-image: url({{ url('/public_image') . '/' . $match->league->image }}); opacity: 0.5">
  311. @endif
  312. <div class="col-sm-10" style="text-align: center; font-weight: bold;">{!!$match->label ? '<span class="matchLabel">' . $match->label . '</span>': ''!!}</div>
  313. <div class="col-sm-10 matchleft">
  314. <a href="{{ url('/') . '/match/' . $match->id }}">
  315. <div style="width: 45%; float: left; text-align: right">
  316. <img class="team2_img" src="{{asset($match->teamA->image)}}" style="float: right;border-radius: 2px;">
  317. @if($match->status == 'settled' && $match->teamA->id == $match->team_winner)
  318. <img src="{{asset('images/won.png')}}" style="position: absolute; margin: -10px 0 0 -15px;">
  319. @endif
  320. <div class="teamtext">
  321. <b style="font-size: 0.9vw">{{$match->teamA->name}}</b><br>
  322. <i class="percent-coins">{{number_format($match->teamA->matchWinPercentage($match->id), 2)}}%</i>
  323. </div>
  324. </div>
  325. <div class="vs_div" style="float: left; text-align: center; margin-top: 0.6em">
  326. <span class="format" style="background: #fff;">{{$match->best_of}}</span><br><span style="background: #fff;">vs</span>
  327. </div>
  328. <div style="width: 45%; float: left; text-align: left">
  329. <img class="team2_img" src="{{asset($match->teamB->image)}}" style="float: left;border-radius: 2px;">
  330. @if($match->status == 'settled' && $match->teamB->id == $match->team_winner)
  331. <img src="{{asset('images/won.png')}}" style="position: absolute; margin: -10px 0 0 -15px;">
  332. @endif
  333. <div class="teamtext">
  334. <b style="font-size: 0.8vw">{{$match->teamB->name}}</b><br>
  335. <i class="percent-coins">{{number_format($match->teamB->matchWinPercentage($match->id), 2)}}%</i>
  336. </div>
  337. </div>
  338. </a>
  339. </div>
  340. </div>
  341. </div>
  342. @endforeach
  343. </div>
  344. </div>
  345.  
  346. <div style="text-align: center; margin-bottom: 10px">
  347. <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>
  348. </div>
  349. </div>
  350. </div>
  351. <div id="popupMessage" class="modal fade" role="dialog">
  352. <div class="modal-dialog">
  353. <div class="modal-content">
  354. <div class="modal-header">
  355. <button type="button" class="close" data-dismiss="modal">&times;</button>
  356. </div>
  357. <div class="modal-body">
  358. <img src="{{asset('/images/pupop_ti.png')}}" width="570" />
  359. </div>
  360. </div>
  361. </div>
  362. </div>
  363. @endsection
  364. @section('script')
  365. <script id="matches-template" class="hidemore" type="text/template">
  366. <div class="matchmain">
  367. <div class="infor">
  368. <div class="time">
  369. @{{& status}}
  370. </div>
  371. <div class="series">@{{league.name}}</div>
  372. </div>
  373. @{{#is_current}}
  374. <div class="match " style="background-image: url({{url('/public_image')}}/@{{league.image}})">
  375. @{{/is_current}}
  376. @{{^is_current}}
  377. <div class="match " style="background-image: url({{url('/public_image')}}/@{{league.image}}); opacity: 0.5">
  378. @{{/is_current}}
  379. @{{#label}}
  380. <div class="col-sm-10" style="text-align: center; font-weight: bold;"><span class="matchLabel">@{{label}}</span></div>
  381. @{{/label}}
  382. <div class="col-sm-10 matchleft">
  383. <a href="{{url('/')}}/match/@{{id}}">
  384. <div style="width: 45%; float: left; text-align: right">
  385. <img class="team2_img" src="{{url('/')}}/@{{team_a.image}}" style="float: right;border-radius: 2px;" />
  386. @{{#team_a_winner}}
  387. <img src="{{asset('images/won.png')}}" style="position: absolute; margin: -10px 0 0 -15px;">
  388. @{{/team_a_winner}}
  389. <div class="teamtext">
  390. <b style="font-size: 0.9vw">@{{team_a.name}}</b><br>
  391. <i class="percent-coins">@{{team_a_winPercentage}}%</i>
  392. </div>
  393. </div>
  394. <div class="vs_div" style="float: left; text-align: center; margin-top: 0.6em">
  395. <span class="format">@{{best_of}}</span><br>vs
  396. </div>
  397. <div style="width: 45%; float: left; text-align: left">
  398. <img class="team2_img" src="{{url('/')}}/@{{team_b.image}}" style="float: left;border-radius: 2px;" />
  399. @{{#team_b_winner}}
  400. <img src="{{asset('images/won.png')}}" style="position: absolute; margin: -10px 0 0 -15px;">
  401. @{{/team_b_winner}}
  402. <div class="teamtext">
  403. <b style="font-size: 0.8vw">@{{team_b.name}}</b><br>
  404. <i class="percent-coins">@{{team_b_winPercentage}}%</i>
  405. </div>
  406. </div>
  407. </a>
  408. </div>
  409. </div>
  410. </div>
  411. </script>
  412. <script type="text/javascript">
  413. $(document).ready(function(){
  414. // Hide displayed paragraphs
  415. $(".allbtn").click(function(){
  416. $(".box").load('{{ url('allmatch') }}');
  417. $(".hidebtn").hide();
  418. $(".matchmain").hide();
  419. $(".matches-template").hide();
  420. });
  421.  
  422. $(".dota1btn").click(function(){
  423. $(".box").load('{{ url('dota2') }}');
  424. $(".hidebtn").hide();
  425. $(".matchmain").hide();
  426. });
  427.  
  428. $(".csgobtn").click(function(){
  429. $(".box").load('{{ url('csgo') }}');
  430. $(".hidebtn").hide();
  431. $(".matchmain").hide();
  432. });
  433. $(".sportsbtn").click(function(){
  434. $(".box").load('{{ url('sports') }}');
  435. $(".hidebtn").hide();
  436. $(".matchmain").hide();
  437. });
  438.  
  439. });
  440. </script>
  441. <script type="text/javascript">
  442. //Selected button category
  443. $('.focusbtn').on('click', function(){
  444. $('.focusbtn').removeClass('selected');
  445. $(this).addClass('selected');
  446. });
  447. </script>
  448. <script type="text/javascript" src="{{ asset('js/moment.min.js')}}"></script>
  449. <script type="text/javascript" src="{{ asset('bower_components/bootstrap-sweetalert/dist/sweetalert.min.js')}}"></script>
  450. <script src="{{ asset('js/mustache.min.js') }}"></script>
  451. <script>
  452. $(function(){
  453. var now = moment(moment().format('YYYY-MM-DD'));
  454. var to_tournament_date = moment("2017-08-03T00:00:00+08:00").fromNow();
  455. $('.tournament-winner-timer').html(to_tournament_date);
  456. })
  457. $(document).ready(function() {
  458. $.each($('.match_countdown'), function(key, index) {
  459. countdown(this, $(this).data('schedule'));
  460. });
  461.  
  462. function countdown(element, time) {
  463. var countDownDate = parseInt(moment(time).format('x'));
  464. var x = setInterval(function() {
  465.  
  466. // Get todays date and time
  467. var now = new Date().getTime();
  468.  
  469. // Find the distance between now an the count down date
  470. var distance = countDownDate - now;
  471.  
  472. // Time calculations for days, hours, minutes and seconds
  473. var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  474. var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  475. var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  476. var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  477.  
  478. // Display the result in the element with id="demo"
  479. element.innerHTML = (days > 0 ? days + "d " : "") + (hours > 0 ? hours + "h " : "") + (minutes > 0 ? minutes + "m " : "") + seconds + "s from now";
  480.  
  481. // If the count down is finished, write some text
  482. if (distance < 0) {
  483. clearInterval(x);
  484. element.innerHTML = "EXPIRED";
  485. }
  486. }, 1000);
  487. }
  488. // $('#popupMessage').modal('show');
  489. $('#loadMoreBtn').click(function() {
  490. $btn = $(this);
  491. $btn.button('loading');
  492. var currIndex = $('#matchesHolder .matchmain:last').index();
  493. var container = $("#matches-template").html();
  494. $.get("{{url('/match/load')}}/" + $btn.data('pointer'))
  495. .done(function(data) {
  496. $btn.button('reset');
  497. $new_contents = '';
  498. $.each(data.matches, function() {
  499. $new_contents += Mustache.render(container, this);
  500. });
  501. $('#matchesHolder').append($new_contents);
  502. // $('html, body').animate({
  503. // scrollTop: $($('#matchesHolder .matchmain')[currIndex]).offset().top
  504. // }, 'fast');
  505. $btn.data('pointer', data.pointer);
  506. });
  507. });
  508. });
  509. // $(window).scroll(function() {
  510. // if($(window).scrollTop() == $(document).height() - $(window).height()) {
  511. // console.log('loading more items...');
  512. // }
  513. // });
  514. </script>
  515. @endsection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement