affiliate.twig (22415B)
1 {{ header }} 2 <div id="account-affiliate" 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 <form action="{{ action }}" method="post" enctype="multipart/form-data" class="form-horizontal"> 22 <fieldset> 23 <legend>{{ text_my_affiliate }}</legend> 24 <div class="form-group"> 25 <label class="col-sm-2 control-label" for="input-company">{{ entry_company }}</label> 26 <div class="col-sm-10"> 27 <input type="text" name="company" value="{{ company }}" placeholder="{{ entry_company }}" id="input-company" class="form-control" /> 28 </div> 29 </div> 30 <div class="form-group"> 31 <label class="col-sm-2 control-label" for="input-website">{{ entry_website }}</label> 32 <div class="col-sm-10"> 33 <input type="text" name="website" value="{{ website }}" placeholder="{{ entry_website }}" id="input-website" class="form-control" /> 34 </div> 35 </div> 36 </fieldset> 37 <fieldset> 38 <legend>{{ text_payment }}</legend> 39 <div class="form-group"> 40 <label class="col-sm-2 control-label" for="input-tax">{{ entry_tax }}</label> 41 <div class="col-sm-10"> 42 <input type="text" name="tax" value="{{ tax }}" placeholder="{{ entry_tax }}" id="input-tax" class="form-control" /> 43 </div> 44 </div> 45 <div class="form-group"> 46 <label class="col-sm-2 control-label">{{ entry_payment }}</label> 47 <div class="col-sm-10"> 48 <div class="radio"> 49 <label>{% if payment == 'cheque' %} 50 <input type="radio" name="payment" value="cheque" checked="checked" /> 51 {% else %} 52 <input type="radio" name="payment" value="cheque" /> 53 {% endif %} 54 {{ text_cheque }}</label> 55 </div> 56 <div class="radio"> 57 <label>{% if payment == 'paypal' %} 58 <input type="radio" name="payment" value="paypal" checked="checked" /> 59 {% else %} 60 <input type="radio" name="payment" value="paypal" /> 61 {% endif %} 62 {{ text_paypal }}</label> 63 </div> 64 <div class="radio"> 65 <label>{% if payment == 'bank' %} 66 <input type="radio" name="payment" value="bank" checked="checked" /> 67 {% else %} 68 <input type="radio" name="payment" value="bank" /> 69 {% endif %} 70 {{ text_bank }}</label> 71 </div> 72 </div> 73 </div> 74 <div class="form-group payment" id="payment-cheque"> 75 <label class="col-sm-2 control-label" for="input-cheque">{{ entry_cheque }}</label> 76 <div class="col-sm-10"> 77 <input type="text" name="cheque" value="{{ cheque }}" placeholder="{{ entry_cheque }}" id="input-cheque" class="form-control" /> 78 {% if error_cheque %} 79 <div class="text-danger">{{ error_cheque }}</div> 80 {% endif %} 81 </div> 82 </div> 83 <div class="form-group payment" id="payment-paypal"> 84 <label class="col-sm-2 control-label" for="input-paypal">{{ entry_paypal }}</label> 85 <div class="col-sm-10"> 86 <input type="text" name="paypal" value="{{ paypal }}" placeholder="{{ entry_paypal }}" id="input-paypal" class="form-control" /> 87 {% if error_paypal %} 88 <div class="text-danger">{{ error_paypal }}</div> 89 {% endif %} 90 </div> 91 </div> 92 <div class="payment" id="payment-bank"> 93 <div class="form-group"> 94 <label class="col-sm-2 control-label" for="input-bank-name">{{ entry_bank_name }}</label> 95 <div class="col-sm-10"> 96 <input type="text" name="bank_name" value="{{ bank_name }}" placeholder="{{ entry_bank_name }}" id="input-bank-name" class="form-control" /> 97 </div> 98 </div> 99 <div class="form-group"> 100 <label class="col-sm-2 control-label" for="input-bank-branch-number">{{ entry_bank_branch_number }}</label> 101 <div class="col-sm-10"> 102 <input type="text" name="bank_branch_number" value="{{ bank_branch_number }}" placeholder="{{ entry_bank_branch_number }}" id="input-bank-branch-number" class="form-control" /> 103 </div> 104 </div> 105 <div class="form-group"> 106 <label class="col-sm-2 control-label" for="input-bank-swift-code">{{ entry_bank_swift_code }}</label> 107 <div class="col-sm-10"> 108 <input type="text" name="bank_swift_code" value="{{ bank_swift_code }}" placeholder="{{ entry_bank_swift_code }}" id="input-bank-swift-code" class="form-control" /> 109 </div> 110 </div> 111 <div class="form-group"> 112 <label class="col-sm-2 control-label" for="input-bank-account-name">{{ entry_bank_account_name }}</label> 113 <div class="col-sm-10"> 114 <input type="text" name="bank_account_name" value="{{ bank_account_name }}" placeholder="{{ entry_bank_account_name }}" id="input-bank-account-name" class="form-control" /> 115 {% if error_bank_account_name %} 116 <div class="text-danger">{{ error_bank_account_name }}</div> 117 {% endif %} 118 </div> 119 </div> 120 <div class="form-group"> 121 <label class="col-sm-2 control-label" for="input-bank-account-number">{{ entry_bank_account_number }}</label> 122 <div class="col-sm-10"> 123 <input type="text" name="bank_account_number" value="{{ bank_account_number }}" placeholder="{{ entry_bank_account_number }}" id="input-bank-account-number" class="form-control" /> 124 {% if error_bank_account_number %} 125 <div class="text-danger">{{ error_bank_account_number }}</div> 126 {% endif %} 127 </div> 128 </div> 129 </div> 130 {% for custom_field in custom_fields %} 131 {% if custom_field.location == 'affiliate' %} 132 {% if custom_field.type == 'select' %} 133 <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}"> 134 <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label> 135 <div class="col-sm-10"> 136 <select name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control"> 137 <option value="">{{ text_select }}</option> 138 {% for custom_field_value in custom_field.custom_field_value %} 139 {% if affiliate_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == affiliate_custom_field[custom_field.custom_field_id] %} 140 <option value="{{ custom_field_value.custom_field_value_id }}" selected="selected">{{ custom_field_value.name }}</option> 141 {% else %} 142 <option value="{{ custom_field_value.custom_field_value_id }}">{{ custom_field_value.name }}</option> 143 {% endif %} 144 {% endfor %} 145 </select> 146 {% if error_custom_field[custom_field.custom_field_id] %} 147 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div> 148 {% endif %} 149 </div> 150 </div> 151 {% endif %} 152 {% if custom_field.type == 'radio' %} 153 <div class="form-group{% if custom_field.required %} required {% endif %} 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> 157 {% for custom_field_value in custom_field.custom_field_value %} 158 <div class="radio"> 159 {% if affiliate_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == affiliate_custom_field[custom_field.custom_field_id] %} 160 <label> 161 <input type="radio" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" checked="checked" /> 162 {{ custom_field_value.name }}</label> 163 {% else %} 164 <label> 165 <input type="radio" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" /> 166 {{ custom_field_value.name }}</label> 167 {% endif %} 168 </div> 169 {% endfor %} 170 </div> 171 {% if error_custom_field[custom_field.custom_field_id] %} 172 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div> 173 {% endif %} 174 </div> 175 </div> 176 {% endif %} 177 {% if custom_field.type == 'checkbox' %} 178 <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}"> 179 <label class="col-sm-2 control-label">{{ custom_field.name }}</label> 180 <div class="col-sm-10"> 181 <div> 182 {% for custom_field_value in custom_field.custom_field_value %} 183 <div class="checkbox"> 184 {% if affiliate_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id in affiliate_custom_field[custom_field.custom_field_id] %} 185 <label> 186 <input type="checkbox" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" checked="checked" /> 187 {{ custom_field_value.name }}</label> 188 {% else %} 189 <label> 190 <input type="checkbox" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" /> 191 {{ custom_field_value.name }}</label> 192 {% endif %} 193 </div> 194 {% endfor %} 195 </div> 196 {% if error_custom_field[custom_field.custom_field_id] %} 197 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div> 198 {% endif %} 199 </div> 200 </div> 201 {% endif %} 202 {% if custom_field.type == 'text' %} 203 <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}"> 204 <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label> 205 <div class="col-sm-10"> 206 <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if affiliate_custom_field[custom_field.custom_field_id] %}{{ affiliate_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" /> 207 {% if error_custom_field[custom_field.custom_field_id] %} 208 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div> 209 {% endif %} 210 </div> 211 </div> 212 {% endif %} 213 {% if custom_field.type == 'textarea' %} 214 <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}"> 215 <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label> 216 <div class="col-sm-10"> 217 <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 affiliate_custom_field[custom_field.custom_field_id] %}{{ affiliate_custom_field[custom_field.custom_field_id] }}{% else %}{{ custom_field.value }}{% endif %}</textarea> 218 {% if error_custom_field[custom_field.custom_field_id] %} 219 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div> 220 {% endif %} 221 </div> 222 </div> 223 {% endif %} 224 {% if custom_field.type == 'file' %} 225 <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}"> 226 <label class="col-sm-2 control-label">{{ custom_field.name }}</label> 227 <div class="col-sm-10"> 228 <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> 229 <input type="hidden" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if affiliate_custom_field[custom_field.custom_field_id] %}{{ affiliate_custom_field[custom_field.custom_field_id] }} {% endif %}" /> 230 {% if error_custom_field[custom_field.custom_field_id] %} 231 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div> 232 {% endif %} 233 </div> 234 </div> 235 {% endif %} 236 {% if custom_field.type == 'date' %} 237 <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}"> 238 <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label> 239 <div class="col-sm-10"> 240 <div class="input-group date"> 241 <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if affiliate_custom_field[custom_field.custom_field_id] %}{{ affiliate_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" /> 242 <span class="input-group-btn"> 243 <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button> 244 </span></div> 245 {% if error_custom_field[custom_field.custom_field_id] %} 246 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div> 247 {% endif %} 248 </div> 249 </div> 250 {% endif %} 251 {% if custom_field.type == 'time' %} 252 <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}"> 253 <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label> 254 <div class="col-sm-10"> 255 <div class="input-group time"> 256 <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if affiliate_custom_field[custom_field.custom_field_id] %}{{ affiliate_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" /> 257 <span class="input-group-btn"> 258 <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button> 259 </span></div> 260 {% if error_custom_field[custom_field.custom_field_id] %} 261 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div> 262 {% endif %} 263 </div> 264 </div> 265 {% endif %} 266 {% if custom_field.type == 'time' %} 267 <div class="form-group{% if custom_field.required %} required {% endif %} custom-field" data-sort="{{ custom_field.sort_order }}"> 268 <label class="col-sm-2 control-label" for="input-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label> 269 <div class="col-sm-10"> 270 <div class="input-group datetime"> 271 <input type="text" name="custom_field[{{ custom_field.location }}][{{ custom_field.custom_field_id }}]" value="{% if affiliate_custom_field[custom_field.custom_field_id] %}{{ affiliate_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" /> 272 <span class="input-group-btn"> 273 <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button> 274 </span></div> 275 {% if error_custom_field[custom_field.custom_field_id] %} 276 <div class="text-danger">{{ error_custom_field[custom_field.custom_field_id] }}</div> 277 {% endif %} 278 </div> 279 </div> 280 {% endif %} 281 {% endif %} 282 {% endfor %} 283 284 285 286 </fieldset> 287 288 {% if text_agree %} 289 <div class="buttons clearfix"> 290 <div class="pull-right">{{ text_agree }} 291 {% if agree %} 292 <input type="checkbox" name="agree" value="1" checked="checked" /> 293 {% else %} 294 <input type="checkbox" name="agree" value="1" /> 295 {% endif %} 296 297 <input type="submit" value="{{ button_continue }}" class="btn btn-primary" /> 298 </div> 299 </div> 300 {% else %} 301 <div class="buttons clearfix"> 302 <div class="pull-right"> 303 <input type="submit" value="{{ button_continue }}" class="btn btn-primary" /> 304 </div> 305 </div> 306 {% endif %} 307 </form> 308 {{ content_bottom }}</div> 309 {{ column_right }}</div> 310 </div> 311 <script type="text/javascript"><!-- 312 $('input[name=\'payment\']').on('change', function() { 313 $('.payment').hide(); 314 315 $('#payment-' + this.value).show(); 316 }); 317 318 $('input[name=\'payment\']:checked').trigger('change'); 319 //--></script> 320 <script type="text/javascript"><!-- 321 // Sort the custom fields 322 $('.form-group[data-sort]').detach().each(function() { 323 if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('.form-group').length) { 324 $('.form-group').eq($(this).attr('data-sort')).before(this); 325 } 326 327 if ($(this).attr('data-sort') > $('.form-group').length) { 328 $('.form-group:last').after(this); 329 } 330 331 if ($(this).attr('data-sort') == $('.form-group').length) { 332 $('.form-group:last').after(this); 333 } 334 335 if ($(this).attr('data-sort') < -$('.form-group').length) { 336 $('.form-group:first').before(this); 337 } 338 }); 339 //--></script> 340 <script type="text/javascript"><!-- 341 $('button[id^=\'button-custom-field\']').on('click', function() { 342 var node = this; 343 344 $('#form-upload').remove(); 345 346 $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>'); 347 348 $('#form-upload input[name=\'file\']').trigger('click'); 349 350 if (typeof timer != 'undefined') { 351 clearInterval(timer); 352 } 353 354 timer = setInterval(function() { 355 if ($('#form-upload input[name=\'file\']').val() != '') { 356 clearInterval(timer); 357 358 $.ajax({ 359 url: 'index.php?route=tool/upload', 360 type: 'post', 361 dataType: 'json', 362 data: new FormData($('#form-upload')[0]), 363 cache: false, 364 contentType: false, 365 processData: false, 366 beforeSend: function() { 367 $(node).button('loading'); 368 }, 369 complete: function() { 370 $(node).button('reset'); 371 }, 372 success: function(json) { 373 $(node).parent().find('.text-danger').remove(); 374 375 if (json['error']) { 376 $(node).parent().find('input').after('<div class="text-danger">' + json['error'] + '</div>'); 377 } 378 379 if (json['success']) { 380 alert(json['success']); 381 382 $(node).parent().find('input').val(json['code']); 383 } 384 }, 385 error: function(xhr, ajaxOptions, thrownError) { 386 alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); 387 } 388 }); 389 } 390 }, 500); 391 }); 392 //--></script> 393 <script type="text/javascript"><!-- 394 $('.date').datetimepicker({ 395 language: '{{ datepicker }}', 396 pickTime: false 397 }); 398 399 $('.datetime').datetimepicker({ 400 language: '{{ datepicker }}', 401 pickDate: true, 402 pickTime: true 403 }); 404 405 $('.time').datetimepicker({ 406 language: '{{ datepicker }}', 407 pickDate: false 408 }); 409 //--></script> 410 {{ footer }}