@extends('layouts.front')
@section('content')
<div class="container">
    <div class="row">
        <div class="col-sm-12">
            <div class="mobilesecitoninner">
                @if (Session::has('sucmessage'))
                    <div class="alert alert-success alert-dismissible show fade">
                        <div class="alert-body">
                            <button class="close" data-dismiss="alert">
                                <span>&times;</span>
                            </button>
                            {{ Session::get('sucmessage') }}
                        </div>
                    </div>
                @endif

                @if (Session::has('message'))
                    <div class="alert alert-danger alert-dismissible show fade">
                        <div class="alert-body">
                            <button class="close" data-dismiss="alert">
                                <span>&times;</span>
                            </button>
                            {{ Session::get('message') }}
                        </div>
                    </div>
                @endif
                <div id="homepageseciton">
                    <div class="megacontentbiscion">
                        <h2>Result Exam Score Table</h2>
                        <div class="megacontentdata">
                            <div class="table-responsive">
                                <table class="table table-striped">
                                    <thead>
                                        <tr>
                                            <th>User Rank</th>
                                            <th>User Name</th>
                                            <th>Competition Name</th>
                                            <th>Join Amount</th>
                                            <th>Win Amount</th>
                                            <th>Applied Date</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @forelse ($gameplayhistory as $gameplayhistorydata)
                                            <tr>
                                                <td>{{ $gameplayhistorydata->winning_rank }}</td>
                                                <td>{{ $gameplayhistorydata->username }}</td>
                                                <td>{{ $gameplayhistorydata->contestname }}</td>
                                                <td>&#8377;{{ number_format((float) $gameplayhistorydata->playedamount, 2) }}</td>
                                                <td>&#8377;{{ number_format((float) $gameplayhistorydata->winning_amount, 2) }}</td>
                                                <td>{{ optional($gameplayhistorydata->createtime)->format('d F Y h:i:s A') }}</td>
                                            </tr>
                                        @empty
                                            <tr>
                                                <td colspan="6" class="text-center">No scoring result available yet.</td>
                                            </tr>
                                        @endforelse
                                    </tbody>
                                </table>
                                {{ $gameplayhistory->links() }}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
$( document ).ready(function() {
    $( "#showedetails" ).on( "click", function() {
        $('#password').attr('type', 'text');
        $('#showedetails').hide();
        $('#hideedetails').show();
    });

    $( "#hideedetails" ).on( "click", function() {
        $('#password').attr('type', 'password');
        $('#hideedetails').hide();
        $('#showedetails').show();
    });
});
</script>
@endsection
