| 24680 |
govind |
1 |
<script>
|
|
|
2 |
$(document).ready(function() {
|
|
|
3 |
$('#inactiveStore').DataTable(
|
|
|
4 |
{
|
|
|
5 |
"bPaginate": true,
|
|
|
6 |
"bLengthChange": true,
|
|
|
7 |
"bFilter": true,
|
|
|
8 |
"bInfo": false,
|
|
|
9 |
"bAutoWidth": false }
|
|
|
10 |
);
|
| 35962 |
amit |
11 |
|
| 24680 |
govind |
12 |
} );
|
| 35962 |
amit |
13 |
|
|
|
14 |
function closeStore(fofoId, storeCode) {
|
|
|
15 |
var inputCode = prompt("This will PERMANENTLY close the store. This action cannot be undone.\n\nTo confirm, type the store code: " + storeCode);
|
|
|
16 |
if (inputCode === null) return;
|
| 35982 |
amit |
17 |
if (inputCode.trim() === "") {
|
|
|
18 |
alert("Store code is required to confirm closure.");
|
|
|
19 |
return;
|
|
|
20 |
}
|
|
|
21 |
if (inputCode.trim() !== storeCode) {
|
| 35962 |
amit |
22 |
alert("Store code does not match. Closure cancelled.");
|
|
|
23 |
return;
|
|
|
24 |
}
|
|
|
25 |
$.ajax({
|
|
|
26 |
url: contextPath + '/closeStore',
|
|
|
27 |
type: 'POST',
|
|
|
28 |
data: { fofoId: fofoId, storeCode: inputCode },
|
|
|
29 |
success: function(response) {
|
|
|
30 |
alert("Store closed permanently.");
|
|
|
31 |
location.reload();
|
|
|
32 |
},
|
|
|
33 |
error: function(xhr) {
|
|
|
34 |
alert("Error closing store: " + (xhr.responseText || "Unknown error"));
|
|
|
35 |
}
|
|
|
36 |
});
|
|
|
37 |
}
|
| 24680 |
govind |
38 |
</script>
|
| 35962 |
amit |
39 |
<section class="wrapper">
|
| 24680 |
govind |
40 |
<div class="row">
|
|
|
41 |
<div class="col-lg-12">
|
| 32457 |
jai.hind |
42 |
<h3 class="page-header"><i class="icon_document_alt"></i>INACTIVE STORE</h3>
|
| 24680 |
govind |
43 |
<ol class="breadcrumb">
|
|
|
44 |
<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
|
| 35962 |
amit |
45 |
<li><i class="icon_document_alt"></i>INACTIVE-STORE</li>
|
| 24680 |
govind |
46 |
</ol>
|
|
|
47 |
</div>
|
|
|
48 |
</div>
|
|
|
49 |
<div id="inactive-store-table">
|
|
|
50 |
<div class="row">
|
|
|
51 |
<div class="col-lg-12">
|
| 35962 |
amit |
52 |
|
|
|
53 |
<table class="table table-bordered" id="inactiveStore">
|
| 24680 |
govind |
54 |
<thead>
|
|
|
55 |
<th>PartnerId</th>
|
|
|
56 |
<th>Store Name</th>
|
|
|
57 |
<th>Email</th>
|
|
|
58 |
<th>Store Code</th>
|
| 35962 |
amit |
59 |
<th>Status</th>
|
| 28711 |
amit.gupta |
60 |
<th>Days For Activation</th>
|
| 35962 |
amit |
61 |
|
| 28711 |
amit.gupta |
62 |
<th>Action</th>
|
| 24680 |
govind |
63 |
</tr>
|
|
|
64 |
</thead>
|
|
|
65 |
<tbody>
|
|
|
66 |
#if(!$fofoStores.isEmpty())
|
| 35962 |
amit |
67 |
#foreach( $inactivefofoStore in $inActiveFofoStores)
|
| 24680 |
govind |
68 |
<tr>
|
| 35962 |
amit |
69 |
<td>$inactivefofoStore.getId()</td>
|
|
|
70 |
#if($customRetailers.get($inactivefofoStore.getId()).getBusinessName())
|
|
|
71 |
<td>$customRetailers.get($inactivefofoStore.getId()).getBusinessName()</td>
|
|
|
72 |
#else
|
|
|
73 |
<td>-</td> #end
|
|
|
74 |
#if($customRetailers.get($inactivefofoStore.getId()).getEmail())
|
|
|
75 |
<td>$customRetailers.get($inactivefofoStore.getId()).getEmail()</td>
|
|
|
76 |
#else
|
|
|
77 |
<td>-</td> #end
|
|
|
78 |
<td>$inactivefofoStore.getCode()</td>
|
|
|
79 |
#if($inactivefofoStore.isClosed())
|
|
|
80 |
<td><span class="label label-danger">CLOSED</span></td>
|
|
|
81 |
<td>-</td>
|
|
|
82 |
<td><span class="text-muted">Permanently Closed</span></td>
|
|
|
83 |
#else
|
|
|
84 |
<td><span class="label label-warning">INACTIVE</span></td>
|
|
|
85 |
<td><input type="text" name="temporaryActivationStore" id="temporary-activation" value="" style=" width: 137px;">
|
|
|
86 |
<button class="btn btn-primary activate-store-temporary" data-fofoid="$inactivefofoStore.getId()">Temp Activate</button></td>
|
|
|
87 |
<td>
|
|
|
88 |
<button class="btn btn-primary activate-store-forever" data-fofoid="$inactivefofoStore.getId()">Activate</button>
|
|
|
89 |
<button class="btn btn-danger" onclick="closeStore($inactivefofoStore.getId(), '$inactivefofoStore.getCode()')">Close Store</button>
|
|
|
90 |
</td>
|
|
|
91 |
#end
|
| 24680 |
govind |
92 |
</tr>
|
|
|
93 |
#end
|
| 35962 |
amit |
94 |
#else
|
|
|
95 |
<tr>
|
|
|
96 |
<td colspan="7" style="text-align:center;">NO MATCHING DATA FOUND FOR CRITERIA</td>
|
|
|
97 |
</tr>
|
|
|
98 |
#end
|
| 24680 |
govind |
99 |
</tbody>
|
|
|
100 |
</table>
|
|
|
101 |
</div>
|
|
|
102 |
</div>
|
|
|
103 |
</div>
|
| 35962 |
amit |
104 |
</section>
|