<body>

    <!--search-->
    <!-- <div class="fixed_search">
        <form class="form">
            <div class="row">
                <div class="col-md-5">
                    <div class="form-group">
                        <select class="form-control">
                            <option value="1">بحث عام </option>
                            <option value="2">بحث برقم الهانجر </option>
                        </select>
                    </div>
                </div>
                <div class="col-md-7">
                    <div class="form-group">
                        <button><i class="fas fa-search"></i></button>
                        <input type="text" class="form-control" placeholder=" كلمه البحث ... ">
                    </div>
                </div>
            </div>
        </form>
        <span class="cls">
        <i class="far fa-times-circle"></i>
    </span>
    </div> -->
    <!-- -------------- navbar --------------- -->
    <nav class="navbar navbar-expand-lg">
        <div class="container-fluid">
            <div class="row w-100 valign">
                <div class="col-lg-4">
                    <a class="navbar-brand" href="{{url(getCurrentLocale().'/')}}">
                        <img src="{{url('')}}/assets/web/images/logo.png" alt="">
                    </a>
                    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                        <!-- <span class="navbar-toggler-icon"></span> -->
                        <div id="nav-icon2" class="">
                          <span></span>
                          <span></span>
                          <span></span>
                          <span></span>
                          <span></span>
                          <span></span>
                      </div>
                      </button>
                    <a href="{{url(getCurrentLocale().'/item')}}" class="sections_btn">
                        <img src="{{url('')}}/assets/web/images/icons/1.svg" alt=""> {{__('web.categories')}}
                    </a>
                   @if(getCurrentLocale() == 'ar')
                    <a href="{{LaravelLocalization::getLocalizedUrl('en')}}" class="m-4 font-weight-bold"> EN <i class="fas fa-globe-americas"></i> </a>
                    @else 
                    <a href="{{LaravelLocalization::getLocalizedUrl('ar')}}" class="m-4 font-weight-bold"> عربية <i class="fas fa-globe-americas"></i> </a>
                    @endif
                </div>
                <div class="col-lg-5">
                    <div class="collapse navbar-collapse justify-content-center" id="navbarNav">
                        <ul class="navbar-nav">
                            <li class="nav-item active">
                                <a class="nav-link" href="{{url(getCurrentLocale().'/')}}">{{__('web.home')}}</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="{{url(getCurrentLocale().'/contactus')}}">{{__('web.contactus')}} </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="{{url(getCurrentLocale().'/aboutus')}}">{{__('web.aboutus')}} </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="{{url(getCurrentLocale().'/package')}}">{{__('web.hanqrs')}}</a>
                            </li>
                            @if(\Auth::user())
                            <li class="nav-item">
                                <a class="nav-link" href="{{url(getCurrentLocale().'/item/create')}}">{{__('web.add_ad')}} </a>
                            </li>
                            
                            @endif
                        </ul>
                    </div>
                </div>
                <div class="col-lg-3 text-right">
                    <div class="login_user d-flex justify-content-between">
                        @if(\Auth::user())
                         <a href="{{url(getCurrentLocale().'/profile')}}" class="u_img text-center">
                             <img src="{{asset(\Auth::user()->photo)}}" alt="">
                             <strong class="text-dark d-block">{{\Auth::user()->name}} </strong>
                         </a>
                        <div class="">
                            <div class="dropdown show">
                            <a href="#" class="bell dropdown-toggle" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fas fa-bell"></i></a>
                            <div class="dropdown-menu" aria-labelledby="dropdownMenuLink" id="notifi">
                               
                                
                                <span class="arrow-up"></span>
                            </div>
                        </div>
                        </div>
                         <div class="login_btns">
                            <a href="{{url(getCurrentLocale().'/logout')}}"><span>{{__('web.logout')}} </span></a>
                        </div>
                        @else
                        <div class="login_btns">
                            <a href="{{url(getCurrentLocale().'/login')}}"><span>{{__('web.login')}} </span></a>
                            <a href="{{url(getCurrentLocale().'/regist')}}"><span> {{__('web.regist')}}</span></a>
                        </div>
                        @endif
                        <div class="dropdown show login_btns">
                            <a class="search_link dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <i class="fas fa-search"></i>
                            </a>
                            <div class="dropdown-menu search_drop" aria-labelledby="dropdownMenuLink">
                                <form method="GET" action="{{url(getCurrentLocale().'/search')}}" class="form-row">
                                    
                                    <div class="form-group col-12">
                                        <select name="type" class="form-control">
                                            <option value="search">{{__('web.searchall')}}  </option>
                                            <option value="hangr">{{__('web.searchhanqr')}}   </option>
                                            <option value="hashtags">{{__('web.searchtag')}}   </option>
                                        </select>
                                    </div>
                                    <div class="form-group m-0 col-12">
                                        <div class="form-group">
                                            <button><i class="fas fa-search"></i></button>
                                            <input name="search" type="text" class="form-control" placeholder="{{__('web.searchword')}}">
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </nav>
    @if(\Auth::user())
     @push('js')
 
  <!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/8.2.9/firebase-app.js"></script>

<!-- TODO: Add SDKs for Firebase products that you want to use
     https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="https://www.gstatic.com/firebasejs/8.2.9/firebase-database.js"></script>

<script>
  // Your web app's Firebase configuration
  // For Firebase JS SDK v7.20.0 and later, measurementId is optional
 var firebaseConfig = {
    apiKey: "AIzaSyD8Ch76IgLgWYeBfVVu_bZVAfg7yaHGjo0",
    authDomain: "alhanger-22dac.firebaseapp.com",
    databaseURL: "https://alhanger-22dac-default-rtdb.firebaseio.com",
    projectId: "alhanger-22dac",
    storageBucket: "alhanger-22dac.appspot.com",
    messagingSenderId: "174330748086",
    appId: "1:174330748086:web:f5bf676633f133442d1a17",
    measurementId: "G-VZBX4HRHS3"
  };
  // Initialize Firebase
  firebase.initializeApp(firebaseConfig);
   var channel = 'notification'+{!! \Auth::user()->id !!}
     
       firebase.database().ref(channel).ref.once("value").then(function(snapshot) {
        
     $('#spanval').text(snapshot.numChildren());
     
  });
 
      
     
  
  var channel = 'notification'+{!! \Auth::user()->id !!}
      
 
   
  
   firebase.database().ref(channel).on("child_added",function (snapshot){
  
      
      
        $.ajax({
          url : {!! json_encode(url(getCurrentLocale().'/notificationmenu/'.\Auth::user()->id)) !!},
          type: 'GET',              
          data: 'dataform', 
          success: function(data)
          {
       
      $('#notifi').html(data); 
}
 }); 
     
         
  }); 
   </script>
   @endpush
   @endif