list.tpl 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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} #{item.buyCourseData.currency ?: item.buyCourseData.currency}" }}
  77. </td>
  78. {% if tax_enable and (tax_applies_to == 1 or tax_applies_to == 2) %}
  79. <td class="text-center">
  80. {% if item.tax_perc is null %}
  81. {{ global_tax_perc }} %
  82. {% else %}
  83. {{ item.buyCourseData.tax_perc }} %
  84. {% endif %}
  85. </td>
  86. {% endif %}
  87. <td class="text-right">
  88. <a href="{{ _p.web_plugin ~ 'buycourses/src/configure_course.php?' ~ {'id': item.id, 'type':product_type_course}|url_encode() }}"
  89. class="btn btn-info btn-sm">
  90. <em class="fa fa-wrench fa-fw"></em> {{ 'Configure'|get_lang }}
  91. </a>
  92. </td>
  93. </tr>
  94. {% endfor %}
  95. </tbody>
  96. </table>
  97. </div>
  98. {{ course_pagination }}
  99. </div>
  100. {% if sessions_are_included %}
  101. <div role="tabpanel" class="tab-pane {{ sessions ? 'fade in active' : '' }} " id="sessions">
  102. <div class="table-responsive">
  103. <table id="session_table" class="table">
  104. <thead>
  105. <tr>
  106. <th>{{ 'Title'|get_lang }}</th>
  107. <th class="text-center">{{ 'StartDate'|get_lang }}</th>
  108. <th class="text-center">{{ 'EndDate'|get_lang }}</th>
  109. <th class="text-center">{{ 'VisibleInCatalog'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  110. <th class="text-right">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  111. {% if tax_enable and (tax_applies_to == 1 or tax_applies_to == 3) %}
  112. <th class="text-center" width="100">{{ tax_name }}</th>
  113. {% endif %}
  114. <th class="text-right">{{ 'Options'|get_lang }}</th>
  115. </tr>
  116. </thead>
  117. <tbody>
  118. {% for item in sessions %}
  119. <tr data-item="{{ item.id }}" data-type="session">
  120. <td>
  121. <a href="{{ _p.web_main ~ 'session/index.php?' ~ {'session_id': item.id}|url_encode() }}">{{ item.name }}</a>
  122. </td>
  123. <td class="text-center">
  124. {{ item.displayStartDate | api_convert_and_format_date(6)}}
  125. </td>
  126. <td class="text-center">
  127. {{ item.displayEndDate |api_convert_and_format_date(6)}}
  128. </td>
  129. <td class="text-center">
  130. {% if item.buyCourseData %}
  131. <em class="fa fa-fw fa-check-square-o"></em>
  132. {% else %}
  133. <em class="fa fa-fw fa-square-o"></em>
  134. {% endif %}
  135. </td>
  136. <td class="text-right" width="200">
  137. {{ "#{item.buyCourseData.price} #{tem.currency ?: item.buyCourseData.currency}" }}
  138. </td>
  139. {% if tax_enable and (tax_applies_to == 1 or tax_applies_to == 3) %}
  140. <td class="text-center">
  141. {% if item.buyCourseData.tax_perc is null %}
  142. {{ global_tax_perc }} %
  143. {% else %}
  144. {{ item.buyCourseData.tax_perc }} %
  145. {% endif %}
  146. </td>
  147. {% endif %}
  148. <td class="text-right">
  149. <a href="{{ _p.web_plugin ~ 'buycourses/src/configure_course.php?' ~ {'id': item.id, 'type': product_type_session}|url_encode() }}"
  150. class="btn btn-info btn-sm">
  151. <em class="fa fa-wrench fa-fw"></em>
  152. {{ 'Configure'|get_lang }}
  153. </a>
  154. </td>
  155. </tr>
  156. {% endfor %}
  157. </tbody>
  158. </table>
  159. {{ session_pagination }}
  160. </div>
  161. </div>
  162. {% endif %}
  163. {% if services_are_included %}
  164. <div role="tabpanel" class="tab-pane {{ services ? 'fade in active' : '' }} " id="services">
  165. <div class="table-responsive">
  166. <a href="{{ _p.web_plugin ~ 'buycourses/src/services_add.php' }}" class="btn btn-primary">
  167. <em class="fa fa-cart-plus fa-fw"></em> {{ 'NewService'| get_plugin_lang('BuyCoursesPlugin') }}
  168. </a>
  169. </br>
  170. </br>
  171. <table id="services_table" class="table">
  172. <thead>
  173. <tr>
  174. <th>{{ 'Service'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  175. <th>{{ 'Description'|get_lang }}</th>
  176. <th class="text-center">{{ 'Duration'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  177. <th class="text-center">{{ 'VisibleInCatalog'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  178. <th class="text-center">{{ 'Owner'|get_lang }}</th>
  179. <th class="text-right">{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</th>
  180. {% if tax_enable and (tax_applies_to == 1 or tax_applies_to == 4) %}
  181. <th class="text-center" width="100">{{ tax_name }}</th>
  182. {% endif %}
  183. <th class="text-right">{{ 'Options'|get_lang }}</th>
  184. </tr>
  185. </thead>
  186. <tbody>
  187. {% for item in services %}
  188. <tr data-item="{{ item.id }}" data-type="service">
  189. <td>
  190. {{ item.name }}
  191. </td>
  192. <td>
  193. {{ item.description }}
  194. </td>
  195. <td class="text-center">
  196. {% if item.duration_days == 0 %}
  197. {{ 'NoLimit'|get_lang }}
  198. {% else %}
  199. {{ item.duration_days }} {{ 'Days'|get_lang }}
  200. {% endif %}
  201. </td>
  202. <td class="text-center">
  203. {% if item.visibility == 1 %}
  204. <em class="fa fa-fw fa-check-square-o"></em>
  205. {% else %}
  206. <em class="fa fa-fw fa-square-o"></em>
  207. {% endif %}
  208. </td>
  209. <td class="text-center">
  210. {{ item.owner_name }}
  211. </td>
  212. <td class="text-right" width="200">
  213. {{ "#{item.price} #{tem.currency ?: item.currency}" }}
  214. </td>
  215. {% if tax_enable and (tax_applies_to == 1 or tax_applies_to == 4) %}
  216. <td class="text-center">
  217. {% if item.tax_perc is null %}
  218. {{ global_tax_perc }} %
  219. {% else %}
  220. {{ item.tax_perc }} %
  221. {% endif %}
  222. </td>
  223. {% endif %}
  224. <td class="text-right">
  225. <a href="{{ _p.web_plugin ~ 'buycourses/src/services_edit.php?' ~ {'id': item.id}|url_encode() }}"
  226. class="btn btn-info btn-sm">
  227. <em class="fa fa-wrench fa-fw"></em> {{ 'Edit'|get_lang }}
  228. </a>
  229. </td>
  230. </tr>
  231. {% endfor %}
  232. </tbody>
  233. </table>
  234. </div>
  235. {{ service_pagination }}
  236. </div>
  237. {% endif %}
  238. </div>