@extends('layouts.app')

@section('title')

{{ $user->name }}

@parent

@stop

@section('header_styles')

<meta name="csrf_token" content="{{ csrf_token() }}">

<link href="{{ asset('assets/vendors/jasny-bootstrap/css/jasny-bootstrap.css') }}" rel="stylesheet"/>

<link href="{{ asset('assets/vendors/x-editable/css/bootstrap-editable.css') }}" rel="stylesheet"/>

<link href="{{ asset('assets/css/pages/user_profile.css') }}" rel="stylesheet"/>



@stop





{{-- Page content --}}

@section('content')

<main id="users_ac"> 

  

  <!--section ends-->

  

  <section>

    <div class="container">

    <div class="row">

      <div class="col-md-4">

        <div class="card bigbox-hvr-slow profile-sidebar">

          <div class="card-body"> 

            <!-- SIDEBAR USERPIC --> 

            @if($user->pic)

            <div class="profile-userpic" style="

    background-image: url({!! url('/').'/uploads/users/'.$user->pic !!});"> </div>

            @elseif($user->gender === "male")

            <div class="profile-userpic" style="

    background-image: url({{ asset('assets/images/authors/avatar3.png') }});"> </div>

            @elseif($user->gender === "female")

            <div class="profile-userpic" style="

    background-image: url({{ asset('assets/images/authors/avatar5.png') }});"> </div>

            @else

            <div class="profile-userpic" style="

    background-image: url({{ asset('assets/images/authors/no_avatar.jpg') }});"> </div>

            @endif 

            <!-- END SIDEBAR USERPIC --> 

            <!-- SIDEBAR USER TITLE -->

            <div class="profile-usertitle">

      @if( (isset($user->first_name) && !empty($user->first_name)) || (isset($user->last_name) && !empty($user->last_name))) 

        <div class="profile-usertitle-name"> {{ $user->first_name }} {{ $user->last_name }} </div>

      @elseif(isset($user->display_name) && !empty($user->display_name)) 

        <div class="profile-usertitle-name"> {{ $user->display_name }} </div>

      @endif    

            

      

      {{-- code blocked

      

        @if( (isset($user->city) && !empty($user->city)) && (isset($user->country) && !empty($user->country)))

          <div class="profile-usertitle-job"> {{ $user->city }}, {{ $user->country }} </div>

        @elseif(isset($user->city) && !empty($user->city)) 

          <div class="profile-usertitle-job"> {{ $user->city }}</div>

        @elseif(isset($user->country) && !empty($user->country)) 

          <div class="profile-usertitle-job"> {{ $user->country }}</div>

        @endif    





        @if($user->deleted_at != "0000-00-00 00:00:00" && $user->deleted_at != NULL)

          

        Deleted {{strtotime($user->deleted_at)}}



        @elseif($user->status==1) <span class="badge badge-success">Activated</span> 

        @elseif($user->status==2) <span class="badge badge-danger">Blocked</span> 

        @elseif($user->status==0) <span class="badge badge-warning">Pending</span> 

        @endif

        

      --}}

        

         </div>

            <!-- END SIDEBAR USER TITLE --> 

            <!-- SIDEBAR BUTTONS -->

            <div class="profile-userbuttons">

              <a href="/home/editprofile" class="btn bg-primary-light text-white btn-sm">Edit Info</a>              

            </div>

            <!-- END SIDEBAR BUTTONS --> 

            <!-- SIDEBAR MENU -->

            <div class="profile-usermenu">

              <ul class="nav flex-column"> 

                <li class="nav-item"> <a class="nac-link" href="/home"> <i class="far fa-address-card"></i> Dashboard </a> </li>

        

        @if(!empty($available_token))

          <li class="nav-item"> <a class="nac-link" href="/home/tokenreport"> <i class="fas fa-coins"></i>Token Report</a> </li>          

        @endif

        @if(isset($user) && $user->counter_usage_report == 1)

          <li class="nav-item"> <a href="/home/usagereport" class="nac-link" > <i class="fas fa-chart-area"></i> Total Usage </a> </li>

        @endif

                <li class="nav-item"> <a class="nac-link" href="/home/invoice"> <i class="fas fa-file-invoice-dollar"></i> My Orders </a> </li>

               @if(count($bundle_order)>0)

                <li class="nav-item"> <a class="nac-link" href="/home/bundle_order"> <i class="fas fa-file-invoice-dollar"></i> My Bundle Order </a> </li>

               @endif

               @if(count($rental_order)>0)

                <li class="nav-item"> <a class="nac-link" href="/home/rental_order"> <i class="fas fa-file-invoice-dollar"></i> My rental Order </a> </li>

               @endif

               </ul>

            </div>

            <!-- END MENU --> 

          </div>

        </div>

      </div>



