<?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"];?>
  </div>
<?php } ?>

<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>" enctype="multipart/form-data">
  <div class="card">
    <div class="card-header card-header-icon card-header-success">
      <div class="card-icon">
        <i class="material-icons">create</i>
      </div>
      <h4 class="card-title "><?php echo $jkl["m21"];?></h4>
    </div>
    <div class="card-body">
      <div class="row">
        <div class="col-md-6">

          <div class="form-group">
            <label class="control-label" for="title"><?php echo $jkl["g16"];?></label>
            <input type="text" name="title" id="title" class="form-control<?php if (isset($errors["e"])) echo " is-invalid";?>" value="<?php echo $JAK_FORM_DATA["title"];?>" />
          </div>

          <div class="form-group">
            <select name="jak_depid" id="department" class="selectpicker col-12" data-live-search="true">
              <option disabled><?php echo $jkl["g131"];?></option>

              <option value="0"<?php if ($JAK_FORM_DATA["department"] == 0) echo ' selected="selected"';?>><?php echo $jkl["g105"];?></option>
              <?php if (isset($JAK_DEPARTMENTS) && is_array($JAK_DEPARTMENTS)) foreach($JAK_DEPARTMENTS as $z) { ?>

                <option value="<?php echo $z["id"];?>"<?php if ($JAK_FORM_DATA["department"] == $z["id"]) echo ' selected="selected"';?>><?php echo $z["title"];?></option>

              <?php } ?>

            </select>
            <a href="javascript:void(0)" class="btn btn-info btn-sm btn-round btn-fab" onclick="md.showNotification('add_alert', '<?php echo addslashes($jkl["hd133"]);?>', 'info', 'top', 'center')"><i class="material-icons">help</i></a>
          </div>

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

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

          <div class="form-group">
            <select name="jak_msgtype" id="jak_msgtype" class="selectpicker col-12" data-live-search="true">
              <option disabled><?php echo $jkl["g250"];?></option>
              <option value="1"<?php if ($JAK_FORM_DATA["msgtype"] == 1) echo " selected";?>> <?php echo $jkl["g246"];?></option>
              <option value="2"<?php if ($JAK_FORM_DATA["msgtype"] == 2) echo " selected";?>> <?php echo $jkl["g247"];?></option>
              <option value="3"<?php if ($JAK_FORM_DATA["msgtype"] == 3) echo " selected";?>> <?php echo $jkl["g248"];?></option>
              <option value="4"<?php if ($JAK_FORM_DATA["msgtype"] == 4) echo " selected";?>> <?php echo $jkl["g249"];?></option>
              <option value="5"<?php if ($JAK_FORM_DATA["msgtype"] == 5) echo " selected";?>> <?php echo $jkl["g255"];?></option>
              <option value="6"<?php if ($JAK_FORM_DATA["msgtype"] == 6) echo " selected";?>> <?php echo $jkl["g259"];?></option>
              <option value="7"<?php if ($JAK_FORM_DATA["msgtype"] == 7) echo " selected";?>> <?php echo $jkl["g260"];?></option>
              <option value="24"<?php if ($JAK_FORM_DATA["msgtype"] == 24) echo " selected";?>> <?php echo $jkl["hd209"];?></option>
              <option value="8"<?php if ($JAK_FORM_DATA["msgtype"] == 8) echo " selected";?>> <?php echo $jkl["g261"];?></option>
              <option value="9"<?php if ($JAK_FORM_DATA["msgtype"] == 9) echo " selected";?>> <?php echo $jkl["g262"];?></option>
              <option value="10"<?php if ($JAK_FORM_DATA["msgtype"] == 10) echo " selected";?>> <?php echo $jkl["g263"];?></option>
              <option value="11"<?php if ($JAK_FORM_DATA["msgtype"] == 11) echo " selected";?>> <?php echo $jkl["g307"];?></option>
              <option value="12"<?php if ($JAK_FORM_DATA["msgtype"] == 12) echo " selected";?>> <?php echo $jkl["g308"];?></option>
              <option value="13"<?php if ($JAK_FORM_DATA["msgtype"] == 13) echo " selected";?>> <?php echo $jkl["g309"];?></option>
              <option value="14"<?php if ($JAK_FORM_DATA["msgtype"] == 14) echo " selected";?>> <?php echo $jkl["hd113"];?></option>
              <option value="15"<?php if ($JAK_FORM_DATA["msgtype"] == 15) echo " selected";?>> <?php echo $jkl["hd114"];?></option>
              <option value="16"<?php if ($JAK_FORM_DATA["msgtype"] == 16) echo " selected";?>> <?php echo $jkl["hd115"];?></option>
              <option value="17"<?php if ($JAK_FORM_DATA["msgtype"] == 17) echo " selected";?>> <?php echo $jkl["hd116"];?></option>
              <option value="18"<?php if ($JAK_FORM_DATA["msgtype"] == 18) echo " selected";?>> <?php echo $jkl["hd117"];?></option>
              <option value="19"<?php if ($JAK_FORM_DATA["msgtype"] == 19) echo " selected";?>> <?php echo $jkl["hd121"];?></option>
              <option value="20"<?php if ($JAK_FORM_DATA["msgtype"] == 20) echo " selected";?>> <?php echo $jkl["hd122"];?></option>
              <option value="21"<?php if ($JAK_FORM_DATA["msgtype"] == 21) echo " selected";?>> <?php echo $jkl["hd123"];?></option>
              <option value="22"<?php if ($JAK_FORM_DATA["msgtype"] == 22) echo " selected";?>> <?php echo $jkl["hd124"];?></option>
              <option value="23"<?php if ($JAK_FORM_DATA["msgtype"] == 23) echo " selected";?>> <?php echo $jkl["hd125"];?></option>
              <option value="25"<?php if ($JAK_FORM_DATA["msgtype"] == 25) echo " selected";?>> <?php echo $jkl["g85"];?></option>
              <option value="26"<?php if ($JAK_FORM_DATA["msgtype"] == 26) echo " selected";?>> <?php echo $jkl["g328"];?></option>
              <option value="27"<?php if ($JAK_FORM_DATA["msgtype"] == 27) echo " selected";?>> <?php echo $jkl["g329"];?></option>
              <option value="28"<?php if ($JAK_FORM_DATA["msgtype"] == 28) echo " selected";?>> <?php echo $jkl["g350"];?></option>
              <option value="29"<?php if ($JAK_FORM_DATA["msgtype"] == 29) echo " selected";?>> <?php echo $jkl["g358"];?></option>
              <option value="30"<?php if ($JAK_FORM_DATA["msgtype"] == 30) echo " selected";?>> <?php echo $jkl["g359"];?></option>
            </select>
          </div>

          <div class="form-group">
            <select name="jak_fireup" id="fireup" class="selectpicker col-12" data-live-search="true">
              <option disabled><?php echo $jkl["g251"];?></option>
              <option value="15"<?php if ($JAK_FORM_DATA["fireup"] == 15) echo " selected";?>>15 <?php echo $jkl["g196"];?></option>
              <option value="30"<?php if ($JAK_FORM_DATA["fireup"] == 30) echo " selected";?>>30 <?php echo $jkl["g196"];?></option>
              <option value="60"<?php if ($JAK_FORM_DATA["fireup"] == 60) echo " selected";?>>1 <?php echo $jkl["g197"];?></option>
              <option value="120"<?php if ($JAK_FORM_DATA["fireup"] == 120) echo " selected";?>>2 <?php echo $jkl["g197"];?></option>
              <option value="180"<?php if ($JAK_FORM_DATA["fireup"] == 180) echo " selected";?>>3 <?php echo $jkl["g197"];?></option>
              <option value="240"<?php if ($JAK_FORM_DATA["fireup"] == 240) echo " selected";?>>4 <?php echo $jkl["g197"];?></option>
              <option value="300"<?php if ($JAK_FORM_DATA["fireup"] == 300) echo " selected";?>>5 <?php echo $jkl["g197"];?></option>
              <option value="360"<?php if ($JAK_FORM_DATA["fireup"] == 360) echo " selected";?>>6 <?php echo $jkl["g197"];?></option>
              <option value="420"<?php if ($JAK_FORM_DATA["fireup"] == 420) echo " selected";?>>7 <?php echo $jkl["g197"];?></option>
              <option value="480"<?php if ($JAK_FORM_DATA["fireup"] == 480) echo " selected";?>>8 <?php echo $jkl["g197"];?></option>
              <option value="540"<?php if ($JAK_FORM_DATA["fireup"] == 540) echo " selected";?>>9 <?php echo $jkl["g197"];?></option>
              <option value="600"<?php if ($JAK_FORM_DATA["fireup"] == 600) echo " selected";?>>10 <?php echo $jkl["g197"];?></option>
              <option value="900"<?php if ($JAK_FORM_DATA["fireup"] == 900) echo " selected";?>>15 <?php echo $jkl["g197"];?></option>
              <option value="1200"<?php if ($JAK_FORM_DATA["fireup"] == 1200) echo " selected";?>>20 <?php echo $jkl["g197"];?></option>
            </select>
            <a href="javascript:void(0)" class="btn btn-info btn-sm btn-round btn-fab" onclick="md.showNotification('add_alert', '<?php echo addslashes($jkl["h17"]);?>', 'info', 'top', 'center')"><i class="material-icons">help</i></a>
          </div>
        </div>
      </div>

      <div class="form-group">
        <textarea name="answer" id="answer" rows="3" class="form-control<?php if (isset($errors["e1"])) echo " is-invalid";?>"><?php echo $JAK_FORM_DATA["message"];?></textarea>
        <small class="form-text text-muted">
          <?php echo (in_array($JAK_FORM_DATA["msgtype"], array("20","21","23","25")) ? $jkl["hd184"] : $jkl["h13"]);?>
        </small>
      </div>

    </div>
    <div class="card-footer">
      <a href="<?php echo JAK_rewrite::jakParseurl('answers');?>" 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>
</form>

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