@extends('layouts.app')

@section('title')

Discipline

@parent
@stop

{{-- page level styles --}}
@section('header_styles')
<!--page level css -->
<link href="{{ asset('assets/vendors/select2/css/select2.min.css') }}" type="text/css" rel="stylesheet">
<link href="{{ asset('assets/vendors/select2/css/select2-bootstrap.css') }}" rel="stylesheet">


<!--end of page level css-->
@stop

@section('content')

<main>

  <section>
    <div class="container">
      <h4>Download Article</h4>
      <div class="row">
          <div class="col-12 text-center ">
      @if (Session::get('message') == "Success")   
         <div  class="alert alert-success alert-dismissible fade show" role="alert">
          <b>Success</b> Thank you for downloading the article         
          </div>
      @else   
         <div  class="alert alert-danger alert-dismissible fade show" role="alert">
          <b>Attention!</b> {{ Session::get('message') }}         
          </div>
      @endif


      @if(!empty($param))
        <form action="{{ route('download_article') }}" method="POST" id="download-form-pdf" id="form1">            @csrf
			  <input type="hidden" name="param" value="{{$param}}">
			  <input type="hidden" name="disc_user_access_id" value="{{$data->disc_user_access_id}}">
			  <input type="hidden" name="dc_user_id" value="{{$data->dc_user_id}}">
        </form>
        <a href="/discipline/{{$data->disc_access_code}}/{{$data->email}}" class="btn btn-dark bg-siteblue mx-auto rounded-pill px-5">View Detail</a>
      @endif  
    </div>
  </div>
</div>
  </section>
</main>
  
  <!----Main Section Ends----> 

@endsection

{{-- page level scripts --}}
@section('footer_scripts')

  @if (Session::get('message') == "Success")

    <script type="text/javascript">

        $('#form1').submit();

    </script>

  @endif
@stop


