process_confirm.tpl 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <div class="row">
  2. <div id="message-alert"></div>
  3. <div class="col-md-5">
  4. <div class="panel panel-default buycourse-panel-default">
  5. <div class="panel-heading">
  6. <h3 class="panel-title">{{ 'PurchaseData'|get_plugin_lang('BuyCoursesPlugin') }}</h3>
  7. </div>
  8. <div class="panel-body">
  9. {% if buying_course %}
  10. <div class="row">
  11. <div class="col-sm-12 col-md-12 col-xs-12">
  12. <a class="ajax" data-title="{{ course.title }}"
  13. href="{{ _p.web_ajax ~ 'course_home.ajax.php?' ~ {'a': 'show_course_information', 'code': course.code}|url_encode() }}">
  14. <img alt="{{ course.title }}" class="img-responsive" style="width: 100%;"
  15. src="{{ course.course_img ? course.course_img : 'session_default.png'|icon() }}">
  16. </a>
  17. </div>
  18. <div class="col-sm-12 col-md-12 col-xs-12">
  19. <h3>
  20. <a class="ajax" data-title="{{ course.title }}"
  21. href="{{ _p.web_ajax ~ 'course_home.ajax.php?' ~ {'a': 'show_course_information', 'code': course.code}|url_encode() }}">{{ course.title }}</a>
  22. </h3>
  23. <ul class="list-unstyled">
  24. {% for teacher in course.teachers %}
  25. <li><em class="fa fa-user"></em> {{ teacher.name }}</li>
  26. {% endfor %}
  27. </ul>
  28. <p id="n-price" class="lead text-right" style="color: white;">
  29. <span class="label label-primary">{{ course.currency == 'BRL' ? 'R$' : course.currency }} {{ course.price }}</span>
  30. </p>
  31. <p id="s-price" class="lead text-right"></p>
  32. </div>
  33. </div>
  34. {% elseif buying_session %}
  35. <div class="row">
  36. <div class="col-sm-12 col-md-12 col-xs-12">
  37. <p>
  38. <img alt="{{ session.name }}" class="img-responsive" style="width: 100%;"
  39. src="{{ session.image ? session.image : 'session_default.png'|icon() }}">
  40. </p>
  41. </div>
  42. <div class="col-sm-12 col-md-12 col-xs-12">
  43. <h3>{{ session.name }}</h3>
  44. <p><em class="fa fa-calendar fa-fw"></em> {{ session.dates.display }}</p>
  45. <ul class="list-unstyled">
  46. {% for course in session.courses %}
  47. <li>
  48. <em class="fa fa-book fa-fw"></em> {{ course.title }}
  49. {% if course.coaches|length %}
  50. <ul>
  51. {% for coach in course.coaches %}
  52. <li><em class="fa fa-user fa-fw"></em>{{ coach }}</li>
  53. {% endfor %}
  54. </ul>
  55. {% endif %}
  56. </li>
  57. {% endfor %}
  58. </ul>
  59. <p id="n-price" class="lead text-right" style="color: white;">
  60. <span class="label label-primary">{{ session.currency == 'BRL' ? 'R$' : session.currency }} {{ session.price }}</span>
  61. </p>
  62. <p id="s-price" class="lead text-right"></p>
  63. </div>
  64. </div>
  65. {% elseif buying_service %}
  66. <div class="row">
  67. <div class="col-sm-12 col-md-12 col-xs-12">
  68. <a href='{{ _p.web }}service/{{ service.id }}'>
  69. <img alt="{{ service.name }}" class="img-responsive"
  70. src="{{ service.image ? _p.web ~ 'plugin/buycourses/uploads/services/images/' ~ service.image : 'session_default.png'|icon() }}">
  71. </a>
  72. </div>
  73. </div>
  74. <div class="row">
  75. <div class="col-sm-12 col-md-12 col-xs-12">
  76. <h3>
  77. <a href='{{ _p.web }}service/{{ service.id }}'>{{ service.name }}</a>
  78. </h3>
  79. <ul class="list-unstyled">
  80. {% if service.applies_to == 0 %}
  81. <li>
  82. <em class="fa fa-hand-o-right"></em> {{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') }} {{ 'None'|get_lang }}
  83. </li>
  84. {% elseif service.applies_to == 1 %}
  85. <li>
  86. <em class="fa fa-hand-o-right"></em> {{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') }} {{ 'User'|get_lang }}
  87. </li>
  88. {% elseif service.applies_to == 2 %}
  89. <li>
  90. <em class="fa fa-hand-o-right"></em> {{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') }} {{ 'Course'|get_lang }}
  91. </li>
  92. {% elseif service.applies_to == 3 %}
  93. <li>
  94. <em class="fa fa-hand-o-right"></em> {{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') }} {{ 'Session'|get_lang }}
  95. </li>
  96. {% elseif service.applies_to == 4 %}
  97. <li>
  98. <em class="fa fa-hand-o-right"></em> {{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') }} {{ 'TemplateTitleCertificate'|get_lang }}
  99. </li>
  100. {% endif %}
  101. <li><em class="fa fa-money"></em> {{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}
  102. : {{ service.currency == 'BRL' ? 'R$' : service.currency }} {{ service.price }}
  103. / {{ service.duration_days == 0 ? 'NoLimit'|get_lang : service.duration_days ~ ' ' ~ 'Days'|get_lang }}
  104. </li>
  105. <li><em class="fa fa-user"></em> {{ service.owner.name }}</li>
  106. {% if service.description %}
  107. <li><em class="fa fa-align-justify"></em> {{ service.description }}</li>
  108. {% endif %}
  109. </ul>
  110. <p id="n-price" class="lead text-right" style="color: white;"><span
  111. class="label label-primary">{{ service.currency == 'BRL' ? 'R$' : service.currency }} {{ service.price }}</span>
  112. </p>
  113. <p id="s-price" class="lead text-right"></p>
  114. </div>
  115. </div>
  116. {% endif %}
  117. </div>
  118. </div>
  119. </div>
  120. {% if terms %}
  121. <div class="col-md-7">
  122. <div class="panel panel-default buycourse-panel-default">
  123. <div class="panel-heading">
  124. <h3 class="panel-title">{{ 'TermsAndConditions'|get_plugin_lang('BuyCoursesPlugin') }}</h3>
  125. </div>
  126. <div class="panel-body">
  127. <form action="#">
  128. <div class="form-group">
  129. <textarea class="form-control" style="height: 345px;" readonly>{{ terms }}</textarea>
  130. </div>
  131. <div class="checkbox">
  132. <label for="confirmTermsAndConditons">
  133. <input class="" type="checkbox" id="confirmTermsAndConditons" name="confirmTermsAndConditons">
  134. {{ 'IConfirmIReadAndAcceptTermsAndCondition'|get_plugin_lang('BuyCoursesPlugin') }}
  135. </label>
  136. </div>
  137. </form>
  138. </div>
  139. </div>
  140. </div>
  141. {% endif %}
  142. </div>
  143. {% if is_bank_transfer %}
  144. <div class="row">
  145. <div class="col-xs-12">
  146. <h3 class="page-header">{{ 'BankAccountInformation'|get_plugin_lang('BuyCoursesPlugin') }}</h3>
  147. <div class="table-responsive">
  148. <table class="table table-striped table-hover">
  149. <thead>
  150. <tr>
  151. <th>{{ 'Name'|get_lang }}</th>
  152. <th class="text-center">{{ 'BankAccount'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  153. <th class="text-center">{{ 'SWIFT'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  154. </tr>
  155. </thead>
  156. <tbody>
  157. {% for account in transfer_accounts %}
  158. <tr>
  159. <td>{{ account.name }}</td>
  160. <td class="text-center">{{ account.account }}</td>
  161. <td class="text-center">{{ account.swift }}</td>
  162. </tr>
  163. {% endfor %}
  164. </tbody>
  165. </table>
  166. </div>
  167. <p>{{ 'OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'|get_plugin_lang('BuyCoursesPlugin') }}</p>
  168. </div>
  169. </div>
  170. {% endif %}
  171. <div class="row">
  172. <div class="col-xs-12">
  173. {{ form }}
  174. </div>
  175. </div>
  176. <script>
  177. $(document).ready(function () {
  178. {% if terms %}
  179. $("#confirm").prop("disabled", true);
  180. $("#confirmTermsAndConditons").click(function () {
  181. if ($("#confirmTermsAndConditons").is(':checked')) {
  182. $("#confirm").prop("disabled", false);
  183. } else {
  184. $("#confirm").prop("disabled", true);
  185. }
  186. });
  187. {% endif %}
  188. {% if is_culqi_payment %}
  189. var price = {{ price }} * 100;
  190. Culqi.codigoComercio = '{{ culqi_params.commerce_code }}';
  191. Culqi.configurar({
  192. nombre: '{{ _s.institution }}',
  193. orden: '{{ sale.reference ? sale.reference : buying_service.reference }}',
  194. moneda: '{{ currency.iso_code }}',
  195. descripcion: '{{ title }}',
  196. monto: price
  197. });
  198. $("#confirm").click(function (e) {
  199. Culqi.abrir();
  200. e.preventDefault();
  201. $(".culqi_checkout").watch('style', function () {
  202. if (Culqi.error) {
  203. $("#message-alert").html('<div class="col-md-12 alert alert-danger">{{ 'ErrorOccurred'|get_plugin_lang('BuyCoursesPlugin')|format(Culqi.error.codigo, Culqi.error.mensaje) }}</div>')
  204. } else if (Culqi.token) {
  205. {% if buying_service %}
  206. var url = '{{ _p.web_plugin }}buycourses/src/buycourses.ajax.php?a=culqi_cargo_service&token_id=' + Culqi.token.id + '&service_sale_id=' + {{ buying_service.id }};
  207. {% else %}
  208. var url = '{{ _p.web_plugin }}buycourses/src/buycourses.ajax.php?a=culqi_cargo&token_id=' + Culqi.token.id + '&sale_id=' + {{ sale.id }};
  209. {% endif %}
  210. $.ajax({
  211. type: 'POST',
  212. url: url,
  213. beforeSend: function () {
  214. $("#confirm").html('<em class="fa fa-spinner fa-pulse fa-fw" ></em> {{ 'Loading'|get_lang }}');
  215. $("#confirm").prop("disabled", true);
  216. $("#cancel").prop("disabled", true);
  217. },
  218. success: function () {
  219. window.location = "{{ _p.web_plugin }}buycourses/index.php";
  220. }
  221. })
  222. }
  223. $(".culqi_checkout").unwatch('style');
  224. });
  225. return false;
  226. });
  227. $.fn.watch = function (property, callback) {
  228. return $(this).each(function () {
  229. var old_property_val = this[property];
  230. var timer;
  231. function watch() {
  232. var self = $(".culqi_checkout");
  233. self = self[0];
  234. if ($(self).data(property + '-watch-abort') == true) {
  235. timer = clearInterval(timer);
  236. $(self).data(property + '-watch-abort', null);
  237. return;
  238. }
  239. if (self[property] != old_property_val) {
  240. old_property_val = self[property];
  241. callback.call(self);
  242. }
  243. }
  244. timer = setInterval(watch, 700);
  245. });
  246. };
  247. $.fn.unwatch = function (property) {
  248. return $(this).each(function () {
  249. $(this).data(property + '-watch-abort', true);
  250. });
  251. };
  252. {% endif %}
  253. })
  254. </script>