shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

register.twig (40973B)


      1 {{ header }}
      2 <div id="affiliate-register" class="container">
      3   <ul class="breadcrumb">
      4     {% for breadcrumb in breadcrumbs %}
      5     <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
      6     {% endfor %}
      7   </ul>
      8   {% if error_warning %}
      9   <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}</div>
     10   {% endif %}
     11   <div class="row">{{ column_left }}
     12     {% if column_left and column_right %}
     13     {% set class = 'col-sm-6' %}
     14     {% elseif column_left or column_right %}
     15     {% set class = 'col-sm-9' %}
     16     {% else %}
     17     {% set class = 'col-sm-12' %}
     18     {% endif %}
     19     <div id="content" class="{{ class }}">{{ content_top }}
     20       <h1>{{ heading_title }}</h1>
     21       <p>{{ text_account_already }}</p>
     22       <p>{{ text_signup }}</p>
     23       <form action="{{ action }}" method="post" enctype="multipart/form-data" class="form-horizontal">
     24         <fieldset id="account">
     25           <legend>{{ text_your_details }}</legend>
     26           <div class="form-group required" style="display: {% if customer_groups|length > 1 %} block {% else %} none {% endif %};">
     27             <label class="col-sm-2 control-label">{{ entry_customer_group }}</label>
     28             <div class="col-sm-10">{% for customer_group in customer_groups %}
     29               {% if customer_group.customer_group_id == customer_group_id %}
     30               <div class="radio">
     31                 <label>
     32                   <input type="radio" name="customer_group_id" value="{{ customer_group.customer_group_id }}" checked="checked" />
     33                   {{ customer_group.name }}</label>
     34               </div>
     35               {% else %}
     36               <div class="radio">
     37                 <label>
     38                   <input type="radio" name="customer_group_id" value="{{ customer_group.customer_group_id }}" />
     39                   {{ customer_group.name }}</label>
     40               </div>
     41               {% endif %}
     42               {% endfor %}</div>
     43           </div>
     44           <div class="form-group required">
     45             <label class="col-sm-2 control-label" for="input-firstname">{{ entry_firstname }}</label>
     46             <div class="col-sm-10">
     47               <input type="text" name="firstname" value="{{ firstname }}" placeholder="{{ entry_firstname }}" id="input-firstname" class="form-control" />
     48               {% if error_firstname %}
     49               <div class="text-danger">{{ error_firstname }}</div>
     50               {% endif %} </div>
     51           </div>
     52           <div class="form-group required">
     53             <label class="col-sm-2 control-label" for="input-lastname">{{ entry_lastname }}</label>
     54             <div class="col-sm-10">
     55               <input type="text" name="lastname" value="{{ lastname }}" placeholder="{{ entry_lastname }}" id="input-lastname" class="form-control" />
     56               {% if error_lastname %}
     57               <div class="text-danger">{{ error_lastname }}</div>
     58               {% endif %} </div>
     59           </div>
     60           <div class="form-group required">
     61             <label class="col-sm-2 control-label" for="input-email">{{ entry_email }}</label>
     62             <div class="col-sm-10">
     63               <input type="text" name="email" value="{{ email }}" placeholder="{{ entry_email }}" id="input-email" class="form-control" />
     64               {% if error_email %}
     65               <div class="text-danger">{{ error_email }}</div>
     66               {% endif %} </div>
     67           </div>
     68           <div class="form-group required">
     69             <label class="col-sm-2 control-label" for="input-telephone">{{ entry_telephone }}</label>
     70             <div class="col-sm-10">
     71               <input type="text" name="telephone" value="{{ telephone }}" placeholder="{{ entry_telephone }}" id="input-telephone" class="form-control" />
     72               {% if error_telephone %}
     73               <div class="text-danger">{{ error_telephone }}</div>
     74               {% endif %} </div>
     75           </div>
     76           {% for custom_field in custom_fields %}
     77           {% if custom_field.location == 'account' %}
     78           {% if custom_field.type == 'select' %}
     79           <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
     80             <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
     81             <div class="col-sm-10">
     82               <select name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control">
     83                 <option value="">{{ text_select }}</option>
     84                 
     85                 
     86                 
     87                 
     88                 
     89                 
     90                 {% for custom_field_value in custom_field.custom_field_value %}
     91                 {% if register_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == register_custom_field[custom_field.custom_field_id] %}
     92                 
     93                 
     94                 
     95                 
     96                 
     97                 <option value="{{ custom_field_value.custom_field_value_id }}" selected="selected">{{ custom_field_value.name }}</option>
     98                 
     99                 
    100                 
    101                 
    102                 
    103                 
    104                 {% else %}
    105                 
    106                 
    107                 
    108                 
    109                 
    110                 
    111                 <option value="{{ custom_field_value.custom_field_value_id }}">{{ custom_field_value.name }}</option>
    112                 
    113                 
    114                 
    115                 
    116                 
    117                 
    118                 {% endif %}
    119                 {% endfor %}
    120               
    121               
    122               
    123               
    124               
    125               
    126               </select>
    127               {% if error_custom_field[custom_field.custom_field_id] %}
    128               <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    129               {% endif %} </div>
    130           </div>
    131           {% endif %}
    132           {% if custom_field.type == 'radio' %}
    133           <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    134             <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
    135             <div class="col-sm-10">
    136               <div> {% for custom_field_value in custom_field.custom_field_value %}
    137                 <div class="radio"> {% if register_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == register_custom_field[custom_field.custom_field_id] %}
    138                   <label>
    139                     <input type="radio" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" checked="checked" />
    140                     {{ custom_field_value.name }}</label>
    141                   {% else %}
    142                   <label>
    143                     <input type="radio" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" />
    144                     {{ custom_field_value.name }}</label>
    145                   {% endif %} </div>
    146                 {% endfor %} </div>
    147               {% if error_custom_field[custom_field.custom_field_id] %}
    148               <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    149               {% endif %} </div>
    150           </div>
    151           {% endif %}
    152           {% if custom_field.type == 'checkbox' %}
    153           <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    154             <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
    155             <div class="col-sm-10">
    156               <div> {% for custom_field_value in custom_field.custom_field_value %}
    157                 <div class="checkbox">{% if register_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id in register_custom_field[custom_field.custom_field_id] %}
    158                   <label>
    159                     <input type="checkbox" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" checked="checked" />
    160                     {{ custom_field_value.name }}</label>
    161                   {% else %}
    162                   <label>
    163                     <input type="checkbox" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" />
    164                     {{ custom_field_value.name }}</label>
    165                   {% endif %} </div>
    166                 {% endfor %} </div>
    167               {% if error_custom_field[custom_field.custom_field_id] %}
    168               <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    169               {% endif %} </div>
    170           </div>
    171           {% endif %}
    172           {% if custom_field.type == 'text' %}
    173           <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    174             <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
    175             <div class="col-sm-10">
    176               <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}{{ register_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" />
    177               {% if error_custom_field[custom_field.custom_field_id] %}
    178               <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    179               {% endif %} </div>
    180           </div>
    181           {% endif %}
    182           {% if custom_field.type == 'textarea' %}
    183           <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    184             <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
    185             <div class="col-sm-10">
    186               <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 register_custom_field[custom_field.custom_field_id] %}{{ register_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}</textarea>
    187               {% if error_custom_field[custom_field.custom_field_id] %}
    188               <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    189               {% endif %} </div>
    190           </div>
    191           {% endif %}
    192           {% if custom_field.type == 'file' %}
    193           <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    194             <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
    195             <div class="col-sm-10">
    196               <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>
    197               <input type="hidden" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}  {{ register_custom_field[custom_field.custom_field_id] }} {% endif %}" />
    198               {% if error_custom_field[custom_field.custom_field_id] %}
    199               <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    200               {% endif %}</div>
    201           </div>
    202           {% endif %}
    203           {% if custom_field.type == 'date' %}
    204           <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    205             <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
    206             <div class="col-sm-10">
    207               <div class="input-group date">
    208                 <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}{{ register_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" />
    209                 <span class="input-group-btn">
    210                 <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
    211                 </span></div>
    212               {% if error_custom_field[custom_field.custom_field_id] %}
    213               <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    214               {% endif %} </div>
    215           </div>
    216           {% endif %}
    217           {% if custom_field.type == 'time' %}
    218           <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    219             <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
    220             <div class="col-sm-10">
    221               <div class="input-group time">
    222                 <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}{{ register_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" />
    223                 <span class="input-group-btn">
    224                 <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
    225                 </span></div>
    226               {% if error_custom_field[custom_field.custom_field_id] %}
    227               <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    228               {% endif %} </div>
    229           </div>
    230           {% endif %}
    231           {% if custom_field.type == 'time' %}
    232           <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    233             <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
    234             <div class="col-sm-10">
    235               <div class="input-group datetime">
    236                 <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}{{ register_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" />
    237                 <span class="input-group-btn">
    238                 <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
    239                 </span></div>
    240               {% if error_custom_field[custom_field.custom_field_id] %}
    241               <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    242               {% endif %} </div>
    243           </div>
    244           {% endif %}
    245           {% endif %}
    246           {% endfor %}
    247         </fieldset>
    248         <fieldset id="affiliate">
    249           <legend>{{ text_your_affiliate }}</legend>
    250           <div class="form-group">
    251             <label class="col-sm-2 control-label" for="input-company">{{ entry_company }}</label>
    252             <div class="col-sm-10">
    253               <input type="text" name="company" value="{{ company }}" placeholder="{{ entry_company }}" id="input-company" class="form-control" />
    254             </div>
    255           </div>       
    256           
    257           <div class="form-group">
    258             <label class="col-sm-2 control-label" for="input-website">{{ entry_website }}</label>
    259             <div class="col-sm-10">
    260               <input type="text" name="website" value="{{ website }}" placeholder="{{ entry_website }}" id="input-website" class="form-control" />
    261             </div>
    262           </div>
    263           <div class="form-group">
    264             <label class="col-sm-2 control-label" for="input-tax">{{ entry_tax }}</label>
    265             <div class="col-sm-10">
    266               <input type="text" name="tax" value="{{ tax }}" placeholder="{{ entry_tax }}" id="input-tax" class="form-control" />
    267             </div>
    268           </div>
    269           <div class="form-group">
    270             <label class="col-sm-2 control-label">{{ entry_payment }}</label>
    271             <div class="col-sm-10">
    272               <div class="radio">
    273                 <label> {% if payment == 'cheque' %}
    274                   <input type="radio" name="payment" value="cheque" checked="checked" />
    275                   {% else %}
    276                   <input type="radio" name="payment" value="cheque" />
    277                   {% endif %}
    278                   {{ text_cheque }}</label>
    279               </div>
    280               <div class="radio">
    281                 <label> {% if payment == 'paypal' %}
    282                   <input type="radio" name="payment" value="paypal" checked="checked" />
    283                   {% else %}
    284                   <input type="radio" name="payment" value="paypal" />
    285                   {% endif %}
    286                   {{ text_paypal }}</label>
    287               </div>
    288               <div class="radio">
    289                 <label> {% if payment == 'bank' %}
    290                   <input type="radio" name="payment" value="bank" checked="checked" />
    291                   {% else %}
    292                   <input type="radio" name="payment" value="bank" />
    293                   {% endif %}
    294                   {{ text_bank }}</label>
    295               </div>
    296             </div>
    297           </div>
    298           <div class="form-group payment required" id="payment-cheque">
    299             <label class="col-sm-2 control-label" for="input-cheque">{{ entry_cheque }}</label>
    300             <div class="col-sm-10">
    301               <input type="text" name="cheque" value="{{ cheque }}" placeholder="{{ entry_cheque }}" id="input-cheque" class="form-control" />
    302               {% if error_cheque %}
    303               <div class="text-danger">{{ error_cheque }}</div>
    304               {% endif %} </div>
    305           </div>
    306           <div class="form-group payment required" id="payment-paypal">
    307             <label class="col-sm-2 control-label" for="input-paypal">{{ entry_paypal }}</label>
    308             <div class="col-sm-10">
    309               <input type="text" name="paypal" value="{{ paypal }}" placeholder="{{ entry_paypal }}" id="input-paypal" class="form-control" />
    310               {% if error_paypal %}
    311               <div class="text-danger">{{ error_paypal }}</div>
    312               {% endif %} </div>
    313           </div>
    314           <div class="payment" id="payment-bank">
    315             <div class="form-group">
    316               <label class="col-sm-2 control-label" for="input-bank-name">{{ entry_bank_name }}</label>
    317               <div class="col-sm-10">
    318                 <input type="text" name="bank_name" value="{{ bank_name }}" placeholder="{{ entry_bank_name }}" id="input-bank-name" class="form-control" />
    319               </div>
    320             </div>
    321             <div class="form-group">
    322               <label class="col-sm-2 control-label" for="input-bank-branch-number">{{ entry_bank_branch_number }}</label>
    323               <div class="col-sm-10">
    324                 <input type="text" name="bank_branch_number" value="{{ bank_branch_number }}" placeholder="{{ entry_bank_branch_number }}" id="input-bank-branch-number" class="form-control" />
    325               </div>
    326             </div>
    327             <div class="form-group">
    328               <label class="col-sm-2 control-label" for="input-bank-swift-code">{{ entry_bank_swift_code }}</label>
    329               <div class="col-sm-10">
    330                 <input type="text" name="bank_swift_code" value="{{ bank_swift_code }}" placeholder="{{ entry_bank_swift_code }}" id="input-bank-swift-code" class="form-control" />
    331               </div>
    332             </div>
    333             <div class="form-group required">
    334               <label class="col-sm-2 control-label" for="input-bank-account-name">{{ entry_bank_account_name }}</label>
    335               <div class="col-sm-10">
    336                 <input type="text" name="bank_account_name" value="{{ bank_account_name }}" placeholder="{{ entry_bank_account_name }}" id="input-bank-account-name" class="form-control" />
    337                 {% if error_bank_account_name %}
    338                 <div class="text-danger">{{ error_bank_account_name }}</div>
    339                 {% endif %} </div>
    340             </div>
    341             <div class="form-group required">
    342               <label class="col-sm-2 control-label" for="input-bank-account-number">{{ entry_bank_account_number }}</label>
    343               <div class="col-sm-10">
    344                 <input type="text" name="bank_account_number" value="{{ bank_account_number }}" placeholder="{{ entry_bank_account_number }}" id="input-bank-account-number" class="form-control" />
    345                 {% if error_bank_account_number %}
    346                 <div class="text-danger">{{ error_bank_account_number }}</div>
    347                 {% endif %} </div>
    348             </div>
    349             {% for custom_field in custom_fields %}
    350             {% if custom_field.location == 'affiliate' %}
    351             {% if custom_field.type == 'select' %}
    352             <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    353               <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
    354               <div class="col-sm-10">
    355                 <select name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control">
    356                   <option value="">{{ text_select }}</option>
    357                   
    358                 
    359                 
    360                 
    361                 
    362                 
    363                 
    364                 {% for custom_field_value in custom_field.custom_field_value %}
    365                 {% if register_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == register_custom_field[custom_field.custom_field_id] %}
    366                 
    367                 
    368                 
    369                 
    370                 
    371                   <option value="{{ custom_field_value.custom_field_value_id }}" selected="selected">{{ custom_field_value.name }}</option>
    372                   
    373                 
    374                 
    375                 
    376                 
    377                 
    378                 
    379                 {% else %}
    380                 
    381                 
    382                 
    383                 
    384                 
    385                 
    386                 
    387                   <option value="{{ custom_field_value.custom_field_value_id }}">{{ custom_field_value.name }}</option>
    388                   
    389                 
    390                 
    391                 
    392                 
    393                 
    394                 
    395                 {% endif %}
    396                 {% endfor %}
    397               
    398               
    399               
    400               
    401               
    402               
    403               
    404                 </select>
    405                 {% if error_custom_field[custom_field.custom_field_id] %}
    406                 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    407                 {% endif %} </div>
    408             </div>
    409             {% endif %}
    410             {% if custom_field.type == 'radio' %}
    411             <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    412               <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
    413               <div class="col-sm-10">
    414                 <div> {% for custom_field_value in custom_field.custom_field_value %}
    415                   <div class="radio"> {% if register_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == register_custom_field[custom_field.custom_field_id] %}
    416                     <label>
    417                       <input type="radio" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" checked="checked" />
    418                       {{ custom_field_value.name }}</label>
    419                     {% else %}
    420                     <label>
    421                       <input type="radio" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" />
    422                       {{ custom_field_value.name }}</label>
    423                     {% endif %} </div>
    424                   {% endfor %} </div>
    425                 {% if error_custom_field[custom_field.custom_field_id] %}
    426                 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    427                 {% endif %} </div>
    428             </div>
    429             {% endif %}
    430             {% if custom_field.type == 'checkbox' %}
    431             <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    432               <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
    433               <div class="col-sm-10">
    434                 <div> {% for custom_field_value in custom_field.custom_field_value %}
    435                   <div class="checkbox"> {% if register_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == register_custom_field[custom_field.custom_field_id] %}
    436                     <label>
    437                       <input type="checkbox" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" checked="checked" />
    438                       {{ custom_field_value.name }}</label>
    439                     {% else %}
    440                     <label>
    441                       <input type="checkbox" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" />
    442                       {{ custom_field_value.name }}</label>
    443                     {% endif %} </div>
    444                   {% endfor %} </div>
    445                 {% if error_custom_field[custom_field.custom_field_id] %}
    446                 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    447                 {% endif %} </div>
    448             </div>
    449             {% endif %}
    450             {% if custom_field.type == 'text' %}
    451             <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    452               <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
    453               <div class="col-sm-10">
    454                 <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}{{ register_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" />
    455                 {% if error_custom_field[custom_field.custom_field_id] %}
    456                 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    457                 {% endif %} </div>
    458             </div>
    459             {% endif %}
    460             {% if custom_field.type == 'textarea' %}
    461             <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    462               <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
    463               <div class="col-sm-10">
    464                 <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 register_custom_field[custom_field.custom_field_id] %}{{ register_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}</textarea>
    465                 {% if error_custom_field[custom_field.custom_field_id] %}
    466                 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    467                 {% endif %} </div>
    468             </div>
    469             {% endif %}
    470             {% if custom_field.type == 'file' %}
    471             <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    472               <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
    473               <div class="col-sm-10">
    474                 <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>
    475                 <input type="hidden" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}  {{ register_custom_field[custom_field.custom_field_id] }} {% endif %}" />
    476                 {% if error_custom_field[custom_field.custom_field_id] %}
    477                 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    478                 {% endif %} </div>
    479             </div>
    480             {% endif %}
    481             {% if custom_field.type == 'date' %}
    482             <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    483               <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
    484               <div class="col-sm-10">
    485                 <div class="input-group date">
    486                   <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}{{ register_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" />
    487                   <span class="input-group-btn">
    488                   <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
    489                   </span></div>
    490                 {% if error_custom_field[custom_field.custom_field_id] %}
    491                 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    492                 {% endif %} </div>
    493             </div>
    494             {% endif %}
    495             {% if custom_field.type == 'time' %}
    496             <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    497               <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
    498               <div class="col-sm-10">
    499                 <div class="input-group time">
    500                   <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}{{ register_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" />
    501                   <span class="input-group-btn">
    502                   <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
    503                   </span></div>
    504                 {% if error_custom_field[custom_field.custom_field_id] %}
    505                 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    506                 {% endif %} </div>
    507             </div>
    508             {% endif %}
    509             {% if custom_field.type == 'time' %}
    510             <div id="custom-field{{ custom_field.custom_field_id }}" class="form-group custom-field" data-sort="{{ custom_field.sort_order }}">
    511               <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
    512               <div class="col-sm-10">
    513                 <div class="input-group datetime">
    514                   <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if register_custom_field[custom_field.custom_field_id] %}{{ register_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" />
    515                   <span class="input-group-btn">
    516                   <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
    517                   </span></div>
    518                 {% if error_custom_field[custom_field.custom_field_id] %}
    519                 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div>
    520                 {% endif %} </div>
    521             </div>
    522             {% endif %}
    523             {% endif %}
    524             {% endfor %} </div>
    525         </fieldset>
    526         <fieldset>
    527           <legend>{{ text_your_password }}</legend>
    528           <div class="form-group required">
    529             <label class="col-sm-2 control-label" for="input-password">{{ entry_password }}</label>
    530             <div class="col-sm-10">
    531               <input type="password" name="password" value="{{ password }}" placeholder="{{ entry_password }}" id="input-password" class="form-control" />
    532               {% if error_password %}
    533               <div class="text-danger">{{ error_password }}</div>
    534               {% endif %} </div>
    535           </div>
    536           <div class="form-group required">
    537             <label class="col-sm-2 control-label" for="input-confirm">{{ entry_confirm }}</label>
    538             <div class="col-sm-10">
    539               <input type="password" name="confirm" value="{{ confirm }}" placeholder="{{ entry_confirm }}" id="input-confirm" class="form-control" />
    540               {% if error_confirm %}
    541               <div class="text-danger">{{ error_confirm }}</div>
    542               {% endif %} </div>
    543           </div>
    544         </fieldset>
    545         {{ captcha }}
    546         {% if text_agree %}
    547         <div class="buttons clearfix">
    548           <div class="pull-right">{{ text_agree }}
    549             {% if agree %}
    550             <input type="checkbox" name="agree" value="1" checked="checked" />
    551             {% else %}
    552             <input type="checkbox" name="agree" value="1" />
    553             {% endif %}
    554             &nbsp;
    555             <input type="submit" value="{{ button_continue }}" class="btn btn-primary" />
    556           </div>
    557         </div>
    558         {% else %}
    559         <div class="buttons clearfix">
    560           <div class="pull-right">
    561             <input type="submit" value="{{ button_continue }}" class="btn btn-primary" />
    562           </div>
    563         </div>
    564         {% endif %}
    565       </form>
    566       {{ content_bottom }}</div>
    567     {{ column_right }}</div>
    568 </div>
    569 <script type="text/javascript"><!--
    570 // Sort the custom fields
    571 $('#account .form-group[data-sort]').detach().each(function() {
    572 	if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('#account .form-group').length) {
    573 		$('#account .form-group').eq($(this).attr('data-sort')).before(this);
    574 	}
    575 
    576 	if ($(this).attr('data-sort') > $('#account .form-group').length) {
    577 		$('#account .form-group:last').after(this);
    578 	}
    579 
    580 	if ($(this).attr('data-sort') == $('#account .form-group').length) {
    581 		$('#account .form-group:last').after(this);
    582 	}
    583 
    584 	if ($(this).attr('data-sort') < -$('#account .form-group').length) {
    585 		$('#account .form-group:first').before(this);
    586 	}
    587 });
    588 
    589 $('#affiliate .form-group[data-sort]').detach().each(function() {
    590 	if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('#affiliate .form-group').length) {
    591 		$('#affiliate .form-group').eq($(this).attr('data-sort')).before(this);
    592 	}
    593 
    594 	if ($(this).attr('data-sort') > $('#affiliate .form-group').length) {
    595 		$('#affiliate .form-group:last').after(this);
    596 	}
    597 
    598 	if ($(this).attr('data-sort') == $('#affiliate .form-group').length) {
    599 		$('#affiliate .form-group:last').after(this);
    600 	}
    601 
    602 	if ($(this).attr('data-sort') < -$('#affiliate .form-group').length) {
    603 		$('#affiliate .form-group:first').before(this);
    604 	}
    605 });
    606 
    607 $('input[name=\'customer_group_id\']').on('change', function() {
    608 	$.ajax({
    609 		url: 'index.php?route=account/register/customfield&customer_group_id=' + this.value,
    610 		dataType: 'json',
    611 		success: function(json) {
    612 			$('.custom-field').hide();
    613 			$('.custom-field').removeClass('required');
    614 
    615 			for (i = 0; i < json.length; i++) {
    616 				custom_field = json[i];
    617 
    618 				$('#custom-field' + custom_field['custom_field_id']).show();
    619 
    620 				if (custom_field['required']) {
    621 					$('#custom-field' + custom_field['custom_field_id']).addClass('required');
    622 				}
    623 			}
    624 		},
    625 		error: function(xhr, ajaxOptions, thrownError) {
    626 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    627 		}
    628 	});
    629 });
    630 
    631 $('input[name=\'customer_group_id\']:checked').trigger('change');
    632 //--></script> 
    633 <script type="text/javascript"><!--
    634 $('button[id^=\'button-custom-field\']').on('click', function() {
    635 	var node = this;
    636 
    637 	$('#form-upload').remove();
    638 
    639 	$('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');
    640 
    641 	$('#form-upload input[name=\'file\']').trigger('click');
    642 
    643 	if (typeof timer != 'undefined') {
    644     	clearInterval(timer);
    645 	}
    646 
    647 	timer = setInterval(function() {
    648 		if ($('#form-upload input[name=\'file\']').val() != '') {
    649 			clearInterval(timer);
    650 
    651 			$.ajax({
    652 				url: 'index.php?route=tool/upload',
    653 				type: 'post',
    654 				dataType: 'json',
    655 				data: new FormData($('#form-upload')[0]),
    656 				cache: false,
    657 				contentType: false,
    658 				processData: false,
    659 				beforeSend: function() {
    660 					$(node).button('loading');
    661 				},
    662 				complete: function() {
    663 					$(node).button('reset');
    664 				},
    665 				success: function(json) {
    666 					$(node).parent().find('.text-danger').remove();
    667 
    668 					if (json['error']) {
    669 						$(node).parent().find('input').after('<div class="text-danger">' + json['error'] + '</div>');
    670 					}
    671 
    672 					if (json['success']) {
    673 						alert(json['success']);
    674 
    675 						$(node).parent().find('input').val(json['code']);
    676 					}
    677 				},
    678 				error: function(xhr, ajaxOptions, thrownError) {
    679 					alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    680 				}
    681 			});
    682 		}
    683 	}, 500);
    684 });
    685 //--></script> 
    686 <script type="text/javascript"><!--
    687 $('.date').datetimepicker({
    688 	language: '{{ datepicker }}',
    689 	pickTime: false
    690 });
    691 
    692 $('.time').datetimepicker({
    693 	language: '{{ datepicker }}',
    694 	pickDate: false
    695 });
    696 
    697 $('.datetime').datetimepicker({
    698 	language: '{{ datepicker }}',
    699 	pickDate: true,
    700 	pickTime: true
    701 });
    702 //--></script>
    703 <script type="text/javascript"><!--
    704 $('input[name=\'payment\']').on('change', function() {
    705 	$('.payment').hide();
    706 
    707 	$('#payment-' + this.value).show();
    708 });
    709 
    710 $('input[name=\'payment\']:checked').trigger('change');
    711 //--></script> 
    712 {{ footer }}