....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 107.180.102.13  /  Your IP : 216.73.216.161
Web Server : Apache
System : Linux ip-107-180-102-13.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : nobody ( 99)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/egdeals/public_html/admin/view/template/customer/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/egdeals/public_html/admin/view/template/customer/customer_form.twig
{{ header }}{{ column_left }}
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-customer" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
        <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
      <h1>{{ heading_title }}</h1>
      <ul class="breadcrumb">
        {% for breadcrumb in breadcrumbs %}
        <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
        {% endfor %}
      </ul>
    </div>
  </div>
  <div class="container-fluid"> {% if error_warning %}
    <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    {% endif %}
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
      </div>
      <div class="panel-body">
        <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-customer" class="form-horizontal">
          <ul class="nav nav-tabs">
            <li class="active"><a href="#tab-general" data-toggle="tab">{{ tab_general }}</a></li>
            <li><a href="#tab-affiliate" data-toggle="tab">{{ tab_affiliate }}</a></li>
            {% if customer_id %}
            <li><a href="#tab-history" data-toggle="tab">{{ tab_history }}</a></li>
            <li><a href="#tab-transaction" data-toggle="tab">{{ tab_transaction }}</a></li>
            <li><a href="#tab-reward" data-toggle="tab">{{ tab_reward }}</a></li>
            <li><a href="#tab-ip" data-toggle="tab">{{ tab_ip }}</a></li>
            {% endif %}
          </ul>
          <div class="tab-content">
            <div class="tab-pane active" id="tab-general">
              <div class="row">
                <div class="col-sm-2">
                  <ul class="nav nav-pills nav-stacked" id="address">
                    <li class="active"><a href="#tab-customer" data-toggle="tab">{{ tab_general }}</a></li>
                    {% set address_row = 1 %}
                    {% for address in addresses %}
                    <li><a href="#tab-address{{ address_row }}" data-toggle="tab"><i class="fa fa-minus-circle" onclick="$('#address a:first').tab('show'); $('#address a[href=\'#tab-address{{ address_row }}\']').parent().remove(); $('#tab-address{{ address_row }}').remove();"></i> {{ tab_address }} {{ address_row }}</a></li>
                    {% set address_row = address_row + 1 %}
                    {% endfor %}
                    <li id="address-add"><a onclick="addAddress();"><i class="fa fa-plus-circle"></i> {{ button_address_add }}</a></li>
                  </ul>
                </div>
                <div class="col-sm-10">
                  <div class="tab-content">
                    <div class="tab-pane active" id="tab-customer">
                      <fieldset>
                        <legend>{{ text_account }}</legend>
                        <div class="form-group">
                          <label class="col-sm-2 control-label" for="input-customer-group">{{ entry_customer_group }}</label>
                          <div class="col-sm-10">
                            <select name="customer_group_id" id="input-customer-group" class="form-control">
                              {% for customer_group in customer_groups %}
                              {% if customer_group.customer_group_id == customer_group_id %}
                              <option value="{{ customer_group.customer_group_id }}" selected="selected">{{ customer_group.name }}</option>
                              {% else %}
                              <option value="{{ customer_group.customer_group_id }}">{{ customer_group.name }}</option>
                              {% endif %}
                              {% endfor %}
                            </select>
                          </div>
                        </div>
                        <div class="form-group required">
                          <label class="col-sm-2 control-label" for="input-firstname">{{ entry_firstname }}</label>
                          <div class="col-sm-10">
                            <input type="text" name="firstname" value="{{ firstname }}" placeholder="{{ entry_firstname }}" id="input-firstname" class="form-control" />
                            {% if error_firstname %}
                            <div class="text-danger">{{ error_firstname }}</div>
                            {% endif %}</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 required">
                          <label class="col-sm-2 control-label" for="input-email">{{ entry_email }}</label>
                          <div class="col-sm-10">
                            <input type="text" 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 required">
                          <label class="col-sm-2 control-label" for="input-telephone">{{ entry_telephone }}</label>
                          <div class="col-sm-10">
                            <input type="text" 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>
                        {% for custom_field in custom_fields %}
                        {% if custom_field.location == 'account' %}
                        {% if custom_field.type == 'select' %}
                        <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" 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.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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.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.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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.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.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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.custom_field_id }}]" value="{{ account_custom_field[custom_field.custom_field_id] ? account_custom_field[custom_field.custom_field_id] : custom_field.value }}" 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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.custom_field_id }}]" rows="5" placeholder="{{ custom_field.name }}" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control">{{ account_custom_field[custom_field.custom_field_id] ? account_custom_field[custom_field.custom_field_id] : custom_field.value }}</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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.custom_field_id }}]" value="{{ account_custom_field[custom_field.custom_field_id] ? account_custom_field[custom_field.custom_field_id] }}" id="input-custom-field{{ custom_field.custom_field_id }}" />
                            {% 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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.custom_field_id }}]" value="{{ account_custom_field[custom_field.custom_field_id] ? account_custom_field[custom_field.custom_field_id] : custom_field.value }}" 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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.custom_field_id }}]" value="{{ account_custom_field[custom_field.custom_field_id] ? account_custom_field[custom_field.custom_field_id] : custom_field.value }}" 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 == 'datetime' %}
                        <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" 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.custom_field_id }}]" value="{{ account_custom_field[custom_field.custom_field_id] ? account_custom_field[custom_field.custom_field_id] : custom_field.value }}" 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 %}
                        {% endif %}
                        {% endfor %}
                      </fieldset>
                      <fieldset>
                        <legend>{{ text_password }}</legend>
                        <div class="form-group required">
                          <label class="col-sm-2 control-label" for="input-password">{{ entry_password }}</label>
                          <div class="col-sm-10">
                            <input type="password" name="password" value="{{ password }}" placeholder="{{ entry_password }}" id="input-password" class="form-control" autocomplete="off" />
                            {% if error_password %}
                            <div class="text-danger">{{ error_password }}</div>
                            {% endif %}</div>
                        </div>
                        <div class="form-group required">
                          <label class="col-sm-2 control-label" for="input-confirm">{{ entry_confirm }}</label>
                          <div class="col-sm-10">
                            <input type="password" name="confirm" value="{{ confirm }}" placeholder="{{ entry_confirm }}" autocomplete="off" id="input-confirm" class="form-control" />
                            {% if error_confirm %}
                            <div class="text-danger">{{ error_confirm }}</div>
                            {% endif %}</div>
                        </div>
                      </fieldset>
                      <fieldset>
                        <legend>{{ text_other }}</legend>
                        <div class="form-group">
                          <label class="col-sm-2 control-label" for="input-newsletter">{{ entry_newsletter }}</label>
                          <div class="col-sm-10">
                            <select name="newsletter" id="input-newsletter" class="form-control">
                              {% if newsletter %}
                              <option value="1" selected="selected">{{ text_enabled }}</option>
                              <option value="0">{{ text_disabled }}</option>
                              {% else %}
                              <option value="1">{{ text_enabled }}</option>
                              <option value="0" selected="selected">{{ text_disabled }}</option>
                              {% endif %}
                            </select>
                          </div>
                        </div>
                        <div class="form-group">
                          <label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>
                          <div class="col-sm-10">
                            <select name="status" id="input-status" class="form-control">
                              {% if status %}
                              <option value="1" selected="selected">{{ text_enabled }}</option>
                              <option value="0">{{ text_disabled }}</option>
                              {% else %}
                              <option value="1">{{ text_enabled }}</option>
                              <option value="0" selected="selected">{{ text_disabled }}</option>
                              {% endif %}
                            </select>
                          </div>
                        </div>
                        <div class="form-group">
                          <label class="col-sm-2 control-label" for="input-safe">{{ entry_safe }}</label>
                          <div class="col-sm-10">
                            <select name="safe" id="input-safe" class="form-control">
                              {% if safe %}
                              <option value="1" selected="selected">{{ text_yes }}</option>
                              <option value="0">{{ text_no }}</option>
                              {% else %}
                              <option value="1">{{ text_yes }}</option>
                              <option value="0" selected="selected">{{ text_no }}</option>
                              {% endif %}
                            </select>
                          </div>
                        </div>
                      </fieldset>
                    </div>
                    {% set address_row = 1 %}
                    {% for address in addresses %}
                    <div class="tab-pane" id="tab-address{{ address_row }}">
                      <input type="hidden" name="address[{{ address_row }}][address_id]" value="{{ address.address_id }}" />
                      <div class="form-group required">
                        <label class="col-sm-2 control-label" for="input-firstname{{ address_row }}">{{ entry_firstname }}</label>
                        <div class="col-sm-10">
                          <input type="text" name="address[{{ address_row }}][firstname]" value="{{ address.firstname }}" placeholder="{{ entry_firstname }}" id="input-firstname{{ address_row }}" class="form-control" />
                          {% if error_address[address_row].firstname %}
                          <div class="text-danger">{{ error_address[address_row].firstname }}</div>
                          {% endif %}</div>
                      </div>
                      <div class="form-group required">
                        <label class="col-sm-2 control-label" for="input-lastname{{ address_row }}">{{ entry_lastname }}</label>
                        <div class="col-sm-10">
                          <input type="text" name="address[{{ address_row }}][lastname]" value="{{ address.lastname }}" placeholder="{{ entry_lastname }}" id="input-lastname{{ address_row }}" class="form-control" />
                          {% if error_address[address_row].lastname %}
                          <div class="text-danger">{{ error_address[address_row].lastname }}</div>
                          {% endif %}</div>
                      </div>
                      <div class="form-group">
                        <label class="col-sm-2 control-label" for="input-company{{ address_row }}">{{ entry_company }}</label>
                        <div class="col-sm-10">
                          <input type="text" name="address[{{ address_row }}][company]" value="{{ address.company }}" placeholder="{{ entry_company }}" id="input-company{{ address_row }}" class="form-control" />
                        </div>
                      </div>
                      <div class="form-group required">
                        <label class="col-sm-2 control-label" for="input-address-1{{ address_row }}">{{ entry_address_1 }}</label>
                        <div class="col-sm-10">
                          <input type="text" name="address[{{ address_row }}][address_1]" value="{{ address.address_1 }}" placeholder="{{ entry_address_1 }}" id="input-address-1{{ address_row }}" class="form-control" />
                          {% if error_address[address_row].address_1 %}
                          <div class="text-danger">{{ error_address[address_row].address_1 }}</div>
                          {% endif %}</div>
                      </div>
                      <div class="form-group">
                        <label class="col-sm-2 control-label" for="input-address-2{{ address_row }}">{{ entry_address_2 }}</label>
                        <div class="col-sm-10">
                          <input type="text" name="address[{{ address_row }}][address_2]" value="{{ address.address_2 }}" placeholder="{{ entry_address_2 }}" id="input-address-2{{ address_row }}" class="form-control" />
                        </div>
                      </div>
                      <div class="form-group required">
                        <label class="col-sm-2 control-label" for="input-city{{ address_row }}">{{ entry_city }}</label>
                        <div class="col-sm-10">
                          <input type="text" name="address[{{ address_row }}][city]" value="{{ address.city }}" placeholder="{{ entry_city }}" id="input-city{{ address_row }}" class="form-control" />
                          {% if error_address[address_row].city %}
                          <div class="text-danger">{{ error_address[address_row].city }}</div>
                          {% endif %}</div>
                      </div>
                      <div class="form-group required">
                        <label class="col-sm-2 control-label" for="input-postcode{{ address_row }}">{{ entry_postcode }}</label>
                        <div class="col-sm-10">
                          <input type="text" name="address[{{ address_row }}][postcode]" value="{{ address.postcode }}" placeholder="{{ entry_postcode }}" id="input-postcode{{ address_row }}" class="form-control" />
                          {% if error_address[address_row].postcode %}
                          <div class="text-danger">{{ error_address[address_row].postcode }}</div>
                          {% endif %}</div>
                      </div>
                      <div class="form-group required">
                        <label class="col-sm-2 control-label" for="input-country{{ address_row }}">{{ entry_country }}</label>
                        <div class="col-sm-10">
                          <select name="address[{{ address_row }}][country_id]" id="input-country{{ address_row }}" onchange="country(this, '{{ address_row }}', '{{ address.zone_id }}');" class="form-control">
                            <option value="">{{ text_select }}</option>
                            {% for country in countries %}
                            {% if country.country_id == address.country_id %}
                            <option value="{{ country.country_id }}" selected="selected">{{ country.name }}</option>
                            {% else %}
                            <option value="{{ country.country_id }}">{{ country.name }}</option>
                            {% endif %}
                            {% endfor %}
                          </select>
                          {% if error_address[address_row].country %}
                          <div class="text-danger">{{ error_address[address_row].country }}</div>
                          {% endif %}</div>
                      </div>
                      <div class="form-group required">
                        <label class="col-sm-2 control-label" for="input-zone{{ address_row }}">{{ entry_zone }}</label>
                        <div class="col-sm-10">
                          <select name="address[{{ address_row }}][zone_id]" id="input-zone{{ address_row }}" class="form-control">
                          </select>
                          {% if error_address[address_row].zone %}
                          <div class="text-danger">{{ error_address[address_row].zone }}</div>
                          {% endif %}</div>
                      </div>
                      {% for custom_field in custom_fields %}
                      {% if custom_field.location == 'address' %}
                      {% if custom_field.type == 'select' %}
                      <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">
                        <label class="col-sm-2 control-label" for="input-address{{ address_row }}-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
                        <div class="col-sm-10">
                          <select name="address[{{ address_row }}][custom_field][{{ custom_field.custom_field_id }}]" id="input-address{{ address_row }}-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 address.custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == address.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_address[address_row]['custom_field'][custom_field.custom_field_id] %}
                          <div class="text-danger">{{ error_address[address_row].custom_field[custom_field.custom_field_id] }}</div>
                          {% endif %}</div>
                      </div>
                      {% endif %}
                      {% if custom_field.type == 'radio' %}
                      <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">
                        <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 address.custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == address.custom_field[custom_field.custom_field_id] %}
                              <label>
                                <input type="radio" name="address[{{ address_row }}][custom_field][{{ 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="address[{{ address_row }}][custom_field][{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" />
                                {{ custom_field_value.name }}</label>
                              {% endif %}</div>
                            {% endfor %} </div>
                          {% if error_address[address_row].custom_field[custom_field.custom_field_id] %}
                          <div class="text-danger">{{ error_address[address_row].custom_field[custom_field.custom_field_id] }}</div>
                          {% endif %}</div>
                      </div>
                      {% endif %}
                      {% if custom_field.type == 'checkbox' %}
                      <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">
                        <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 address.custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id in address.custom_field[custom_field.custom_field_id] %}
                              <label>
                                <input type="checkbox" name="address[{{ address_row }}][custom_field][{{ 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="address[{{ address_row }}][custom_field][{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" />
                                {{ custom_field_value.name }}</label>
                              {% endif %}</div>
                            {% endfor %} </div>
                          {% if error_address[address_row]['custom_field'][custom_field.custom_field_id] %}
                          <div class="text-danger">{{ error_address[address_row].custom_field[custom_field.custom_field_id] }}</div>
                          {% endif %}</div>
                      </div>
                      {% endif %}
                      {% if custom_field.type == 'text' %}
                      <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">
                        <label class="col-sm-2 control-label" for="input-address{{ address_row }}-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
                        <div class="col-sm-10">
                          <input type="text" name="address[{{ address_row }}][custom_field][{{ custom_field.custom_field_id }}]" value="{{ address.custom_field[custom_field.custom_field_id] ? address.custom_field[custom_field.custom_field_id] : custom_field.value }}" placeholder="{{ custom_field.name }}" id="input-address{{ address_row }}-custom-field{{ custom_field.custom_field_id }}" class="form-control" />
                          {% if error_address[address_row]['custom_field'][custom_field.custom_field_id] %}
                          <div class="text-danger">{{ error_address[address_row].custom_field[custom_field.custom_field_id] }}</div>
                          {% endif %}</div>
                      </div>
                      {% endif %}
                      {% if custom_field.type == 'textarea' %}
                      <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">
                        <label class="col-sm-2 control-label" for="input-address{{ address_row }}-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name }}</label>
                        <div class="col-sm-10">
                          <textarea name="address[{{ address_row }}][custom_field][{{ custom_field.custom_field_id }}]" rows="5" placeholder="{{ custom_field.name }}" id="input-address{{ address_row }}-custom-field{{ custom_field.custom_field_id }}" class="form-control">{{ address.custom_field[custom_field.custom_field_id] ? address.custom_field[custom_field.custom_field_id] : custom_field.value }}</textarea>
                          {% if error_address[address_row]['custom_field'][custom_field.custom_field_id] %}
                          <div class="text-danger">{{ error_address[address_row].custom_field[custom_field.custom_field_id] }}</div>
                          {% endif %}</div>
                      </div>
                      {% endif %}
                      {% if custom_field.type == 'file' %}
                      <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">
                        <label class="col-sm-2 control-label">{{ custom_field.name }}</label>
                        <div class="col-sm-10">
                          <button type="button" id="button-address{{ address_row }}-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="address[{{ address_row }}][custom_field][{{ custom_field.custom_field_id }}]" value="{{ address.custom_field[custom_field.custom_field_id] ? address.custom_field[custom_field.custom_field_id] }}" />
                          {% if error_address[address_row]['custom_field'][custom_field.custom_field_id] %}
                          <div class="text-danger">{{ error_address[address_row].custom_field[custom_field.custom_field_id] }}</div>
                          {% endif %}</div>
                      </div>
                      {% endif %}
                      {% if custom_field.type == 'date' %}
                      <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">
                        <label class="col-sm-2 control-label" for="input-address{{ address_row }}-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="address[{{ address_row }}][custom_field][{{ custom_field.custom_field_id }}]" value="{{ address.custom_field[custom_field.custom_field_id] ? address.custom_field[custom_field.custom_field_id] : custom_field.value }}" placeholder="{{ custom_field.name }}" data-date-format="YYYY-MM-DD" id="input-address{{ address_row }}-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_address[address_row]['custom_field'][custom_field.custom_field_id] %}
                          <div class="text-danger">{{ error_address[address_row].custom_field[custom_field.custom_field_id] }}</div>
                          {% endif %}</div>
                      </div>
                      {% endif %}
                      {% if custom_field.type == 'time' %}
                      <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">
                        <label class="col-sm-2 control-label" for="input-address{{ address_row }}-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="address[{{ address_row }}][custom_field][{{ custom_field.custom_field_id }}]" value="{{ address.custom_field[custom_field.custom_field_id] ? address.custom_field[custom_field.custom_field_id] : custom_field.value }}" placeholder="{{ custom_field.name }}" data-date-format="HH:mm" id="input-address{{ address_row }}-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_address[address_row]['custom_field'][custom_field.custom_field_id] %}
                          <div class="text-danger">{{ error_address[address_row].custom_field[custom_field.custom_field_id] }}</div>
                          {% endif %}</div>
                      </div>
                      {% endif %}
                      {% if custom_field.type == 'datetime' %}
                      <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">
                        <label class="col-sm-2 control-label" for="input-address{{ address_row }}-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="address[{{ address_row }}][custom_field][{{ custom_field.custom_field_id }}]" value="{{ address.custom_field[custom_field.custom_field_id] ? address.custom_field[custom_field.custom_field_id] : custom_field.value }}" placeholder="{{ custom_field.name }}" data-date-format="YYYY-MM-DD HH:mm" id="input-address{{ address_row }}-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_address[address_row]['custom_field'][custom_field.custom_field_id] %}
                          <div class="text-danger">{{ error_address[address_row].custom_field[custom_field.custom_field_id] }}</div>
                          {% endif %}</div>
                      </div>
                      {% endif %}
                      {% endif %}
                      {% endfor %}
                      <div class="form-group">
                        <label class="col-sm-2 control-label">{{ entry_default }}</label>
                        <div class="col-sm-10">
                          <label class="radio">{% if address.address_id == address_id or not addresses %}
                            <input type="radio" name="address[{{ address_row }}][default]" value="{{ address_row }}" checked="checked" />
                            {% else %}
                            <input type="radio" name="address[{{ address_row }}][default]" value="{{ address_row }}" />
                            {% endif %}</label>
                        </div>
                      </div>
                    </div>
                    {% set address_row = address_row + 1 %}
                    {% endfor %}
                  </div>
                </div>
              </div>
            </div>
            <div class="tab-pane" id="tab-affiliate">
              <fieldset>
                <legend>{{ text_affiliate }}</legend>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="input-company">{{ entry_company }}</label>
                  <div class="col-sm-10">
                    <input type="text" name="company" value="{{ company }}" placeholder="{{ entry_company }}" id="input-company" class="form-control" />
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="input-website">{{ entry_website }}</label>
                  <div class="col-sm-10">
                    <input type="text" name="website" value="{{ website }}" placeholder="{{ entry_website }}" id="input-website" class="form-control" />
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="input-tracking"><span data-toggle="tooltip" title="{{ help_tracking }}">{{ entry_tracking }}</span></label>
                  <div class="col-sm-10">
                    <input type="text" name="tracking" value="{{ tracking }}" placeholder="{{ entry_tracking }}" id="input-tracking" class="form-control" />
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="input-commission"><span data-toggle="tooltip" title="{{ help_commission }}">{{ entry_commission }}</span></label>
                  <div class="col-sm-10">
                    <input type="text" name="commission" value="{{ commission }}" placeholder="{{ entry_commission }}" id="input-commission" class="form-control" />
                  </div>
                </div>
                {% for custom_field in custom_fields %}
                {% if custom_field.location == 'affiliate' %}
                {% if custom_field.type == 'select' %}
                <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" 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.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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.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.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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.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.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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.custom_field_id }}]" value="{{ account_custom_field[custom_field.custom_field_id] ? account_custom_field[custom_field.custom_field_id] : custom_field.value }}" 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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.custom_field_id }}]" rows="5" placeholder="{{ custom_field.name }}" id="input-custom-field{{ custom_field.custom_field_id }}" class="form-control">{{ account_custom_field[custom_field.custom_field_id] ? account_custom_field[custom_field.custom_field_id] : custom_field.value }}</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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.custom_field_id }}]" value="{{ account_custom_field[custom_field.custom_field_id] ? account_custom_field[custom_field.custom_field_id] }}" id="input-custom-field{{ custom_field.custom_field_id }}" />
                    {% 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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.custom_field_id }}]" value="{{ account_custom_field[custom_field.custom_field_id] ? account_custom_field[custom_field.custom_field_id] : custom_field.value }}" 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 custom-field custom-field{{ custom_field.custom_field_id }}" 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.custom_field_id }}]" value="{{ account_custom_field[custom_field.custom_field_id] ? account_custom_field[custom_field.custom_field_id] : custom_field.value }}" 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 == 'datetime' %}
                <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" 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.custom_field_id }}]" value="{{ account_custom_field[custom_field.custom_field_id] ? account_custom_field[custom_field.custom_field_id] : custom_field.value }}" 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 %}
                {% endif %}
                {% endfor %}
              </fieldset>
              <fieldset>
                <legend>{{ text_payment }}</legend>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="input-tax">{{ entry_tax }}</label>
                  <div class="col-sm-10">
                    <input type="text" name="tax" value="{{ tax }}" placeholder="{{ entry_tax }}" id="input-tax" class="form-control" />
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label">{{ entry_payment }}</label>
                  <div class="col-sm-10">
                    <div class="radio">
                      <label>{% if payment == 'cheque' %}
                        <input type="radio" name="payment" value="cheque" checked="checked" />
                        {% else %}
                        <input type="radio" name="payment" value="cheque" />
                        {% endif %}
                        {{ text_cheque }}</label>
                    </div>
                    <div class="radio">
                      <label> {% if payment == 'paypal' %}
                        <input type="radio" name="payment" value="paypal" checked="checked" />
                        {% else %}
                        <input type="radio" name="payment" value="paypal" />
                        {% endif %}
                        {{ text_paypal }}</label>
                    </div>
                    <div class="radio">
                      <label> {% if payment == 'bank' %}
                        <input type="radio" name="payment" value="bank" checked="checked" />
                        {% else %}
                        <input type="radio" name="payment" value="bank" />
                        {% endif %}
                        {{ text_bank }}</label>
                    </div>
                  </div>
                </div>
                <div id="payment-cheque" class="payment">
                  <div class="form-group required">
                    <label class="col-sm-2 control-label" for="input-cheque">{{ entry_cheque }}</label>
                    <div class="col-sm-10">
                      <input type="text" name="cheque" value="{{ cheque }}" placeholder="{{ entry_cheque }}" id="input-cheque" class="form-control" />
                      {% if error_cheque %}
                      <div class="text-danger">{{ error_cheque }}</div>
                      {% endif %}</div>
                  </div>
                </div>
                <div id="payment-paypal" class="payment">
                  <div class="form-group required">
                    <label class="col-sm-2 control-label" for="input-paypal">{{ entry_paypal }}</label>
                    <div class="col-sm-10">
                      <input type="text" name="paypal" value="{{ paypal }}" placeholder="{{ entry_paypal }}" id="input-paypal" class="form-control" />
                      {% if error_paypal %}
                      <div class="text-danger">{{ error_paypal }}</div>
                      {% endif %}</div>
                  </div>
                </div>
                <div id="payment-bank" class="payment">
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-bank-name">{{ entry_bank_name }}</label>
                    <div class="col-sm-10">
                      <input type="text" name="bank_name" value="{{ bank_name }}" placeholder="{{ entry_bank_name }}" id="input-bank-name" class="form-control" />
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-bank-branch-number">{{ entry_bank_branch_number }}</label>
                    <div class="col-sm-10">
                      <input type="text" name="bank_branch_number" value="{{ bank_branch_number }}" placeholder="{{ entry_bank_branch_number }}" id="input-bank-branch-number" class="form-control" />
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-bank-swift-code">{{ entry_bank_swift_code }}</label>
                    <div class="col-sm-10">
                      <input type="text" name="bank_swift_code" value="{{ bank_swift_code }}" placeholder="{{ entry_bank_swift_code }}" id="input-bank-swift-code" class="form-control" />
                    </div>
                  </div>
                  <div class="form-group required">
                    <label class="col-sm-2 control-label" for="input-bank-account-name">{{ entry_bank_account_name }}</label>
                    <div class="col-sm-10">
                      <input type="text" name="bank_account_name" value="{{ bank_account_name }}" placeholder="{{ entry_bank_account_name }}" id="input-bank-account-name" class="form-control" />
                      {% if error_bank_account_name %}
                      <div class="text-danger">{{ error_bank_account_name }}</div>
                      {% endif %}</div>
                  </div>
                  <div class="form-group required">
                    <label class="col-sm-2 control-label" for="input-bank-account-number">{{ entry_bank_account_number }}</label>
                    <div class="col-sm-10">
                      <input type="text" name="bank_account_number" value="{{ bank_account_number }}" placeholder="{{ entry_bank_account_number }}" id="input-bank-account-number" class="form-control" />
                      {% if error_bank_account_number %}
                      <div class="text-danger">{{ error_bank_account_number }}</div>
                      {% endif %}</div>
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="input-affiliate">{{ entry_status }}</label>
                  <div class="col-sm-10">
                    <select name="affiliate" id="input-affiliate" class="form-control">
                      {% if affiliate %}
                      <option value="1" selected="selected">{{ text_enabled }}</option>
                      <option value="0">{{ text_disabled }}</option>
                      {% else %}
                      <option value="1">{{ text_enabled }}</option>
                      <option value="0" selected="selected">{{ text_disabled }}</option>
                      {% endif %}
                     </select>
                  </div>
                </div>
              </fieldset>           
            </div>         
            {% if customer_id %}
            <div class="tab-pane" id="tab-history">
              <fieldset>
                <legend>{{ text_history }}</legend>
                <div id="history"></div>
              </fieldset>
              <br />
              <fieldset>
                <legend>{{ text_history_add }}</legend>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="input-comment">{{ entry_comment }}</label>
                  <div class="col-sm-10">
                    <textarea name="comment" rows="8" placeholder="{{ entry_comment }}" id="input-comment" class="form-control"></textarea>
                  </div>
                </div>
              </fieldset>
              <div class="text-right">
                <button id="button-history" data-loading-text="{{ text_loading }}" class="btn btn-primary"><i class="fa fa-plus-circle"></i> {{ button_history_add }}</button>
              </div>
            </div>
            <div class="tab-pane" id="tab-transaction">
              <fieldset>
                <legend>{{ text_transaction }}</legend>
                <div id="transaction"></div>
              </fieldset>
              <br />
              <fieldset>
                <legend>{{ text_transaction_add }}</legend>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="input-transaction-description">{{ entry_description }}</label>
                  <div class="col-sm-10">
                    <input type="text" name="description" value="" placeholder="{{ entry_description }}" id="input-transaction-description" class="form-control" />
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="input-amount">{{ entry_amount }}</label>
                  <div class="col-sm-10">
                    <input type="text" name="amount" value="" placeholder="{{ entry_amount }}" id="input-amount" class="form-control" />
                  </div>
                </div>
              </fieldset>
              <div class="text-right">
                <button type="button" id="button-transaction" data-loading-text="{{ text_loading }}" class="btn btn-primary"><i class="fa fa-plus-circle"></i> {{ button_transaction_add }}</button>
              </div>
            </div>
            <div class="tab-pane" id="tab-reward">
              <fieldset>
                <legend>{{ text_reward }}</legend>
                <div id="reward"></div>
              </fieldset>
              <br />
              <fieldset>
                <legend>{{ text_reward_add }}</legend>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="input-reward-description">{{ entry_description }}</label>
                  <div class="col-sm-10">
                    <input type="text" name="description" value="" placeholder="{{ entry_description }}" id="input-reward-description" class="form-control" />
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="input-points"><span data-toggle="tooltip" title="{{ help_points }}">{{ entry_points }}</span></label>
                  <div class="col-sm-10">
                    <input type="text" name="points" value="" placeholder="{{ entry_points }}" id="input-points" class="form-control" />
                  </div>
                </div>
              </fieldset>
              <div class="text-right">
                <button type="button" id="button-reward" data-loading-text="{{ text_loading }}" class="btn btn-primary"><i class="fa fa-plus-circle"></i> {{ button_reward_add }}</button>
              </div>
            </div>
            {% endif %}
            <div class="tab-pane" id="tab-ip">
              <fieldset>
                <legend>{{ text_ip }}</legend>
                <div id="ip"></div>
              </fieldset>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>

  <script type="text/javascript"><!--
  $('input[name="affiliate"]').on('change', function() {
    if ($(this).val() == '1') { 
      $('#tab-affiliate :input').not('input[name="affiliate"]').prop('disabled', false);
    } else {
      $('#tab-affiliate :input').not('input[name="affiliate"]').prop('disabled', true);
    }
  }); 

  $('input[name=\'affiliate\']:checked').trigger('change');
  //--></script> 
  <script type="text/javascript"><!--
  $('select[name=\'customer_group_id\']').on('change', function() {
    $.ajax({
      url: 'index.php?route=customer/customer/customfield&user_token={{ user_token }}&customer_group_id=' + this.value,
      dataType: 'json',
      success: function(json) {
        $('.custom-field').hide();
        $('.custom-field').removeClass('required');

        for (i = 0; i < json.length; i++) {
          custom_field = json[i];

          $('.custom-field' + custom_field['custom_field_id']).show();

          if (custom_field['required']) {
            $('.custom-field' + custom_field['custom_field_id']).addClass('required');
          }
        }
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
      }
    });
  });

  $('select[name=\'customer_group_id\']').trigger('change');
  //--></script> 
  <script type="text/javascript"><!--
  var address_row = {{ address_row }};

  function addAddress() {
    html  = '<div class="tab-pane" id="tab-address' + address_row + '">';
    html += '  <input type="hidden" name="address[' + address_row + '][address_id]" value="" />';

    html += '  <div class="form-group required">';
    html += '    <label class="col-sm-2 control-label" for="input-firstname' + address_row + '">{{ entry_firstname }}</label>';
    html += '    <div class="col-sm-10"><input type="text" name="address[' + address_row + '][firstname]" value="" placeholder="{{ entry_firstname }}" id="input-firstname' + address_row + '" class="form-control" /></div>';
    html += '  </div>';

    html += '  <div class="form-group required">';
    html += '    <label class="col-sm-2 control-label" for="input-lastname' + address_row + '">{{ entry_lastname }}</label>';
    html += '    <div class="col-sm-10"><input type="text" name="address[' + address_row + '][lastname]" value="" placeholder="{{ entry_lastname }}" id="input-lastname' + address_row + '" class="form-control" /></div>';
    html += '  </div>';

    html += '  <div class="form-group">';
    html += '    <label class="col-sm-2 control-label" for="input-company' + address_row + '">{{ entry_company }}</label>';
    html += '    <div class="col-sm-10"><input type="text" name="address[' + address_row + '][company]" value="" placeholder="{{ entry_company }}" id="input-company' + address_row + '" class="form-control" /></div>';
    html += '  </div>';

    html += '  <div class="form-group required">';
    html += '    <label class="col-sm-2 control-label" for="input-address-1' + address_row + '">{{ entry_address_1 }}</label>';
    html += '    <div class="col-sm-10"><input type="text" name="address[' + address_row + '][address_1]" value="" placeholder="{{ entry_address_1 }}" id="input-address-1' + address_row + '" class="form-control" /></div>';
    html += '  </div>';

    html += '  <div class="form-group">';
    html += '    <label class="col-sm-2 control-label" for="input-address-2' + address_row + '">{{ entry_address_2 }}</label>';
    html += '    <div class="col-sm-10"><input type="text" name="address[' + address_row + '][address_2]" value="" placeholder="{{ entry_address_2 }}" id="input-address-2' + address_row + '" class="form-control" /></div>';
    html += '  </div>';

    html += '  <div class="form-group required">';
    html += '    <label class="col-sm-2 control-label" for="input-city' + address_row + '">{{ entry_city }}</label>';
    html += '    <div class="col-sm-10"><input type="text" name="address[' + address_row + '][city]" value="" placeholder="{{ entry_city }}" id="input-city' + address_row + '" class="form-control" /></div>';
    html += '  </div>';

    html += '  <div class="form-group required">';
    html += '    <label class="col-sm-2 control-label" for="input-postcode' + address_row + '">{{ entry_postcode }}</label>';
    html += '    <div class="col-sm-10"><input type="text" name="address[' + address_row + '][postcode]" value="" placeholder="{{ entry_postcode }}" id="input-postcode' + address_row + '" class="form-control" /></div>';
    html += '  </div>';

    html += '  <div class="form-group required">';
    html += '    <label class="col-sm-2 control-label" for="input-country' + address_row + '">{{ entry_country }}</label>';
    html += '    <div class="col-sm-10"><select name="address[' + address_row + '][country_id]" id="input-country' + address_row + '" onchange="country(this, \'' + address_row + '\', \'0\');" class="form-control">';
      html += '         <option value="">{{ text_select }}</option>';
      {% for country in countries %}
      html += '         <option value="{{ country.country_id }}">{{ country.name|escape('js') }}</option>';
      {% endfor %}
      html += '      </select></div>';
    html += '  </div>';

    html += '  <div class="form-group required">';
    html += '    <label class="col-sm-2 control-label" for="input-zone' + address_row + '">{{ entry_zone }}</label>';
    html += '    <div class="col-sm-10"><select name="address[' + address_row + '][zone_id]" id="input-zone' + address_row + '" class="form-control"><option value="">{{ text_none }}</option></select></div>';
    html += '  </div>';

    // Custom Fields
    {% for custom_field in custom_fields %}
    {% if custom_field.location == 'address' %}
    {% if custom_field.type == 'select' %}

    html += '  <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">';
    html += '  		<label class="col-sm-2 control-label" for="input-address' + address_row + '-custom-field{{ custom_field.custom_field_id }}">{{ custom_field.name|e('js') }}</label>';
    html += '  		<div class="col-sm-10">';
    html += '  		  <select name="address[' + address_row + '][custom_field][{{ custom_field.custom_field_id }}]" id="input-address' + address_row + '-custom-field{{ custom_field.custom_field_id }}" class="form-control">';
    html += '  			<option value="">{{ text_select }}</option>';

    {% for custom_field_value in custom_field.custom_field_value %}
    html += '  			<option value="{{ custom_field_value.custom_field_value_id }}">{{ custom_field.name|e('js') }}</option>';
    {% endfor %}

    html += '  		  </select>';
    html += '  		</div>';
    html += '  	  </div>';
    {% endif %}

    {% if custom_field.type == 'radio' %}
    html += '  	  <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}">';
    html += '  		<label class="col-sm-2 control-label">{{ custom_field.name|e('js') }}</label>';
    html += '  		<div class="col-sm-10">';
    html += '  		  <div>';

    {% for custom_field_value in custom_field.custom_field_value %}
    html += '  			<div class="radio"><label><input type="radio" name="address[' + address_row + '][custom_field][{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" /> {{ custom_field_value.name|e('js') }}</label></div>';
    {% endfor %}

    html += '		  </div>';
    html += '		</div>';
    html += '	  </div>';
    {% endif %}

    {% if custom_field.type == 'checkbox' %}
    html += '	  <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">';
    html += '		<label class="col-sm-2 control-label">{{ custom_field.name|e('js') }}</label>';
    html += '		<div class="col-sm-10">';
    html += '		  <div>';

    {% for custom_field_value in custom_field.custom_field_value %}
    html += '			<div class="checkbox"><label><input type="checkbox" name="address[{{ address_row }}][custom_field][{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" /> {{ custom_field_value.name|e('js') }}</label></div>';
    {% endfor %}

    html += '		  </div>';
    html += '		</div>';
    html += '	  </div>';
    {% endif %}

    {% if custom_field.type == 'text' %}
    html += '	  <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">';
    html += '		<label class="col-sm-2 control-label" for="input-address' + address_row + '-custom-field{{ custom_field.custom_field_id }}">{{ custom_field_value.name|e('js') }}</label>';
    html += '		<div class="col-sm-10">';
    html += '		  <input type="text" name="address[' + address_row + '][custom_field][{{ custom_field.custom_field_id }}]" value="{{ custom_field.value|e('js') }}" placeholder="{{ custom_field_value.name|e('js') }}" id="input-address' + address_row + '-custom-field{{ custom_field.custom_field_id }}" class="form-control" />';
    html += '		</div>';
    html += '	  </div>';
    {% endif %}

    {% if custom_field.type == 'textarea' %}
    html += '	  <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">';
    html += '		<label class="col-sm-2 control-label" for="input-address' + address_row + '-custom-field{{ custom_field.custom_field_id }}">{{ custom_field_value.name|e('js') }}</label>';
    html += '		<div class="col-sm-10">';
    html += '		  <textarea name="address[' + address_row + '][custom_field][{{ custom_field.custom_field_id }}]" rows="5" placeholder="{{ custom_field_value.name|e('js') }}" id="input-address' + address_row + '-custom-field{{ custom_field.custom_field_id }}" class="form-control">{{ custom_field.value|e('js') }}</textarea>';
    html += '		</div>';
    html += '	  </div>';
    {% endif %}

    {% if custom_field.type == 'file' %}
    html += '	  <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">';
    html += '		<label class="col-sm-2 control-label">{{ custom_field.name|e('js') }}</label>';
    html += '		<div class="col-sm-10">';
    html += '		  <button type="button" id="button-address' + address_row + '-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>';
    html += '		  <input type="hidden" name="address[' + address_row + '][{{ custom_field.custom_field_id }}]" value="" id="input-address' + address_row + '-custom-field{{ custom_field.custom_field_id }}" />';
    html += '		</div>';
    html += '	  </div>';
    {% endif %}

    {% if custom_field.type == 'date' %}
    html += '	  <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">';
    html += '		<label class="col-sm-2 control-label" for="input-address' + address_row + '-custom-field{{ custom_field.custom_field_id }}">{{ custom_field_value.name|e('js') }}</label>';
    html += '		<div class="col-sm-10">';
    html += '		  <div class="input-group date"><input type="text" name="address[' + address_row + '][custom_field][{{ custom_field.custom_field_id }}]" value="{{ custom_field.value|e('js') }}" placeholder="{{ custom_field.name|e('js') }} data-date-format="YYYY-MM-DD" id="input-address' + address_row + '-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>';
    html += '		</div>';
    html += '	  </div>';
    {% endif %}

    {% if custom_field.type == 'time' %}
    html += '	  <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">';
    html += '		<label class="col-sm-2 control-label" for="input-address' + address_row + '-custom-field{{ custom_field.custom_field_id }}">{{ custom_field_value.name|e('js') }}</label>';
    html += '		<div class="col-sm-10">';
    html += '		  <div class="input-group time"><input type="text" name="address[' + address_row + '][custom_field][{{ custom_field.custom_field_id }}]" value="{{ custom_field.value|e('js') }}" placeholder="{{ custom_field.name|e('js') }}" data-date-format="HH:mm" id="input-address' + address_row + '-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>';
    html += '		</div>';
    html += '	  </div>';
    {% endif %}

    {% if custom_field.type == 'datetime' %}
    html += '	  <div class="form-group custom-field custom-field{{ custom_field.custom_field_id }}" data-sort="{{ custom_field.sort_order + 1 }}">';
    html += '		<label class="col-sm-2 control-label" for="input-address' + address_row + '-custom-field{{ custom_field.custom_field_id }}">{{ custom_field_value.name|e('js') }}</label>';
    html += '		<div class="col-sm-10">';
    html += '		  <div class="input-group datetime"><input type="text" name="address[' + address_row + '][custom_field][{{ custom_field.custom_field_id }}]" value="{{ custom_field.value|e('js') }}" placeholder="{{ custom_field.name|e('js') }}" data-date-format="YYYY-MM-DD HH:mm" id="input-address' + address_row + '-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>';
    html += '		</div>';
    html += '	  </div>';
    {% endif %}

    {% endif %}
    {% endfor %}

    html += '  <div class="form-group">';
    html += '    <label class="col-sm-2 control-label">{{ entry_default }}</label>';
    html += '    <div class="col-sm-10"><label class="radio"><input type="radio" name="address[' + address_row + '][default]" value="1" /></label></div>';
    html += '  </div>';

    html += '</div>';

    $('#tab-general .tab-content').append(html);

    $('select[name=\'customer_group_id\']').trigger('change');

    $('select[name=\'address[' + address_row + '][country_id]\']').trigger('change');

    $('#address-add').before('<li><a href="#tab-address' + address_row + '" data-toggle="tab"><i class="fa fa-minus-circle" onclick="$(\'#address a:first\').tab(\'show\'); $(\'a[href=\\\'#tab-address' + address_row + '\\\']\').parent().remove(); $(\'#tab-address' + address_row + '\').remove();"></i> {{ tab_address }} ' + address_row + '</a></li>');

    $('#address a[href=\'#tab-address' + address_row + '\']').tab('show');

    $('.date').datetimepicker({
		language: '{{ datepicker }}',
		pickTime: false
    });

	$('.datetime').datetimepicker({
		language: '{{ datepicker }}',
		pickDate: true,
		pickTime: true
    });

    $('.time').datetimepicker({
		language: '{{ datepicker }}',
		pickDate: false
    });

    $('#tab-address' + address_row + ' .form-group[data-sort]').detach().each(function() {
		if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('#tab-address' + address_row + ' .form-group').length) {
			$('#tab-address' + address_row + ' .form-group').eq($(this).attr('data-sort')).before(this);
		}
		
		if ($(this).attr('data-sort') > $('#tab-address' + address_row + ' .form-group').length) {
			$('#tab-address' + address_row + ' .form-group:last').after(this);
		}
		
		if ($(this).attr('data-sort') < -$('#tab-address' + address_row + ' .form-group').length) {
			$('#tab-address' + address_row + ' .form-group:first').before(this);
		}
    });

    address_row++;
  }
  //--></script> 
  <script type="text/javascript"><!--
  function country(element, index, zone_id) {
    $.ajax({
      url: 'index.php?route=localisation/country/country&user_token={{ user_token }}&country_id=' + element.value,
      dataType: 'json',
      beforeSend: function() {
        $('select[name=\'address[' + index + '][country_id]\']').prop('disabled', true);
      },
      complete: function() {
        $('select[name=\'address[' + index + '][country_id]\']').prop('disabled', false);
      },
      success: function(json) {
        if (json['postcode_required'] == '1') {
          $('input[name=\'address[' + index + '][postcode]\']').parent().parent().addClass('required');
        } else {
          $('input[name=\'address[' + index + '][postcode]\']').parent().parent().removeClass('required');
        }

        html = '<option value="">{{ text_select }}</option>';

        if (json['zone'] && json['zone'] != '') {
          for (i = 0; i < json['zone'].length; i++) {
            html += '<option value="' + json['zone'][i]['zone_id'] + '"';

            if (json['zone'][i]['zone_id'] == zone_id) {
              html += ' selected="selected"';
            }

            html += '>' + json['zone'][i]['name'] + '</option>';
          }
        } else {
          html += '<option value="0">{{ text_none }}</option>';
        }

        $('select[name=\'address[' + index + '][zone_id]\']').html(html);
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
      }
    });
  }

  $('select[name$=\'[country_id]\']').trigger('change');
  //--></script> 
  <script type="text/javascript"><!--
  $('#history').delegate('.pagination a', 'click', function(e) {
    e.preventDefault();

    $('#history').load(this.href);
  });

  $('#history').load('index.php?route=customer/customer/history&user_token={{ user_token }}&customer_id={{ customer_id }}');

  $('#button-history').on('click', function(e) {
    e.preventDefault();

    $.ajax({
      url: 'index.php?route=customer/customer/addhistory&user_token={{ user_token }}&customer_id={{ customer_id }}',
      type: 'post',
      dataType: 'json',
      data: 'comment=' + encodeURIComponent($('#tab-history textarea[name=\'comment\']').val()),
      beforeSend: function() {
        $('#button-history').button('loading');
      },
      complete: function() {
        $('#button-history').button('reset');
      },
      success: function(json) {
        $('.alert-dismissible').remove();

        if (json['error']) {
           $('#tab-history').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
        }

        if (json['success']) {
          $('#tab-history').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');

          $('#history').load('index.php?route=customer/customer/history&user_token={{ user_token }}&customer_id={{ customer_id }}');

          $('#tab-history textarea[name=\'comment\']').val('');
        }
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
      }
    });
  });
  //--></script> 
  <script type="text/javascript"><!--
  $('#transaction').delegate('.pagination a', 'click', function(e) {
    e.preventDefault();

    $('#transaction').load(this.href);
  });

  $('#transaction').load('index.php?route=customer/customer/transaction&user_token={{ user_token }}&customer_id={{ customer_id }}');

  $('#button-transaction').on('click', function(e) {
    e.preventDefault();

    $.ajax({
      url: 'index.php?route=customer/customer/addtransaction&user_token={{ user_token }}&customer_id={{ customer_id }}',
      type: 'post',
      dataType: 'json',
      data: 'description=' + encodeURIComponent($('#tab-transaction input[name=\'description\']').val()) + '&amount=' + encodeURIComponent($('#tab-transaction input[name=\'amount\']').val()),
      beforeSend: function() {
        $('#button-transaction').button('loading');
      },
      complete: function() {
        $('#button-transaction').button('reset');
      },
      success: function(json) {
        $('.alert-dismissible').remove();

        if (json['error']) {
           $('#tab-transaction').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
        }

        if (json['success']) {
          $('#tab-transaction').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');

          $('#transaction').load('index.php?route=customer/customer/transaction&user_token={{ user_token }}&customer_id={{ customer_id }}');

          $('#tab-transaction input[name=\'amount\']').val('');
          $('#tab-transaction input[name=\'description\']').val('');
        }
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
      }
    });
  });
  //--></script> 
  <script type="text/javascript"><!--
  $('#reward').delegate('.pagination a', 'click', function(e) {
    e.preventDefault();

    $('#reward').load(this.href);
  });

  $('#reward').load('index.php?route=customer/customer/reward&user_token={{ user_token }}&customer_id={{ customer_id }}');

  $('#button-reward').on('click', function(e) {
    e.preventDefault();

    $.ajax({
      url: 'index.php?route=customer/customer/addreward&user_token={{ user_token }}&customer_id={{ customer_id }}',
      type: 'post',
      dataType: 'json',
      data: 'description=' + encodeURIComponent($('#tab-reward input[name=\'description\']').val()) + '&points=' + encodeURIComponent($('#tab-reward input[name=\'points\']').val()),
      beforeSend: function() {
        $('#button-reward').button('loading');
      },
      complete: function() {
        $('#button-reward').button('reset');
      },
      success: function(json) {
        $('.alert-dismissible').remove();

        if (json['error']) {
           $('#tab-reward').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
        }

        if (json['success']) {
          $('#tab-reward').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');

          $('#reward').load('index.php?route=customer/customer/reward&user_token={{ user_token }}&customer_id={{ customer_id }}');

          $('#tab-reward input[name=\'points\']').val('');
          $('#tab-reward input[name=\'description\']').val('');
        }
      },
      error: function(xhr, ajaxOptions, thrownError) {
        alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
      }
    });
  });

  $('#ip').delegate('.pagination a', 'click', function(e) {
    e.preventDefault();

    $('#ip').load(this.href);
  });

  $('#ip').load('index.php?route=customer/customer/ip&user_token={{ user_token }}&customer_id={{ customer_id }}');

  $('#content').delegate('button[id^=\'button-custom-field\'], button[id^=\'button-address\']', 'click', function() {
    var node = 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/upload&user_token={{ user_token }}',
          type: 'post',
          dataType: 'json',
          data: new FormData($('#form-upload')[0]),
          cache: false,
          contentType: false,
          processData: false,
          beforeSend: function() {
            $(node).button('loading');
          },
          complete: function() {
            $(node).button('reset');
          },
          success: function(json) {
            $(node).parent().find('.text-danger').remove();

            if (json['error']) {
              $(node).parent().find('input[type=\'hidden\']').after('<div class="text-danger">' + json['error'] + '</div>');
            }

            if (json['success']) {
              alert(json['success']);
            }

            if (json['code']) {
              $(node).parent().find('input[type=\'hidden\']').val(json['code']);
            }
          },
          error: function(xhr, ajaxOptions, thrownError) {
            alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
          }
        });
      }
    }, 500);
  });

  $('.date').datetimepicker({
    language: '{{ datepicker }}',
    pickTime: false
  });

  $('.datetime').datetimepicker({
    language: '{{ datepicker }}',
    pickDate: true,
    pickTime: true
  });

  $('.time').datetimepicker({
    language: '{{ datepicker }}',
    pickDate: false
  });

  // Sort the custom fields
  {% set address_row = 1 %}
  {% for address in addresses %}
  $('#tab-address{{ address_row }} .form-group[data-sort]').detach().each(function() {
    if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('#tab-address{{ address_row }} .form-group').length) {
      $('#tab-address{{ address_row }} .form-group').eq($(this).attr('data-sort')).before(this);
    }

    if ($(this).attr('data-sort') > $('#tab-address{{ address_row }} .form-group').length) {
      $('#tab-address{{ address_row }} .form-group:last').after(this);
    }

    if ($(this).attr('data-sort') < -$('#tab-address{{ address_row }} .form-group').length) {
      $('#tab-address{{ address_row }} .form-group:first').before(this);
    }
  });
  {% set address_row = address_row + 1 %}
  {% endfor %}

  $('#tab-customer .form-group[data-sort]').detach().each(function() {
    if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('#tab-customer .form-group').length) {
      $('#tab-customer .form-group').eq($(this).attr('data-sort')).before(this);
    }

    if ($(this).attr('data-sort') > $('#tab-customer .form-group').length) {
      $('#tab-customer .form-group:last').after(this);
    }

    if ($(this).attr('data-sort') < -$('#tab-customer .form-group').length) {
      $('#tab-customer .form-group:first').before(this);
    }
  });

  $('#tab-affiliate .form-group[data-sort]').detach().each(function() {
    if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('#tab-affiliate .form-group').length) {
      $('#tab-affiliate .form-group').eq($(this).attr('data-sort')).before(this);
    }

    if ($(this).attr('data-sort') > $('#tab-affiliate .form-group').length) {
      $('#tab-affiliate .form-group:last').after(this);
    }

    if ($(this).attr('data-sort') < -$('#tab-affiliate .form-group').length) {
      $('#tab-affiliate .form-group:first').before(this);
    }
  });
  //--></script> 
  <script type="text/javascript"><!--
  $('input[name=\'payment\']').on('change', function() {
    $('.payment').hide();

    $('#payment-' + this.value).show();
  });

  $('input[name=\'payment\']:checked').trigger('change');
  //--></script> 
</div>
{{ footer }} 

Youez - 2016 - github.com/yon3zu
LinuXploit