Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
35499 aman 1
<script type="text/javascript">
2
 
3
    $(document).ready(function () {
4
 
5
        $('#trial-users').DataTable({
6
 
7
                    "bPaginate": true,
8
                    "bLengthChange": true,
9
                    "bFilter": true,
10
                    "bInfo": false,
11
                    "bAutoWidth": false,
12
                    "scrollX": true,
13
                    "order": [[0, 'desc']]
14
 
15
                }
16
        );
17
    });
18
</script>
19
 
20
<style>
21
 
22
 
23
    img:target {
24
        border: 5px solid red;
25
    }
26
 
27
    .lightbox {
28
        /* Default to hidden */
29
        display: none;
30
 
31
        /* Overlay entire screen */
32
        position: fixed;
33
        z-index: 999;
34
        top: 0;
35
        left: 0;
36
        right: 0;
37
        bottom: 0;
38
 
39
        /* A bit of padding around image */
40
        padding: 1em;
41
 
42
        /* Translucent background */
43
        background: rgba(0, 0, 0, 0.8);
44
    }
45
 
46
    /* Unhide the lightbox when it's the target */
47
    .lightbox:target {
48
        display: block;
49
    }
50
 
51
    .lightbox span {
52
        /* Full width and height */
53
        display: block;
54
        width: 100%;
55
        height: 100%;
56
 
57
        /* Size and position background image */
58
        background-position: center;
59
        background-repeat: no-repeat;
60
        background-size: contain;
61
    }
62
 
63
    .p-2 {
64
        padding: 0.7em;
65
    }
66
 
67
 
68
</style>
69
<section class="wrapper">
70
    <div class="row">
71
        <div class="col-lg-12">
72
            <h3 class="page-header"><i class="icon_document_alt"></i>Trial Partner</h3>
73
            <ol class="breadcrumb">
74
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
35517 aman 75
                <li><i class="icon_document_alt"></i>All Trial Partner page</li>
35499 aman 76
            </ol>
77
        </div>
78
    </div>
79
 
35517 aman 80
    <div class="col-md-4 p-2">
81
        <label class="form-label">Select Status</label>
82
        <select name="status" class="form-select tstatus">
83
            <option value="">Select Status</option>
84
            #foreach($st in $status)
85
                <option value="$st.name()"
86
                    #if($selectedStatus && $selectedStatus.name() == $st.name())
87
                        selected
88
                    #end
89
                >
90
                    $st.name()
91
                </option>
92
            #end
93
        </select>
94
    </div>
35499 aman 95
 
35517 aman 96
 
35499 aman 97
    <div class="row">
98
        <div class="col-lg-12">
99
            <table class="table table-border table-condensed table-bordered" id="trial-users">
100
                <thead>
101
                <tr>
102
                    <th>Id</th>
103
                    <th>Outlet Name</th>
104
                    <th>Email</th>
105
                    <th>Mobile</th>
106
                    <th>Name</th>
107
                    <th>City</th>
108
                    <th>State</th>
109
                    <th>Address</th>
110
                    <th>Pin Code</th>
111
                    <th>Pan Document</th>
112
                    <th>Aadhaar Document</th>
113
                    <th>Shop Images</th>
114
                    <th>Status</th>
35517 aman 115
                    <th>Remark</th>
35499 aman 116
                </tr>
117
                </thead>
118
                <tbody>
119
                    #if($trialForms.size() > 0)
120
                        #foreach( $trialForm in $trialForms )
121
                        <tr data-id="$trialForm.getId()">
122
                            <td>$trialForm.getId()</td>
123
                            <td>$trialForm.getBusinessName()</td>
124
                            <td>$trialForm.getEmail()</td>
125
                            <td>$trialForm.getMobile()</td>
126
                            <td>$trialForm.getFirstName() $trialForm.getLastName()</td>
127
                            <td>$trialForm.getCity()</td>
128
                            <td>$trialForm.getState()</td>
129
                            <td>$trialForm.getAddressLine1()   #if($trialForm.addressLine2)
130
                                <br/>$trialForm.addressLine2
131
                            #end</td>
132
                            <td>$trialForm.getPincode()</td>
133
                            <td>
