<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>PDF Download</title>

        <!-- Fonts -->
        <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">

        <!-- Scripts -->
        <script src="{{asset('js/jquery.min.js')}}"></script>
        <script type="text/javascript" src="{{asset('js/loader.js')}}"></script>

        <!-- Styles -->
        <link rel="stylesheet" href="{{asset('css/bootstrap.min.css')}}" />
        <link rel="stylesheet" href="{{asset('css/pages/frontend/pdf_download.css')}}" />

        @include('frontend._includes.bar_chart')
        @include('frontend._includes.line_chart')
    </head>
    <body>
        <div class="flex-center position-ref full-height">
            @if (Route::has('login'))
                <div class="top-right links">
                    @auth
                        <a href="{{ url('/home') }}">Home</a>
                    @else
                        <a href="{{ route('login') }}">Login</a>

                        @if (Route::has('register'))
                            <a href="{{ route('register') }}">Register</a>
                        @endif
                    @endauth
                </div>
            @endif

            <div class="content">
                <div class="title m-b-md">
                    PDF Download
                </div>
                <div class="links">
                    <button type="submit" form="myForm">Click me to download sample pdf</button>
                </div>
                <form id='myForm' action="{{route('pdf_download.download')}}" method="POST" style="">
                    <div class="chart_div">
                        <input type="hidden" name="_token"  value="{{csrf_token()}}">
                    </div>
                    @foreach($elements as $index => $data)
                    <div id="bar_chart_div_{!!$index!!}"></div>
                    @endforeach
                    @foreach($pet_popularity as $index => $data)
                    <div id="line_chart_div_{!!$index!!}"></div>
                    @endforeach
                </form>
            </div>
        </div>
    </body>
</html>
