<?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" href="<?php echo JAK_rewrite::jakParseurl('settings');?>"><?php echo $jkl["hd9"];?></a>
      </li>
      <?php if ($jakosub['tickets'] && jak_get_access("support", $jakuser->getVar("permissions"), JAK_MAIN_OP)){?>
        <li class="nav-item">
          <a class="nav-link active" href="<?php echo JAK_rewrite::jakParseurl('settings', 'support');?>"><?php echo $jkl["hd10"];?></a>
        </li>
      <?php } if ($jakosub['faq'] && jak_get_access("faq", $jakuser->getVar("permissions"), JAK_MAIN_OP)){?>
        <li class="nav-item">
          <a class="nav-link" href="<?php echo JAK_rewrite::jakParseurl('settings', 'faq');?>"><?php echo $jkl["hd11"];?></a>
        </li>
      <?php } if ($jakosub['blog'] && jak_get_access("blog", $jakuser->getVar("permissions"), JAK_MAIN_OP)){?>
        <li class="nav-item">
          <a class="nav-link" href="<?php echo JAK_rewrite::jakParseurl('settings', 'blog');?>"><?php echo $jkl["hd12"];?></a>
        </li>
      <?php } ?>
      <li class="nav-item">
        <a class="nav-link" href="<?php echo JAK_rewrite::jakParseurl('settings', 'email');?>"><?php echo $jkl["hd119"];?></a>
      </li>
      <?php if ($jakosub['tickets'] && jak_get_access("support", $jakuser->getVar("permissions"), JAK_MAIN_OP)){?>
        <li class="nav-item">
          <a class="nav-link" href="<?php echo JAK_rewrite::jakParseurl('settings', 'phpimap');?>"><?php echo $jkl["hd43"];?></a>
        </li>
      <?php } ?>
    </ul>
  </div>
</div>
<hr>

