<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* reward/reward_promotion_form.twig */
class __TwigTemplate_1c7fb6b91211419b782b6c48c23c23dd96960f19ca132f58d8f80262385d0ae9 extends \Twig\Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 1
        echo ($context["header"] ?? null);
        echo ($context["column_left"] ?? null);
        echo "
<div id=\"content\">
  <div class=\"page-header\">
    <div class=\"container-fluid\">
      <div class=\"pull-right\">
        <button type=\"submit\" form=\"form-reward-promotion\" data-toggle=\"tooltip\" title=\"";
        // line 6
        echo ($context["button_save"] ?? null);
        echo "\" class=\"btn btn-primary\"><i class=\"fa fa-save\"></i></button>
        <a href=\"";
        // line 7
        echo ($context["cancel"] ?? null);
        echo "\" data-toggle=\"tooltip\" title=\"";
        echo ($context["button_cancel"] ?? null);
        echo "\" class=\"btn btn-default\"><i class=\"fa fa-reply\"></i></a></div>
      <h1>";
        // line 8
        echo ($context["heading_title"] ?? null);
        echo "</h1>
      <ul class=\"breadcrumb\">
        ";
        // line 10
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["breadcrumbs"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["breadcrumb"]) {
            // line 11
            echo "        <li><a href=\"";
            echo twig_get_attribute($this->env, $this->source, $context["breadcrumb"], "href", [], "any", false, false, false, 11);
            echo "\">";
            echo twig_get_attribute($this->env, $this->source, $context["breadcrumb"], "text", [], "any", false, false, false, 11);
            echo "</a></li>
        ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['breadcrumb'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 13
        echo "      </ul>
    </div>
  </div>
  <div class=\"container-fluid\">
    ";
        // line 17
        if (($context["error_warning"] ?? null)) {
            // line 18
            echo "    <div class=\"alert alert-danger alert-dismissible\"><i class=\"fa fa-exclamation-circle\"></i> ";
            echo ($context["error_warning"] ?? null);
            echo "
      <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>
    </div>
    ";
        }
        // line 22
        echo "    <div class=\"panel panel-default\">
      <div class=\"panel-heading\">
        <h3 class=\"panel-title\"><i class=\"fa fa-pencil\"></i> ";
        // line 24
        echo ($context["text_form"] ?? null);
        echo "</h3>
      </div>
      <div class=\"panel-body\">
        <form action=\"";
        // line 27
        echo ($context["action"] ?? null);
        echo "\" method=\"post\" enctype=\"multipart/form-data\" id=\"form-reward-promotion\" class=\"form-horizontal\">
          <div class=\"form-group required\">
            <label class=\"col-sm-2 control-label\" for=\"input-reward-type\">";
        // line 29
        echo ($context["entry_reward"] ?? null);
        echo "</label>
            <div class=\"col-sm-10\">
              <select name=\"reward_setting_id\" id=\"input-reward\" class=\"form-control\">
                ";
        // line 32
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["rewards"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["reward"]) {
            // line 33
            echo "                ";
            if ((twig_get_attribute($this->env, $this->source, $context["reward"], "reward_setting_id", [], "any", false, false, false, 33) == ($context["reward_setting_id"] ?? null))) {
                // line 34
                echo "                <option value=\"";
                echo twig_get_attribute($this->env, $this->source, $context["reward"], "reward_setting_id", [], "any", false, false, false, 34);
                echo "\" selected=\"selected\">";
                echo twig_get_attribute($this->env, $this->source, $context["reward"], "reward_setting_name", [], "any", false, false, false, 34);
                echo "</option>
                ";
            } else {
                // line 36
                echo "                <option value=\"";
                echo twig_get_attribute($this->env, $this->source, $context["reward"], "reward_setting_id", [], "any", false, false, false, 36);
                echo "\">";
                echo twig_get_attribute($this->env, $this->source, $context["reward"], "reward_setting_name", [], "any", false, false, false, 36);
                echo "</option>
                ";
            }
            // line 38
            echo "                ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['reward'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 39
        echo "              </select>
              <b>";
        // line 40
        echo ($context["text_rs_point"] ?? null);
        echo ": </b><label id=\"lblpoint\"></label><br> 
              <b>";
        // line 41
        echo ($context["text_rs_start_date"] ?? null);
        echo ": </b><label id=\"lblstartdate\"></label><br> 
              <b>";
        // line 42
        echo ($context["text_rs_end_date"] ?? null);
        echo ": </b><label id=\"lblenddate\"></label><br> 
            </div>
          </div>
          <div class=\"form-group required\">
            <label class=\"col-sm-2 control-label\" for=\"input-point\">";
        // line 46
        echo ($context["entry_point"] ?? null);
        echo "</label>
            <div class=\"col-sm-10\">
              <input type=\"text\" name=\"point\" value=\"";
        // line 48
        echo ($context["point"] ?? null);
        echo "\" placeholder=\"";
        echo ($context["entry_point"] ?? null);
        echo "\" id=\"input-point\" class=\"form-control\" />
              ";
        // line 49
        if (($context["error_point"] ?? null)) {
            // line 50
            echo "              <div class=\"text-danger\">";
            echo ($context["error_point"] ?? null);
            echo "</div>
              ";
        }
        // line 52
        echo "            </div>
          </div>
          <div class=\"form-group required\">
            <label class=\"col-sm-2 control-label\" for=\"input-start-date\">";
        // line 55
        echo ($context["entry_start_date"] ?? null);
        echo "</label>
            <div class=\"col-sm-3\">
              <div class=\"input-group date\">
                <input type=\"text\" name=\"start_date\" value=\"";
        // line 58
        echo ($context["start_date"] ?? null);
        echo "\" placeholder=\"";
        echo ($context["entry_start_date"] ?? null);
        echo "\" data-date-format=\"YYYY-MM-DD\" id=\"input-date-start\" class=\"form-control\" />
                <span class=\"input-group-btn\">
                <button type=\"button\" class=\"btn btn-default\"><i class=\"fa fa-calendar\"></i></button>
                </span></div>
                ";
        // line 62
        if (($context["error_start_date"] ?? null)) {
            // line 63
            echo "                <div class=\"text-danger\">";
            echo ($context["error_start_date"] ?? null);
            echo "</div>
                ";
        }
        // line 65
        echo "            </div>
          </div>
          <div class=\"form-group\">
            <label class=\"col-sm-2 control-label\" for=\"input-end-date\">";
        // line 68
        echo ($context["entry_end_date"] ?? null);
        echo "</label>
            <div class=\"col-sm-3\">
              <div class=\"input-group date\">
                <input type=\"text\" name=\"end_date\" value=\"";
        // line 71
        echo ($context["end_date"] ?? null);
        echo "\" placeholder=\"";
        echo ($context["entry_end_date"] ?? null);
        echo "\" data-date-format=\"YYYY-MM-DD\" id=\"input-end_date\" class=\"form-control\" />
                <span class=\"input-group-btn\">
                <button type=\"button\" class=\"btn btn-default\"><i class=\"fa fa-calendar\"></i></button>
                </span></div>
                ";
        // line 75
        if (($context["error_end_date"] ?? null)) {
            // line 76
            echo "                <div class=\"text-danger\">";
            echo ($context["error_end_date"] ?? null);
            echo "</div>
                ";
        }
        // line 78
        echo "            </div>
          </div>
          <div class=\"form-group required\">
            <label class=\"col-sm-2 control-label\" for=\"input-status\">";
        // line 81
        echo ($context["entry_status"] ?? null);
        echo "</label>
            <div class=\"col-sm-10\">
              <select name=\"status\" id=\"input-status\" class=\"form-control\">
                ";
        // line 84
        if (($context["status"] ?? null)) {
            // line 85
            echo "                <option value=\"0\">";
            echo ($context["text_disabled"] ?? null);
            echo "</option>
                <option value=\"1\" selected=\"selected\">";
            // line 86
            echo ($context["text_enabled"] ?? null);
            echo "</option>
                ";
        } else {
            // line 88
            echo "                <option value=\"0\" selected=\"selected\">";
            echo ($context["text_disabled"] ?? null);
            echo "</option>
                <option value=\"1\">";
            // line 89
            echo ($context["text_enabled"] ?? null);
            echo "</option>
                ";
        }
        // line 91
        echo "              </select>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
  <script type=\"text/javascript\"><!--
\$('.date').datetimepicker({
\tlanguage: '";
        // line 100
        echo ($context["datepicker"] ?? null);
        echo "',
\tpickTime: false
});
\$('#input-reward').on('change', function() {
  var value = \$('#input-reward').val();
  \$.ajax({
\t\turl: 'index.php?route=reward/reward_promotion/reward&user_token=";
        // line 106
        echo ($context["user_token"] ?? null);
        echo "&reward_setting_id=' + this.value,
\t\tdataType: 'json',
\t\tbeforeSend: function() {
\t\t\t\$('select[name=\\'reward_setting_id\\']').after(' <i class=\"fa fa-circle-o-notch fa-spin\"></i>');
\t\t},
\t\tcomplete: function() {
\t\t\t\$('.fa-spin').remove();
\t\t},
\t\tsuccess: function(json) {
      \t\$('#lblpoint').val(json['point']);
        \$('#lblstartdate').val(json['start_date']);
        \$('#lblenddate').val(json['end_date']); 
\t\t},
\t\terror: function(xhr, ajaxOptions, thrownError) {
\t\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t}
\t});
})
//--></script>
</div>
";
        // line 126
        echo ($context["footer"] ?? null);
        echo " ";
    }

    public function getTemplateName()
    {
        return "reward/reward_promotion_form.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  311 => 126,  288 => 106,  279 => 100,  268 => 91,  263 => 89,  258 => 88,  253 => 86,  248 => 85,  246 => 84,  240 => 81,  235 => 78,  229 => 76,  227 => 75,  218 => 71,  212 => 68,  207 => 65,  201 => 63,  199 => 62,  190 => 58,  184 => 55,  179 => 52,  173 => 50,  171 => 49,  165 => 48,  160 => 46,  153 => 42,  149 => 41,  145 => 40,  142 => 39,  136 => 38,  128 => 36,  120 => 34,  117 => 33,  113 => 32,  107 => 29,  102 => 27,  96 => 24,  92 => 22,  84 => 18,  82 => 17,  76 => 13,  65 => 11,  61 => 10,  56 => 8,  50 => 7,  46 => 6,  37 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "reward/reward_promotion_form.twig", "");
    }
}
