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

<div class="row">
  <div class="col-md-12">
    <ul class="nav nav-pills nav-pills-warning">
      <li class="nav-item">
        <a class="nav-link active" href="<?php echo JAK_rewrite::jakParseurl('users');?>"><?php echo $jkl["hd5"];?></a>
      </li>
      <?php if (jak_get_access("client", $jakuser->getVar("permissions"), JAK_MAIN_OP)){?>
        <li class="nav-item">
          <a class="nav-link" href="<?php echo JAK_rewrite::jakParseurl('users', 'clients');?>"><?php echo $jkl["hd6"];?></a>
        </li>
      <?php } ?>
    </ul>
  </div>
</div>
<hr>

<?php if ($addmuser && jak_get_access("usrmanage", $jakuser->getVar("permissions"))) { ?>
  <p><a class="btn btn-primary" href="<?php echo JAK_rewrite::jakParseurl('users', 'new');?>"><?php echo $jkl["m7"];?></a></p>
<?php } ?>

<?php if (!$addmuser && jak_get_access("usrmanage", $jakuser->getVar("permissions"), JAK_MAIN_OP)) { ?>
  <div class="alert alert-rose"><?php echo sprintf($jkl['i14'], $totalAll, $totalavops, $jkl['m4']);?></div>
<?php } ?>

<div class="row">
  <div class="col-md-12">

    <form method="post" class="jak_form" action="<?php echo $_SERVER['REQUEST_URI'];?>">

      <div class="card">
        <div class="card-header card-header-icon card-header-rose">
          <div class="card-icon">
            <i class="material-icons">person</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["m4"];?></h4>
        </div>
        <div class="card-body">

          <div class="table-responsive">
            <table class="table table-striped">
              <thead>
                <tr>
                  <th>#</th>
                  <th><input type="checkbox" id="jak_delock_all" /></th>
                  <th><?php echo $jkl["u"];?></th>
                  <th><?php echo $jkl["u1"];?></th>
                  <th><?php echo $jkl["u2"];?></th>
                  <th></th>
                  <th></th>
                </tr>
              </thead>
              <?php if (isset($JAK_USER_ALL) && is_array($JAK_USER_ALL)) foreach($JAK_USER_ALL as $v) { ?>
                <tr>
                  <td><?php echo $v["id"];?></td>
                  <td><input type="checkbox" name="jak_delock_all[]" class="highlight" value="<?php echo $v["id"].':#:'.$v["access"];?>"></td>
                  <td><a href="<?php echo JAK_rewrite::jakParseurl('users', 'edit', $v["id"], $v["opid"]);?>"><?php echo $v["name"];?></a></td>
                  <td><?php echo $v["email"];?></td>
                  <td><a href="<?php echo JAK_rewrite::jakParseurl('users', 'edit', $v["id"], $v["opid"]);?>"><?php echo $v["username"];?></a></td>
                  <td><a class="btn btn-default btn-sm" data-toggle="modal" href="<?php echo JAK_rewrite::jakParseurl('users', 'stats', $v["id"], $v["username"], $v["opid"]);?>" data-target="#jakModal"><i class="fa fa-signal"></i></a></td>
                  <td><a class="btn btn-default btn-sm" href="<?php echo JAK_rewrite::jakParseurl('users', 'edit', $v["id"], $v["opid"]);?>"><i class="fa fa-pencil"></i></a></td>
                </tr>
              <?php } ?>
            </table>
          </div>

        </div>
      </div>
      <input type="hidden" name="action" id="action">
    </form>
  </div>
</div>

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