process_confirm.tpl 14 KB

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