<?php
/*
 * Copyright (c) 2018 Earworks.
 * Codeigniter Project Template Modification
 * Please contact our email for more information :
 * contact@earworks.co.id
 */
defined('BASEPATH') or exit('No direct script access allowed');
$this->load->title = 'Dashboard';
$this->load->add_js("assets/plugins/counterup/jquery.waypoints.min.js");
$this->load->add_js("assets/plugins/counterup/jquery.counterup.min.js");
?>
<div class="row">
    <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <a class="dashboard-stat dashboard-stat-v2 green" href="<?php echo base_url('backoffice/register/lists') ?>">
            <div class="visual">
                <i class="fa fa-sign-in"></i>
            </div>
            <div class="details">
                <div class="number">
                    <span data-counter="counterup" data-value="<?php echo $register ?>">0</span>
                </div>
                <div class="desc"> Total Register </div>
            </div>
        </a>
    </div>
    <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <a class="dashboard-stat dashboard-stat-v2 blue" href="<?php echo base_url('backoffice/register/lists') ?>">
            <div class="visual">
                <i class="fa fa-bus"></i>
            </div>
            <div class="details">
                <div class="number">
                    <span data-counter="counterup" data-value="<?php echo $offroad ?>">0</span>
                </div>
                <div class="desc"> Total Offroad Test </div>
            </div>
        </a>
    </div>
</div>
<div class="row">
    <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <a class="dashboard-stat dashboard-stat-v2 red" href="javascript:void(0)">
            <div class="visual">
                <i class="fa fa-user-secret"></i>
            </div>
            <div class="details">
                <div class="number">
                    <span data-counter="counterup" data-value="<?php echo $admin ?>">0</span>
                </div>
                <div class="desc"> Administrator </div>
            </div>
        </a>
    </div>
    <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <a class="dashboard-stat dashboard-stat-v2 yellow" href="javascript:void(0)">
            <div class="visual">
                <i class="fa fa-users"></i>
            </div>
            <div class="details">
                <div class="number">
                    <span data-counter="counterup" data-value="<?php echo $u_register ?>">0</span>
                </div>
                <div class="desc"> Usher Register </div>
            </div>
        </a>
    </div>
    <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <a class="dashboard-stat dashboard-stat-v2 blue" href="javascript:void(0)">
            <div class="visual">
                <i class="fa fa-user"></i>
            </div>
            <div class="details">
                <div class="number">
                    <span data-counter="counterup" data-value="<?php echo $u_testride ?>">0</span>
                </div>
                <div class="desc"> Usher Test Ride </div>
            </div>
        </a>
    </div>
<!--    <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
        <a class="dashboard-stat dashboard-stat-v2 grey" href="<?php echo base_url('backoffice/dashboard') ?>">
            <div class="visual">
                <i class="fa fa-user-md"></i>
            </div>
            <div class="details">
                <div class="number">
                    <span data-counter="counterup" data-value="<?php echo $u_testdrive ?>">0</span>
                </div>
                <div class="desc"> Usher Test Drive </div>
            </div>
        </a>
    </div>-->
</div>
<?php
/*
  $js_data = '[';
  foreach ($data['visitors_detail'] as $res) {
  $js_data .= '[\'' . date('d/m/Y', $res['created']) . '\', ' . $res['visitorscount'] . '],';
  }
  $js_data .= ']';
  $this->load->add_js(<<<EOD
  var visitors = {$js_data};
  if ($('#site_statistics').size() != 0) {

  $('#site_statistics_loading').hide();
  $('#site_statistics_content').show();

  var plot_statistics = $.plot($("#site_statistics"), [{
  data: visitors,
  lines: {
  fill: 0.6,
  lineWidth: 0
  },
  color: ['#f89f9f']
  }, {
  data: visitors,
  points: {
  show: true,
  fill: true,
  radius: 5,
  fillColor: "#f89f9f",
  lineWidth: 3
  },
  color: '#fff',
  shadowSize: 0
  }],

  {
  xaxis: {
  tickLength: 0,
  tickDecimals: 0,
  mode: "categories",
  min: 0,
  font: {
  lineHeight: 14,
  style: "normal",
  variant: "small-caps",
  color: "#6F7B8A"
  }
  },
  yaxis: {
  ticks: 5,
  tickDecimals: 0,
  tickColor: "#eee",
  font: {
  lineHeight: 14,
  style: "normal",
  variant: "small-caps",
  color: "#6F7B8A"
  }
  },
  grid: {
  hoverable: true,
  clickable: true,
  tickColor: "#eee",
  borderColor: "#eee",
  borderWidth: 1
  }
  });

  var previousPoint = null;
  $("#site_statistics").bind("plothover", function(event, pos, item) {
  $("#x").text(pos.x.toFixed(2));
  $("#y").text(pos.y.toFixed(2));
  if (item) {
  if (previousPoint != item.dataIndex) {
  previousPoint = item.dataIndex;

  $("#tooltip").remove();
  var x = item.datapoint[0].toFixed(2),
  y = item.datapoint[1].toFixed(2);

  showChartTooltip(item.pageX, item.pageY, item.datapoint[0], item.datapoint[1] + ' visits');
  }
  } else {
  $("#tooltip").remove();
  previousPoint = null;
  }
  });
  }

  EOD
  , 'embed');
 */?>