@extends('layouts.master')
@section('css')

@endsection
@section('content')



<div class="">

<div class="right_cols" role="main">
  <div class="">
    <div class="row top_tiles">
      <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <div class="tile-stats">
          <div class="icon"><i class="fa fa-sun-o"></i></div>
          <div class="count">{{ $total }}</div>
          <h3 class="" style="color: #53b8e5">Total Clients</h3>
        </div>
      </div>
      <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <div class="tile-stats">
          <div class="icon"><i class="fa fa-comments-o"></i></div>
          <div class="count">{{ $sms }}</div>
          <h3 style="color: #53b8e5">SMS Clients</h3>
          <!-- <p>Lorem ipsum psdea itgum rixt.</p> -->
        </div>
      </div>
      <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <div class="tile-stats">
          <div class="icon"><i class="fa fa-mobile-phone"></i></div>
          <div class="count">{{ $ussd }}</div>
          <h3 style="color: #53b8e5">USSD Client</h3>
          <!-- <p>Lorem ipsum psdea itgum rixt.</p> -->
        </div>
      </div>
      <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <div class="tile-stats">
          <div class="icon"><i class="fa fa-bullhorn"></i></div>
          <div class="count">{{ $voice }}</div>
          <h3 style="color: #53b8e5">Voice Clients</h3>
          <!-- <p>Lorem ipsum psdea itgum rixt.</p> -->
        </div>
      </div>
    </div>
  </div>
</div>


