Subversion Repositories SmartDukaan

Rev

Rev 32457 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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