-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtemplate-user-status.php
112 lines (112 loc) · 7.94 KB
/
template-user-status.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/**Template name: User status*/
get_header();
the_post();
$level = ccgn_current_user_level();
$logged_in = is_user_logged_in();
$user_id = get_current_user_id();
$user_status = ccgn_registration_user_get_stage_and_date($user_id);
$application_status = ccgn_show_current_application_status($user_id);
$step = array();
$step[1] = ($application_status['step']['step'] == 1) ? $application_status['step']['class'] : 'hide-for-small-only';
$step[2] = ($application_status['step']['step'] == 2) ? $application_status['step']['class'] : 'hide-for-small-only';
$step[3] = ($application_status['step']['step'] == 3) ? $application_status['step']['class'] : 'hide-for-small-only';
?>
<section class="main-content space-top">
<div class="grid-container">
<div class="grid-x grid-padding-x inner-space">
<div class="cell large-12">
<div class="entry-header">
<h1 class="entry-title"><?php the_title() ?></h1>
</div>
<div class="entry-content">
<?php the_content(); ?>
<div class="user-status-container">
<?php if ($logged_in): ?>
<?php if ($user_status['stage'] == 'accepted'): ?>
<div class="grid-x grid-padding-x">
<div class="cell">
<div class="entry-status success auto-height">
<span class="icon"><span class="dashicons dashicons-yes-alt"></span></span>
<span class="subtitle">Application Approved</span>
<h4 class="entry-title">You're now a member</h4>
</div>
</div>
</div>
<?php else: ?>
<div class="grid-x grid-padding-x large-up-3 medium-up-3 small-up-1">
<div class="cell">
<article class="entry-status <?php echo $step[1] ?>">
<span class="icon"><span class="dashicons dashicons-universal-access-alt"></span></span>
<span class="subtitle">Application Incomplete</span>
<h4 class="entry-title">Create Account && Select vouchers</h4>
<p class="entry-summary">Your application is still incomplete. You need to update the information provided or update the names of the vouchers</p>
<?php if ($application_status['step']['step'] == 1): ?>
<p class="entry-status-content">
<span class="subtitle">Your current status</span>
<span class="status-text"><?php echo $application_status['step']['msg'] ?></span>
<small class="update-date">
Last updated: <?php echo date('Y-m-d', strtotime($application_status['date'])) ?>
</small>
<?php if (!empty($application_status['step']['link'])) : ?>
<a href="<?php echo $application_status['step']['link'] ?>" class="button status-action"><?php echo $application_status['step']['link_text'] ?></a>
<?php endif; ?>
</p>
<?php endif; ?>
</article>
</div>
<div class="cell">
<article class="entry-status <?php echo $step[2] ?>">
<span class="icon"><span class="dashicons dashicons-tickets-alt"></span></span>
<span class="subtitle">Not yet vouched</span>
<h4 class="entry-title">Wait for Vouchers</h4>
<p class="entry-summary">Your application is not yet vouched. The members you selected to vouch for your application still do not respond</p>
<?php if ($application_status['step']['step'] == 2) : ?>
<p class="entry-status-content">
<span class="subtitle">Your current status</span>
<span class="status-text"><?php echo $application_status['step']['msg'] ?></span>
<small class="update-date">
Last updated: <?php echo date('Y-m-d', strtotime($application_status['date'])) ?>
</small>
<?php if (!empty($application_status['step']['link'])) : ?>
<a href="<?php echo $application_status['step']['link'] ?>" class="button status-action"><?php echo $application_status['step']['link_text'] ?></a>
<?php endif; ?>
</p>
<?php endif; ?>
</article>
</div>
<div class="cell">
<article class="entry-status <?php echo $step[3] ?>">
<span class="icon"><span class="dashicons dashicons-thumbs-up"></span></span>
<span class="subtitle">Under review</span>
<h4 class="entry-title">Final Approval</h4>
<p class="entry-summary">Your application has been vouched and now it’s under review from the Membership Council. Please be patient! It shouldn’t take very long.</p>
<?php if ($application_status['step']['step'] == 3) : ?>
<p class="entry-status-content">
<span class="subtitle">Your current status</span>
<span class="status-text"><?php echo $application_status['step']['msg'] ?></span>
<small class="update-date">
Last updated: <?php echo date('Y-m-d', strtotime($application_status['date'])) ?>
</small>
<?php if (!empty($application_status['step']['link'])) : ?>
<a href="<?php echo $application_status['step']['link'] ?>" class="button status-action"><?php echo $application_status['step']['link_text'] ?></a>
<?php endif; ?>
</p>
<?php endif; ?>
</article>
</div>
</div>
<?php endif; ?>
<?php else: ?>
<div class="callout warning">
<h5 class="title">Logged in</h5>
<p>You have to log in in to see your Application status</p>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</section>
<?php get_footer(); ?>