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

<?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"];?></div>
<?php } ?>
<form class="jak_form" method="post" 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-success">
          <div class="card-icon">
            <i class="material-icons">add</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["g40"];?></h4>
        </div>
        <div class="card-body">

          <div class="form-group<?php if (isset($errors["e1"])) echo " has-danger";?>">
            <label class="control-label" for="name"><?php echo $jkl["u"];?></label>
            <input type="text" name="jak_name" id="name" class="form-control" value="<?php if (isset($_POST["jak_name"])) echo $_POST["jak_name"];?>">
          </div>

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

          <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">
              <option value=""><?php echo $jkl["u11"];?></option>
              <?php if (isset($lang_files) && is_array($lang_files)) foreach($lang_files as $lf) { ?><option value="<?php echo $lf;?>"><?php echo ucwords($lf);?></option><?php } ?>
            </select>
          </div>

          <?php if ($jakosub['files'] == 1) { ?>

            <div class="form-group">
              <label class="control-label" for="jak_upload"><?php echo $jkl["hd139"];?></label>
              <div class="form-check">
                <label class="form-check-label">
                  <input class="form-check-input" type="radio" name="jak_upload" value="1" checked> <?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_upload" value="0"> <?php echo $jkl["g18"];?>
                  <span class="circle">
                    <span class="check"></span>
                  </span>
                </label>
              </div>
            </div>
          <?php } ?>

          <div class="form-check form-check-inline">
            <label class="form-check-label">
              <input class="form-check-input" type="checkbox" name="send_email" value="1"> <?php echo $jkl["hd120"];?>
              <span class="form-check-sign">
                <span class="check"></span>
              </span>
            </label>
          </div>

        </div>
        <div class="card-footer">
          <a href="<?php echo JAK_rewrite::jakParseurl('users', 'clients');?>" class="btn btn-default"><?php echo $jkl["g103"];?></a>
          <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">vpn_key</i>
          </div>
          <h4 class="card-title "><?php echo $jkl["g39"];?></h4>
        </div>
        <div class="card-body">

          <div class="form-group<?php if (isset($errors["e5"]) || isset($errors["e6"])) echo " has-danger";?>">
            <label class="control-label" for="pass"><?php echo $jkl["u4"];?></label>
            <input type="password" name="jak_password" id="pass" class="form-control" value="">
          </div>

          <div class="form-group<?php if (isset($errors["e5"]) || isset($errors["e6"])) echo " has-danger";?>">
            <label class="control-label" for="jak_confirm_password"><?php echo $jkl["u5"];?></label>
            <input type="password" name="jak_confirm_password" class="form-control" value="">
          </div>

          <div class="progress">
            <div id="jak_pstrength" class="progress-bar progress-bar-striped progress-bar-animated" style="width:0" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
          </div>

        </div>
        <div class="card-footer">
          <a href="<?php echo JAK_rewrite::jakParseurl('users', 'clients');?>" class="btn btn-default"><?php echo $jkl["g103"];?></a>
          <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-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["hd2"];?></label>
            <select name="jak_depid[]" class="selectpicker col-12" data-live-search="true" multiple>
              <option value="0"<?php if (isset($_POST["jak_depid"]) && $_POST["jak_depid"] == '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 echo $v["title"];?></option>

              <?php } ?>
            </select>
          </div>

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

            <select name="jak_depids[]" class="selectpicker col-12" data-live-search="true" multiple>
              <option value="0"<?php if (isset($_POST["jak_depids"]) && $_POST["jak_depids"] == '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 echo $d["title"];?></option>

              <?php } ?>
            </select>
          </div>

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

            <select name="jak_depidf[]" class="selectpicker col-12" data-live-search="true" multiple>
              <option value="0"<?php if (isset($_POST["jak_depidf"]) && $_POST["jak_depidf"] == '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 echo $f["title"];?></option>

              <?php } ?>
            </select>
          </div>

        </div>
        <div class="card-footer">
          <a href="<?php echo JAK_rewrite::jakParseurl('users', 'clients');?>" class="btn btn-default"><?php echo $jkl["g103"];?></a>
          <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';?>
