{{ header }}
<section class="about-bg">
<div id="account-edit" class="container personal-frm">
  <ul class="breadcrumb">
    {% for breadcrumb in breadcrumbs %}
    <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
    {% endfor %}
  </ul>
  {% if error_warning %}
  <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}</div>
  {% endif %}
  

  <div class="container mt-4">
        <div class="vertical-tabs row">
            <ul class="nav nav-tabs col-sm-3" role="tablist">
                <li class="nav-item">
                  <a class="nav-link active" data-toggle="tab" href="#account_tab" role="tab" aria-controls="home">My Account</a>
                </li>

                <li class="nav-item">
                  <a class="nav-link " data-toggle="tab" href="#member_tab" role="tab" aria-controls="home">Membership Details</a>
                </li>

                <li class="nav-item">
                  <a class="nav-link " href="password" >Change Password</a>
                </li>

                <li class="nav-item">
                  <a class="nav-link " href="election">Election</a>
                </li>

                <li class="nav-item">
                  <a class="nav-link" href="conference" aria-controls="profile">Conference</a>
                </li>

                <li class="nav-item">
                  <a class="nav-link " data-toggle="tab" href="#journal_tab" role="tab" aria-controls="home">Online Journal Access</a>
                </li>
                <li class="nav-item">
                  <a class="nav-link " data-toggle="tab" href="#award_tab" role="tab" aria-controls="home">Award</a>
                </li>
            </ul>
            <div class="tab-content col-sm-8">
                <div class="tab-pane active" id="account_tab" role="tabpanel">
                  <div class="sv-tab-panel">
                      <h3>Personal Details</h3>
                      <form action="{{ action }}" method="post" enctype="multipart/form-data" class="form-horizontal">
                        <fieldset>
                          <legend class="mb-4">{{ text_your_details }}</legend>
                          {#<div class="form-group required">#}
                          {#   <p class="label-txt" for="input-firstname">{{ entry_firstname }}</p>#}
                            {#<label class="col-sm-2 control-label" for="input-firstname">{{ entry_firstname }} </label>#}
                          {#  <div class="col-sm-10">#}
                              
                          {#  </div>#}
                          {#</div>#}
                          <div class="row">
                          <div class="form-group col-sm-6">
                            <p class="label-txt" for="input-firstname">{{ entry_firstname }}</p>
                            <input type="text" name="firstname" value="{{ firstname }}" id="input-firstname" class="form-control input" />
                          {% if error_firstname %}
                              <div class="text-danger">{{ error_firstname }}</div>
                              {% endif %}
                                <div class="line-box">
                                    <div class="line"></div>
                                </div>
                            </div>
                            <div class="form-group col-sm-6">
                            <p class="label-txt" for="input-firstname">{{ entry_lastname }}</p>
                            <input type="text" name="lastname" value="{{ lastname }}" id="input-lastname" class="form-control input" />
                              {% if error_lastname %}
                              <div class="text-danger">{{ error_lastname }}</div>
                              {% endif %}
                                <div class="line-box">
                                    <div class="line"></div>
                                </div>
                            </div>
                          {#<div class="form-group required">#}
                          {#  <label class="col-sm-2 control-label" for="input-lastname">{{ entry_lastname }}</label>#}
                          {#  <div class="col-sm-10">#}
                          {#    <input type="text" name="lastname" value="{{ lastname }}" placeholder="{{ entry_lastname }}" id="input-lastname" class="form-control" />#}
                          {#    {% if error_lastname %}#}
                          {#    <div class="text-danger">{{ error_lastname }}</div>#}
                          {#    {% endif %}#}
                          {#  </div>#}
                          {#</div>#}
                          <div class="form-group col-sm-6">
                            <p class="label-txt" for="input-firstname">{{ entry_email }}</p>
                             <input type="email" name="email" value="{{ email }}" id="input-email" class="form-control input" />
                              {% if error_email %}
                              <div class="text-danger">{{ error_email }}</div>
                              {% endif %}
                              <div class="line-box">
                                  <div class="line"></div>
                              </div>
                          </div>

                          

                          {#<div class="form-group required">#}
                          {#  <label class="col-sm-2 control-label" for="input-email">{{ entry_email }}</label>#}
                          {#  <div class="col-sm-10">#}
                          {#    <input type="email" name="email" value="{{ email }}" placeholder="{{ entry_email }}" id="input-email" class="form-control" />#}
                          {#    {% if error_email %}#}
                          {#    <div class="text-danger">{{ error_email }}</div>#}
                          {#    {% endif %}#}
                          {#  </div>#}
                          {#</div>#}

                          <div class="form-group col-sm-6">
                            <p class="label-txt" for="input-email2">E Mail(Secondary)</p>
                             <input type="email" name="email2" value="{{ email2 }}" id="input-email2" class="form-control input" />
                              <div class="line-box">
                                  <div class="line"></div>
                              </div>
                          </div>

                          {#<div class="form-group required">#}
                          {#  <label class="col-sm-2 control-label" for="input-telephone">{{ entry_telephone }}</label>#}
                          {#  <div class="col-sm-10">#}
                          {#    <input type="tel" name="telephone" value="{{ telephone }}" placeholder="{{ entry_telephone }}" id="input-telephone" class="form-control" />#}
                          {#    {% if error_telephone %}#}
                          {#    <div class="text-danger">{{ error_telephone }}</div>#}
                          {#    {% endif %}#}
                          {#  </div>#}
                          {#</div>#}

                            <div class="form-group col-sm-6 required">
                              <p class="label-txt" for="input-firstname">Mobile Number</p>
                              <input type="tel" name="telephone" value="{{ telephone }}" id="input-telephone" class="form-control input" maxlength="12" />
                                {% if error_telephone %}
                                <div class="text-danger">{{ error_telephone }}</div>
                                {% endif %}
                                  <div class="line-box">
                                      <div class="line"></div>
                                  </div>
                            </div>

                            <div class="form-group col-sm-6 ">
                            <p class="label-txt" for="input-mobile">TelePhone</p>
                            <input type="tel" name="mobile" value="{{ mobile }}" id="input-mobile" class="form-control input" maxlength="12" />
                            <div class="line-box">
                                    <div class="line"></div>
                                </div>
                            </div>

                            <div class="form-group col-sm-6 required">
                            <p class="label-txt" for="input-designation">Designation</p>
                            <input type="text" maxlength="80" name="designation" value="{{ designation }}" id="input-designation" class="form-control input" />
                                <div class="line-box">
                                    <div class="line"></div>
                                </div>
                            </div>

                            <div class="form-group col-sm-6 required">
                            <p class="label-txt" for="input-fpsi">FPSI Year</p>
                            <input type="text" maxlength="10" placeholder="" name="fpsi" value="{{ fpsi }}" id="input-fpsi" class="form-control input" />
                            <div class="line-box">
                                    <div class="line"></div>
                                </div>
                            </div>

                            <div class="form-group col-sm-12 required">
                            <p class="label-txt" for="input-specialization">Specialization</p>
                            <input type="text" maxlength="80" name="specialization" value="{{ specialization }}" id="input-specialization" class="form-control input" />
                            <div class="line-box">
                                    <div class="line"></div>
                                </div>
                            </div>

                            <div class="form-group col-sm-12 required">
                            <p class="label-txt" for="input-allied">Allied</p>
                            <input type="text" maxlength="80" name="allied" value="{{ allied }}" id="input-allied" class="form-control input" />
                            <div class="line-box">
                                    <div class="line"></div>
                                </div>
                            </div>

                            <div class="form-group col-sm-12 required">
                            <p class="label-txt" for="input-anydetail">Other Details</p>
                            <input type="text" maxlength="80" name="anydetail" value="{{ anydetail }}" id="input-anydetail" class="form-control input" />
                            <div class="line-box">
                                    <div class="line"></div>
                                </div>
                            </div>


                            <div class="col-sm-12 mt-4"><legend class="mb-4">Address Information</legend></div>

                            <div class="form-group col-sm-12 required">
                            <p class="label-txt" for="input-add1">Address 1</p>
                            <input type="text" maxlength="80" name="add1" value="{{ add1 }}" id="input-add1" class="form-control input" />
                            <div class="line-box">
                                    <div class="line"></div>
                                </div>
                            </div>

                            <div class="form-group col-sm-12">
                            <p class="label-txt" for="input-add2">Address 2</p>
                            <input type="text" maxlength="80" name="add2" value="{{ add2 }}" id="input-add2" class="form-control input" />
                            <div class="line-box">
                                    <div class="line"></div>
                                </div>
                            </div>

                            <div class="form-group col-sm-6">
                            <p class="label-txt" for="input-pincode">Pincode</p>
                            <input type="text" maxlength="6" name="pincode" value="{{ pincode }}" id="input-pincode" class="form-control input" />
                            <div class="line-box">
                                    <div class="line"></div>
                                </div>
                            </div>

                            <div class="form-group col-sm-6">
                            <p class="label-txt" for="input-city">City</p>
                            <input type="text" maxlength="60" name="city" value="{{ city }}" id="input-city" class="form-control input" />
                                <div class="line-box">
                                    <div class="line"></div>
                                </div>
                            </div>

                            <div class="form-group">
                            <label class="col-sm-2 control-label" for="input-telephone">State</label>
                              <div class="col-sm-10">
                                <select name="state" id="input-state" class="form-control">
                                  <option value="">Select</option>
                                  {% for allstate in states %}
                                  <option value="{{ allstate.name }}" {% if allstate.name == state %} selected {% endif %} >{{ allstate.name }}</option>
                                  {% endfor %}
                                </select>
                              </div>
                            </div>

                            <div class="form-group">
                            <label class="col-sm-2 control-label" for="input-telephone">Zone</label>
                              <div class="col-sm-10">
                                <select name="zone" id="input-state" class="form-control">
                                  <option value="">Select</option>
                                  {% for zone in zones %}
                                  <option value="{{ zone.code }}" {% if zone.code == customerzone %} selected {% endif %} >{{ zone.name }}</option>
                                  {% endfor %}
                                </select>
                              </div>
                            </div>

                          </div>
                          
                          {% for custom_field in custom_fields %}
                          {% if custom_field.type == 'select' %}
                          <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}">
                            <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
                            <div class="col-sm-10">
                              <select name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control">
                                <option value="">{{ text_select }}</option>
                                {% for custom_field_value in custom_field.custom_field_value %}
                                {% if account_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == account_custom_field[custom_field.custom_field_id] %}
                                <option value="{{ custom_field_value.custom_field_value_id }}" selected="selected">{{ custom_field_value.name }}</option>
                                {% else %}
                                <option value="{{ custom_field_value.custom_field_value_id }}">{{ custom_field_value.name }}</option>
                                {% endif %}
                                {% endfor %}
                              </select>
                              {% if error_custom_field[custom_field.custom_field_id] %}
                              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
                              {% endif %}
                            </div>
                          </div>
                          {% endif %}
                          {% if custom_field.type == 'radio' %}
                          <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}">
                            <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
                            <div class="col-sm-10">
                              <div>
                                {% for custom_field_value in custom_field.custom_field_value %}
                                <div class="radio">
                                  {% if account_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == account_custom_field[custom_field.custom_field_id] %}
                                  <label>
                                    <input type="radio" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" checked="checked" />
                                    {{ custom_field_value.name }}</label>
                                  {% else %}
                                  <label>
                                    <input type="radio" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" />
                                    {{ custom_field_value.name }}</label>
                                  {% endif %}
                                </div>
                                {% endfor %}
                              </div>
                              {% if error_custom_field[custom_field.custom_field_id] %}
                              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
                              {% endif %}
                            </div>
                          </div>
                          {% endif %}
                          {% if custom_field.type == 'checkbox' %}
                          <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}">
                            <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
                            <div class="col-sm-10">
                              <div>
                                {% for custom_field_value in custom_field.custom_field_value %}
                                <div class="checkbox">
                                  {% if account_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id in account_custom_field[custom_field.custom_field_id] %}
                                  <label>
                                    <input type="checkbox" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" checked="checked" />
                                    {{ custom_field_value.name }}</label>
                                  {% else %}
                                  <label>
                                    <input type="checkbox" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" />
                                    {{ custom_field_value.name }}</label>
                                  {% endif %}
                                </div>
                                {% endfor %}
                              </div>
                              {% if error_custom_field[custom_field.custom_field_id] %}
                              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
                              {% endif %}
                            </div>
                          </div>
                          {% endif %}
                          {% if custom_field.type == 'text' %}
                          <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}">
                            <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
                            <div class="col-sm-10">
                              <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if account_custom_field[custom_field.custom_field_id] %}{{ account_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}" placeholder="{{ custom_field.name }}" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control" />
                              {% if error_custom_field[custom_field.custom_field_id] %}
                              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
                              {% endif %}
                            </div>
                          </div>
                          {% endif %}
                          {% if custom_field.type == 'textarea' %}
                          <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}">
                            <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
                            <div class="col-sm-10">
                              <textarea name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" rows="5" placeholder="{{ custom_field.name }}" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control">{% if account_custom_field[custom_field.custom_field_id] %}{{ account_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}</textarea>
                              {% if error_custom_field[custom_field.custom_field_id] %}
                              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
                              {% endif %}
                            </div>
                          </div>
                          {% endif %}
                          {% if custom_field.type == 'file' %}
                          <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}">
                            <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
                            <div class="col-sm-10">
                              <button type="button" id="button-custom-field{{ custom_field.custom_field_id }}" data-loading-text="{{ text_loading }}" class="btn btn-default"><i class="fa fa-upload"></i> {{ button_upload }}</button>
                              <input type="hidden" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if account_custom_field[custom_field.custom_field_id] %}{{ account_custom_field[custom_field.custom_field_id] }} {% endif %}" />
                              {% if error_custom_field[custom_field.custom_field_id] %}
                              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
                              {% endif %}
                            </div>
                          </div>
                          {% endif %}
                          {% if custom_field.type == 'date' %}
                          <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}">
                            <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
                            <div class="col-sm-10">
                              <div class="input-group date">
                                <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if account_custom_field[custom_field.custom_field_id] %}{{ account_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}" placeholder="{{ custom_field.name }}" data-date-format="YYYY-MM-DD" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control" />
                                <span class="input-group-btn">
                                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                                </span></div>
                              {% if error_custom_field[custom_field.custom_field_id] %}
                              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
                              {% endif %}
                            </div>
                          </div>
                          {% endif %}
                          {% if custom_field.type == 'time' %}
                          <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}">
                            <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
                            <div class="col-sm-10">
                              <div class="input-group time">
                                <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if account_custom_field[custom_field.custom_field_id] %}{{ account_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}" placeholder="{{ custom_field.name }}" data-date-format="HH:mm" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control" />
                                <span class="input-group-btn">
                                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                                </span></div>
                              {% if error_custom_field[custom_field.custom_field_id] %}
                              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
                              {% endif %}
                            </div>
                          </div>
                          {% endif %}
                          {% if custom_field.type == 'time' %}
                          <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}">
                            <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
                            <div class="col-sm-10">
                              <div class="input-group datetime">
                                <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if account_custom_field[custom_field.custom_field_id] %}{{ account_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}" placeholder="{{ custom_field.name }}" data-date-format="YYYY-MM-DD HH:mm" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control" />
                                <span class="input-group-btn">
                                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                                </span></div>
                              {% if error_custom_field[custom_field.custom_field_id] %}
                              <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
                              {% endif %}
                            </div>
                          </div>
                          {% endif %}
                          {% endfor %}
                        </fieldset>
                        <div class="buttons clearfix">
                          {#<div class="pull-left"><a href="{{ back }}" class="btn btn-success">{{ button_back }}</a></div>#}
                          <div class="pull-right">
                            <input type="submit" value="Save" class="btn btn-success" />
                          </div>
                        </div>
                      </form>
                  </div>
                </div>
                <div class="tab-pane" id="member_tab" role="tabpanel">
                    <div class="sv-tab-panel">
                        <h3>Membership Details</h3>

                        <table class="table table-striped col-sm-6 mt-4">
                          <tbody>
                            <tr>
                              <th scope="row">Membership Type:</th>
                              <td>{{ membership }}</td>
                            </tr>
                            <tr>
                              <th scope="row">Membership Fee (18% GST + 2% Transaction charge):</th>
                              <td>{{ membership_currency }} {{ membership_fee }}</td>
                            </tr>
                            <tr>
                              <th scope="row">Paid:</th>
                              <td>{{ membership_currency }} {{ paid }}</td>
                            </tr>
                            <tr>
                              <th scope="row">Balance:</th>
                              <td>{{ membership_currency }} {{ balance }}</td>
                            </tr>

                            
                            {% if customer_id == 2393 %}
                            <tr class="hidden">
                              <th scope="row"></th>
                              <td colspan="2">
                                <?php Include 'pgRedirect.php' ?>
                                <form method="post" action="pgRedirect.php">
                                  <table border="1">
                                    <tbody>
                                      <tr style="display: none;">
                                        <td><input id="ORDER_ID" tabindex="1" maxlength="20" size="20" name="ORDER_ID" autocomplete="off" value="ORDER_{{random(100,200)}}_{{customer_id}}">
                                        </td>
                                      </tr>
                                      <tr  style="display: none;">
                                        <td><input id="CUST_ID" tabindex="2" maxlength="12" size="12" name="CUST_ID" autocomplete="off" value="{{customer_id}}"></td>
                                      </tr>
                                      <tr style="display: none;">
                                        <td><input id="INDUSTRY_TYPE_ID" tabindex="4" maxlength="12" size="12" name="INDUSTRY_TYPE_ID" autocomplete="off" value="Retail"></td>
                                      </tr>
                                      <tr style="display: none;">
                                        <td><input id="CHANNEL_ID" tabindex="4" maxlength="12" size="12" name="CHANNEL_ID" autocomplete="off" value="WEB">
                                        </td>
                                      </tr>
                                      <tr style="display: none;">
                                        <td><input title="TXN_AMOUNT" tabindex="10" type="text" name="TXN_AMOUNT" value="1">
                                        </td>
                                      </tr>
                                      <tr>
                                        <td><input class="btn btn-success" value="Pay" type="submit" onclick=""></td>
                                      </tr>
                                    </tbody>
                                  </table>
                                </form>
                              </td>
                            </tr>        

                            {% endif %}

                          </tbody>
                        </table>
                    </div>
                </div>

                <div class="tab-pane" id="journal_tab" role="tabpanel">
                    <div class="sv-tab-panel row">

                        <div class="col-md-8">
                            <h3>Online Journal Access</h3>

                            <p>The electronic content of the journal “Indian Phytopathology” via Springer Link is available for the members of the Society. </p>

                            <p>Kindly click on the <a target="_blank" href="https://login.springer.com/public/gb/login?url=https%3A%2F%2Fwww.springer.com&flavour=springer"><u><b>https://login.springer.com/public/gb/login?url=https%3A%2F%2Fwww.springer.com&flavour=springer</b></u></a> to create and activate your account with the Online Journal Access Code given below:</p>
                        </div>

                        <div class="col-md-4 text-center">
                          <a target="_blank" href="https://www.springer.com/journal/42360"><img src="https://media.springernature.com/w92/springer-static/cover/journal/42360.jpg" style="width: 85%"></a>
                        </div>

                        <div class="col-md-12">
                          <p><b style="text-align: left !important">Activation Code: </b><span id="activation_code">{{ activation_code }}</span></p>
                            <p><b>Validity:</b><span id="code_validity"> {{code_validity}}</span></p>
                        </div>
                        
                        
                    </div>
                </div>

                <div class="tab-pane" id="award_tab" role="tabpanel">
                    <div class="sv-tab-panel row">
                        <div class="col-md-8">
                            <h3>Award</h3>

                            <h5>Pending Form</h5>
                            {% if pending_awards %}
                              <table class="table">
                                <thead>
                                  <tr>
                                    <th scope="col">#</th>
                                    <th scope="col">Award</th>
                                    <th scope="col">Edit</th>
                                  </tr>
                                </thead>
                                <tbody>
                                  {% for key, award in pending_awards %}
                                  <tr>
                                    <th scope="row">{{key+1}}</th>
                                    <td>{{award.awardname}}</td>
                                    <td><a href="{{award.href}}"><i class="fa fa-edit"></i></a></td>
                                  </tr>
                                  {% endfor %}
                                </tbody>
                              </table>
                            {% else %}
                            <p>No Pending Awards</p>
                            {% endif %}

                            <h5>Submitted Form</h5>
                            {% if submitted_awards %}
                              <table class="table">
                                <thead>
                                  <tr>
                                    <th scope="col">#</th>
                                    <th scope="col">Award</th>
                                    <th scope="col">Year</th>
                                    <th scope="col">View</th>
                                    <!-- <th scope="col">Download</th> -->
                                  </tr>
                                </thead>
                                <tbody>
                                  {% for key, award in submitted_awards %}
                                  <tr>
                                    <th scope="row">{{key+1}}</th>
                                    <td>{{award.awardname}}</td>
                                    <td>{{award.year}}</td>
                                    <td><a href="{{award.href}}"><button class="btn btn-success">View</button></a></td>
                                    <!-- <td><a href="{{award.href}}" download><button class="btn btn-success">Download</button></a></td> -->
                                  </tr>
                                  {% endfor %}
                                </tbody>
                              </table>
                            {% else %}
                            <p>No Pending Awards</p>
                            {% endif %}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</section>
<script type="text/javascript"><!--
// Sort the custom fields
$('.form-group[data-sort]').detach().each(function() {
  if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('.form-group').length) {
    $('.form-group').eq($(this).attr('data-sort')).before(this);
  }

  if ($(this).attr('data-sort') > $('.form-group').length) {
    $('.form-group:last').after(this);
  }

  if ($(this).attr('data-sort') == $('.form-group').length) {
    $('.form-group:last').after(this);
  }

  if ($(this).attr('data-sort') < -$('.form-group').length) {
    $('.form-group:first').before(this);
  }
});
//--></script>
<script type="text/javascript"><!--
$('button[id^=\'button-custom-field\']').on('click', function() {
  var element = this;

  $('#form-upload').remove();

  $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');

  $('#form-upload input[name=\'file\']').trigger('click');

  if (typeof timer != 'undefined') {
      clearInterval(timer);
  }

  timer = setInterval(function() {
    if ($('#form-upload input[name=\'file\']').val() != '') {
      clearInterval(timer);

      $.ajax({
        url: 'index.php?route=tool/upload',
        type: 'post',
        dataType: 'json',
        data: new FormData($('#form-upload')[0]),
        cache: false,
        contentType: false,
        processData: false,
        beforeSend: function() {
          $(element).button('loading');
        },
        complete: function() {
          $(element).button('reset');
        },
        success: function(json) {
          $(element).parent().find('.text-danger').remove();

          if (json['error']) {
            $(element).parent().find('input').after('<div class="text-danger">' + json['error'] + '</div>');
          }

          if (json['success']) {
            alert(json['success']);

            $(element).parent().find('input').val(json['code']);
          }
        },
        error: function(xhr, ajaxOptions, thrownError) {
          alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
        }
      });
    }
  }, 500);
});
//--></script>
<script type="text/javascript"><!--
$('.date').datetimepicker({
  language: '{{ datepicker }}',
  pickTime: false
});

$('.datetime').datetimepicker({
  language: '{{ datepicker }}',
  pickDate: true,
  pickTime: true
});

$('.time').datetimepicker({
  language: '{{ datepicker }}',
  pickDate: false
});
//--></script>
{{ footer }}
