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

<?php if (JAK_HOLIDAY_MODE != 0) { ?>

<div class="alert alert-danger"><i class="fa fa-exclamation-triangle"></i> <?php echo $jkl["g303"];?> (<?php echo (JAK_HOLIDAY_MODE == 1 ? $jkl["g1"] : $jkl["g305"]);?>)</div>

<?php } if (!empty($sett["welcomedash"])) { ?>

<div class="row">
  <div class="col-md-12">
    <div class="card">
      <div class="card-body">
        <?php $trans = array("{{business}}" => (JAK_WILDCARD_SUBDOMAIN ? "https://".$jakosub['business'].".".FULL_SITE_DOMAIN : str_replace(JAK_OPERATOR_LOC."/", "", JAK_rewrite::jakParseurl('bs', $jakosub['business']))));
        echo strtr($sett["welcomedash"], $trans);?>
      </div>
    </div>
  </div>
</div>

<?php } if (isset($gcarray) && !empty($gcarray)) { ?>
<div class="row">
  <div class="col-md-12">
    <div class="card">
      <div class="card-header">
        <h3 class="card-title"><i class="fa fa-users"></i> <?php echo $jkl["m29"];?></h3>
      </div><!-- /.box-header -->
      <div class="card-body">
        <?php foreach ($gcarray as $c) { ?>
          <a class="btn btn-primary btn-sm" href="<?php echo str_replace(JAK_OPERATOR_LOC."/", "", JAK_rewrite::jakParseurl('groupchat', $c["id"], $c["lang"]));?>" target="_blank"><i class="fa fa-comments"></i> <?php echo $c["title"];?></a>&nbsp;
        <?php } ?>
      </div>
    </div>
  </div>
</div>
<?php } ?>

