| 34881 |
aman |
1 |
<style>
|
|
|
2 |
.select2-container .select2-selection--single {
|
|
|
3 |
box-sizing: border-box;
|
|
|
4 |
cursor: pointer;
|
|
|
5 |
display: block;
|
|
|
6 |
height: 35px;
|
|
|
7 |
padding: 3px;
|
|
|
8 |
user-select: none;
|
|
|
9 |
-webkit-user-select: none;
|
|
|
10 |
}
|
|
|
11 |
|
|
|
12 |
.modal-body {
|
|
|
13 |
overflow-y: auto;
|
|
|
14 |
max-height: calc(100vh - 200px);
|
|
|
15 |
}
|
|
|
16 |
</style>
|
|
|
17 |
<section class="wrapper">
|
|
|
18 |
<div class="row">
|
|
|
19 |
<div class="col-lg-12">
|
|
|
20 |
<h3 class="page-header"><i class="icon_document_alt"></i>Affiliate Product</h3>
|
|
|
21 |
<ol class="breadcrumb">
|
|
|
22 |
<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Dashboard</a></li>
|
|
|
23 |
<li><i class="icon_document_alt"></i>Affiliate Product</li>
|
|
|
24 |
<li class="pull-right">
|
|
|
25 |
<button class="btn btn-primary map-catalog" type="button" data-toggle="modal"
|
|
|
26 |
data-target="#addAffiliateProductModal">
|
|
|
27 |
<i class="icon_document_alt"></i>Create New
|
|
|
28 |
</button>
|
|
|
29 |
</li>
|
|
|
30 |
</ol>
|
|
|
31 |
</div>
|
|
|
32 |
</div>
|
|
|
33 |
<table class="table table-border table-condensed table-bordered"
|
|
|
34 |
id="categoriesed-catalog-list" style="width: 100%;">
|
|
|
35 |
<h3 class="ribbon-highlight">All Active Affiliate Product List</h3>
|
|
|
36 |
<thead class="row">
|
|
|
37 |
<tr>
|
|
|
38 |
<th>Product Id</th>
|
|
|
39 |
<th>Catalog Brand</th>
|
|
|
40 |
<th>Gift Id</th>
|
|
|
41 |
<th>Status</th>
|
|
|
42 |
<th>Expire Date</th>
|
|
|
43 |
<th>Action</th>
|
|
|
44 |
</tr>
|
|
|
45 |
</thead>
|
|
|
46 |
<tbody>
|
|
|
47 |
#foreach($product in $affiliateProductList)
|
|
|
48 |
<tr>
|
|
|
49 |
<td>$product.getId()</td>
|
|
|
50 |
<td>$catalogIdMap.get($product.getCatalogId()).getBrand()</td>
|
|
|
51 |
<td>$product.getGiftId()</td>
|
|
|
52 |
<td>$product.getStatus()</td>
|
|
|
53 |
<td> $dateFormatter.format( $product.getExpiryDate()) </td>
|
|
|
54 |
<td>
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
<button class="btn btn-info btn-sm edit-affiliate-product" data-target="#editAffiliateProductModal"
|
|
|
58 |
data-productid="$product.getId()">Update
|
|
|
59 |
</button>
|
|
|
60 |
<button class="btn btn-primary btn-sm delete-affiliate-product"
|
|
|
61 |
data-productid="$product.getId()" data-toggle="modal"
|
|
|
62 |
>Delete
|
|
|
63 |
</button>
|
|
|
64 |
</td>
|
|
|
65 |
</tr>
|
|
|
66 |
|
|
|
67 |
#end
|
|
|
68 |
|
|
|
69 |
</tbody>
|
|
|
70 |
</table>
|
|
|
71 |
</section>
|
|
|
72 |
|
|
|
73 |
<div id="addAffiliateProductModal" class="modal" role="dialog">
|
|
|
74 |
<div class="modal-dialog modal-lg">
|
|
|
75 |
<div class="modal-content">
|
|
|
76 |
<div class="modal-header">
|
|
|
77 |
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
78 |
<h4 class="modal-title">Create New Affiliate Product</h4>
|
|
|
79 |
</div>
|
|
|
80 |
<div class="modal-body" id="manageSuperCatalogModalBody">
|
|
|
81 |
<form id="affiliateProductForm">
|
|
|
82 |
<div class="row">
|
|
|
83 |
<div class="col-md-6">
|
|
|
84 |
<div class="form-group">
|
|
|
85 |
<label class="w-full" for="catalog_id">Select Catalog *</label>
|
|
|
86 |
|
|
|
87 |
<select id="catalog_id" name="catalogId" class="form-control" required>
|
|
|
88 |
<option value="">-- Select Catalog First --</option>
|
|
|
89 |
#foreach($catalog in $catalogList)
|
|
|
90 |
<option value="$catalog.id">$catalog.description</option>
|
|
|
91 |
#end
|
|
|
92 |
</select>
|
|
|
93 |
</div>
|
|
|
94 |
</div>
|
|
|
95 |
<div class="col-md-6">
|
|
|
96 |
<div class="form-group">
|
|
|
97 |
<label class="w-full" for="gift_ids">Gift IDs (comma separated)</label>
|
|
|
98 |
<select id="gift_ids" name="giftId" class="form-control" required multiple>
|
|
|
99 |
<option value="">-- Select Gift --</option>
|
|
|
100 |
#foreach($gift in $giftsList)
|
|
|
101 |
<option value="$gift.getId()">$gift.getName()</option>
|
|
|
102 |
#end
|
|
|
103 |
</select>
|
|
|
104 |
</div>
|
|
|
105 |
</div>
|
|
|
106 |
</div>
|
|
|
107 |
|
|
|
108 |
<div class="row">
|
|
|
109 |
<div class="col-md-6">
|
|
|
110 |
<div class="form-group">
|
|
|
111 |
<label for="status">Status *</label>
|
|
|
112 |
<select id="status" name="status" class="form-control" required>
|
|
|
113 |
#foreach($status in $productStatus)
|
|
|
114 |
<option value="$status">$status</option>
|
|
|
115 |
#end
|
|
|
116 |
</select>
|
|
|
117 |
</div>
|
|
|
118 |
</div>
|
|
|
119 |
<div class="col-md-6">
|
|
|
120 |
<div class="form-group">
|
|
|
121 |
<label for="expiry_date">Expiry Date</label>
|
|
|
122 |
<input type="datetime-local" class="form-control" id="expiry_date" name="expiryDate">
|
|
|
123 |
</div>
|
|
|
124 |
</div>
|
|
|
125 |
</div>
|
|
|
126 |
</form>
|
|
|
127 |
</div>
|
|
|
128 |
<div class="modal-footer">
|
|
|
129 |
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
|
|
|
130 |
<button type="button" class="btn btn-primary saveAffiliateProduct">Save</button>
|
|
|
131 |
</div>
|
|
|
132 |
</div>
|
|
|
133 |
</div>
|
|
|
134 |
</div>
|
|
|
135 |
|
|
|
136 |
<div id="editAffiliateProductModal" class="modal" role="dialog">
|
|
|
137 |
<div class="modal-dialog modal-lg">
|
|
|
138 |
<div class="modal-content">
|
|
|
139 |
<div class="modal-header">
|
|
|
140 |
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
141 |
<h4 class="modal-title">Update Affiliate Product</h4>
|
|
|
142 |
</div>
|
|
|
143 |
<div class="modal-body" id="editModalBody">
|
|
|
144 |
<form id="editAffiliateProductForm">
|
|
|
145 |
<!-- Hidden field to store product ID for updates -->
|
|
|
146 |
<input type="hidden" id="edit_product_id" name="productId" value="">
|
|
|
147 |
|
|
|
148 |
<div class="row">
|
|
|
149 |
<div class="col-md-6">
|
|
|
150 |
<div class="form-group">
|
|
|
151 |
<label class="w-full" for="edit_catalog_id">Select Catalog *</label>
|
|
|
152 |
<select id="edit_catalog_id" name="catalogId" class="form-control" required>
|
|
|
153 |
<option value="">-- Select Catalog First --</option>
|
|
|
154 |
#foreach($catalog in $catalogList)
|
|
|
155 |
<option value="$catalog.id">$catalog.description</option>
|
|
|
156 |
#end
|
|
|
157 |
</select>
|
|
|
158 |
</div>
|
|
|
159 |
</div>
|
|
|
160 |
<div class="col-md-6">
|
|
|
161 |
<div class="form-group">
|
|
|
162 |
<label class="w-full" for="edit_gift_ids">Select Gift *</label>
|
|
|
163 |
<select id="edit_gift_ids" name="giftId" class="form-control" required multiple>
|
|
|
164 |
<option value="">-- Select Gift --</option>
|
|
|
165 |
#foreach($gift in $giftsList)
|
|
|
166 |
<option value="$gift.getId()">$gift.getName()</option>
|
|
|
167 |
#end
|
|
|
168 |
</select>
|
|
|
169 |
</div>
|
|
|
170 |
</div>
|
|
|
171 |
</div>
|
|
|
172 |
|
|
|
173 |
<div class="row">
|
|
|
174 |
<div class="col-md-6">
|
|
|
175 |
<div class="form-group">
|
|
|
176 |
<label for="edit_status">Status *</label>
|
|
|
177 |
<select id="edit_status" name="status" class="form-control" required>
|
|
|
178 |
#foreach($status in $productStatus)
|
|
|
179 |
<option value="$status">$status</option>
|
|
|
180 |
#end
|
|
|
181 |
</select>
|
|
|
182 |
</div>
|
|
|
183 |
</div>
|
|
|
184 |
<div class="col-md-6">
|
|
|
185 |
<div class="form-group">
|
|
|
186 |
<label for="edit_expiry_date">Expiry Date</label>
|
|
|
187 |
<input type="datetime-local" class="form-control" id="edit_expiry_date"
|
|
|
188 |
name="expiryDate">
|
|
|
189 |
</div>
|
|
|
190 |
</div>
|
|
|
191 |
</div>
|
|
|
192 |
</form>
|
|
|
193 |
</div>
|
|
|
194 |
<div class="modal-footer">
|
|
|
195 |
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
|
|
|
196 |
<button type="button" class="btn btn-primary updateAffiliateProduct">Update</button>
|
|
|
197 |
</div>
|
|
|
198 |
</div>
|
|
|
199 |
</div>
|
|
|
200 |
</div>
|
|
|
201 |
|
|
|
202 |
<script>
|
|
|
203 |
|
|
|
204 |
$(document).ready(function () {
|
|
|
205 |
$('#catalog_id').multiselect({
|
|
|
206 |
includeSelectAllOption: true,
|
|
|
207 |
multiple: false,
|
|
|
208 |
maxHeight: 400,
|
|
|
209 |
buttonWidth: '400px',
|
|
|
210 |
numberDisplayed: 1,
|
|
|
211 |
nonSelectedText: 'Catalog',
|
|
|
212 |
nSelectedText: ' - Catalog Selected',
|
|
|
213 |
allSelectedText: 'All Catalog Selected',
|
|
|
214 |
enableFiltering: true,
|
|
|
215 |
enableCaseInsensitiveFiltering: true
|
|
|
216 |
});
|
|
|
217 |
$('#gift_ids').multiselect({
|
|
|
218 |
includeSelectAllOption: true,
|
|
|
219 |
multiple: true,
|
|
|
220 |
maxHeight: 400,
|
|
|
221 |
buttonWidth: '400px',
|
|
|
222 |
numberDisplayed: 1,
|
|
|
223 |
nonSelectedText: 'Gifts',
|
|
|
224 |
nSelectedText: ' - Gifts Selected',
|
|
|
225 |
allSelectedText: 'All Gifts Selected',
|
|
|
226 |
enableFiltering: true,
|
|
|
227 |
enableCaseInsensitiveFiltering: true
|
|
|
228 |
});
|
|
|
229 |
$('#edit_catalog_id').multiselect({
|
|
|
230 |
includeSelectAllOption: true,
|
|
|
231 |
multiple: false,
|
|
|
232 |
maxHeight: 400,
|
|
|
233 |
buttonWidth: '400px',
|
|
|
234 |
numberDisplayed: 1,
|
|
|
235 |
nonSelectedText: 'Catalog',
|
|
|
236 |
enableFiltering: true,
|
|
|
237 |
enableCaseInsensitiveFiltering: true
|
|
|
238 |
});
|
|
|
239 |
|
|
|
240 |
$('#edit_gift_ids').multiselect({
|
|
|
241 |
includeSelectAllOption: true,
|
|
|
242 |
multiple: true,
|
|
|
243 |
maxHeight: 400,
|
|
|
244 |
buttonWidth: '400px',
|
|
|
245 |
numberDisplayed: 1,
|
|
|
246 |
nonSelectedText: 'Gifts',
|
|
|
247 |
nSelectedText: ' - Gifts Selected',
|
|
|
248 |
allSelectedText: 'All Gifts Selected',
|
|
|
249 |
enableFiltering: true,
|
|
|
250 |
enableCaseInsensitiveFiltering: true
|
|
|
251 |
});
|
|
|
252 |
});
|
|
|
253 |
|
|
|
254 |
</script>
|