<?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('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" 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>

<div class="alert alert-rose">
  <p><?php echo $jkl["hd89"];?></p>
  <?php echo sprintf($jkl["hd87"], $api_key);?><br>
  <?php echo sprintf($jkl["hd88"], $api_key1);?>
</div>

<?php if ($errors) { ?>
  <div class="alert alert-danger">
    <?php if (isset($errors["e"])) echo $errors["e"];
    if (isset($errors["e1"])) echo $errors["e1"];
    if (isset($errors["e2"])) echo $errors["e2"];
    if (isset($errors["e3"])) echo $errors["e3"];
    if (isset($errors["e4"])) echo $errors["e4"];
    if (isset($errors["e5"])) echo $errors["e5"];
    if (isset($errors["e6"])) echo $errors["e6"];
    if (isset($errors["e7"])) echo $errors["e7"];?>
  </div>
<?php } if ($success) { ?>
  <div class="alert alert-success">
    <?php if (isset($success["e"])) echo $success["e"];?>
  </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-rose">
          <div class="card-icon">
            <i class="material-icons">settings</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["g15"];?></h4>
        </div>
        <div class="card-body">
          <div class="form-group">
            <label class="control-label" for="jak_title"><?php echo $jkl["g16"];?></label>
            <input type="text" name="jak_title" class="form-control" value="<?php echo JAK_TITLE;?>">
          </div>

          <div class="form-group<?php if (isset($errors["e1"])) echo " has-danger";?>">
            <label class="control-label" for="jak_email"><?php echo $jkl["l5"];?></label>
            <input type="text" name="jak_email" class="form-control" value="<?php echo JAK_EMAIL;?>">
            <small class="form-text text-muted">
              <?php echo $jkl["h"];?>
            </small>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_emailcc"><?php echo $jkl["g201"];?></label>
            <input type="text" name="jak_emailcc" class="form-control" value="<?php echo JAK_EMAILCC;?>">
            <small class="form-text text-muted">
              <?php echo $jkl["h16"];?>
            </small>
          </div>

          <?php if (JAK_SUPERADMINACCESS || JAK_MAIN_OP) { ?>

            <div class="form-group<?php if (isset($errors["e2"])) echo " has-danger";?>">
              <label class="control-label" for="jak_custom_domain"><?php echo $jkl["hd349"];?></label>
              <input type="text" name="jak_custom_domain" class="form-control" value="<?php echo $custom_domain;?>">
              <small class="form-text text-muted">
                <?php echo $jkl["h23"];?>
              </small>
            </div>

          <?php } ?>

          <div class="form-group">
            <label class="control-label" for="jak_holidaym"><?php echo $jkl["g303"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_holidaym" value="0"<?php if (JAK_HOLIDAY_MODE == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g304"];?>
                <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_holidaym" value="1"<?php if (JAK_HOLIDAY_MODE == 1) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g1"];?>
                <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_holidaym" value="2"<?php if (JAK_HOLIDAY_MODE == 2) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g305"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_billing"><?php echo $jkl["hd85"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_billing" value="0"<?php if (JAK_BILLING_MODE == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g304"];?>
                <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_billing" value="1"<?php if (JAK_BILLING_MODE == 1) { ?> checked="checked"<?php } ?>> <?php echo $jkl["hd61"];?>
                <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_billing" value="2"<?php if (JAK_BILLING_MODE == 2) { ?> checked="checked"<?php } ?>> <?php echo $jkl["hd62"];?>
                <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_billing" value="3"<?php if (JAK_BILLING_MODE == 3) { ?> checked="checked"<?php } ?>> <?php echo $jkl["hd293"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_showip"><?php echo $jkl["g242"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_showip" value="1"<?php if (JAK_SHOW_IPS == 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_showip" value="0"<?php if (JAK_SHOW_IPS == 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_rating"><?php echo $jkl["g92"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_rating" value="1"<?php if (JAK_CRATING == 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_rating" value="0"<?php if (JAK_CRATING == 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_trans"><?php echo $jkl["g234"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_trans" value="1"<?php if (JAK_SEND_TSCRIPT == 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_trans" value="0"<?php if (JAK_SEND_TSCRIPT == 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_openop"><?php echo $jkl["g266"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_openop" value="1"<?php if (JAK_OPENOP == 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_openop" value="0"<?php if (JAK_OPENOP == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

        <?php if (JAK_SUPERADMINACCESS) { ?>

            <div class="form-group">
              <label class="control-label" for="jak_proactive_time"><?php echo $jkl["g327"];?></label>
              <input type="number" name="jak_proactive_time" class="form-control" min="1" max="30" step="1" value="<?php echo JAK_PROACTIVE_TIME;?>">
            </div>

            <div class="form-group">
              <label class="control-label" for="jak_user_left"><?php echo $jkl["g253"];?></label>
              <input type="number" name="jak_user_left" class="form-control" min="30" max="1800" step="1" value="<?php echo JAK_CLIENT_LEFT;?>">
              <small class="form-text text-muted">
                <?php echo $jkl["h18"];?>
              </small>
            </div>

            <div class="form-group">
              <label class="control-label" for="jak_user_expired"><?php echo $jkl["g254"];?></label>
              <input type="number" name="jak_user_expired" class="form-control" min="120" max="2000" step="1" value="<?php echo JAK_CLIENT_EXPIRED;?>">
              <small class="form-text text-muted">
                <?php echo $jkl["h18"];?>
              </small>
            </div>

            <div class="form-group">
              <label class="control-label" for="jak_pushrem"><?php echo $jkl["g311"];?></label>
              <input type="number" name="jak_pushrem" class="form-control" min="15" max="300" step="1" value="<?php echo JAK_PUSH_REMINDER;?>">
              <small class="form-text text-muted">
                <?php echo $jkl["h12"];?>
              </small>
            </div>

          <?php } ?>

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

              <div class="form-group">
                <label class="control-label" for="jak_lang"><?php echo $jkl["g22"];?></label>
                <select name="jak_lang" class="selectpicker col-12" data-live-search="true">
                  <?php if (isset($lang_files) && is_array($lang_files)) foreach($lang_files as $lf) { ?><option value="<?php echo $lf;?>"<?php if (JAK_LANG == $lf) { ?> selected="selected"<?php } ?>><?php echo ucwords($lf);?></option><?php } ?>
                </select>
              </div>

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

              <div class="form-group">
                <label class="control-label" for="jak_timezone_server"><?php echo $jkl["g25"];?></label>
                <select name="jak_timezone_server" class="selectpicker col-12" data-live-search="true">
                  <?php include_once "timezoneserver.php";?>
                </select>
              </div>

            </div>
          </div>

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

              <div class="form-group<?php if (isset($errors["e2"])) echo " has-danger";?>">
                <label class="control-label" for="jak_date"><?php echo $jkl["g23"];?></label>
                <input type="text" name="jak_date" class="form-control" value="<?php echo JAK_DATEFORMAT;?>">
              </div>

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

              <div class="form-group<?php if (isset($errors["e3"])) echo " has-danger";?>">
                <label class="control-label" for="jak_date"><?php echo $jkl["g24"];?></label>
                <input type="text" name="jak_time" class="form-control" value="<?php echo JAK_TIMEFORMAT?>">
              </div>

            </div>
          </div>

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

              <div class="form-group">
                <label class="control-label" for="allowed_files"><?php echo $jkl["g109"];?></label>
                <input type="text" name="allowed_files" class="form-control" value="<?php echo JAK_ALLOWED_FILES;?>"<?php if (!JAK_SUPERADMINACCESS) echo " disabled";?>>
              </div>

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

              <div class="form-group">
                <label class="control-label" for="allowedo_files"><?php echo $jkl["g128"];?></label>
                <input type="text" name="allowedo_files" class="form-control" value="<?php echo JAK_ALLOWEDO_FILES;?>"<?php if (!JAK_SUPERADMINACCESS) echo " disabled";?>>
              </div>

            </div>
          </div>
          <div class="row">
            <div class="col-md-6">
              <div class="form-group">
                <label class="control-label" for="jak_avatwidth"><?php echo $jkl["g44"];?></label>
                <input type="text" name="jak_avatwidth" class="form-control" value="<?php echo JAK_USERAVATWIDTH;?>"<?php if (!JAK_SUPERADMINACCESS) echo " disabled";?>>
              </div>
            </div>
            <div class="col-md-6">
              <div class="form-group">
                <label class="control-label" for="jak_avatheight"><?php echo $jkl["g44"];?></label>
                <input type="text" name="jak_avatheight" class="form-control" value="<?php echo JAK_USERAVATHEIGHT;?>"<?php if (!JAK_SUPERADMINACCESS) echo " disabled";?>>
              </div>
            </div>
          </div>

          <div class="form-group">
                <label for="dsgvo"><?php echo $jkl["hd335"];?></label>
                <textarea name="jak_dsgvo" id="dsgvo" rows="5" class="form-control"><?php echo JAK_DSGVO_CONTACT;?></textarea>
            </div>

          <div class="form-group">
            <label for="jak_facebookid"><?php echo $jkl["hd206"];?></label>
            <input type="text" name="jak_facebookid" class="form-control" value="<?php echo JAK_FACEBOOK_APP_ID;?>">
          </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-success">
          <div class="card-icon">
            <i class="material-icons">money</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["hd214"];?></h4>
        </div>
        <div class="card-body">

          <div class="form-group">
            <label class="control-label" for="jak_stripe_secret"><?php echo $jkl["hd215"];?></label>
            <input type="text" name="jak_stripe_secret" class="form-control" value="<?php echo JAK_STRIPE_SECRET_KEY;?>">
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_stripe_publish"><?php echo $jkl["hd216"];?></label>
            <input type="text" name="jak_stripe_publish" class="form-control" value="<?php echo JAK_STRIPE_PUBLISH_KEY;?>">
          </div>
          <div class="form-group">
            <label class="control-label" for="jak_paypal_client"><?php echo $jkl["hd217"];?></label>
            <input type="text" name="jak_paypal_client" class="form-control" value="<?php echo JAK_PAYPAL_CLIENT;?>">
          </div>
          <div class="form-group">
            <label class="control-label" for="jak_paypal_secret"><?php echo $jkl["hd336"];?></label>
            <input type="text" name="jak_paypal_secret" class="form-control" value="<?php echo JAK_PAYPAL_SECRET;?>">
          </div>
          <div class="form-group">
            <label class="control-label" for="jak_sandbox"><?php echo $jkl["hd342"];?></label>
              <div class="form-check">
                <label class="form-check-label">
                  <input class="form-check-input" type="radio" name="jak_sandbox" value="1"<?php if (JAK_SANDBOX_MODE == 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_sandbox" value="0"<?php if (JAK_SANDBOX_MODE == 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_yookassa_id"><?php echo $jkl["hd337"];?></label>
            <input type="text" name="jak_yookassa_id" class="form-control" value="<?php echo JAK_YOOKASSA_ID;?>">
          </div>
          <div class="form-group">
            <label class="control-label" for="jak_yookassa_secret"><?php echo $jkl["hd338"];?></label>
            <input type="text" name="jak_yookassa_secret" class="form-control" value="<?php echo JAK_YOOKASSA_SECRET;?>">
          </div>
          <div class="form-group">
            <label class="control-label" for="jak_paystack_secret"><?php echo $jkl["hd339"];?></label>
            <input type="text" name="jak_paystack_secret" class="form-control" value="<?php echo JAK_PAYSTACK_SECRET;?>">
          </div>
          <!-- <div class="form-group">
                        <label class="control-label" for="jak_twoco"><?php echo $jkl['hd259'];?></label>
                        <input type="text" name="jak_twoco" class="form-control" id="jak_twoco" value="<?php echo JAK_TWOCO;?>">
                    </div>
          <div class="form-group">
                        <label class="control-label" for="jak_twoco_secret"><?php echo $jkl['hd260'];?></label>
                        <input type="password" name="jak_twoco_secret" class="form-control" id="jak_twoco_secret" value="<?php echo JAK_TWOCO_SECRET;?>">
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="jak_authorize_id"><?php echo $jkl['hd340'];?></label>
                        <input type="text" name="jak_authorize_id" class="form-control" id="jak_authorize_id" value="<?php echo JAK_AUTHORIZE_ID;?>">
                    </div>
          <div class="form-group">
                        <label class="control-label" for="jak_authorize_key"><?php echo $jkl['hd341'];?></label>
                        <input type="password" name="jak_authorize_key" class="form-control" id="jak_authorize_key" value="<?php echo JAK_AUTHORIZE_KEY;?>">
                    </div> -->
        </div>
        <div class="card-footer">
          <button type="submit" name="save" class="btn btn-primary pull-right"><?php echo $jkl["g38"];?></button>
        </div>
      </div>

      <?php if (JAK_SUPERADMINACCESS) { ?>

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

            <div class="form-group">
              <label class="control-label" for="nativtok"><?php echo $jkl["u51"];?></label>
              <input type="text" name="jak_nativtok" id="nativtok" class="form-control" value="<?php echo JAK_NATIVE_APP_TOKEN;?>">
            </div>

            <div class="form-group">
              <label class="control-label" for="nativkey"><?php echo $jkl["u52"];?></label>
              <input type="text" name="jak_nativkey" id="nativkey" class="form-control" value="<?php echo JAK_NATIVE_APP_KEY;?>">
            </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-success">
            <div class="card-icon">
              <i class="material-icons">vpn_lock</i>
            </div>
            <h4 class="card-title "><?php echo $jkl["hd82"];?></h4>
          </div>
          <div class="card-body">

            <div class="form-group">
              <label class="control-label" for="recapclient"><?php echo $jkl["hd83"];?></label>
              <input type="text" name="jak_recapclient" id="recapclient" class="form-control" value="<?php echo JAK_RECAP_CLIENT;?>">
            </div>

            <div class="form-group">
              <label class="control-label" for="recapserver"><?php echo $jkl["hd84"];?></label>
              <input type="text" name="jak_recapserver" id="recapserver" class="form-control" value="<?php echo JAK_RECAP_SERVER;?>">
            </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-success">
            <div class="card-icon">
              <i class="material-icons">vpn_key</i>
            </div>
            <h4 class="card-title "><?php echo $jkl["hd295"];?></h4>
          </div>
          <div class="card-body">

            <div class="form-group">
              <label class="control-label" for="envato_token"><?php echo $jkl["hd294"];?></label>
              <input type="text" name="envato_token" id="envato_token" class="form-control" value="<?php echo JAK_ENVATO_API_TOKEN;?>">
            </div>

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

      <?php } ?>

      <div class="card">
          <div class="card-header card-header-icon card-header-success">
            <div class="card-icon">
              <i class="material-icons">vpn_key</i>
            </div>
        <h4 class="card-title "><?php echo $jkl["g383"];?></h4>
          </div><!-- /.box-header -->
          <div class="card-body">

            <div class="form-group">
          <label class="control-label" for="jak_chatgptbot"><?php echo $jkl["g384"];?></label>
          <div class="form-check">
            <label class="form-check-label">
              <input class="form-check-input" type="radio" name="jak_chatgptbot" value="1"<?php if (JAK_OPENAI_CHATGPT == 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_chatgptbot" value="0"<?php if (JAK_OPENAI_CHATGPT == 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="openaiapikey"><?php echo $jkl["g385"];?></label>
              <input type="text" name="jak_openaiapikey" id="openaiapikey" class="form-control" value="<?php echo JAK_OPENAI_APIKEY;?>">
            </div>

          </div>
          <div class="card-footer">
            <button type="submit" name="save" class="btn btn-primary"><?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-rose">
          <div class="card-icon">
            <i class="material-icons">calendar_today</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["hd238"];?></h4>
        </div>
        <div class="card-body">

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

              <div class="form-group">
                <label class="control-label" for="jak_calendar_tickets"><?php echo $jkl["hd239"];?></label>
                <div class="form-check">
                  <label class="form-check-label">
                    <input class="form-check-input" type="radio" name="jak_calendar_tickets" value="1"<?php if (JAK_CALENDAR_TICKETS == 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_calendar_tickets" value="0"<?php if (JAK_CALENDAR_TICKETS == 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_calendar_chats"><?php echo $jkl["hd240"];?></label>
                <div class="form-check">
                  <label class="form-check-label">
                    <input class="form-check-input" type="radio" name="jak_calendar_chats" value="1"<?php if (JAK_CALENDAR_CHATS == 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_calendar_chats" value="0"<?php if (JAK_CALENDAR_CHATS == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                    <span class="circle">
                      <span class="check"></span>
                    </span>
                  </label>
                </div>
              </div>

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

              <div class="form-group">
                <label class="control-label" for="jak_calendar_offline"><?php echo $jkl["hd241"];?></label>
                <div class="form-check">
                  <label class="form-check-label">
                    <input class="form-check-input" type="radio" name="jak_calendar_offline" value="1"<?php if (JAK_CALENDAR_OFFLINE == 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_calendar_offline" value="0"<?php if (JAK_CALENDAR_OFFLINE == 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_calendar_purchases"><?php echo $jkl["hd242"];?></label>
                <div class="form-check">
                  <label class="form-check-label">
                    <input class="form-check-input" type="radio" name="jak_calendar_purchases" value="1"<?php if (JAK_CALENDAR_PURCHASES == 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_calendar_purchases" value="0"<?php if (JAK_CALENDAR_PURCHASES == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                    <span class="circle">
                      <span class="check"></span>
                    </span>
                  </label>
                </div>
              </div>

            </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 class="card">
        <div class="card-header card-header-icon card-header-danger">
          <div class="card-icon">
            <i class="material-icons">list_alt</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["m9"];?></h4>
        </div>
        <div class="card-body">

          <div class="form-group">
            <label class="control-label" for="jak_depid"><?php echo $jkl['g246'].' -> '.$jkl["hd2"];?></label>
            <select name="jak_depid[]" class="selectpicker col-12" data-live-search="true" multiple>
              <option value="0"<?php if (JAK_STANDARD_CHAT_DEP == 0) { ?> selected="selected"<?php } ?>><?php echo $jkl["g105"];?></option>
              <?php if (isset($JAK_DEPARTMENTS) && is_array($JAK_DEPARTMENTS)) foreach($JAK_DEPARTMENTS as $v) { ?>
                <option value="<?php echo $v["id"];?>"<?php if (in_array($v["id"], explode(',', JAK_STANDARD_CHAT_DEP))) echo ' selected';?>><?php echo $v["title"];?></option>
              <?php } ?>
            </select>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_depids"><?php echo $jkl['g246'].' -> '.$jkl["hd3"];?></label>

            <select name="jak_depids[]" class="selectpicker col-12" data-live-search="true" multiple>
              <option value="0"<?php if (JAK_STANDARD_SUPPORT_DEP == 0) { ?> selected="selected"<?php } ?>><?php echo $jkl["g105"];?></option>
              <?php if (isset($JAK_DEP_SUPPORT) && is_array($JAK_DEP_SUPPORT)) foreach($JAK_DEP_SUPPORT as $d) { ?>
                <option value="<?php echo $d["id"];?>"<?php if (in_array($d["id"], explode(',', JAK_STANDARD_SUPPORT_DEP))) echo ' selected';?>><?php echo $d["title"];?></option>
              <?php } ?>
            </select>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_depidf"><?php echo $jkl['g246'].' -> '.$jkl["hd4"];?></label>


            <select name="jak_depidf[]" class="selectpicker col-12" data-live-search="true" multiple>
              <option value="0"<?php if (JAK_STANDARD_FAQ_CAT == 0) { ?> selected="selected"<?php } ?>><?php echo $jkl["g105"];?></option>
              <?php if (isset($JAK_CAT_FAQ) && is_array($JAK_CAT_FAQ)) foreach($JAK_CAT_FAQ as $f) { ?>
                <option value="<?php echo $f["id"];?>"<?php if (in_array($f["id"], explode(',', JAK_STANDARD_FAQ_CAT))) echo ' selected';?>><?php echo $f["title"];?></option>
              <?php } ?>
            </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">music_note</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["g258"];?></h4>
        </div>
        <div class="card-body">

          <div class="form-group">
            <label class="control-label" for="jak_ringtone"><?php echo $jkl['g256'];?></label>
            <select name="jak_ringtone" class="selectpicker col-12" data-live-search="true" onchange="playSound(this);">
              <?php if (isset($sound_files) && is_array($sound_files)) foreach($sound_files as $sfc) { ?><option value="<?php echo $sfc;?>"<?php if (JAK_RING_TONE == $sfc) { ?> selected="selected"<?php } ?>><?php echo $sfc;?></option><?php } ?>
            </select>
          </div>
          <div class="form-group">
            <label class="control-label" for="jak_msgtone"><?php echo $jkl['g257'];?></label>
            <select name="jak_msgtone" class="selectpicker col-12" data-live-search="true" onchange="playSound(this);">
              <?php if (isset($sound_files) && is_array($sound_files)) foreach($sound_files as $sfn) { ?><option value="<?php echo $sfn;?>"<?php if (JAK_MSG_TONE == $sfn) { ?> selected="selected"<?php } ?>><?php echo $sfn;?></option><?php } ?>
            </select>
          </div>
          <div class="form-group">
            <label class="control-label" for="jak_client_sound"><?php echo $jkl['g257'];?></label>
            <select name="jak_client_sound" class="selectpicker col-12" data-live-search="true" onchange="playSound(this);">
              <?php if (isset($sound_files) && is_array($sound_files)) foreach($sound_files as $sfc) { ?><option value="<?php echo $sfc;?>"<?php if (JAK_CLIENT_SOUND == $sfc) { ?> selected="selected"<?php } ?>><?php echo $sfc;?></option><?php } ?>
            </select>
          </div>
          <div class="form-group">
            <label class="control-label" for="jak_engage_sound"><?php echo $jkl['g316'];?></label>
            <select name="jak_engage_sound" class="selectpicker col-12" data-live-search="true" onchange="playSound(this);">
              <option value=""<?php if (empty(JAK_ENGAGE_SOUND)) echo ' selected="selected"';?>>-</option>
              <?php if (isset($sound_files) && is_array($sound_files)) foreach($sound_files as $sfc) { ?><option value="<?php echo $sfc;?>"<?php if (JAK_ENGAGE_SOUND == $sfc) { ?> selected="selected"<?php } ?>><?php echo $sfc;?></option><?php } ?>
            </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-warning">
          <div class="card-icon">
            <i class="material-icons">settings</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["g318"];?></h4>
        </div>
        <div class="card-body">

          <div class="form-group">
                  <label class="control-label" for="jak_icon"><?php echo $jkl["hd283"];?></label>
                  <div class="input-group">
                    <input type="text" name="jak_engage_icon" class="form-control" value="<?php echo JAK_ENGAGE_ICON;?>">
                    <div class="input-group-append">
                        <span class="input-group-text">
                          <i class="<?php echo JAK_ENGAGE_ICON;?>"></i>&nbsp;<a href="https://fontawesome.com/v5/search" target="_blank"><i class="fa fa-link"></i></a>
                        </span>
                     </div>
                  </div>
                </div>

          <div class="form-group">
            <label class="control-label" for="showalert"><?php echo $jkl["g191"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="showalert" value="1"<?php if (JAK_PRO_ALERT == 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="showalert" value="0"<?php if (JAK_PRO_ALERT == 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_chat_upload_standard"><?php echo $jkl["g334"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_chat_upload_standard" value="1"<?php if (JAK_CHAT_UPLOAD_STANDARD == 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_chat_upload_standard" value="0"<?php if (JAK_CHAT_UPLOAD_STANDARD == 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_client_push_not"><?php echo $jkl["g317"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_client_push_not" value="1"<?php if (JAK_CLIENT_PUSH_NOT == 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_client_push_not" value="0"<?php if (JAK_CLIENT_PUSH_NOT == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

          <?php if (JAK_SUPERADMINACCESS) { ?>

            <div class="form-group">
              <label class="control-label" for="jak_live_online_status"><?php echo $jkl["g319"];?></label>
              <div class="form-check">
                <label class="form-check-label">
                  <input class="form-check-input" type="radio" name="jak_live_online_status" value="1"<?php if (JAK_LIVE_ONLINE_STATUS == 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_live_online_status" value="0"<?php if (JAK_LIVE_ONLINE_STATUS == 0) { ?> checked="checked"<?php } ?>> <?php echo $jkl["g18"];?>
                  <span class="circle">
                    <span class="check"></span>
                  </span>
                </label>
              </div>
            </div>

          <?php } ?>

          <div class="form-group">
            <label class="control-label" for="jak_register"><?php echo $jkl["hd236"];?></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_register" value="1"<?php if (JAK_REGISTER == 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_register" value="0"<?php if (JAK_REGISTER == 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 class="card">
        <div class="card-header card-header-icon card-header-info">
          <div class="card-icon">
            <i class="material-icons">design_services</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["hd145"];?></h4>
        </div>
        <div class="card-body">

          <div class="form-group">
            <label class="control-label" for="jak_template"><?php echo $jkl["hd145"];?></label>
            <select name="jak_template" class="selectpicker col-12" data-live-search="true">
            <?php if (isset($templates) && is_array($templates)) foreach($templates as $c) { ?>
              <option value="<?php echo $c;?>"<?php if (JAK_FRONT_TEMPLATE == $c) { ?> selected="selected"<?php } ?>><?php echo $c;?></option>
            <?php } ?>
            </select>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_offline_page"><?php echo $jkl["hd210"];?></label>
            <select name="jak_offline_page" class="selectpicker col-12" data-live-search="true">
              <option value="0"<?php if (JAK_OFFLINE_CMS_PAGE == 0) echo " selected";?>>-</option>
            <?php if (isset($JAK_CMS_PAGES) && is_array($JAK_CMS_PAGES)) foreach($JAK_CMS_PAGES as $t) { ?>
              <option value="<?php echo $t["id"];?>"<?php if (JAK_OFFLINE_CMS_PAGE == $t["id"]) { ?> selected="selected"<?php } ?>><?php echo $t["title"];?></option>
            <?php } ?>
            </select>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_chatwidget_id"><?php echo $jkl['hd282'];?></label>
            <select name="jak_chatwidget_id" class="selectpicker col-12" data-live-search="true">
              <option value="0"<?php if (JAK_CHATWIDGET_ID == 0) echo " selected";?>>-</option>
            <?php if (isset($CHATWIDGET_ALL) && is_array($CHATWIDGET_ALL)) foreach($CHATWIDGET_ALL as $cw) { ?>
                    <option value="<?php echo $cw["id"];?>"<?php if (JAK_CHATWIDGET_ID == $cw["id"]) echo " selected";?>><?php echo $cw["title"];?></option>
                  <?php } ?>
            </select>
          </div>

          <div class="form-group">
            <label class="control-label" for="api_profile"><?php echo $jkl["hd286"];?></label>
            <input type="text" name="api_profile" class="form-control" value="<?php echo JAK_API_PROFILE;?>">
          </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-warning">
          <div class="card-icon">
            <i class="fal fa-file-code fa-2x"></i>
          </div>
          <h4 class="card-title "><?php echo $jkl["g377"];?></h4>
        </div>
        <div class="card-body">

          <div class="form-group">
            <label class="control-label" for="jak_emailtpllogo"><?php echo $jkl["g378"];?></label>
            <div class="input-group">
              <input type="text" name="jak_emailtpllogo" id="previmg" class="form-control" value="<?php if (!empty(JAK_EMAILTPLLOGO)) echo JAK_EMAILTPLLOGO;?>">
              <span class="input-group-btn">
                <a class="btn btn-rose btn-round btn-fab" data-toggle="modal" data-target="#jakFM" type="button" href="javascript:void(0)"><i class="far fa-file-archive"></i></a>
              </span>
            </div><!-- /input-group -->
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_emailtplcopy"><?php echo $jkl["g379"];?></label>
            <input type="text" name="jak_emailtplcopy" class="form-control" value="<?php echo JAK_EMAILTPLCOPY;?>">
          </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-danger">
          <div class="card-icon">
            <i class="material-icons">block</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["g97"];?></h4>
        </div>
        <div class="card-body">

          <div class="form-group">
            <label class="control-label" for="ip_block"><?php echo $jkl["g95"];?></label>
            <textarea name="ip_block" rows="3" class="form-control"><?php echo JAK_IP_BLOCK;?></textarea>
            <small class="form-text text-muted">
              <?php echo $jkl["h3"];?>
            </small>
          </div>

          <div class="form-group">
            <label class="control-label" for="email_block"><?php echo $jkl["g96"];?></label>
            <textarea name="email_block" rows="3" class="form-control"><?php echo JAK_EMAIL_BLOCK;?></textarea>
            <small class="form-text text-muted">
              <?php echo $jkl["h4"];?>
            </small>
          </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">phone_iphone</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["g155"];?></h4>
        </div>
        <div class="card-body">

          <div class="form-group">
            <label class="control-label" for="jak_twilio_nexmo"><a href="http://www.twilio.com">Twilio</a>, <a href="http://www.plivo.com">Plivo</a> <?php echo $jkl["g157"];?> <a href="http://www.nexmo.com">Nexmo</a></label>
            <div class="form-check">
              <label class="form-check-label">
                <input class="form-check-input" type="radio" name="jak_twilio_nexmo" value="1"<?php if (JAK_TWILIO_NEXMO == 1) { ?> checked="checked"<?php } ?>> Twilio
                <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_twilio_nexmo" value="0"<?php if (JAK_TWILIO_NEXMO == 0) { ?> checked="checked"<?php } ?>> Nexmo
                <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_twilio_nexmo" value="2"<?php if (JAK_TWILIO_NEXMO == 0) { ?> checked="checked"<?php } ?>> Plivo
                <span class="circle">
                  <span class="check"></span>
                </span>
              </label>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_tw_msg"><?php echo $jkl["g151"];?></label>
            <input type="text" name="jak_tw_msg" class="form-control" value="<?php echo JAK_TW_MSG;?>" maxlength="160">
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_tw_phone"><?php echo $jkl["g152"];?></label>
            <input type="text" name="jak_tw_phone" class="form-control" value="<?php echo JAK_TW_PHONE;?>">
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_tw_sid"><?php echo $jkl["g153"];?></label>
            <input type="text" name="jak_tw_sid" class="form-control" value="<?php echo JAK_TW_SID;?>">
          </div>

          <div class="form-group">
            <label class="control-label" for="jak_tw_token"><?php echo $jkl["g154"];?></label>
            <input type="text" name="jak_tw_token" class="form-control" value="<?php echo JAK_TW_TOKEN;?>">
          </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>

</form>

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