<?php include_once 'header.php';?>

<!-- Small boxes (Stat box) -->
<div class="row">
  <div class="col-md-3">
    <div class="card card-stats">
      <div class="card-header card-header-warning card-header-icon">
        <div class="card-icon">
          <i class="material-icons">chat</i>
        </div>
        <p class="card-category"><?php echo $jkl["stat_s25"];?></p>
        <h3 class="card-title"><?php echo $sessCtotal;?></h3>
      </div>
      <div class="card-footer">
      </div>
    </div>
  </div>
  <div class="col-md-3">
    <div class="card card-stats">
      <div class="card-header card-header-rose card-header-icon">
        <div class="card-icon">
          <i class="material-icons">drafts</i>
        </div>
        <p class="card-category"><?php echo $jkl["stat_s26"];?></p>
        <h3 class="card-title"><?php echo $commCtotal;?></h3>
      </div>
      <div class="card-footer">
      </div>
    </div>
  </div>
  <div class="col-md-3">
    <div class="card card-stats">
      <div class="card-header card-header-info card-header-icon">
        <div class="card-icon">
          <i class="material-icons">feedback</i>
        </div>
        <p class="card-category"><?php echo $jkl["stat_s10"];?></p>
        <h3 class="card-title"><?php echo $statsCtotal;?></h3>
      </div>
      <div class="card-footer">
      </div>
    </div>
  </div>
  <div class="col-md-3">
    <div class="card card-stats">
      <div class="card-header card-header-primary card-header-icon">
        <div class="card-icon">
          <i class="material-icons">people</i>
        </div>
        <p class="card-category"><?php echo $jkl["stat_s27"];?></p>
        <h3 class="card-title"><?php echo $visitCtotal;?></h3>
      </div>
      <div class="card-footer">
      </div>
    </div>
  </div>
</div>

<?php if (JAK_SHOW_IPS) { ?>
  <div class="row">
    <div class="col-md-12">
      <div class="card">
        <div class="card-header card-header-icon card-header-rose">
          <div class="card-icon">
            <i class="material-icons">location_on</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["stat_s"];?></h4>
        </div>
        <div class="card-body">
          <div id="map_canvas"></div>
        </div>
      </div>
    </div>
  </div>
<?php } ?>

<h4><?php echo $jkl["stat_s3"];?></h4>
<form id="jak_statform" method="post" action="<?php echo $_SERVER['REQUEST_URI'];?>">
  <div class="row">
   <div class="col-md-6">
    <?php if (isset($JAK_DEPARTMENTS) && !empty($JAK_DEPARTMENTS)) { ?>
      <select name="jak_depid" id="jak_depid" class="selectpicker col-12" data-live-search="true">

        <option value="0"<?php if (isset($_POST["jak_depid"]) && $_POST["jak_depid"] == '0') { ?> selected="selected"<?php } ?>><?php echo $jkl["g105"];?></option>

        <?php foreach($JAK_DEPARTMENTS as $v) { ?>

          <option value="<?php echo $v["id"];?>"<?php if (isset($_POST["jak_depid"]) && $_POST["jak_depid"] == $v["id"]) { ?> selected="selected"<?php } ?>><?php echo $v["title"];?></option>

        <?php } ?>
      </select>
    <?php } ?>
    <input type="hidden" name="start_date" id="start_date" value="<?php if (isset($_SESSION["stat_start_date"])) echo $_SESSION["stat_start_date"];?>">
    <input type="hidden" name="end_date" id="end_date" value="<?php if (isset($_SESSION["stat_end_date"])) echo $_SESSION["stat_end_date"];?>">
  </div>
  <div class="col-md-6">
    <div id="reportrange" class="pull-right">
      <i class="fa fa-calendar fa-lg"></i>
      <span><?php echo date("F j, Y", strtotime($_SESSION["stat_start_date"]));?> - <?php echo date("F j, Y", strtotime($_SESSION["stat_end_date"]));?></span>
    </div>
  </div>
</div>
</form>
<hr>

<div class="row">
  <div class="col-md-6">
    
    <div id="chart_operator" style="width: 100%; height: 300px; margin-right: 20px;"></div>
    
  </div>
  
  <div class="col-md-6">
    
    <div id="chart_feedback" style=";width: 100%; height: 300px;"></div>
    
  </div>

</div>

<h4 class="mt-3"><?php echo $jkl["m10"];?></h4>
<div class="row">
  <div class="col-md-6">
    
    <div id="chart" style="width: 100%; height: 300px; margin-right: 20px;"></div>
    
  </div>
  
  <div class="col-md-6">
    
    <div id="chart2" style=";width: 100%; height: 300px;"></div>
    
  </div>

</div>

<?php include_once 'footer.php';?>