134
                                <a href="#pan-id$trialForm.getId()">
135
                                    <img src="${rc.contextPath}/download-attachment?documentId=$trialForm.getPanDocumentId()"
136
                                         width="100">
137
                                </a>
138
                                <a href="#" class="lightbox" id="pan-id$trialForm.getId()">
139
                                    <span style="background-image:url('${rc.contextPath}/download-attachment?documentId=$trialForm.getPanDocumentId()')"></span>
140
                                </a>
141
                            </td>
142
                            <td>
143
                                <a href="#aadhaar-id$trialForm.getId()">
144
                                    <img src="${rc.contextPath}/download-attachment?documentId=$trialForm.getAadhaarDocumentId()"
145
                                         width="100">
146
                                </a>
147
                                <a href="#" class="lightbox" id="aadhaar-id$trialForm.getId()">
148
                                    <span style="background-image:url('${rc.contextPath}/download-attachment?documentId=$trialForm.getAadhaarDocumentId()')"></span>
149
                                </a>
150
                            </td>
35517 aman 151
                            <td class="text-center">
35499 aman 152
                                #set($shopImages = $trialForm.getShopImageDocumentIds())
153
 
154
                                #if($shopImages && $shopImages.size() > 0)
155
                                    #foreach($docId in $shopImages)
156
                                        <a href="#shop-img-$docId-$trialForm.getId()">
157
                                            <img src="${rc.contextPath}/download-attachment?documentId=$docId"
158
                                                 width="80" style="margin:4px;">
159
                                        </a>
160
 
161
                                        <a href="#" class="lightbox" id="shop-img-$docId-$trialForm.getId()">
162
                                            <span style="background-image:url('${rc.contextPath}/download-attachment?documentId=$docId')"></span>
163
                                        </a>
164
                                    #end
165
                                #else
35517 aman 166
                                    <span class="text-center">-</span>
35499 aman 167
                                #end
168
 
169
                            </td>
170
 
171
 
172
                            <td class="text-center">
173
                                $trialForm.getStatus()
174
                            </td>
35517 aman 175
                            <td class="text-center">
176
                                #if($trialForm.remark)
177
                                    <br/>$trialForm.remark
178
                                #else
179
                                    <span class="text-center">-</span>
180
                                #end
181
                            </td>
35499 aman 182
 
183
                        </tr>
184
                        #end
185
                    #else
186
                    <tr>
187
                        <td colspan="12" style="text-align:center;">NO MATCHING DATA FOUND FOR CRITERIA</td>
188
                    </tr>
189
                    #end
190
                </tbody>
191
            </table>
192
        </div>
193
    </div>
194
 
195
 
196
    <div id="fetchLeadActivityData" class="modal" role="dialog">
197
        <div class="modal-dialog">
198
            <div class="modal-content"></div>
199
        </div>
200
    </div>
201
</section>
202
 
203
<div class="modal fade" id="brandPotentialModal" tabindex="-1" role="dialog">
204
    <div class="modal-dialog modal-lg" role="document">
205
        <div class="modal-content">
206
 
207
            <!-- Modal Header -->
208
            <div class="modal-header text-white">
209
                <h5 class="modal-title">Brand Potential Verification</h5>
210
                <button type="button" class="close text-white" data-dismiss="modal">
211
                    <span>&times;</span>
212
                </button>
213
            </div>
214
 
215
            <!-- Modal Body -->
216
            <div class="modal-body">
217
 
218
                <form id="asmBmForm" onsubmit="event.preventDefault(); saveAsmBm();"
219
                      class=" bg-light rounded shadow-sm">
220
 
221
                    <div class="row p-2">
222
                        <!-- BM Select -->
223
                        <div class="col-md-4 p-2">
224
                            <label class="form-label">Select BM</label>
225
                            <select name="bm" class="form-select">
226
                                <option value="">Select BM</option>
227
                                #foreach($option in $bm)
228
                                    <option value="$option.getId()">
229
                                        $option.getFirstName() $option.getLastName()
230
                                    </option>
231
                                #end
232
                            </select>
233
                        </div>
234
 
235
                        <!-- ASM Select -->
236
                        <div class="col-md-4 p-2">
