



@extends('user.user_dashboard_link')
@section('content')
 <!-- Page Wrapper -->
 <div id="wrapper">

    @include('user.user_dashboard_sidebar')

      <!-- Content Wrapper -->
      <div id="content-wrapper" class="d-flex flex-column">

          <!-- Main Content -->
          <div id="content">

              <!-- Topbar -->
              <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">

                  <!-- Sidebar Toggle (Topbar) -->
                  <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
                      <i class="fa fa-bars"></i>
                  </button>

               

                  <!-- Topbar Navbar -->
                  <ul class="navbar-nav ml-auto">

                
                     

                      <div class="topbar-divider d-none d-sm-block"></div>

                      <!-- Nav Item - User Information -->
                      <li class="nav-item dropdown no-arrow">
                          <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button"
                              data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                              <span class="mr-2 d-none d-lg-inline text-gray-600 small">
                                  @if(Auth::guard('user_login')->check())
                                  {{Auth::guard('user_login')->user()->name}}
                                  @endif
                              </span>
                              {{-- <img class="img-profile rounded-circle"
                                  src="img/undraw_profile.svg"> --}}
                          </a>
                          <!-- Dropdown - User Information -->
                          <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
                              aria-labelledby="userDropdown">
                              {{-- <a class="dropdown-item" href="#">
                                  <i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>
                                  Profile
                              </a> --}}
                             
                              <div class="dropdown-divider"></div>
                              <a class="dropdown-item" href="" data-toggle="modal" data-target="#logoutModal">
                                  <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                                  Logout
                              </a>
                          </div>
                      </li>

                  </ul>

              </nav>
              <!-- End of Topbar -->

              <!-- Begin Page Content -->
              <div class="container-fluid">
                <div class="col-sm-4 mb-5">
                    <div class="card ">
                        <div class="card-header bg-primary text-white">
                            {{-- 'total_secon_lvl'=>$total_secon_lvl,
                            'total_re'=>$total_re, --}}
                            <h3>Total:{{$total_secon_lvl}} $</h3>
                            <h3>Withdraw : {{$total_re}} $</h3>
                            <h3>Rest Of The Money : {{$total_secon_lvl}} - {{$total_re}} == {{$total_secon_lvl-$total_re}}</h3>
                        </div>
                    </div>
                </div>
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-header">
                            <h3>Daily Second Level Commission [Username: {{Auth::guard('user_login')->user()->name}}]</h3>
                        </div>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table table-striped">
                                    <tr>
                                        <th>Serial</th>
                                        <th>First Level Username</th>
                                        <th>Second Level Username</th>
                                        <th>Second Level User's Daily Profit</th>
                                        <th>Second Level Commision Percentage</th>
                                        <th>Second Level Commision After Percentage</th>
                                        <th>Second Level Created At</th>
                                    </tr>
                                    @if($second_level)
                                    @forelse($second_level as $key=>$daily_second_lvl)
                                    <tr class="text-center">
                                        <td>{{$key+1}}</td>
                                        <td>{{$daily_second_lvl->rel_to_first_level_user->name}}</td>
                                        <td>{{$daily_second_lvl->rel_to_secend_level_user->name}}</td>
                                        <td>{{$daily_second_lvl->seceond_level_daily_profit_ammount}}$</td>
                                        <td>{{$daily_second_lvl->seceond_level_commission_percentage}}%</td>
                                        <td>{{$daily_second_lvl->seceond_level_commission_ammount_after_per}}$</td>
                                        <td>{{$daily_second_lvl->seceond_level_created_at}}$</td>
                                       
                                        {{-- <td>{{$daily_second_lvl->rel_to_first_level_user->Refer_id}}</td>
                                        <td>{{$daily_first_lvl->first_level_daily_profit_ammount}} TK</td>
                                        <td>{{$daily_first_lvl->fist_level_commission_percentage}} %</td>
                                        <td>{{$daily_first_lvl->fist_level_commission_ammount_after_per}} TK</td>
                                        <td>{{$daily_first_lvl->first_level_created_at}}</td>
                                    </tr> --}}
                                    @empty
                                    Sorry
                                    @endforelse
                                    @else
                                    Sorry 
                                    @endif
                                
                                </table>
                            </div>
                          
                        </div>
                    </div>
                   
                </div>

          <!-- End of Main Content -->
              </div>
          <!-- Footer -->
          {{-- <footer class="sticky-footer bg-white">
              <div class="container my-auto">
                  <div class="copyright text-center my-auto">
                    <span>Copyright &copy; SOFTTECH</span>
                  </div>
              </div>
          </footer> --}}
        
          <!-- End of Footer -->

      </div>
      <!-- End of Content Wrapper -->

  </div>
  <!-- End of Page Wrapper -->

  <!-- Scroll to Top Button-->
  <a class="scroll-to-top rounded" href="#page-top">
      <i class="fas fa-angle-up"></i>
  </a>

  <!-- Logout Modal-->
  <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
      aria-hidden="true">
      <div class="modal-dialog" role="document">
          <div class="modal-content">
              <div class="modal-header">
                  <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
                  <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                      <span aria-hidden="true">×</span>
                  </button>
              </div>
              <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
              <div class="modal-footer">
                  <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
                  <a class="btn btn-primary" href="{{route('logout')}}">Logout</a>
              </div>
          </div>
      </div>
  </div>
@endsection

   



    