<?php if (isset($approve_comments) && !empty($approve_comments)) { ?>

<div class="row">
  <div class="col-md-12">
    <div class="box">
      <div class="box-header">
        <h3 class="box-title"><i class="fa fa-comments"></i> <?php echo $jkl['hd233'];?></h3>
        <div class="box-body">
          <div class="table-responsive">
            <table class="table table-striped">
              <thead>
                <th><?php echo $jkl['g16'];?></th>
                <th><?php echo $jkl['g146'];?></th>
                <th><?php echo $jkl['hd234'];?></th>
                <th><?php echo $jkl['g48'];?></th>
              </thead>
              <?php foreach ($approve_comments as $c) { ?>
                <tr>
                  <td><a href="<?php echo str_replace(JAK_OPERATOR_LOC."/", "", JAK_rewrite::jakParseurl(JAK_BLOG_URL, 'a', $c["blogid"], JAK_rewrite::jakCleanurl($c["title"])));?>"><?php echo $c["title"];?></a></td>
                  <td><?php echo $c["message"];?></td>
                  <td><a class="btn btn-sm btn-success" href="<?php echo JAK_rewrite::jakParseurl('blog', 'comment', 'status', $c["id"]);?>"><i class="material-icons">check</i></a></td>
                  <td><a class="btn btn-sm btn-danger" href="<?php echo JAK_rewrite::jakParseurl('blog', 'comment', 'delete', $c["id"]);?>"><i class="fa fa-trash"></i></a></td>
                </tr>
              <?php } ?>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<?php } if ($mainop) { ?>

<div class="header text-center">
<h3 class="title"><?php echo $sett["purchasedtitle"];?></h3>
<p class="category">
  <a href="<?php echo JAK_rewrite::jakParseurl('extend');?>"><?php echo $sett["packageseltitle"];?></a>
</p>
</div>

<?php if (isset($subscriptions) && !empty($subscriptions)) { ?>

<!-- Purchased subscriptions -->
<div class="row">
  <div class="col-md-12">
    <div class="table-responsive">
      <table class="table table-striped">
        <thead>
          <tr>
            <th><?php echo $jkl['g16'];?></th>
            <th><?php echo $jkl["i36"];?></th>
            <th><?php echo $jkl["i37"];?></th>
            <th><?php echo $jkl["i38"];?></th>
            <th><?php echo $jkl["i39"];?></th>
            <th><?php echo $jkl["i40"];?></th>
            <th><?php echo $jkl["g14"];?></th>
            <th><?php echo $jkl['g101'];?></th>
            <th></th>
          </tr>
        </thead>
        <?php $subused = array(); foreach($subscriptions as $s) { ?>
          <tr>
            <td><?php echo ($s["title"] ? $s["title"] : $s["paidfor"]);?></td>
            <td><?php echo $s["amount"].' '.$s["currency"];?></td>
            <td><?php echo $s["paidhow"];?></td>
            <td><?php echo ($s["subscribed"] ? '<i class="material-icons">check</i>' : '<i class="material-icons">clear</i>');?></td>
            <td><?php echo ($s["paidwhen"] ? JAK_base::jakTimesince($s["paidwhen"], "d.m.Y", " g:i a") : "-");?></td>
            <td><?php echo ($s["paidtill"] ? JAK_base::jakTimesince($s["paidtill"], "d.m.Y", " g:i a") : "-");?></td>
            <td><?php echo ($s["success"] ? '<i class="material-icons">check</i>' : '<i class="material-icons">clear</i>');?></td>
            <td><?php echo ($s["active"] ? '<i class="material-icons">check</i>' : '<i class="material-icons">clear</i>');?></td>
            <td><?php echo ($s["subscribed"] && $s["active"] ? '<a href="'.JAK_rewrite::jakParseurl('cs', $s["id"],JAK_USERID).'" class="btn btn-sm btn-danger">'.$jkl['g280'].'</a>' : '');?></td>
          </tr>
          <?php $subused[] = $s["packageid"]; } ?>
        </table>
      </div>
    </div>
  </div>

<?php } } if ($stataccess) { ?>

  <div class="header text-center">
    <h3 class="title"><?php echo $jkl["hd174"];?></h3>
  </div>

  <div class="row">
    <div class="col-lg-3 col-md-6 col-sm-6">
      <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 class="stats">
            <i class="material-icons">more</i>
            <a href="<?php echo JAK_rewrite::jakParseurl('leads');?>"><?php echo $jkl["stat_s28"];?></a>
          </div>
        </div>
      </div>
    </div>
    <div class="col-lg-3 col-md-6 col-sm-6">
      <div class="card card-stats">
        <div class="card-header card-header-rose card-header-icon">
          <div class="card-icon">
            <i class="material-icons">message</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 class="stats">
            <i class="material-icons">more</i>
            <a href="<?php echo JAK_rewrite::jakParseurl('leads');?>"><?php echo $jkl["stat_s28"];?></a>
          </div>
        </div>
      </div>
    </div>
    <div class="col-lg-3 col-md-6 col-sm-6">
      <div class="card card-stats">
        <div class="card-header card-header-success 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 class="stats">
            <i class="material-icons">more</i>
            <a href="<?php echo JAK_rewrite::jakParseurl('users');?>"><?php echo $jkl["stat_s28"];?></a>
          </div>
        </div>
      </div>
    </div>
    <div class="col-lg-3 col-md-6 col-sm-6">
      <div class="card card-stats">
        <div class="card-header card-header-info card-header-icon">
          <div class="card-icon">
            <i class="material-icons">equalizer</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 class="stats">
            <i class="material-icons">more</i>
            <a href="<?php echo JAK_rewrite::jakParseurl('uonline');?>"><?php echo $jkl["stat_s28"];?></a>
          </div>
        </div>
      </div>
    </div>
  </div>

<?php } if ($statsupport) { ?>

  <div class="header text-center">
    <h3 class="title"><?php echo $jkl["hd175"];?></h3>
  </div>

  <div class="row">
    <div class="col-lg-3 col-md-6 col-sm-6">
      <div class="card card-stats">
        <div class="card-header card-header-warning card-header-icon">
          <div class="card-icon">
            <i class="material-icons">assignment</i>
          </div>
          <p class="card-category"><?php echo $jkl["hd135"];?></p>
          <h3 class="card-title"><?php echo $totalAll;?></h3>
        </div>
        <div class="card-footer">
          <div class="stats">
            <i class="material-icons">more</i>
            <a href="<?php echo JAK_rewrite::jakParseurl('support');?>"><?php echo $jkl["stat_s28"];?></a>
          </div>
        </div>
      </div>
    </div>
    <?php if (isset($totalTStat) && !empty($totalTStat)) foreach ($totalTStat as $v) { ?>
    <div class="col-lg-3 col-md-6 col-sm-6">
      <div class="card card-stats">
        <div class="card-header card-header-<?php echo $v["class"];?> card-header-icon">
          <div class="card-icon">
            <i class="material-icons">drafts</i>
          </div>
          <p class="card-category"><?php echo $v["title"];?></p>
          <h3 class="card-title"><?php echo $v["total"];?></h3>
        </div>
        <div class="card-footer">
          <div class="stats">
            <i class="material-icons">more</i>
            <a href="<?php echo JAK_rewrite::jakParseurl('support');?>"><?php echo $jkl["stat_s28"];?></a>
          </div>
        </div>
      </div>
    </div>
    <?php } ?>
  </div>

<?php } ?>

<div class="header text-center">
  <h3 class="title"><?php echo $jkl['hd237'];?></h3>
  <p class="category"><span class="badge badge-primary" style="background-color:#d649d8"><?php echo $jkl['m31'];?></span> <span class="badge badge-primary" style="background-color:#49abd8"><?php echo $jkl['m1'];?></span> <span class="badge badge-dark" style="background-color:#d88c49"><?php echo $jkl['m22'];?></span> <span class="badge badge-dark" style="background-color:#71d849"><?php echo $jkl['hd57'];?></span>
  </p>
</div>
<div class="row">
  <div class="col-md-12">
    <div class="card card-calendar">
      <div class="card-body ">
        <div id="calendar"></div>
      </div>
    </div>
  </div>
</div>

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