<?php if (JAK_SUPERADMINACCESS) { ?>
  <div class="alert alert-rose">
    <p><?php echo $jkl["hd90"];?></p>
    <b><?php echo APP_PATH.'cron/tickets.php';?></b>
  </div>
<?php } ?>

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

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

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

          <div class="form-group">
            <label class="control-label" for="jak_ticket_close_r"><?php echo $jkl["hd92"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_close_r" value="1"<?php if (JAK_TICKET_CLOSE_R == 1) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g19"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_close_r" value="0"<?php if (JAK_TICKET_CLOSE_R == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_ticket_inform"><?php echo $jkl["hd93"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_inform" value="1"<?php if (JAK_TICKET_INFORM_R == 1) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g19"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_inform" value="0"<?php if (JAK_TICKET_INFORM_R == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_ticket_guest"><?php echo $jkl["hd94"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_guest" value="1"<?php if (JAK_TICKET_GUEST == 1) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g19"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_guest" value="0"<?php if (JAK_TICKET_GUEST == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_ticket_guest_web"><?php echo $jkl["hd208"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_guest_web" value="1"<?php if (JAK_TICKET_GUEST_WEB == 1) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g19"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_guest_web" value="0"<?php if (JAK_TICKET_GUEST_WEB == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_ticket_account"><?php echo $jkl["hd95"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_account" value="1"<?php if (JAK_TICKET_ACCOUNT == 1) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g19"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_account" value="0"<?php if (JAK_TICKET_ACCOUNT == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_ticket_rating"><?php echo $jkl["g85"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_rating" value="1"<?php if (JAK_TICKET_RATING == 1) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g19"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_rating" value="0"<?php if (JAK_TICKET_RATING == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_priority"><?php echo $jkl["hd229"];?></label>
            <select name="jak_priority" class="selectpicker col-12" data-live-search="true">
              <option value="0"<?php if (JAK_STANDARD_TICKET_PRIORITY == 0) echo ' selected';?>><?php echo $jkl["g304"];?></option>
              <?php if (isset($PRIORITY_ALL) && !empty($PRIORITY_ALL)) foreach ($PRIORITY_ALL as $p) {
                if ($p["id"] == JAK_STANDARD_TICKET_PRIORITY) {
                  echo '<option value="'.$p["id"].'" selected>'.$p["title"].((JAK_BILLING_MODE == 1 && $p["credits"] != 0) ? ' ('.sprintf($jkl['hd232'], $p["credits"]).')' : '').'</option>';
                } else {
                  echo '<option value="'.$p["id"].'">'.$p["title"].((JAK_BILLING_MODE == 1 && $p["credits"] != 0) ? ' ('.sprintf($jkl['hd232'], $p["credits"]).')' : '').'</option>';
                }
              } ?>
            </select>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_option"><?php echo $jkl["hd230"];?></label>
            <select name="jak_option" class="selectpicker col-12" data-live-search="true">
              <option value="0"<?php if (JAK_STANDARD_TICKET_OPTION == 0) echo ' selected';?>><?php echo $jkl["g304"];?></option>
              <?php if (isset($TOPTIONS_ALL) && !empty($TOPTIONS_ALL)) foreach ($TOPTIONS_ALL as $o) {
                if ($o["id"] == JAK_STANDARD_TICKET_OPTION) {
                  echo '<option value="'.$o["id"].'" selected>'.$o["title"].((JAK_BILLING_MODE == 1 && $o["credits"] != 0) ? ' ('.sprintf($jkl['hd232'], $o["credits"]).')' : '').'</option>';
                } else {
                  echo '<option value="'.$o["id"].'">'.$o["title"].((JAK_BILLING_MODE == 1 && $o["credits"] != 0) ? ' ('.sprintf($jkl['hd232'], $o["credits"]).')' : '').'</option>';
                }
              } ?>
            </select>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_private"><?php echo $jkl["hd231"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_private" value="1"<?php if (JAK_TICKET_PRIVATE == 1) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g19"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_private" value="0"<?php if (JAK_TICKET_PRIVATE == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_private_show"><?php echo $jkl["hd292"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_private_show" value="1"<?php if (JAK_TICKET_PRIVATE_SHOW == 1) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g19"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_private_show" value="0"<?php if (JAK_TICKET_PRIVATE_SHOW == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_ticket_similar"><?php echo $jkl["hd280"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_similar" value="1"<?php if (JAK_TICKET_SIMILAR == 1) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g19"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_similar" value="0"<?php if (JAK_TICKET_SIMILAR == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

        </div>
        <div class="card-footer">
          <button type="submit" name="save" class="btn btn-primary pull-right"><?php echo $jkl["g38"];?></button>
        </div>
      </div>

    </div>
    <div class="col-md-6">

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

          <div class="form-group">
            <label class="control-label" for="jak_ticket_limit"><?php echo $jkl["hd99"];?></label>
            <select name="jak_ticket_limit" class="selectpicker col-12" data-live-search="true">
              <option value="0"<?php if (JAK_TICKET_LIMIT == 0) echo ' selected';?>><?php echo $jkl["hd100"];?></option>
              <?php for ($i = 1; $i < 31; $i++) {
                if ($i == JAK_TICKET_LIMIT) {
                  echo '<option value="'.$i.'" selected>'.$i.'</option>';
                } else {
                  echo '<option value="'.$i.'">'.$i.'</option>';
                }
              } ?>
            </select>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_ticket_reminder"><?php echo $jkl["hd101"];?></label>
            <select name="jak_ticket_reminder" class="selectpicker col-12" data-live-search="true">
              <option value="0"<?php if (JAK_TICKET_REMINDER == 0) echo ' selected';?>><?php echo $jkl["g304"];?></option>
              <?php for ($i = 1; $i < 31; $i++) {
                if ($i == JAK_TICKET_REMINDER) {
                  echo '<option value="'.$i.'" selected>'.$i.'</option>';
                } else {
                  echo '<option value="'.$i.'">'.$i.'</option>';
                }
              } ?>
            </select>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_ticket_close"><?php echo $jkl["hd102"];?></label>
            <select name="jak_ticket_close" class="selectpicker col-12" data-live-search="true">
              <option value="0"<?php if (JAK_TICKET_CLOSE_C == 0) echo ' selected';?>><?php echo $jkl["g304"];?></option>
              <?php for ($i = 1; $i < 31; $i++) {
                if ($i == JAK_TICKET_CLOSE_C) {
                  echo '<option value="'.$i.'" selected>'.$i.'</option>';
                } else {
                  echo '<option value="'.$i.'">'.$i.'</option>';
                }
              } ?>
            </select>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_ticket_reopen"><?php echo $jkl["hd103"];?></label>
            <select name="jak_ticket_reopen" class="selectpicker col-12" data-live-search="true">
              <option value="0"<?php if (JAK_TICKET_REOPEN == 0) echo ' selected';?>><?php echo $jkl["g304"];?></option>
              <?php for ($i = 1; $i < 31; $i++) {
                if ($i == JAK_TICKET_REOPEN) {
                  echo '<option value="'.$i.'" selected>'.$i.'</option>';
                } else {
                  echo '<option value="'.$i.'">'.$i.'</option>';
                }
              } ?>
            </select>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_ticket_attach"><?php echo $jkl["hd104"];?></label>
            <select name="jak_ticket_attach" class="selectpicker col-12" data-live-search="true">
              <option value="0"<?php if (JAK_TICKET_ATTACH == 0) echo ' selected';?>><?php echo $jkl["hd100"];?></option>
              <?php for ($i = 1; $i < 31; $i++) {
                if ($i == JAK_TICKET_ATTACH) {
                  echo '<option value="'.$i.'" selected>'.$i.'</option>';
                } else {
                  echo '<option value="'.$i.'">'.$i.'</option>';
                }
              } ?>
            </select>
          </div>

        </div>
        <div class="card-footer">
          <button type="submit" name="save" class="btn btn-primary pull-right"><?php echo $jkl["g38"];?></button>
        </div>
      </div>

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

            <div class="form-group">
            <label class="control-label" for="jak_ticket_duedate"><?php echo $jkl["hd270"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_duedate" value="1"<?php if (JAK_TICKET_DUEDATE == 1) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g19"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_ticket_duedate" value="0"<?php if (JAK_TICKET_DUEDATE == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

            <div class="form-group">
              <p><label><?php echo $jkl["hd271"];?></label></p>
              <select name="jak_ticket_duedate_format" class="selectpicker col-12" title="<?php echo $jkl["hd271"];?>">
                <option value="F d, Y:#:LL"<?php if (JAK_TICKET_DUEDATE_FORMAT == "F d, Y:#:LL") echo ' selected';?>><?php echo date("F d, Y");?></option>
                <option value="d.m.Y:#:D.M.YYYY"<?php if (JAK_TICKET_DUEDATE_FORMAT == "d.m.Y:#:D.M.YYYY") echo ' selected';?>><?php echo date("d.m.Y");?></option>
                <option value="m-d-Y:#:M-D-YYYY"<?php if (JAK_TICKET_DUEDATE_FORMAT == "m-d-Y:#:M-D-YYYY") echo ' selected';?>><?php echo date("m-d-Y");?></option>
                <option value="m/d/Y:#:M/D/YYYY"<?php if (JAK_TICKET_DUEDATE_FORMAT == "m/d/Y:#:M/D/YYYY") echo ' selected';?>><?php echo date("m/d/Y");?></option>
              </select>
            </div>

            <div class="form-group">
              <p><label><?php echo $jkl["hd272"];?></label></p>
              <select name="jak_ticket_duedate_preset" class="selectpicker col-12" title="<?php echo $jkl["hd272"];?>">
                <option value="0"<?php if (JAK_TICKET_DUEDATE_PRESET == 0) echo ' selected';?>><?php echo $jkl["hd273"];?></option>
                <option value="1"<?php if (JAK_TICKET_DUEDATE_PRESET == 1) echo ' selected';?>><?php echo $jkl["hd274"];?></option>
                <option value="2"<?php if (JAK_TICKET_DUEDATE_PRESET == 2) echo ' selected';?>><?php echo (sprintf($jkl['hd64'], 2));?></option>
                <option value="3"<?php if (JAK_TICKET_DUEDATE_PRESET == 3) echo ' selected';?>><?php echo (sprintf($jkl['hd64'], 3));?></option>
              </select>
            </div>

          </div>
          <div class="card-footer">
            <button type="submit" name="save" class="btn btn-primary"><?php echo $jkl["g38"];?></button>
          </div>
      </div>

    </div>
  </div>

</form>

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