| 34861 |
ranu |
1 |
<section class="wrapper">
|
|
|
2 |
<div class="row">
|
|
|
3 |
<div class="col-lg-12">
|
|
|
4 |
<h3 class="page-header"><i class="icon_document_alt"></i>Franchisee Account</h3>
|
|
|
5 |
<ol class="breadcrumb">
|
|
|
6 |
<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
|
|
|
7 |
<li><i class="icon_document_alt"></i>Create Franchisee Account</li>
|
|
|
8 |
</ol>
|
|
|
9 |
</div>
|
|
|
10 |
</div>
|
|
|
11 |
<form class="form-horizontal">
|
|
|
12 |
<label class="control-label col-sm-2" for="excelfile">XLSX File:</label>
|
|
|
13 |
<div class="col-lg-3">
|
|
|
14 |
<div class="input-group">
|
|
|
15 |
<input class="form-control" type="file" id="accountsfileupload" name="uploadfile"
|
|
|
16 |
value="Upload Excel">
|
|
|
17 |
<span class="input-group-btn">
|
|
|
18 |
<button class="btn btn-default accountsupload" type="button">
|
|
|
19 |
Upload
|
|
|
20 |
</button>
|
|
|
21 |
</span>
|
|
|
22 |
</div>
|
|
|
23 |
</div>
|
|
|
24 |
</form>
|
|
|
25 |
<div class="col-lg-2">
|
|
|
26 |
<a class="btn btn-default" id="accountsTemplate">
|
|
|
27 |
Download Template
|
|
|
28 |
</a>
|
|
|
29 |
</div>
|
|
|
30 |
|
|
|
31 |
</section>
|
|
|
32 |
<section>
|
|
|
33 |
<div class="row" style="margin:15px;">
|
|
|
34 |
<div class="col-lg-12">
|
|
|
35 |
<h4 class="mb">Created Franchisee Accounts</h4>
|
|
|
36 |
<section class="panel">
|
|
|
37 |
<table class="table table-striped table-advance table-hover">
|
|
|
38 |
<thead>
|
|
|
39 |
<tr>
|
|
|
40 |
<th>Fofo ID</th>
|
|
|
41 |
<th>Person Name</th>
|
|
|
42 |
<th>Contact No</th>
|
|
|
43 |
<th>Email</th>
|
|
|
44 |
<th>MID</th>
|
|
|
45 |
<th>TID</th>
|
|
|
46 |
<th>Bank A/C</th>
|
|
|
47 |
<th>IFSC</th>
|
|
|
48 |
<th>Contact ID</th>
|
|
|
49 |
<th>Account ID</th>
|
|
|
50 |
<th>Action</th>
|
|
|
51 |
</tr>
|
|
|
52 |
</thead>
|
|
|
53 |
<tbody>
|
|
|
54 |
#foreach($account in $franchiseeAccounts)
|
|
|
55 |
<tr>
|
|
|
56 |
<td>$account.getFofoId()</td>
|
|
|
57 |
<td>$account.getPersonName()</td>
|
|
|
58 |
<td>$account.getContactNumber()</td>
|
|
|
59 |
<td>$account.getEmail()</td>
|
|
|
60 |
<td>$account.getMid()</td>
|
|
|
61 |
<td>$account.getTid()</td>
|
|
|
62 |
<td>$account.getBankAccountNumber()</td>
|
|
|
63 |
<td>$account.getIfsc()</td>
|
|
|
64 |
<td>#if($account.getContactId()) $account.getContactId() #else - #end </td>
|
|
|
65 |
<td>#if($account.getAccountId()) $account.getAccountId() #else - #end </td>
|
|
|
66 |
<td>
|
|
|
67 |
<button class="btn btn-xs btn-primary open-edit-modal" data-id="$account.id">
|
|
|
68 |
Edit
|
|
|
69 |
</button>
|
|
|
70 |
</td>
|
|
|
71 |
|
|
|
72 |
</tr>
|
|
|
73 |
#end
|
|
|
74 |
</tbody>
|
|
|
75 |
</table>
|
|
|
76 |
</section>
|
|
|
77 |
</div>
|
|
|
78 |
</div>
|
|
|
79 |
|
|
|
80 |
</section>
|
|
|
81 |
|
|
|
82 |
|
|
|
83 |
<div id="editAccountModal" class="modal fade" tabindex="-1" role="dialog">
|
|
|
84 |
<div class="modal-dialog modal-lg" role="document">
|
|
|
85 |
<div class="modal-content">
|
|
|
86 |
<form id="editAccountForm">
|
|
|
87 |
<div class="modal-header">
|
|
|
88 |
<div class="row">
|
|
|
89 |
<div class="col-md-8">
|
|
|
90 |
<h5 class="modal-title">Edit Franchisee Account</h5>
|
|
|
91 |
</div>
|
|
|
92 |
<div class="col-md-4">
|
|
|
93 |
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
94 |
</div>
|
|
|
95 |
</div>
|
|
|
96 |
</div>
|
|
|
97 |
<div class="modal-body">
|
|
|
98 |
<!-- Fields -->
|
|
|
99 |
<input type="hidden" name="id" id="accountId">
|
|
|
100 |
<div class="row">
|
|
|
101 |
<div class="col-md-6">
|
|
|
102 |
<div class="form-group">
|
|
|
103 |
<label>Fofo ID</label>
|
|
|
104 |
<input type="text" class="form-control" name="fofoId" id="fofoId">
|
|
|
105 |
</div>
|
|
|
106 |
<div class="form-group">
|
|
|
107 |
<label>Person Name</label>
|
|
|
108 |
<input type="text" class="form-control" name="personName" id="personName">
|
|
|
109 |
</div>
|
|
|
110 |
<div class="form-group">
|
|
|
111 |
<label>Contact Number</label>
|
|
|
112 |
<input type="text" class="form-control" name="contactNumber" id="contactNumber">
|
|
|
113 |
</div>
|
|
|
114 |
<div class="form-group">
|
|
|
115 |
<label>Email</label>
|
|
|
116 |
<input type="text" class="form-control" name="email" id="email">
|
|
|
117 |
</div>
|
|
|
118 |
</div>
|
|
|
119 |
<div class="col-md-6">
|
|
|
120 |
<div class="form-group">
|
|
|
121 |
<label>TID</label>
|
|
|
122 |
<input type="text" class="form-control" name="tid" id="tid">
|
|
|
123 |
</div>
|
|
|
124 |
<div class="form-group">
|
|
|
125 |
<label>MID</label>
|
|
|
126 |
<input type="text" class="form-control" name="mid" id="mid">
|
|
|
127 |
</div>
|
|
|
128 |
<div class="form-group">
|
|
|
129 |
<label>IFSC</label>
|
|
|
130 |
<input type="text" class="form-control" name="ifsc" id="ifsc">
|
|
|
131 |
</div>
|
|
|
132 |
<div class="form-group">
|
|
|
133 |
<label>Bank Account Number</label>
|
|
|
134 |
<input type="text" class="form-control" name="bankAccountNumber" id="bankAccountNumber">
|
|
|
135 |
</div>
|
|
|
136 |
</div>
|
|
|
137 |
</div>
|
|
|
138 |
|
|
|
139 |
</div>
|
|
|
140 |
<div class="modal-footer">
|
|
|
141 |
<button type="submit" class="btn btn-success">Update</button>
|
|
|
142 |
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
|
|
143 |
</div>
|
|
|
144 |
</form>
|
|
|
145 |
</div>
|
|
|
146 |
</div>
|
|
|
147 |
</div>
|
|
|
148 |
|
|
|
149 |
|
|
|
150 |
<script type="text/javascript">
|
|
|
151 |
$(document).ready(function () {
|
|
|
152 |
$('button.accountsupload').on('click', function () {
|
|
|
153 |
var fileSelector = $('#accountsfileupload')[0];
|
|
|
154 |
if (fileSelector != undefined && fileSelector.files[0] != undefined) {
|
|
|
155 |
if (confirm("Confirm Upload?")) {
|
|
|
156 |
doAjaxUploadRequestHandler("${rc.contextPath}/franchisee/account/upload", "POST", fileSelector.files[0], function (response) {
|
|
|
157 |
if (response) {
|
|
|
158 |
alert("Order placed successfully");
|
|
|
159 |
loadFranchiseeAccount("main-content");
|
|
|
160 |
}
|
|
|
161 |
});
|
|
|
162 |
}
|
|
|
163 |
} else {
|
|
|
164 |
alert("Please upload file!");
|
|
|
165 |
}
|
|
|
166 |
return false;
|
|
|
167 |
});
|
|
|
168 |
$(document).on('click', "#accountsTemplate", function () {
|
|
|
169 |
window.location.href = context + "/franchiseeAccountCreationTemplate";
|
|
|
170 |
});
|
|
|
171 |
|
|
|
172 |
$(document).on('click', '.edit-franchisee-account-btn', function () {
|
|
|
173 |
var id = $(this).data('id');
|
|
|
174 |
doGetAjaxRequestHandler(context + "/franchisee/account/edit/" + id, function (response) {
|
|
|
175 |
$('#main-content').html(response); // Load edit form in content section
|
|
|
176 |
});
|
|
|
177 |
});
|
|
|
178 |
|
|
|
179 |
$(document).on('click', '.open-edit-modal', function () {
|
|
|
180 |
var accountId = $(this).data('id');
|
|
|
181 |
$.get(context + "/franchisee/account/edit/" + accountId, function (data) {
|
|
|
182 |
// Populate modal fields
|
|
|
183 |
$('#accountId').val(data.id);
|
|
|
184 |
$('#fofoId').val(data.fofoId);
|
|
|
185 |
$('#personName').val(data.personName);
|
|
|
186 |
$('#contactNumber').val(data.contactNumber);
|
|
|
187 |
$('#email').val(data.email);
|
|
|
188 |
$('#tid').val(data.tid);
|
|
|
189 |
$('#mid').val(data.mid);
|
|
|
190 |
$('#bankAccountNumber').val(data.bankAccountNumber);
|
|
|
191 |
$('#ifsc').val(data.ifsc);
|
|
|
192 |
$('#editAccountModal').modal('show');
|
|
|
193 |
});
|
|
|
194 |
});
|
|
|
195 |
|
|
|
196 |
$('#editAccountForm').validate({
|
|
|
197 |
submitHandler: function (form, event) {
|
|
|
198 |
event.preventDefault();
|
|
|
199 |
var payload = franchiseeAccountPayload();
|
|
|
200 |
doPostAjaxRequestWithJsonHandler(
|
|
|
201 |
context + "/franchisee/account/update",
|
|
|
202 |
payload, function (response) {
|
|
|
203 |
alert("Account updated!");
|
|
|
204 |
$('#editAccountModal').modal('hide');
|
|
|
205 |
$('.modal-backdrop').remove();
|
|
|
206 |
loadFranchiseeAccount("main-content");
|
|
|
207 |
}
|
|
|
208 |
);
|
|
|
209 |
return false;
|
|
|
210 |
}
|
|
|
211 |
});
|
|
|
212 |
|
|
|
213 |
|
|
|
214 |
});
|
|
|
215 |
|
|
|
216 |
function franchiseeAccountPayload() {
|
|
|
217 |
var payload = {};
|
|
|
218 |
payload['id'] = $('#accountId').val();
|
|
|
219 |
payload['fofoId'] = $('#fofoId').val();
|
|
|
220 |
payload['personName'] = $('#personName').val();
|
|
|
221 |
payload['contactNumber'] = $('#contactNumber').val();
|
|
|
222 |
payload['email'] = $('#email').val();
|
|
|
223 |
payload['tid'] = $('#tid').val();
|
|
|
224 |
payload['mid'] = $('#mid').val();
|
|
|
225 |
payload['bankAccountNumber'] = $('#bankAccountNumber').val();
|
|
|
226 |
payload['ifsc'] = $('#ifsc').val();
|
|
|
227 |
return JSON.stringify(payload); // return JSON
|
|
|
228 |
}
|
|
|
229 |
|
|
|
230 |
</script>
|