<section class="user_dashboard pt-2">
    
        <div class="container">
			@if ($message = Session::get('success'))
			<div class="alert alert-success alert-dismissable">
			  <button type="button" class="close" data-dismiss="alert">×</button>
			  <p>{{ $message }}</p>
			</div>
			@endif
            <div class="row">
                @if(file_exists( public_path().'/images/institute/'.Auth::user()->institution_id.'.jpg' ))
                <div class="col-md-8 mx-auto text-center my-2">
                    <img src="/images/institute/{{Auth::user()->institution_id}}.jpg" class="img-fluid">
                </div>
                @endif
                <div class="col-12 mb-2">
                    <div class="d-flex justify-content-between align-items-center border-bottom bg-light rounded shadow-sm p-2">
                        <h3 class="mb-0">@if(empty($pages)) Dashboard @endif</h3>
                        <div class=" bg-white">
                            <span role="button" class="nav-link nav-profile d-flex align-items-center p-0"
                                data-bs-toggle="dropdown">

                            
                                <span class="dropdown-toggle ps-2 text-dark">
                                @if( (isset(Auth::user()->first_name) && !empty(Auth::user()->first_name)) || (isset(Auth::user()->last_name) && !empty(Auth::user()->last_name)))
                                  {{ Auth::user()->first_name }} {{ Auth::user()->last_name }}
                                @elseif(isset(Auth::user()->display_name) && !empty(Auth::user()->display_name))
                                  {{ Auth::user()->display_name }}
                                @endif
                                </span>
                            </span><!-- End Profile Iamge Icon -->

                            <ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow profile">

                                <li>
                                  <a class="dropdown-item" href="/home"><i class="far fa-address-card mr-2"></i> Dashboard</a>
                                </li>

                                  @if(!empty($available_token))
                                  <li>
                                      <hr class="dropdown-divider">
                                  </li>
                                  <a class="dropdown-item" href="/home/tokenreport"><i class="fas fa-coins mr-2"></i> Token Report</a>
                                  @endif

                                  @if(isset($user) && $user->counter_usage_report == 1)
                                  <li>
                                      <hr class="dropdown-divider">
                                  </li>
                                  @if($user_consortia_counter->count() > 0)

                                    <a class="dropdown-item" href="/home/usageconsortiareport"><i class="fas fa-coins mr-2"></i>

                                  @else
                                    <a class="dropdown-item" href="/home/usagereport"><i class="fas fa-coins mr-2"></i>
                                  @endif
                                     Usage / Denials</a>
                                  @endif
<!-- 
                                <li>
                                    <hr class="dropdown-divider">
                                </li>
                                <li>
                                   <a class="dropdown-item" href="/home/invoice"> <i class="fa-solid fa-box mr-2"></i> My Orders </a>
                                </li>
                                
 -->                                 @if($user_consortia_counter->count() > 0)
                                <li>
                                    <hr class="dropdown-divider">
                                </li>
                                <li>
                                   <a class="dropdown-item" href="/home/registeredips"> <i class="fa-solid fa-grip-vertical mr-2"></i> User Registered IP Addresses </a>
                                </li>
                                <li>
                                    <hr class="dropdown-divider">
                                </li>
                                <li>
                                   <a class="dropdown-item" href="/home/susbscribed_content"> 
                                   @if($member_admin)
                                    <i class="fa-solid fa-book-open-reader mr-2"></i> Institution(s) - Contents Subscribed </a>
                                   @else
                                    <i class="fa-solid fa-book-open-reader mr-2"></i> Contents Subscribed </a>
                                   @endif
                                </li>
                                <li>
                                    <hr class="dropdown-divider">
                                </li>
                                <li>
                                   <a class="dropdown-item" href="/member"> 
                                   @if($member_admin)
                                    <i class="fa-solid fa-file-lines mr-2"></i> Submissions </a>
                                   @else
                                    <i class="fa-solid fa-file-lines mr-2"></i> My Submissions </a>
                                   @endif

                                </li>
                                @endif
								
								<li>
									<hr class="dropdown-divider">
								</li>

								<li>
									<a class="dropdown-item" href="/home/support">
									<i class="fa-solid fa-headset mr-2"></i> Support </a>
								</li>

                               @if(count($bundle_order)>0)
<!--                                 
                                <li>
                                  <hr class="dropdown-divider">
                                </li>

                                  <a class="dropdown-item" href="/home/bundle_order"><i class="fa-solid fa-book mr-2"></i> My Bundle Order</a>

 -->                               @endif

                               @if(count($rental_order)>0)
