<?php include_once APP_PATH.'template/business/tplblocks/header.php';?>

<div class="section section-white">
  <div class="container">
    <?php if (JAK_CLIENTID && $jakclient->getVar("frontendadmin") == 1) { ?>
      <div class="col-md-8 ml-auto mr-auto text-center mb-1">
        <button class="btn btn-sm btn-primary firefrontedit s-<?php echo $pageid;?>" data-area="support-<?php echo $pageid;?>" data-pageid="s-<?php echo $pageid;?>" data-lighteditor="false" type="button"><?php echo $jkl['hd66'];?></button>
        <button class="btn btn-sm btn-success firefrontsave s-<?php echo $pageid;?>" data-area="support-<?php echo $pageid;?>" data-pageid="s-<?php echo $pageid;?>" type="button"><?php echo $jkl['hd53'];?></button>
        <button class="btn btn-sm btn-danger firefrontclose s-<?php echo $pageid;?>" data-area="support-<?php echo $pageid;?>" data-pageid="s-<?php echo $pageid;?>" type="button"><?php echo $jkl['hd162'];?></button>
      </div>
    <?php } ?>
    <div class="support-<?php echo $pageid;?>">
      <?php if (isset($cms_text) && !empty($cms_text)) foreach ($cms_text as $t) { if ($t["cmsslug"].$t["cmsid"] == 'support-'.$pageid) { echo $t["description"]; break; } } ?>
    </div>

    <div class="navbar navbar-expand-lg bg-primary">
      <div class="container">
        <h4 class="navbar-brand"><?php echo $jkl['hd141'];?></h4>

        <div class="col-md-2">
          <select class="selectpicker" name="jak_shownr" id="jak_shownr" data-style="select-with-transition btn-primary btn-round">
            <option value="10"><?php echo sprintf($jkl['hd139'], 10);?></option>
            <option value="25"<?php if (isset($_SESSION["shownr"]) && $_SESSION["shownr"] == 25) echo ' selected';?>><?php echo sprintf($jkl['hd139'], 25);?></option>
            <option value="50"<?php if (isset($_SESSION["shownr"]) && $_SESSION["shownr"] == 50) echo ' selected';?>><?php echo sprintf($jkl['hd139'], 50);?></option>
            <option value="100"<?php if (isset($_SESSION["shownr"]) && $_SESSION["shownr"] == 100) echo ' selected';?>><?php echo sprintf($jkl['hd139'], 100);?></option>
          </select>
        </div>

        <div class="col-md-3">
          <?php if (isset($dep_filter) && is_array($dep_filter) && !empty($dep_filter)) { ?>
            <form id="jak_statform" method="post" action="<?php echo $_SERVER['REQUEST_URI'];?>">
              <select name="jak_depid" id="jak_depid" class="selectpicker" data-style="select-with-transition btn-primary btn-round">
                <option value="0"><?php echo $jkl['g88'];?></option>
                <?php foreach ($dep_filter as $v) { ?>
                  <option value="<?php echo $v["id"];?>"<?php if (isset($_SESSION["sortdepid"]) && $_SESSION["sortdepid"] == $v["id"]) echo ' selected';?>><?php echo $v["title"];?></option>
                <?php } ?>
              </select>
              <input type="hidden" name="action" value="filter">
            </form>
          <?php } ?>
        </div>

        <div class="col-md-3 form-row align-items-center">
          <div class="col-10">
            <input class="form-control mr-sm-2 no-border" type="text" placeholder="Search" id="supportItext">
          </div>
          <div class="col-2 text-left">
            <button type="submit" class="btn btn-primary btn-just-icon btn-round" id="supportIsearch"><i class="fa fa-search" aria-hidden="true"></i></button>
          </div>
        </div>

        <div class="col-md-auto text-center">
          <?php if (JAK_CLIENTID || JAK_TICKET_GUEST_WEB) { ?>
            <a href="<?php echo (JAK_USERID ? JAK_rewrite::jakParseurl(JAK_OPERATOR_LOC, 'support', 'new') : JAK_rewrite::jakParseurl(JAK_SUPPORT_URL, 'n'));?>" class="btn btn-block btn-rotate btn-round btn-danger"><i class="fa fa-paper-plane"></i> <?php echo $jkl['hd47'];?></a>
          <?php } ?>  
        </div>

        
      </div>
    </div>

    <table id="dynamic-data" class="table table-hover" cellspacing="0" width="100%">
      <thead>
        <th class="text-center"><span class="badge badge-pill badge-info"><i class="fa fa-hashtag" aria-hidden="true" data-toggle="tooltip" data-placement="top" title="" data-original-title="Ticket ID" aria-describedby="tooltip50022"></i></span></th>
        <th><?php echo $jkl['hd7'];?></th>
        <th><?php echo $jkl['hd9'];?></th>
        <th><?php echo $jkl['hd8'];?></th>
        <th><?php echo $jkl['hd10'];?></th>
        <th class="text-right"><?php echo $jkl['hd11'].' / '.$jkl['hd12'];?></th>
        <th class="text-right"><?php echo $jkl['hd13'];?></th>
      </thead>
    </table>

    <div class="section section-white p-0">
      <div class="row">
        <?php if (JAK_CLIENTID && $jakclient->getVar("frontendadmin") == 1) { ?>
          <div class="col-md-12 ml-auto mr-auto text-center mb-1">
            <button class="btn btn-sm btn-primary firefrontedit sb-<?php echo $pageid;?>" data-area="support-bottom-<?php echo $pageid;?>" data-pageid="sb-<?php echo $pageid;?>" data-lighteditor="false" type="button"><?php echo $jkl['hd66'];?></button>
            <button class="btn btn-sm btn-success firefrontsave sb-<?php echo $pageid;?>" data-area="support-bottom-<?php echo $pageid;?>" data-pageid="sb-<?php echo $pageid;?>" type="button"><?php echo $jkl['hd53'];?></button>
            <button class="btn btn-sm btn-danger firefrontclose sb-<?php echo $pageid;?>" data-area="support-bottom-<?php echo $pageid;?>" data-pageid="sb-<?php echo $pageid;?>" type="button"><?php echo $jkl['hd162'];?></button>
          </div>
        <?php } ?>
        <div class="col-md-12 support-bottom-<?php echo $pageid;?>">
          <?php if (isset($cms_text) && !empty($cms_text)) foreach ($cms_text as $t) { if ($t["cmsslug"].$t["cmsid"] == 'support-bottom-'.$pageid) { echo $t["description"]; break; } } ?>
        </div>
      </div>
    </div>

  </div>
</div>

<?php include_once APP_PATH.'template/business/tplblocks/footer.php';?>
