@extends('master')
@section('content')
    {{-- <x-slot name="header">
        <h2 class="font-semibold text-xl text-gray-800 leading-tight">
            {{ __('Dashboard') }}
        </h2>
    </x-slot> --}}

            @if (session()->has('message'))
                <div class="alert alert-icon-right alert-success alert-dismissible mt-2" role="alert">
                    <span class="alert-icon">
                        <i class="la la-info"></i>
                    </span>
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                    <strong>{{ session('message') }}</strong>
                </div>
            @endif
    <section class="banner">
    <div class="container">
      <div class="row">
        <div class="col-12 col-sm-10">
          <h1>BGP Oman - Online HSE Management System</h1>
          <p>Health, Safety & the Environment (HSE) - The Protection and effective management of Health and Safety of our employees & the Environment has always been & will continue to be one of BGP Oman's highest priorities in its operations</p>
        </div>
      </div>
    </div>
  </section>
  <section class="catergories">
    <div class="container">
      <div class="row">
        <div class="col-12">
          <div class="d-flex flex-wrap justify-content-center">
            @if(isset($categories) && !empty($categories))
            @foreach($categories as $category)
            <a class="category-item" href="{{url('datarepository?categoryid='.$category->id)}}">
              <span>
              @if(($category->logo_image_path != ''))  
                <img src="{{$path.$category->logo_image_path}}" alt="">
              @else
                <img src="{{ asset('img/frontend/default-category.svg') }}" alt="">
              @endif  
              </span>
              <p>{{$category->categoryname}}</p>
              @if($category->bg_image_path != '')
              <img class="fixed-category-img" src="{{$path.$category->bg_image_path}}" alt="">
              @else
              <img class="fixed-category-img" src="{{ asset('img/frontend/bg-image.png') }}" alt="">
              @endif
            </a>
            @endforeach
            @endif
            <a class="category-item" href="{{url('datarepository')}}">
              <span>
                <img src="{{ asset('img/frontend/category-icons/kebab-icon.svg') }}" alt="">
              </span>
              <p>MORE</p>
            </a>
          </div>
        </div>
      </div>
    </div>
  </section>
  <section class="information">
    <div class="container">
      <div class="row">
        <div class="col-12">
          <h2>Information on Health, Safety, Environment</h2>
          <p>BGP, as a member of the International Association of Geophysical Contractors, is dedicated to ensuring the
            standards contained in this organization. In addition, in seeking contract with energy companies, we
            consistently makes every effort to apply and adhere to the guidelines of the International Association of
            Oil and Gas Producers in the development and application of its Health, Safety and Environmental Management
            System.</p>
          </div>
        </div>
      </div>
    </section>

    <section class="home-news text-left">
      <div class="container position-relative">
        <!-- <div class="latestAlert"><span>?</span></div> -->
        <div class="row">
          <div class="col-12 col-sm-12 col-md-8 col-lg-9 mb-5 mb-sm-0">

            <!-- News block repeating item starts-->
            @forelse ($quicklinks as $quicklink)
            <div class="row mb-5">
              <div class="col-12 pr-sm-0 pr-md-5">
                <div class="row">
                  <div class="col-12 col-md-12 col-sm-6 col-lg-5 col-xl-4">
                    <div class="news-list-img-wrap">
                      @if($quicklink->image_path != '')
                        <img src="{{$path.$quicklink->image_path}}" alt="">
                      @else
                        <img src="{{ asset('img/frontend/news-img.png') }}" alt="">
                      @endif
                    </div>
                  </div>
                  <div class="col-12 col-sm-6 col-md-12 col-lg-7 col-xl-8 pt-3">
                    <h3 class="text-truncate">{{$quicklink->title}} </h3>
                    <p>{!!substr( $quicklink->description,0,400) !!} @if(strlen ( $quicklink->description) > 400) ... @endif</p>
                      <a href="{{url('quicklinks')}}" class="btn-link">Read More</a>
                    </div>
                  </div>
                </div>
              </div>
              @empty
              <div class="col-12 pt-3">
                <div class="no-data mb-4">
                  <i class="fas fa-exclamation-triangle"></i>
                  <h5>No records found</h5>
                </div>
              </div>
              @endforelse
              <!-- News block repeating item ends-->

              </div>
              <div class="col-12 col-sm-12 col-md-4 col-lg-3 left-border">
                @if(!empty($news))
                <h4>Latest News & Development</h4>

                <div class="row">
                  <!-- sidelist start -->
                  @foreach($news as $newslist)
                  <div class="col-12 col-sm-6 col-md-12 mb-4">
                    <div class="list-img-wrap">
                      @if($newslist->image_path != '')
                        <img src="{{$path.$newslist->image_path}}" alt="">
                      @else
                        <img src="{{ asset('img/frontend/news.jpg') }}" alt="">
                      @endif 
                    </div>
                    <p class="mb-1">{{$newslist->title}}</p>
                    <a href="{{url('newsdetails/'.$newslist->id)}}" class="btn-link">Read More</a>
                  </div>
                  @endforeach
                  <!-- sidelist end -->

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