<div class="row">
  <div class="col-md-6">
    <div class="x_panel">
      <div class="x_title">
        <h2>Quotes <small></small></h2>
        <div class="clearfix"></div>
      </div>
      <div class="x_content">
        <div class="row" style="border-bottom: 1px solid #E0E0E0; padding-bottom: 5px; margin-bottom: 5px;">
          <div class="col-md-6" style="overflow:hidden;">
            <span class="sparkline_one" style="height: 160px; padding: 10px 25px;">
                  <blockquote id="dailyQuoteBlock"> ... </blockquote>
                  <p id="authorParagraph"></p>
            </span>
            <h4 style="margin:18px" class="red">Quote of the Day </h4>
          </div>
           <div class="col-md-6" style="overflow:hidden;">
            <span class="sparkline_one" style="height: 160px; padding: 10px 25px;">
                  <blockquote id="dailyQuoteBlock">
                      He my polite be object oh change. Consider no mr am overcame yourself throwing sociable children.
                  </blockquote>
            </span>
            <h4 style="margin:18px" class="blue">Sam Message of the Day </h4>
          </div>

          
        </div>
      </div>
    </div>
  </div>
  <div class="col-md-6">
    <div class="x_panel">
      <div class="x_title">
        <h2>Contract Expiry Notice <small></small></h2>
        <div class="clearfix"></div>
      </div>
      <div class="x_content">
        <div class="row" style="border-bottom: 1px solid #E0E0E0; padding-bottom: 5px; margin-bottom: 5px;">
          <div class="col-md-12">
            <div class="row" style="text-align: center;">
              <div class="col-md-12">
                <h4 class="blue"><u> MNO Contracts</u></h4>
              </div>
              <div class="col-md-4">
                <h5 style="margin:0" class="text-danger">Expired</h5>
                <div class="badge bg-red" style="margin: 5px 10px 10px 0" id="mnoExpired">0</div>
                
              </div>
              <div class="col-md-4">
                <h5 style="margin:0" class="text-warning">Expiring This Month </h5>
                <div class="badge bg-orange" style="margin: 5px 10px 10px 0" id="mnoExpiringThisMonth">0</div>
              </div>
              <div class="col-md-4">
                <!-- <canvas class="canvasDoughnut" height="110" width="110" style="margin: 5px 10px 10px 0"></canvas> -->
                <h5 style="margin:0" class="text-primary">Expiring in 3 months</h5>
                <div class="badge bg-green" style="margin: 5px 10px 10px 0" id="mnoExpiringInThreeMonths">0</div>
                
              </div>
            </div>
            <hr>
            <div class="row" style="text-align: center;">
              <div class="col-md-12">
                <h4 class="blue"><u>Client Contracts</u></h4>
              </div>
              <div class="col-md-4">
                <h5 style="margin:0" class="text-dangers">Expired</h5>
                <div class="badge bg-red" style="margin: 5px 10px 10px 0" id="clientExpired">0</div>
                
              </div>
              <div class="col-md-4">
                    
                <h5 style="margin:0" class="text-warning">Expiring This Month </h5>
                <div class="badge bg-orange" style="margin: 5px 10px 10px 0" id="clientExpiringThisMonth">0</div>
              </div>
              <div class="col-md-4">
                <!-- <canvas class="canvasDoughnut" height="110" width="110" style="margin: 5px 10px 10px 0"></canvas> -->
                <h5 style="margin:0" class="text-primary">Expiring in 3 months</h5>
                <div class="badge bg-green" style="margin: 5px 10px 10px 0" id="clientExpiringInThreeMonths">0</div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="row">
  <div class="col-md-4">
    <div class="x_panel">
      <div class="x_title">
        <h2 class="blue">Recent Activities </h2>

        <div class="clearfix"></div>
      </div>
      <div class="x_content">
         <div class="dashboard-widget-content">
            <ul class="list-unstyled timeline widget">
              @if($user_activities->isEmpty() == false)
              @foreach($user_activities as $userrow)
              <li>
                <div class="block">
                  <div class="block_content">
                    <h2 class="title">
                      <a>{{ $userrow->content }}</a>
                      </h2>
                    <div class="byline">
                      <span>{{ $userrow->activity_time }}</span>
                      <!-- by <a>Jane Smith</a> -->
                    </div>
                    <p class="excerpt"></p>
                  </div>
                </div>
              </li>
              @endforeach
              @endif
            </ul>
          </div>
          <a href="{{ url('reports/useractivities') }}" class="btn btn-link">View More</a>
      </div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="x_panel">
      <div class="x_title">
        <h2 class="blue">Contracts Expiry Dates </h2>

        <div class="clearfix"></div>
      </div>
      <div class="x_content">
        @if($expiring_contracts->isEmpty() == false)
        @foreach($expiring_contracts as $row)
        <article class="media event">
          <a class="pull-left date" style="background-color: #de9a24">

            <p class="month" style="margin-top: -4px; margin-bottom: -4px;">{{ date("M", strtotime($row->contract_validity)) }}</p>
            <p class="day" style="font-size: 22px !important">{{ date("d", strtotime($row->contract_validity)) }}</p>
            <p class="text-center" style="color:#fff; margin-bottom: -4px; margin-top: -4px;">{{ date("Y", strtotime($row->contract_validity)) }}</p>

          </a>
          <div class="media-body">
            <a class="title" title="View Client Details" href="{{ url('clients', $row->id) }}">{{ $row->name }}</a>
            <p class="">Contract Type : {{ strtoupper($row->contract_type) }}</p>
            <p class="">Auto Renew : {{ strtoupper($row->contract_auto_renew) }}</p>

          </div>
        </article>
        @endforeach
        @else
          <article class="media event">
          <a class="pull-left date">
            <p class="month">00</p>
            <p class="day">00</p>
          </a>
          <div class="media-body">
            <a class="title" href="#"></a>
            <p>No Records</p>
          </div>
        </article>
        @endif

      </div>
    </div>
    <div>
          <div class="x_title">
            <h2 class="blue">Upcoming Holidays</h2>
            <div class="clearfix"></div>
          </div>
          <ul class="list-unstyled top_profiles scroll-view">
            @foreach($upcoming_hodidays as $holiday_row)
            <li class="media event">
              <a class="pull-left border-aero profile_thumb">
                <i class="fa fa-cube aero"></i>
              </a>
              <div class="media-body">
                <a class="title" href="#">{{ $holiday_row->name }}</a>
                <p><strong></strong> {{ date("jS, F", strtotime($holiday_row->event_date)) }} </p>
                <p> <small>{{ $holiday_row->country }}</small>
                </p>
              </div>
            </li>
            @endforeach
          </ul>

        </div>
  </div>
  <div class="col-md-4">
    <div class="x_panel">
      <div class="x_title">
        <h2 class="blue">Newly Added Clients</h2>
        <div class="clearfix"></div>
      </div>
      <div class="x_content">
        @if($recent_clients->isEmpty() == false)
        @foreach($recent_clients as $recentrow)
        <article class="media event">
          <a class="pull-left date" style="background-color: #de9a24">

            <p class="month" style="margin-top: -4px; margin-bottom: -4px;">{{ date("M", strtotime($recentrow->created_at)) }}</p>
            <p class="day" style="font-size: 22px !important">{{ date("d", strtotime($recentrow->created_at)) }}</p>
            <p class="text-center" style="color:#fff; margin-bottom: -4px; margin-top: -4px;">{{ date("Y", strtotime($recentrow->created_at)) }}</p>

          </a>
          <div class="media-body">
            <a class="title" title="View Client Details" href="{{ url('clients', $row->id) }}">{{ $recentrow->name }}</a>
            <p class="">Company Type : {{ strtoupper($recentrow->company_type) }}</p>
            <p class="">Account Manager : {{ strtoupper($recentrow->auth_user_info->name) }}</p>
          </div>
        </article>
        @endforeach
        @else
          <article class="media event">
          <a class="pull-left date">
            <p class="month">00</p>
            <p class="day">00</p>
          </a>
          <div class="media-body">
            <a class="title" href="#"></a>
            <p>No Records</p>
          </div>
        </article>
        @endif
      </div>
    </div>
        <div>
          <div class="x_title">
            <h2 class="blue">Upcoming Birthdays</h2>
            <div class="clearfix"></div>
          </div>
          <ul class="list-unstyled top_profiles scroll-view">
            @foreach($upcoming_birthdays as $dobrow)
            <li class="media event">
              <a class="pull-left border-aero profile_thumb">
                <i class="fa fa-user aero"></i>
              </a>
              <div class="media-body">
                <a class="title" href="#">{{ $dobrow->name }}</a>
                <p><strong></strong> {{ date("jS, F", strtotime($dobrow->dob)) }} </p>
                <!-- <p> <small>12 Sales Today</small> -->
                </p>
              </div>
            </li>
            @endforeach
          </ul>

        </div>
  </div>


</div>

</div>
@endsection
@section('javascript')

  <!-- DateJS -->
  <script src="{{ url('public/assets/vendors/DateJS/build/date.js') }}"></script>
  <script src="{{ url('public/assets/js/dashboard.js') }}"></script>
@endsection