@if($pages=='')    

      <div class="col-md-8 mt-xs-5">

          <h2 class="h4 p-3 bg-dark-light text-primary-light">

              Dashboard

            </h2>

     <div class="row font-18">

    

    @if(!empty($available_token))

           <div class="col-md-6">

            <div class="card bigbox-hvr-slow text-center mt-4">

                <div class="card-body">

                  <a class="card-title text-primary-light" href="/home/tokenreport"><i class="fas fa-coins fa-3x mb-3"></i><br><font color="green">Token Report</font></a>

                </div>

            </div>

          </div>

    @else

      <div class="col-md-6">

            <div class="card bigbox-hvr-slow text-center mt-4">

                <div class="card-body text-primary-light">

                  <i class="fas fa-coins fa-3x mb-3"></i><br><font color="red">Token Not Available</font>

                </div>

            </div>

      </div>

      

    @endif

    @if(isset($user) && $user->counter_usage_report == 1)

          <div class="col-md-6">

            <div class="card bigbox-hvr-slow text-center mt-4">

                <div class="card-body">


                  @if($user_consortia_counter->count() > 0)
                  <a class="card-title  text-primary-light" href="/home/usageconsortiareport">
                  @else
                  <a class="card-title  text-primary-light" href="/home/usagereport">
                  @endif  
                    <i class="fas fa-chart-area fa-3x mb-3"></i><br>Total Usage</a>

                </div>

            </div>

          </div>

    @endif

          <div class="col-md-6">

            <div class="card bigbox-hvr-slow text-center mt-4">

                <div class="card-body">

                  <a class="card-title text-primary-light" href="/home/invoice"><i class="fas fa-file-invoice-dollar fa-3x mb-3"></i><br>My Orders</a>                </div>

            </div>

          </div>



          <div class="col-md-6">

            <div class="card bigbox-hvr-slow text-center mt-4">

                <div class="card-body">

                  <a class="card-title text-primary-light" href="#"><i class="far fa-bell fas fa-coins fa-3x mb-3"></i><br>Promotions</a>

                </div>

            </div>

          </div>

         @if(count($bundle_order)>0)

          <div class="col-md-6">

            <div class="card bigbox-hvr-slow text-center mt-4">

                <div class="card-body">

                  <a class="card-title text-primary-light" href="/home/bundle_order"><i class="fas fa-file-invoice-dollar fa-3x mb-3"></i><br>My Bundle Order</a>                

                </div>

            </div>

          </div>

          @endif



         @if(count($rental_order)>0)

          <div class="col-md-6">

            <div class="card bigbox-hvr-slow text-center mt-4">

                <div class="card-body">

                  <a class="card-title text-primary-light" href="/home/rental_order"><i class="fas fa-file-invoice-dollar fa-3x mb-3"></i><br>My Rental Order</a>                

                </div>

            </div>

          </div>

          @endif



        </div>



    </div>

      

        @elseif($pages=='editprofile')    

          @include('includes.editprofile')        

        @elseif($pages=='invoice')

          @include('includes.invoice')

        @elseif($pages=='tokenreport')

          @include('includes.tokenreport')

        @elseif($pages=='usagereport')

          @include('includes.usagereport')
        @elseif($pages=='usageconsortiareport')
          @include('includes.usageconsortiareport')

        @elseif($pages=='bundle_order')

          @include('includes.bundle_order')

        @elseif($pages=='rental_order')

          @include('includes.rental_order')

        @endif

      </div>

    </div>

   </div>

  </section>

</main>

@stop



{{-- page level scripts --}}

@section('footer_scripts') 

<!-- Bootstrap WYSIHTML5 --> 

<script  src="{{ asset('assets/vendors/jasny-bootstrap/js/jasny-bootstrap.js') }}" type="text/javascript"></script> 

<script>

        $(".select2").select2({

            theme:"bootstrap",

            placeholder:"",

            width: '100%'

        });



        function disabledebook(v,uid){



        

        var journal = ['JR1','JR2','JR5'];

        

        var ebook = ['BR1'];

        var chapter = ['BR2'];

     

            var x = document.getElementById("reporttype");

            for (i = 0; i < x.length; ) { 

                x.remove(x.length -1);

            }

            

            var a;

            if (v=='exportrange1'){

                a = ebook;

            } else if (v=='exportrange2'){

                a = chapter;

            } else if (v=='exportrange3'){

                a = journal;

            }

            for (i = 0; i < a.length; ++i)

             {

                var option = document.createElement("option");

                option.text = a[i];

                if(v=='exportrange1'){

                    option.value = '';

                    option.value = 4;

                    x.add(option);

                }if(v=='exportrange2'){

                    option.value = '';

                    option.value = 5;

                    x.add(option);

                }

                if(v=='exportrange3')

                {

                        option.value = '';

                        if(i==3)

                        {option.value = 6;}

                        else if(i==4)

                        {option.value = 7;}

                        else if(i==5)

                        {option.value = 8;}

                        else{

                                option.value = i+1;

                            }

                            

                        }

                        x.add(option);                  

                }

                 

               // x.document.getElementsByName('counterindividual[reporttype]')[i].value = i;

            }

    </script>

@stop

