<?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;

/* member/member_reward_form.twig */
class __TwigTemplate_b5c5fbfee916ca122e6f8393c9b647437fbd6630c62f60c7b2c174aaa98da24c 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\" 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-member-reward\" class=\"form-horizontal\">
           <div class=\"form-group\">
               <label class=\"col-sm-2 control-label\">";
        // line 29
        echo ($context["entry_phone_no"] ?? null);
        echo "</label>
               <div class=\"col-sm-10\">
                  <label>";
        // line 31
        echo ($context["phone_no"] ?? null);
        echo " </label>  
               </div>
           </div>
           <div class=\"form-group\">
               <label class=\"col-sm-2 control-label\">";
        // line 35
        echo ($context["entry_email"] ?? null);
        echo "</label>
               <div class=\"col-sm-10\">
                  <label>";
        // line 37
        echo ($context["email"] ?? null);
        echo " </label>
               </div>
           </div>
           <div class=\"form-group\">
              <label class=\"col-sm-2 control-label\">";
        // line 41
        echo ($context["entry_tier_level"] ?? null);
        echo "</label>
              <div class=\"col-sm-10\">
              <label>  ";
        // line 43
        echo ($context["tier_level"] ?? null);
        echo " </label>
              </div>
            </div>
          <div class=\"form-group required\">
            <label class=\"col-sm-2 control-label\" for=\"input-reward\">";
        // line 47
        echo ($context["entry_reward"] ?? null);
        echo "</label>
            <div class=\"col-sm-10\">
              <select name=\"reward_setting_id\" id=\"input-reward_setting_id\" class=\"form-control\" >
                ";
        // line 50
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["rewards"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["reward"]) {
            // line 51
            echo "                ";
            if ((twig_get_attribute($this->env, $this->source, $context["reward"], "reward_setting_id", [], "any", false, false, false, 51) == ($context["reward_setting_id"] ?? null))) {
                // line 52
                echo "                <option value=\"";
                echo twig_get_attribute($this->env, $this->source, $context["reward"], "reward_setting_id", [], "any", false, false, false, 52);
                echo "\" selected=\"selected\">";
                echo twig_get_attribute($this->env, $this->source, $context["reward"], "title", [], "any", false, false, false, 52);
                echo "</option>
                ";
            } else {
                // line 54
                echo "                <option value=\"";
                echo twig_get_attribute($this->env, $this->source, $context["reward"], "reward_setting_id", [], "any", false, false, false, 54);
                echo "\">";
                echo twig_get_attribute($this->env, $this->source, $context["reward"], "title", [], "any", false, false, false, 54);
                echo "</option>
                ";
            }
            // line 56
            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 57
        echo "              </select>
                 <div class=\"form-group required\">
                  <label class=\"col-sm-2 control-label\" for=\"input-used_point\">";
        // line 59
        echo ($context["entry_used_point"] ?? null);
        echo "</label>
                  <div class=\"col-sm-10\">
                      <label>";
        // line 61
        echo ($context["used_point"] ?? null);
        echo " </label>  
                  </div>
                </div>    
                <div class=\"form-group required\">
                  <label class=\"col-sm-2 control-label\" for=\"input-value\">";
        // line 65
        echo ($context["entry_value"] ?? null);
        echo "</label>
                  <div class=\"col-sm-10\">
                    <label>";
        // line 67
        echo ($context["value"] ?? null);
        echo " </label>  
                  </div>
                </div>            
                <div class=\"form-group required\">
                  <label class=\"col-sm-2 control-label\" for=\"input-start-date\">";
        // line 71
        echo ($context["entry_expiry_date"] ?? null);
        echo "</label>
                  <div class=\"col-sm-3\">
                    <label>";
        // line 73
        echo (twig_date_converter($this->env, "Y/m/d") + ($context["expiry"] ?? null));
        echo " </label>  
                  </div>
                </div>
                </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
<style type=\"text/css\">
label{
    display: block;
    width: 100%;
    height: 36px;
    padding: 8px 13px;
    font-size: 13px;
    color: #555;
}
</style>
<script type=\"text/javascript\"><!--
\$('.date').datetimepicker({
\tlanguage: '";
        // line 95
        echo ($context["datepicker"] ?? null);
        echo "',
\tpickTime: false
});
//--></script>

<script type=\"text/javascript\"><!--
\$('select[name=\\'reward_setting_id\\']').on('change', function() {
  alert(this.value);
\t\$.ajax({
\t\turl: 'index.php?route=member/member/reward&reward_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\t\tif (json['postcode_required'] == '1') {
\t\t\t\t\$('#collapse-shipping-address input[name=\\'postcode\\']').parent().parent().addClass('required');
\t\t\t} else {
\t\t\t\t\$('#collapse-shipping-address input[name=\\'postcode\\']').parent().parent().removeClass('required');
\t\t\t}

\t\t\thtml = '<option value=\"\"><?php echo \$text_select; ?></option>';

\t\t\tif (json['zone'] && json['zone'] != '') {
\t\t\t\tfor (i = 0; i < json['zone'].length; i++) {
\t\t\t\t\thtml += '<option value=\"' + json['zone'][i]['zone_id'] + '\"';

\t\t\t\t\tif (json['zone'][i]['zone_id'] == '<?php echo \$zone_id; ?>') {
\t\t\t\t\t\thtml += ' selected=\"selected\"';
\t\t\t\t\t}

\t\t\t\t\thtml += '>' + json['zone'][i]['name'] + '</option>';
\t\t\t\t}
\t\t\t} else {
\t\t\t\thtml += '<option value=\"0\" selected=\"selected\"><?php echo \$text_none; ?></option>';
\t\t\t}

\t\t\t\$('#collapse-shipping-address select[name=\\'zone_id\\']').html(html);
\t\t},
\t\terror: function(xhr, ajaxOptions, thrownError) {
\t\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t}
\t});
});

\$('#collapse-shipping-address select[name=\\'country_id\\']').trigger('change');
//--></script>
</div>
";
        // line 146
        echo ($context["footer"] ?? null);
        echo " ";
    }

    public function getTemplateName()
    {
        return "member/member_reward_form.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  290 => 146,  236 => 95,  211 => 73,  206 => 71,  199 => 67,  194 => 65,  187 => 61,  182 => 59,  178 => 57,  172 => 56,  164 => 54,  156 => 52,  153 => 51,  149 => 50,  143 => 47,  136 => 43,  131 => 41,  124 => 37,  119 => 35,  112 => 31,  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("", "member/member_reward_form.twig", "");
    }
}
