list.tpl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <link rel="stylesheet" type="text/css" href="../resources/css/style.css"/>
  2. {% if sessions_are_included or services_are_included %}
  3. <ul class="nav nav-tabs buy-courses-tabs" role="tablist">
  4. <li role="presentation" class="{{ courses ? 'active' : '' }}">
  5. <a href="{{ _p.web_plugin ~ 'buycourses/src/list.php' }}" >
  6. {{ 'Courses'|get_lang }}
  7. </a>
  8. </li>
  9. {% if sessions_are_included %}
  10. <li role="presentation" class="{{ sessions ? 'active' : '' }}">
  11. <a href="{{ _p.web_plugin ~ 'buycourses/src/list_session.php' }}" >
  12. {{ 'Sessions'|get_lang }}</a>
  13. </li>
  14. {% endif %}
  15. {% if services_are_included %}
  16. <li role="presentation" class="{{ services ? 'active' : '' }}">
  17. <a href="{{ _p.web_plugin ~ 'buycourses/src/list_service.php' }}">
  18. {{ 'Services'|get_plugin_lang('BuyCoursesPlugin') }}
  19. </a>
  20. </li>
  21. {% endif %}
  22. </ul>
  23. {% endif %}
  24. <div class="tab-content">
  25. <div role="tabpanel" class="tab-pane {{ courses ? 'fade in active' : '' }} " id="courses">
  26. <div class="table-responsive">
  27. <table id="courses_table" class="table table-striped table-hover">
  28. <thead>
  29. <tr>
  30. <th>{{ 'Title'|get_lang }}</th>
  31. <th class="text-center">{{ 'OfficialCode'|get_lang }}</th>
  32. <th class="text-center">{{ 'VisibleInCatalog'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  33. <th class="text-right" width="200">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  34. {% if tax_enable and (tax_applies_to == 1 or tax_applies_to == 2) %}
  35. <th class="text-center" width="100">{{ tax_name }}</th>
  36. {% endif %}
  37. <th class="text-right">{{ 'Options'|get_lang }}</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. {% for item in courses %}
  42. <tr data-item="{{ item.id }}" data-type="course">
  43. <td>
  44. {% if item.visibility == 0 %}
  45. <img src="{{ 'bullet_red.png'|icon() }}" alt="{{ 'CourseVisibilityClosed'|get_lang }}"
  46. title="{{ 'CourseVisibilityClosed'|get_lang }}">
  47. {% elseif item.visibility == 1 %}
  48. <img src="{{ 'bullet_orange.png'|icon() }}" alt="{{ 'Private'|get_lang }}"
  49. title="{{ 'Private'|get_lang }}">
  50. {% elseif item.visibility == 2 %}
  51. <img src="{{ 'bullet_green.png'|icon() }}" alt="{{ 'OpenToThePlatform'|get_lang }}"
  52. title="{{ 'OpenToThePlatform'|get_lang }}">
  53. {% elseif item.visibility == 3 %}
  54. <img src="{{ 'bullet_blue.png'|icon() }}" alt="{{ 'OpenToTheWorld'|get_lang }}"
  55. title="{{ 'OpenToTheWorld'|get_lang }}">
  56. {% elseif item.visibility == 4 %}
  57. <img src="{{ 'bullet_grey.png'|icon() }}" alt="{{ 'CourseVisibilityHidden'|get_lang }}"
  58. title="{{ 'CourseVisibilityHidden'|get_lang }}">
  59. {% endif %}
  60. <a href="{{ _p.web_course ~ item.path ~ item.code~ '/index.php' }}">
  61. {{ item.title }}
  62. </a>
  63. <span class="label label-info">{{ item.code }}</span>
  64. </td>
  65. <td class="text-center">
  66. {{ item.code }}
  67. </td>
  68. <td class="text-center">
  69. {% if item.buyCourseData %}
  70. <em class="fa fa-fw fa-check-square-o"></em>
  71. {% else %}
  72. <em class="fa fa-fw fa-square-o"></em>
  73. {% endif %}
  74. </td>
  75. <td width="200" class="text-right">
  76. {{ item.buyCourseData.price_formatted }}
  77. </td>
  78. {% if tax_enable and (tax_applies_to == 1 or tax_applies_to == 2) %}
  79. <td class="text-center">
  80. {{ item.buyCourseData.tax_perc_show }} %
  81. </td>
  82. {% endif %}
  83. <td class="text-right">
  84. <a href="{{ _p.web_plugin ~ 'buycourses/src/configure_course.php?' ~ {'id': item.id, 'type':product_type_course}|url_encode() }}"
  85. class="btn btn-info btn-sm">
  86. <em class="fa fa-wrench fa-fw"></em> {{ 'Configure'|get_lang }}
  87. </a>
  88. </td>
  89. </tr>
  90. {% endfor %}
  91. </tbody>
  92. </table>
  93. </div>
  94. {{ course_pagination }}
  95. </div>
  96. {% if sessions_are_included %}
  97. <div role="tabpanel" class="tab-pane {{ sessions ? 'fade in active' : '' }} " id="sessions">
  98. <div class="table-responsive">
  99. <table id="session_table" class="table">
  100. <thead>
  101. <tr>
  102. <th>{{ 'Title'|get_lang }}</th>
  103. <th class="text-center">{{ 'StartDate'|get_lang }}</th>
  104. <th class="text-center">{{ 'EndDate'|get_lang }}</th>
  105. <th class="text-center">{{ 'VisibleInCatalog'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  106. <th class="text-right">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  107. {% if tax_enable and (tax_applies_to == 1 or tax_applies_to == 3) %}
  108. <th class="text-center" width="100">{{ tax_name }}</th>
  109. {% endif %}
  110. <th class="text-right">{{ 'Options'|get_lang }}</th>
  111. </tr>
  112. </thead>
  113. <tbody>
  114. {% for item in sessions %}
  115. <tr data-item="{{ item.id }}" data-type="session">
  116. <td>
  117. <a href="{{ _p.web_main ~ 'session/index.php?' ~ {'session_id': item.id}|url_encode() }}">{{ item.name }}</a>
  118. </td>
  119. <td class="text-center">
  120. {{ item.displayStartDate | api_convert_and_format_date(6)}}
  121. </td>
  122. <td class="text-center">
  123. {{ item.displayEndDate |api_convert_and_format_date(6)}}
  124. </td>
  125. <td class="text-center">
  126. {% if item.buyCourseData %}
  127. <em class="fa fa-fw fa-check-square-o"></em>
  128. {% else %}
  129. <em class="fa fa-fw fa-square-o"></em>
  130. {% endif %}
  131. </td>
  132. <td class="text-right" width="200">
  133. {{ item.buyCourseData.price_formatted }}
  134. </td>
  135. {% if tax_enable and (tax_applies_to == 1 or tax_applies_to == 3) %}
  136. <td class="text-center">
  137. {{ item.buyCourseData.tax_perc_show }} %
  138. </td>
  139. {% endif %}
  140. <td class="text-right">
  141. <a href="{{ _p.web_plugin ~ 'buycourses/src/configure_course.php?' ~ {'id': item.id, 'type': product_type_session}|url_encode() }}"
  142. class="btn btn-info btn-sm">
  143. <em class="fa fa-wrench fa-fw"></em>
  144. {{ 'Configure'|get_lang }}
  145. </a>
  146. </td>
  147. </tr>
  148. {% endfor %}
  149. </tbody>
  150. </table>
  151. {{ session_pagination }}
  152. </div>
  153. </div>
  154. {% endif %}
  155. {% if services_are_included %}
  156. <div role="tabpanel" class="tab-pane {{ services ? 'fade in active' : '' }} " id="services">
  157. <div class="table-responsive">
  158. <a href="{{ _p.web_plugin ~ 'buycourses/src/services_add.php' }}" class="btn btn-primary">
  159. <em class="fa fa-cart-plus fa-fw"></em> {{ 'NewService'| get_plugin_lang('BuyCoursesPlugin') }}
  160. </a>
  161. </br>
  162. </br>
  163. <table id="services_table" class="table">
  164. <thead>
  165. <tr>
  166. <th>{{ 'Service'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  167. <th>{{ 'Description'|get_lang }}</th>
  168. <th class="text-center">{{ 'Duration'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  169. <th class="text-center">{{ 'VisibleInCatalog'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  170. <th class="text-center">{{ 'Owner'|get_lang }}</th>
  171. <th class="text-right">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  172. {% if tax_enable and (tax_applies_to == 1 or tax_applies_to == 4) %}
  173. <th class="text-center" width="100">{{ tax_name }}</th>
  174. {% endif %}
  175. <th class="text-right">{{ 'Options'|get_lang }}</th>
  176. </tr>
  177. </thead>
  178. <tbody>
  179. {% for item in services %}
  180. <tr data-item="{{ item.id }}" data-type="service">
  181. <td>
  182. {{ item.name }}
  183. </td>
  184. <td>
  185. {{ item.description }}
  186. </td>
  187. <td class="text-center">
  188. {% if item.duration_days == 0 %}
  189. {{ 'NoLimit'|get_lang }}
  190. {% else %}
  191. {{ item.duration_days }} {{ 'Days'|get_lang }}
  192. {% endif %}
  193. </td>
  194. <td class="text-center">
  195. {% if item.visibility == 1 %}
  196. <em class="fa fa-fw fa-check-square-o"></em>
  197. {% else %}
  198. <em class="fa fa-fw fa-square-o"></em>
  199. {% endif %}
  200. </td>
  201. <td class="text-center">
  202. {{ item.owner_name }}
  203. </td>
  204. <td class="text-right" width="200">
  205. {{ item.price_formatted }}
  206. </td>
  207. {% if tax_enable and (tax_applies_to == 1 or tax_applies_to == 4) %}
  208. <td class="text-center">
  209. {% if item.tax_perc is null %}
  210. {{ global_tax_perc }} %
  211. {% else %}
  212. {{ item.tax_perc }} %
  213. {% endif %}
  214. </td>
  215. {% endif %}
  216. <td class="text-right">
  217. <a href="{{ _p.web_plugin ~ 'buycourses/src/services_edit.php?' ~ {'id': item.id}|url_encode() }}"
  218. class="btn btn-info btn-sm">
  219. <em class="fa fa-wrench fa-fw"></em> {{ 'Edit'|get_lang }}
  220. </a>
  221. </td>
  222. </tr>
  223. {% endfor %}
  224. </tbody>
  225. </table>
  226. </div>
  227. {{ service_pagination }}
  228. </div>
  229. {% endif %}
  230. </div>