<!-- 
                                <li>
                                  <hr class="dropdown-divider">
                                </li>

                                  <a class="dropdown-item" href="/home/rental_order"><i class="fa-solid fa-stopwatch-20 mr-2"></i> My rental Order</a>
                               
 -->                               @endif
                                <li>
                                  <hr class="dropdown-divider">
                                </li>
                            </ul><!-- End Profile Dropdown Items -->
                        </div>
                    </div>
                </div>
            
            
            <style type="text/css">
            .row .col-md-8.mt-xs-5{
                max-width: 100% !important;
                flex: 100%;
            }
         </style>
        
@if($pages=='')
    
           <div class="col-md-4 mt-4">
                @if($member_admin)  
                        <a href="/home/susbscribed_content" class="card card-body p-4 hvr-shadow hvr-icon-wobble-vertical d-block text-center">
                     @else
                        <a href="/home/susbscribed_content" class="card card-body p-4 hvr-shadow hvr-icon-wobble-vertical d-block text-center">
                     @endif 
                    <div class="icon-box subscribe">
                        <i class="hvr-icon far fa-bell"></i>
                    </div>
                    <h5 class="mt-4 discription text-dark">
                     @if($member_admin)  
                        Institution(s) - Contents Subscribed
                     @else
                        Contents Subscribed 
                     @endif   
                    </h5>
                </a>
           </div>
           <div class="col-md-4 mt-4">
                <a href="/home/usageconsortiareport" class="card card-body p-4 hvr-shadow hvr-icon-wobble-vertical d-block text-center">
                    <div class="icon-box token">
                        <i class="hvr-icon fas fa-coins"></i>
                    </div>
                    <h5 class="mt-4 discription text-dark">
                        Usage / Denials
                    </h5>
                </a>
           </div>
<!--            <div class="col-md-4 mt-4">
                <a href="" class="card card-body p-4 hvr-shadow hvr-icon-wobble-vertical d-block text-center">
                    <div class="icon-box order">
                        <i class="hvr-icon fa-solid fa-box"></i>
                    </div>
                    <h5 class="mt-4 discription text-dark">
                        <a href="/home/invoice">My Order</a>
                    </h5>
                </a>
           </div>
 -->
           <div class="col-md-4 mt-4">
                <a href="/home/registeredips" class="card card-body p-4 hvr-shadow hvr-icon-wobble-vertical d-block text-center">
                    <div class="icon-box ip">
                        <i class="hvr-icon fa fa-bars"></i>
                    </div>
                    <h5 class="mt-4 discription text-dark">
                        Registered IP Addresses
                    </h5>
                </a>
           </div>
           <div class="col-md-4 mt-4">
                @if($member_admin)  
                    <a href="/member" class="card card-body p-4 hvr-shadow hvr-icon-wobble-vertical d-block text-center">
                 @else
                    <a href="/member" class="card card-body p-4 hvr-shadow hvr-icon-wobble-vertical d-block text-center">
                 @endif  
                
                    <div class="icon-box submissions">
                        <i class="hvr-icon fa fa-book"></i>
                    </div>
                    <h5 class="mt-4 discription text-dark">
                     @if($member_admin)  
                        Submissions
                     @else
                        My Submissions
                     @endif   
                    </h5>
                </a>
            </div>
			<div class="col-md-4 mt-4">
                <a href="/home/support" class="card card-body p-4 hvr-shadow hvr-icon-wobble-vertical d-block text-center">
                    <div class="icon-box ip">
                        <i class="fa-solid fa-headset"></i>
                    </div>
                    <h5 class="mt-4 discription text-dark">
                        Support
                    </h5>
                </a>
           </div>
		  </div>

    <!-- graph -->

<!--        <div class="col-md-12 mt-4">
                <div class="card p-4 shadow text-center">
                    <h4 class="border-bottom mb-3 pb-3">Customer Content Details</h4>
                    <div id="basic_column_chart"></div>
                </div>
            </div>

 -->       

        
    
    <!-- graph -->

        @elseif($pages=='editprofile')

 
          @include('includes.editprofile')

        @elseif($pages=='invoice')

          @include('includes.invoice')

        @elseif($pages=='tokenreport')

          @include('includes.tokenreport')

        @elseif($pages=='usagereport')
          @if($user->counter_usage_report == 1)
            @include('includes.usagereport-R'.$user->counter_report_type)
          @endif

        @elseif($pages=='usageconsortiareport')

          @include('includes.usageconsortiareport')

        @elseif($pages=='bundle_order')

          @include('includes.bundle_order')

        @elseif($pages=='rental_order')

          @include('includes.rental_order')

        @elseif($pages=='registeredips')

          @include('includes.registeredips')

        @elseif($pages=='susbscribed_content')

          @include('includes.susbscribed_content')

        @elseif($pages=='view_submissions')

          @include('includes.view_submissions')
		  
		@elseif($pages=='support')

		  @include('includes.support')

    
        @endif
    </div>
    </div>
</section>

