-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.twig
179 lines (131 loc) · 5.64 KB
/
index.twig
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
{% extends 'admin/templates/settings.twig' %}
{% block admin_settings %}
<style>
/*CSS to control our pagination items*/
div.pagination {
padding: 3px;
margin: 3px;
text-align:center;
}
div.pagination a {
padding: 2px 5px 2px 5px;
margin: 2px;
border: 1px solid #AAAADD;
text-decoration: none; /* no underline */
color: #000099;
}
div.pagination a:hover, div.digg a:active {
border: 1px solid #000099;
color: #000;
}
div.pagination span.current {
padding: 2px 5px 2px 5px;
margin: 2px;
border: 1px solid #000099;
font-weight: bold;
background-color: #000099;
color: #FFF;
}
div.pagination span.disabled {
padding: 2px 5px 2px 5px;
margin: 2px;
border: 1px solid #EEE;
color: #DDD;
}
</style>
{#just the current url where we are so we can append page number to it when user clicks pagination#}
{% set current_path = path_for('admin_manage_subscription_all') %}
<script type="text/javascript">
$(document).ready(function(){
//changePagination('0'); // if we are using ajax we can allow this
});
function changePagination(pageId){
// so if the pagination is displaying, and the user clicks on a new page we just need to refresh the page, make the ?pageId = new page id clicked on
window.location.href = '{{ current_path }}' + '?pageId=' + pageId;
/* // you can be loading your data via ajax here, but we do not want now
var dataString = 'pageId='+ pageId;
$.ajax({
type: "POST",
data: dataString,
cache: false,
success: function(result){
$(".flash").hide();
$("#pageData").html(result);
}
});*/
}
</script>
<div class="row">
<div class="col s12 l12 m12" >
<div id="">
<div class="text-center">
<h4 class="header">Manage Menu Subscription </h4>
<span class="shop-mail"> {{ store.name }} <i class="fa fa-angle-double-right" aria-hidden="true"></i> {{ store.email }}</span>
</div>
<div class="divider"></div>
<div class="row">
<div class="col s12 l12 m12 table-responsive">
{#{% if subscriptions is not empty %}#}
<table id="manage-food_subscription" class="display" cellspacing="0">
<thead>
<tr>
<th>S/N</th>
<th>Invoice</th>
<th>Amount</th>
<th>Package</th>
<th>subscriber</th>
<th>days</th>
<th>paid</th>
<th>Status</th>
</tr>
</thead>
<tfoot>
<tr>
<th>S/N</th>
<th>Invoice</th>
<th>Amount</th>
<th>Package</th>
<th>subscriber</th>
<th>days</th>
<th>paid</th>
<th>Status</th>
</tr>
</tfoot>
<tbody>
{% for p in subscriptions.data %}
<tr>
<td>{{ loop.index }} </td>
<td style="min-width: 150px">
<a href="{{ path_for('admin_view_manage_single_food_subscription', {'subscription_hash': p.id_hash }) }}">
{{ p.invoice}}
</a>
</td>
<td>₦{{ p.price|number_format(2, '.', ',') }}</td>
<td>{{ p.package }}</td>
<td>{{ p.subscriber }}
</td>
<td> {{ p.days }} </td>
<td>
{% if p.paid == 0 %}
<span class="label false">unpaid</span>
{% elseif p.paid == 1 %}
<span class="label true">Paid</span>
{% else %}
<span class="label false">unknown</span>
{% endif %}
</td>
<td>
<span class="label false">{{ p.status }}</span>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{{ packages.pagination | raw }}
</div>
</div>
</div>
<br>
</div>
</div>
{% endblock %}