PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/themes/default-bootstrap/modules/referralprogram/views/templates/front/program.tpl

https://gitlab.com/staging06/myproject
Smarty Template | 223 lines | 191 code | 8 blank | 24 comment | 9 complexity | 6ce82b7b06089088334a9b151102a129 MD5 | raw file
  1. {*
  2. * 2007-2015 PrestaShop
  3. *
  4. * NOTICE OF LICENSE
  5. *
  6. * This source file is subject to the Academic Free License (AFL 3.0)
  7. * that is bundled with this package in the file LICENSE.txt.
  8. * It is also available through the world-wide-web at this URL:
  9. * http://opensource.org/licenses/afl-3.0.php
  10. * If you did not receive a copy of the license and are unable to
  11. * obtain it through the world-wide-web, please send an email
  12. * to license@prestashop.com so we can send you a copy immediately.
  13. *
  14. * DISCLAIMER
  15. *
  16. * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
  17. * versions in the future. If you wish to customize PrestaShop for your
  18. * needs please refer to http://www.prestashop.com for more information.
  19. *
  20. * @author PrestaShop SA <contact@prestashop.com>
  21. * @copyright 2007-2015 PrestaShop SA
  22. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  23. * International Registered Trademark & Property of PrestaShop SA
  24. *}
  25. {capture name=path}<a href="{$link->getPageLink('my-account', true)|escape:'html':'UTF-8'}" title="{l s='Manage my account' mod='referralprogram'}" rel="nofollow">{l s='My account' mod='referralprogram'}</a><span class="navigation-pipe">{$navigationPipe}</span><span class="navigation_page">{l s='Referral Program' mod='referralprogram'}</span>{/capture}
  26. <h1 class="page-heading">{l s='Referral program' mod='referralprogram'}</h1>
  27. {if $error}
  28. <p class="alert alert-danger">
  29. {if $error == 'conditions not valided'}
  30. {l s='You need to agree to the conditions of the referral program!' mod='referralprogram'}
  31. {elseif $error == 'email invalid'}
  32. {l s='At least one e-mail address is invalid!' mod='referralprogram'}
  33. {elseif $error == 'name invalid'}
  34. {l s='At least one first name or last name is invalid!' mod='referralprogram'}
  35. {elseif $error == 'email exists'}
  36. {l s='Someone with this e-mail address has already been sponsored!' mod='referralprogram'}: {foreach from=$mails_exists item=mail}{$mail} {/foreach}
  37. {elseif $error == 'no revive checked'}
  38. {l s='Please mark at least one checkbox' mod='referralprogram'}
  39. {elseif $error == 'cannot add friends'}
  40. {l s='Cannot add friends to database' mod='referralprogram'}
  41. {/if}
  42. </p>
  43. {/if}
  44. {if $invitation_sent}
  45. <p class="alert alert-success">
  46. {if $nbInvitation > 1}
  47. {l s='E-mails have been sent to your friends!' mod='referralprogram'}
  48. {else}
  49. {l s='An e-mail has been sent to your friend!' mod='referralprogram'}
  50. {/if}
  51. </p>
  52. {/if}
  53. {if $revive_sent}
  54. <p class="alert alert-success">
  55. {if $nbRevive > 1}
  56. {l s='Reminder e-mails have been sent to your friends!' mod='referralprogram'}
  57. {else}
  58. {l s='A reminder e-mail has been sent to your friend!' mod='referralprogram'}
  59. {/if}
  60. </p>
  61. {/if}
  62. <ul class="nav nav-tabs" id="idTabs">
  63. <li class="active"><a data-toggle="tab" href="#idTab1" class="tab-pane {if $activeTab eq 'sponsor'} active{/if}" title="{l s='Sponsor my friends' mod='referralprogram'}" rel="nofollow">{l s='Sponsor my friends' mod='referralprogram'}</a></li>
  64. <li><a data-toggle="tab" href="#idTab2" class="tab-pane {if $activeTab eq 'pending'} selected{/if}" title="{l s='List of pending friends' mod='referralprogram'}" rel="nofollow">{l s='Pending friends' mod='referralprogram'}</a></li>
  65. <li><a data-toggle="tab" href="#idTab3" class="tab-pane {if $activeTab eq 'subscribed'} selected{/if}" title="{l s='List of friends I sponsored' mod='referralprogram'}" rel="nofollow">{l s='Friends I sponsored' mod='referralprogram'}</a></li>
  66. </ul>
  67. <div class="sheets tab-content">
  68. <div id="idTab1" class="tab-pane active">
  69. <p class="bold">
  70. <strong>{l s='Get a discount of %1$s for you and your friends by recommending this Website.' sprintf=[$discount] mod='referralprogram'}</strong>
  71. </p>
  72. {if $canSendInvitations}
  73. <p>
  74. {l s='It\'s quick and it\'s easy. Just fill in the first name, last name, and e-mail address(es) of your friend(s) in the fields below.' mod='referralprogram'}
  75. {if $orderQuantity > 1}
  76. {l s='When one of them makes at least %d orders, ' sprintf=$orderQuantity mod='referralprogram'}
  77. {else}
  78. {l s='When one of them makes at least %d order, ' sprintf=$orderQuantity mod='referralprogram'}
  79. {/if},
  80. {l s='he or she will receive a %1$s voucher and you will receive your own voucher worth %1$s.' sprintf=[$discount] mod='referralprogram'}
  81. </p>
  82. <form method="post" action="{$link->getModuleLink('referralprogram', 'program', [], true)|escape:'html':'UTF-8'}" class="std">
  83. <table class="table table-bordered">
  84. <thead>
  85. <tr>
  86. <th class="first_item">&nbsp;</th>
  87. <th class="item">{l s='Last name' mod='referralprogram'}</th>
  88. <th class="item">{l s='First name' mod='referralprogram'}</th>
  89. <th class="last_item">{l s='E-mail' mod='referralprogram'}</th>
  90. </tr>
  91. </thead>
  92. <tbody>
  93. {section name=friends start=0 loop=$nbFriends step=1}
  94. <tr class="{if $smarty.section.friends.index % 2}item{else}alternate_item{/if}">
  95. <td class="align_right">{$smarty.section.friends.iteration}</td>
  96. <td><input type="text" class="form-control" name="friendsLastName[{$smarty.section.friends.index}]" size="14" value="{if isset($smarty.post.friendsLastName[$smarty.section.friends.index])}{$smarty.post.friendsLastName[$smarty.section.friends.index]|escape:'html':'UTF-8'}{/if}" /></td>
  97. <td><input type="text" class="form-control" name="friendsFirstName[{$smarty.section.friends.index}]" size="14" value="{if isset($smarty.post.friendsFirstName[$smarty.section.friends.index])}{$smarty.post.friendsFirstName[$smarty.section.friends.index]|escape:'html':'UTF-8'}{/if}" /></td>
  98. <td><input type="text" class="form-control" name="friendsEmail[{$smarty.section.friends.index}]" size="20" value="{if isset($smarty.post.friendsEmail[$smarty.section.friends.index])}{$smarty.post.friendsEmail[$smarty.section.friends.index]|escape:'html':'UTF-8'}{/if}" /></td>
  99. </tr>
  100. {/section}
  101. </tbody>
  102. </table>
  103. <p class="bold">
  104. <strong>{l s='Important: Your friends\' e-mail addresses will only be used in the referral program. They will never be used for other purposes.' mod='referralprogram'}</strong>
  105. </p>
  106. <p class="checkbox">
  107. <input type="checkbox" name="conditionsValided" id="conditionsValided" value="1" {if isset($smarty.post.conditionsValided) AND $smarty.post.conditionsValided eq 1}checked="checked"{/if} />
  108. <label for="conditionsValided">{l s='I agree to the terms of service and adhere to them unconditionally.' mod='referralprogram'}</label>
  109. <a href="{$link->getModuleLink('referralprogram', 'rules', ['height' => '500', 'width' => '400'], true)|escape:'html':'UTF-8'}" class="thickbox" title="{l s='Conditions of the referral program' mod='referralprogram'}" rel="nofollow">{l s='Read conditions.' mod='referralprogram'}</a>
  110. </p>
  111. <p class="see_email">
  112. {l s='Preview' mod='referralprogram'}
  113. {assign var="file" value="{$lang_iso}/referralprogram-invitation.html"}
  114. <a href="{$link->getModuleLink('referralprogram', 'email', ['height' => '500', 'width' => '600', 'mail' => {$file}], true)|escape:'html':'UTF-8'}" class="thickbox" title="{l s='Invitation e-mail' mod='referralprogram'}" rel="nofollow">{l s='the default e-mail' mod='referralprogram'}</a> {l s='that will be sent to your friend(s).' mod='referralprogram'}
  115. </p>
  116. <p class="submit">
  117. <button type="submit" id="submitSponsorFriends" name="submitSponsorFriends" class="btn btn-default button button-medium"><span>{l s='Validate' mod='referralprogram'}<i class="icon-chevron-right right"></i></span></button>
  118. </p>
  119. </form>
  120. {else}
  121. <p class="alert alert-warning">
  122. {l s='To become a sponsor, you need to have completed at least' mod='referralprogram'} {$orderQuantity} {if $orderQuantity > 1}{l s='orders' mod='referralprogram'}{else}{l s='order' mod='referralprogram'}{/if}.
  123. </p>
  124. {/if}
  125. </div>
  126. <div id="idTab2" class="tab-pane">
  127. {if $pendingFriends AND $pendingFriends|@count > 0}
  128. <p>
  129. {l s='These friends have not yet placed an order on this Website since you sponsored them, but you can try again! To do so, mark the checkboxes of the friend(s) you want to remind, then click on the button "Remind my friend(s)"' mod='referralprogram'}
  130. </p>
  131. <form method="post" action="{$link->getModuleLink('referralprogram', 'program', [], true)|escape:'html':'UTF-8'}" class="std">
  132. <table class="table table-bordered">
  133. <thead>
  134. <tr>
  135. <th class="first_item">&nbsp;</th>
  136. <th class="item">{l s='Last name' mod='referralprogram'}</th>
  137. <th class="item">{l s='First name' mod='referralprogram'}</th>
  138. <th class="item">{l s='E-mail' mod='referralprogram'}</th>
  139. <th class="last_item"><b>{l s='Last invitation' mod='referralprogram'}</b></th>
  140. </tr>
  141. </thead>
  142. <tbody>
  143. {foreach from=$pendingFriends item=pendingFriend name=myLoop}
  144. <tr>
  145. <td>
  146. <input type="checkbox" name="friendChecked[{$pendingFriend.id_referralprogram}]" id="friendChecked[{$pendingFriend.id_referralprogram}]" value="1" />
  147. </td>
  148. <td>
  149. <label for="friendChecked[{$pendingFriend.id_referralprogram}]">{$pendingFriend.lastname|substr:0:22}</label>
  150. </td>
  151. <td>{$pendingFriend.firstname|substr:0:22}</td>
  152. <td>{$pendingFriend.email}</td>
  153. <td>{dateFormat date=$pendingFriend.date_upd full=1}</td>
  154. </tr>
  155. {/foreach}
  156. </tbody>
  157. </table>
  158. <p class="submit">
  159. <button type="submit" name="revive" id="revive" class="button_large btn btn-default">{l s='Remind my friend(s)' mod='referralprogram'}</button>
  160. </p>
  161. </form>
  162. {else}
  163. <p class="alert alert-warning">
  164. {if $subscribeFriends AND $subscribeFriends|@count > 0}
  165. {l s='You have no pending invitations.' mod='referralprogram'}
  166. {else}
  167. {l s='You have not sponsored any friends yet.' mod='referralprogram'}
  168. {/if}
  169. </p>
  170. {/if}
  171. </div>
  172. <div id="idTab3" class="tab-pane">
  173. {if $subscribeFriends AND $subscribeFriends|@count > 0}
  174. <p>
  175. {l s='Here are sponsored friends who have accepted your invitation:' mod='referralprogram'}
  176. </p>
  177. <table class="table table-bordered">
  178. <thead>
  179. <tr>
  180. <th class="first_item">&nbsp;</th>
  181. <th class="item">{l s='Last name' mod='referralprogram'}</th>
  182. <th class="item">{l s='First name' mod='referralprogram'}</th>
  183. <th class="item">{l s='E-mail' mod='referralprogram'}</th>
  184. <th class="last_item">{l s='Inscription date' mod='referralprogram'}</th>
  185. </tr>
  186. </thead>
  187. <tbody>
  188. {foreach from=$subscribeFriends item=subscribeFriend name=myLoop}
  189. <tr>
  190. <td>{$smarty.foreach.myLoop.iteration}.</td>
  191. <td>{$subscribeFriend.lastname|substr:0:22}</td>
  192. <td>{$subscribeFriend.firstname|substr:0:22}</td>
  193. <td>{$subscribeFriend.email}</td>
  194. <td>{dateFormat date=$subscribeFriend.date_upd full=1}</td>
  195. </tr>
  196. {/foreach}
  197. </tbody>
  198. </table>
  199. {else}
  200. <p class="alert alert-warning">
  201. {l s='No sponsored friends have accepted your invitation yet.' mod='referralprogram'}
  202. </p>
  203. {/if}
  204. </div>
  205. </div>
  206. <ul class="footer_links clearfix">
  207. <li>
  208. <a class="btn btn-default button button-small" href="{$link->getPageLink('my-account', true)|escape:'html':'UTF-8'}" title="{l s='Back to Your Account' mod='referralprogram'}" rel="nofollow">
  209. <span><i class="icon-chevron-left"></i> {l s='Back to Your Account' mod='referralprogram'}</span></a>
  210. </li>
  211. <li><a class="btn btn-default button button-small" href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}" title="{l s='Home' mod='referralprogram'}"><span><i class="icon-chevron-left"></i>{l s='Home' mod='referralprogram'}</span></a></li>
  212. </ul>
  213. {addJsDefL name=ThickboxI18nClose}{l s='Close' mod='referralprogram' js=1}{/addJsDefL}
  214. {addJsDefL name=ThickboxI18nOrEscKey}{l s='or Esc key' mod='referralprogram' js=1}{/addJsDefL}
  215. {addJsDef tb_pathToImage=$img_ps_dir|cat:'loadingAnimation.gif'}