PageRenderTime 28ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/membership/app/view/templates/membership_account.php

https://gitlab.com/najomie/fit-hippie
PHP | 265 lines | 204 code | 15 blank | 46 comment | 16 complexity | 0e35022fd3f75de42d95edb67b31f0bf MD5 | raw file
  1. <div class="ms-account-wrapper">
  2. <?php if ( ms_is_user_logged_in() ) : ?>
  3. <?php
  4. // ================================================= MEMBERSHIPS
  5. if ( ms_is_user_logged_in() ) : ?>
  6. <div id="account-membership">
  7. <h2>
  8. <?php
  9. echo get_ms_ac_title();
  10. if ( show_membership_change_link() ) {
  11. echo get_ms_ac_signup_modified_url();
  12. }
  13. ?>
  14. </h2>
  15. <?php
  16. /**
  17. * Add custom content right before the memberships list.
  18. *
  19. * @since 1.0.0
  20. */
  21. do_action( 'ms_view_account_memberships_top', get_ms_ac_member_obj(), get_ms_ac_account_obj() );
  22. if ( is_ms_admin_user() ) {
  23. _e( 'You are an admin user and have access to all memberships', 'membership2' );
  24. } else {
  25. if ( has_ms_ac_subscriptions() ) {
  26. ?>
  27. <table>
  28. <tr>
  29. <th class="ms-col-membership"><?php
  30. _e( 'Membership name', 'membership2' );
  31. ?></th>
  32. <th class="ms-col-status"><?php
  33. _e( 'Status', 'membership2' );
  34. ?></th>
  35. <th class="ms-col-expire-date"><?php
  36. _e( 'Expire date', 'membership2' );
  37. ?></th>
  38. </tr>
  39. <?php
  40. $empty = true;
  41. $m2_subscriptions = get_ms_ac_subscriptions();
  42. foreach ( $m2_subscriptions as $subscription ) :
  43. $empty = false;
  44. ms_account_the_membership( $subscription );
  45. ?>
  46. <tr class="<?php echo get_ms_account_classes(); ?>">
  47. <td class="ms-col-membership"><?php echo get_ms_account_membership_name(); ?></td>
  48. <td class="ms-col-status"><?php echo get_ms_account_membership_status(); ?></td>
  49. <td class="ms-col-expire-date"><?php echo get_ms_account_expire_date(); ?></td>
  50. </tr>
  51. <?php
  52. endforeach;
  53. if ( $empty ) {
  54. echo get_ms_no_account_membership_status();
  55. }
  56. ?>
  57. </table>
  58. <?php
  59. } else {
  60. _e( 'No memberships', 'membership2' );
  61. }
  62. }
  63. /**
  64. * Add custom content right after the memberships list.
  65. *
  66. * @since 1.0.0
  67. */
  68. do_action( 'ms_view_account_memberships_bottom', get_ms_ac_member_obj(), get_ms_ac_account_obj() );
  69. ?>
  70. </div>
  71. <?php
  72. endif;
  73. ?>
  74. <?php
  75. // ===================================================== PROFILE
  76. if ( is_ms_ac_show_profile() ) : ?>
  77. <div id="account-profile">
  78. <h2>
  79. <?php
  80. echo get_ms_ac_profile_title();
  81. if ( is_ms_ac_show_profile_change() ) {
  82. echo get_ms_ac_profile_change_link();
  83. }
  84. ?>
  85. </h2>
  86. <?php
  87. /**
  88. * Add custom content right before the profile overview.
  89. *
  90. * @since 1.0.0
  91. */
  92. do_action( 'ms_view_account_profile_top', get_ms_ac_member_obj(), get_ms_ac_account_obj() );
  93. ?>
  94. <table>
  95. <?php $profile_fields = get_ms_ac_profile_fields(); ?>
  96. <?php foreach ( $profile_fields as $field => $title ) : ?>
  97. <tr>
  98. <th class="ms-label-title"><?php echo esc_html( $title ); ?>: </th>
  99. <td class="ms-label-field"><?php echo esc_html( get_ms_ac_profile_info( $field ) ); ?></td>
  100. </tr>
  101. <?php endforeach; ?>
  102. </table>
  103. <?php
  104. do_action( 'ms_view_account_profile_before_card', get_ms_ac_member_obj(), get_ms_ac_account_obj() );
  105. do_action( 'ms_view_shortcode_account_card_info', get_ms_ac_data() );
  106. /**
  107. * Add custom content right after the profile overview.
  108. *
  109. * @since 1.0.0
  110. */
  111. do_action( 'ms_view_account_profile_bottom', get_ms_ac_member_obj(), get_ms_ac_account_obj() );
  112. ?>
  113. </div>
  114. <?php
  115. endif;
  116. // END: if ( $show_profile )
  117. // =============================================================
  118. ?>
  119. <?php
  120. // ==================================================== INVOICES
  121. if ( is_ms_ac_show_invoices() ) : ?>
  122. <div id="account-invoices">
  123. <h2>
  124. <?php
  125. echo get_ms_ac_invoices_title();
  126. if ( is_ms_ac_show_all_invoices() ) {
  127. echo get_ms_ac_invoices_detail_label();
  128. }
  129. ?>
  130. </h2>
  131. <?php
  132. /**
  133. * Add custom content right before the invoice overview list.
  134. *
  135. * @since 1.0.0
  136. */
  137. do_action( 'ms_view_account_invoices_top', get_ms_ac_member_obj(), get_ms_ac_account_obj() );
  138. ?>
  139. <table>
  140. <thead>
  141. <tr>
  142. <th class="ms-col-invoice-no"><?php
  143. _e( 'Invoice #', 'membership2' );
  144. ?></th>
  145. <th class="ms-col-invoice-status"><?php
  146. _e( 'Status', 'membership2' );
  147. ?></th>
  148. <th class="ms-col-invoice-total"><?php
  149. printf(
  150. '%s (%s)',
  151. __( 'Total', 'membership2' ),
  152. MS_Plugin::instance()->settings->currency
  153. );
  154. ?></th>
  155. <th class="ms-col-invoice-title"><?php
  156. _e( 'Membership', 'membership2' );
  157. ?></th>
  158. <th class="ms-col-invoice-due"><?php
  159. _e( 'Due date', 'membership2' );
  160. ?></th>
  161. </tr>
  162. </thead>
  163. <tbody>
  164. <?php $m2_invoices = get_ms_ac_invoices(); ?>
  165. <?php foreach ( $m2_invoices as $invoice ) :
  166. ms_account_the_invoice( $invoice );
  167. ?>
  168. <tr class="<?php echo get_ms_invoice_classes(); ?>">
  169. <td class="ms-col-invoice-no"><?php echo get_ms_invoice_number(); ?></td>
  170. <td class="ms-col-invoice-status"><?php echo get_ms_invoice_next_status(); ?></td>
  171. <td class="ms-col-invoice-total"><?php echo get_ms_invoice_total(); ?></td>
  172. <td class="ms-col-invoice-title"><?php echo get_ms_invoice_name(); ?></td>
  173. <td class="ms-col-invoice-due"><?php echo get_ms_invoice_due_date(); ?></td>
  174. </tr>
  175. <?php endforeach; ?>
  176. </tbody>
  177. </table>
  178. <?php
  179. /**
  180. * Add custom content right after the invoices overview list.
  181. *
  182. * @since 1.0.0
  183. */
  184. do_action( 'ms_view_account_invoices_bottom', get_ms_ac_member_obj(), get_ms_ac_account_obj() );
  185. ?>
  186. </div>
  187. <?php
  188. endif;
  189. ?>
  190. <?php
  191. // ==================================================== ACTIVITY
  192. if ( is_ms_ac_show_activity() ) : ?>
  193. <div id="account-activity">
  194. <h2>
  195. <?php
  196. echo get_ms_ac_activity_title();
  197. if ( is_ms_ac_show_all_activities() ) {
  198. echo get_ms_ac_activity_details_label();
  199. }
  200. ?>
  201. </h2>
  202. <?php
  203. /**
  204. * Add custom content right before the activities overview list.
  205. *
  206. * @since 1.0.0
  207. */
  208. do_action( 'ms_view_account_activity_top', get_ms_ac_member_obj(), get_ms_ac_account_obj() );
  209. ?>
  210. <table>
  211. <thead>
  212. <tr>
  213. <th class="ms-col-activity-date"><?php
  214. _e( 'Date', 'membership2' );
  215. ?></th>
  216. <th class="ms-col-activity-title"><?php
  217. _e( 'Activity', 'membership2' );
  218. ?></th>
  219. </tr>
  220. </thead>
  221. <tbody>
  222. <?php $m2_events = get_ms_ac_events(); ?>
  223. <?php foreach ( $m2_events as $event ) :
  224. ms_account_the_event( $event );
  225. ?>
  226. <tr class="<?php echo get_ms_event_classes(); ?>">
  227. <td class="ms-col-activity-date"><?php echo get_ms_event_date(); ?></td>
  228. <td class="ms-col-activity-title"><?php echo get_ms_event_description(); ?></td>
  229. </tr>
  230. <?php endforeach; ?>
  231. </tbody>
  232. </table>
  233. <?php
  234. /**
  235. * Add custom content right after the activities overview list.
  236. *
  237. * @since 1.0.0
  238. */
  239. do_action( 'ms_view_account_activity_bottom', get_ms_ac_member_obj(), get_ms_ac_account_obj() );
  240. ?>
  241. </div>
  242. <?php
  243. endif;
  244. ?>
  245. <?php else :
  246. if ( ! has_ms_ac_login_form() ) {
  247. echo get_ms_ac_login_form();
  248. }
  249. endif; ?>
  250. </div>