process_confirm.tpl 12 KB

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