237
                            <label class="form-label">Select ASM</label>
238
                            <select name="asm" class="form-select">
239
                                <option value="">Select ASM</option>
240
                                #foreach($option in $asm)
241
                                    <option value="$option.getId()">
242
                                        $option.getFirstName() $option.getLastName()
243
                                    </option>
244
                                #end
245
                            </select>
246
                        </div>
247
                        <div class="col-md-4">
248
                            <button type="submit" class="btn btn-danger w-100 mt-3">
249
                                Save
250
                            </button>
251
                        </div>
252
                    </div>
253
 
254
                </form>
255
                <hr>
256
 
257
 
258
                <form id="brandPotentialForm" onsubmit="event.preventDefault(); saveBrandPotential();">
259
 
260
                    <input type="hidden" name="trialFormId" value=""/>
261
 
262
                    <table class="table table-bordered align-middle">
263
                        <thead class="table-light">
264
                        <tr>
265
                            <th>Brand</th>
266
                            <th>Potential</th>
267
                            <th style="width: 50px;">Add</th>
268
                        </tr>
269
                        </thead>
270
 
271
                        <tbody id="brandPotentialRows">
272
                        <tr>
273
                            <td>
274
                                <input type="text" name="brand_1" class="form-control" placeholder="Brand Name"/>
275
                            </td>
276
                            <td>
277
                                <input type="number" name="potential_1" class="form-control"
278
                                       placeholder="Enter Potential"/>
279
                            </td>
280
                            <td class="text-center">
281
                                <button type="button" class="btn btn-sm btn-danger" onclick="addRow()">+</button>
282
                            </td>
283
                        </tr>
284
                        </tbody>
285
 
286
                    </table>
287
 
288
                    <button type="submit" class="btn w-100 mt-3 btn-danger">
289
                        Save & Verify
290
                    </button>
291
 
292
                </form>
293
 
294
            </div>
295
 
296
        </div>
297
    </div>
298
</div>
299
<div class="modal fade" id="cancelTrialModal" tabindex="-1" role="dialog">
300
    <div class="modal-dialog modal-sm modal-dialog-centered" role="document">
301
        <div class="modal-content">
302
 
303
            <div class="modal-header">
304
                <h5 class="modal-title text-danger">Cancel Trial</h5>
305
                <button type="button" class="close" data-dismiss="modal">
306
                    <span>&times;</span>
307
                </button>
308
            </div>
309
 
310
            <div class="modal-body">
311
                <input type="hidden" id="cancelTrialFormId"/>
312
 
313
                <div class="form-group mb-0">
314
                    <label>
315
                        Remark <span class="text-danger">*</span>
316
                    </label>
317
                    <textarea
318
                            id="cancelTrialRemark"
319
                            class="form-control"
320
                            rows="3"
321
                            placeholder="Enter reason"
322
                    ></textarea>
323
                </div>
324
            </div>
325
 
326
            <div class="modal-footer">
327
                <button
328
                        class="btn btn-light btn-sm"
329
                        data-dismiss="modal"
330
                >
331
                    Close
332
                </button>
333
 
334
                <button
335
                        class="btn btn-danger btn-sm"
336
                        id="confirmCancelTrial"
337
                >
338
                    Confirm Cancel
339
                </button>
340
            </div>
341
 
342
        </div>
343
    </div>
344
</div>
345
 
346
 
347
<script>
348
    let rowCount = 1;
349
 
350
    function addRow() {
351
        rowCount++;
352
 
353
        const tbody = document.getElementById("brandPotentialRows");
354
 
355
        const newRow = document.createElement("tr");
356
        newRow.innerHTML = `
357
            <td>
358
                <input type="text" name="brand_${rowCount}" class="form-control" placeholder="Brand Name" />
359
            </td>
360
            <td>
361
                <input type="number" name="potential_${rowCount}" class="form-control"  placeholder="Enter Potential" />
362
            </td>
363
            <td class="text-center">
364
                <button type="button" class="btn btn-sm btn-danger" onclick="addRow()">+</button>
365
            </td>
366
        `;
367
 
368
        tbody.appendChild(newRow);
369
    }
370
</script>
371
 
372
 
373
 
374
 
375
 
376
 
377