Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
25979 tejbeer 1
<script type="text/javascript">
30601 amit.gupta 2
    $(function () {
27605 tejbeer 3
 
30601 amit.gupta 4
        var object = {
5
            timePicker: true,
6
            locale: {
7
                format: 'DD/MM/YYYY hh A'
8
            }
9
        };
28200 tejbeer 10
 
30601 amit.gupta 11
        $('input[name="scheduleTime"]').daterangepicker(
12
                $.extend(getSingleDatePicker(), object));
28200 tejbeer 13
 
30601 amit.gupta 14
        $('input[name="editScheduleTime"]').daterangepicker(
15
                $.extend(getSingleDatePicker(), object));
16
    });
25979 tejbeer 17
 
30601 amit.gupta 18
    $(".lead-request").click(function () {
19
        $("#newEntryLeadModal").modal({
20
            backdrop: false
21
        });
28200 tejbeer 22
 
30601 amit.gupta 23
    });
28200 tejbeer 24
 
30601 amit.gupta 25
    $(".lead-edit-request").click(function () {
26
        $("#editLeadData").modal({
27
            backdrop: false
28
        });
28200 tejbeer 29
 
30601 amit.gupta 30
    });
28200 tejbeer 31
 
30601 amit.gupta 32
    $('#statusFilter').multiselect({
33
        includeSelectAllOption: true,
34
        multiple: true,
35
        maxHeight: 200,
36
        buttonWidth: '180px',
37
        numberDisplayed: 1,
38
        nonSelectedText: 'Status',
39
        nSelectedText: ' - Status Selected',
40
        allSelectedText: 'All Status Selected',
41
        enableFiltering: true,
42
        enableCaseInsensitiveFiltering: true
43
    });
28200 tejbeer 44
 
30601 amit.gupta 45
    $('#colorFilter').multiselect({
46
        includeSelectAllOption: true,
47
        multiple: true,
48
        maxHeight: 200,
49
        buttonWidth: '180px',
50
        numberDisplayed: 1,
51
        nonSelectedText: 'Color Status',
52
        nSelectedText: ' - Color Selected',
53
        allSelectedText: 'All Status Selected',
54
        enableFiltering: true,
55
        enableCaseInsensitiveFiltering: true
56
    });
25979 tejbeer 57
</script>
58
 
59
 
60
<section class="wrapper">
30601 amit.gupta 61
    <div class="row">
62
        <div class="col-lg-12">
63
            <h3 class="page-header">
64
                <i class="icon_document_alt"></i>LEAD DASHBOARD
65
            </h3>
66
            <ol class="breadcrumb">
67
                <li><i class="fa fa-home"></i><a
68
                        href="${rc.contextPath}/dashboard">Home</a></li>
69
                <li><i class="icon_document_alt"></i>Lead</li>
70
                <li>
71
                    <button class="btn btn-primary newLead" data-toggle="modal"
72
                            data-target="#newEntryLeadModal" type="button">New
73
                    </button>
74
                </li>
75
            </ol>
76
        </div>
77
    </div>
28200 tejbeer 78
 
30601 amit.gupta 79
    <table style="Width: 100%">
80
        <tr>
81
            <td align="left" style="Width: 20%">
82
                <div class="row">
83
                    <div class="col-lg-2 form-group" style="width: 12%;">
84
                        <select id="statusFilter" name="statusFilter" placeholder="Status"
85
                                class="form-control input-sm">
86
                            <option value="" disabled selected>Status</option> #foreach($ls
87
                        in $leadStatus) #if($ls == $selectedLeadStatus)
88
                            <option value="$ls" selected>$ls</option> #else
89
                            <option value="$ls">$ls</option> #end #end
90
                        </select>
91
                    </div>
28200 tejbeer 92
 
30601 amit.gupta 93
                    <div class="col-lg-2">
94
                        <button class="btn btn-primary show-lead" type="button"
95
                        >Submit
96
                        </button>
97
                    </div>
28200 tejbeer 98
 
30601 amit.gupta 99
                    <div class="col-lg-2">
28200 tejbeer 100
 
30601 amit.gupta 101
                        #if($leadDate)
102
                            <input type="date" id="dateWiseLead" placeholder=""
103
                                   value="$leadDate" name="">
104
                        #else
105
                            <input type="date" id="dateWiseLead" placeholder="" name="">
106
                        #end
29268 manish 107
 
30601 amit.gupta 108
                        <button type="button" class="btn btn-default submitDateWiseLead">
109
                            submit
110
                        </button>
111
                    </div>
29268 manish 112
 
113
 
30601 amit.gupta 114
                </div>
115
            </td>
116
        </tr>
29268 manish 117
 
30601 amit.gupta 118
        <tr>
119
            <td align="left" style="Width: 20%">
120
                <div class="row">
121
                    <div class="col-lg-2 form-group" style="width: 12%;">
29268 manish 122
 
30601 amit.gupta 123
                        <select id="colorFilter" name="colorFilter" placeholder="Status"
124
                                class="form-control input-sm">
125
                            <option value="" disabled selected>Status</option>
29268 manish 126
 
30601 amit.gupta 127
                            #if($colors.contains("All") && $colors.contains("yellow") && $colors.contains("green"))
28200 tejbeer 128
 
30601 amit.gupta 129
                                <option value="All" selected>All</option>
28200 tejbeer 130
 
30601 amit.gupta 131
                            #else
132
                                <option value="All">All</option>
133
                            #end
28200 tejbeer 134
 
30601 amit.gupta 135
                            #if($colors.contains("yellow")&& !$colors.contains("green"))
25979 tejbeer 136
 
30601 amit.gupta 137
                                <option value="yellow" selected>yellow</option>
28200 tejbeer 138
 
30601 amit.gupta 139
                            #else
140
                                <option value="yellow">yellow</option>
28200 tejbeer 141
 
30601 amit.gupta 142
                            #end
28200 tejbeer 143
 
30601 amit.gupta 144
                            #if($colors.contains("green") && !$colors.contains("yellow"))
145
                                <option value="green" selected>green</option>
146
                            #else
147
                                <option value="green">green</option>
148
                            #end
28200 tejbeer 149
 
150
 
30601 amit.gupta 151
                        </select>
152
                    </div>
28200 tejbeer 153
 
30601 amit.gupta 154
                    <div class="col-lg-1">
155
                        <button class="btn btn-primary show-colowise-lead" type="button"
156
                        >Submit
157
                        </button>
158
                    </div>
28200 tejbeer 159
 
30601 amit.gupta 160
                    <div class="row col-lg-5" style="width:518px;height:272px; margin-left: 650px;">
161
                        <canvas id="chart-leadstatus" style="width:auto"></canvas>
28200 tejbeer 162
 
30601 amit.gupta 163
                        <canvas id="chart-lead-search" class="" style="width:auto"></canvas>
28200 tejbeer 164
 
30601 amit.gupta 165
                    </div>
166
                </div>
167
            </td>
168
        </tr>
169
        <tr>
170
            <td align="left">
171
                <div class="row">
172
                    <div class="col-lg-10">
173
                        <table class="table table-border table-condensed table-bordered" id="lead-weakwise-table"
174
                               style="width:100%">
28200 tejbeer 175
 
30601 amit.gupta 176
                            <thead class="row htable" style="background:#F5F5F5;">
28200 tejbeer 177
 
30601 amit.gupta 178
                            <tr style="color:black;">
179
                                <th></th>
180
                                <th>Week 4</th>
181
                                <th>Week 3</th>
182
                                <th>Week 2</th>
183
                                <th colspan="7">Week</th>
184
                                <th></th>
185
                            </tr>
28200 tejbeer 186
 
30601 amit.gupta 187
                            <tr style="color:black;">
188
                                <th>Created By</th>
189
                                <th>$weekDates.get(0) - $weekDates.get(1)</th>
190
                                <th>$weekDates.get(2) - $weekDates.get(3)</th>
191
                                <th>$weekDates.get(4) - $weekDates.get(5)</th>
28200 tejbeer 192
 
30601 amit.gupta 193
                                #foreach($lwDay in $lwDays )
194
                                    <th>$lwDay.getMonth().format($dateMonthChYear)</th>
195
                                #end
28200 tejbeer 196
 
30601 amit.gupta 197
                                <th>Result</th>
198
                            </tr>
199
                            </thead>
200
                            <tbody>
201
                                #foreach($leadCreator in $leadCreators)
202
                                <tr>
28200 tejbeer 203
 
30601 amit.gupta 204
                                    <td>
205
                                        $leadCreator
206
                                    </td>
207
                                    #if($leadLasts.get($leadCreator))
208
                                        <td>
209
                                            $leadLasts.get($leadCreator)
210
                                        </td>
211
                                    #else
212
                                        <td style="background:#ff9999;"> 0
213
                                        </td>
214
                                    #end
215
                                    #if($leadThirds.get($leadCreator))
216
                                        <td>
217
                                            $leadThirds.get($leadCreator)
218
                                        </td>
219
                                    #else
220
                                        <td style="background:#ff9999;"> 0
221
                                        </td>
222
                                    #end
223
                                    #if( $leadSeconds.get($leadCreator))
224
                                        <td>
225
                                            $leadSeconds.get($leadCreator)
226
                                        </td>
227
                                    #else
228
                                        <td style="background:#ff9999;">0</td>
229
                                    #end
28200 tejbeer 230
 
231
 
30601 amit.gupta 232
                                    #foreach($lwDay in $lwDays )
28200 tejbeer 233
 
30601 amit.gupta 234
                                        #if($leadFirsts.get($leadCreator).get($lwDay.getMonth()))
235
                                            <td>
236
                                                $leadFirsts.get($leadCreator).get($lwDay.getMonth())
28200 tejbeer 237
 
30601 amit.gupta 238
                                            </td>
239
                                        #else
240
                                            <td style="background:#ff9999;">0</td>
241
                                        #end
28200 tejbeer 242
 
30601 amit.gupta 243
                                    #end
28200 tejbeer 244
 
30601 amit.gupta 245
                                    #if($leadFirsts.get($leadCreator).get($lastDate))
28200 tejbeer 246
 
30601 amit.gupta 247
                                        #if($leadFirsts.get($leadCreator).get($lastDate) >= 5)
248
                                            <td style="color:green;">Appreciate</td>
28200 tejbeer 249
 
30601 amit.gupta 250
                                        #else
28200 tejbeer 251
 
30601 amit.gupta 252
                                            <td>Meet more prospects</td>
253
                                        #end
254
                                    #else
255
                                        <td style="color:red;">
256
                                            No leads created yesterday
257
                                        </td>
258
                                    #end
28200 tejbeer 259
 
30601 amit.gupta 260
                                </tr>
261
 
262
                                #end
263
                            </tbody>
264
 
265
                        </table>
266
                    </div>
267
                </div>
268
 
269
 
270
                </div>
271
            </td>
272
        </tr>
273
    </table>
274
 
275
 
276
    <div id="lead-request-table">
277
        <div class="row">
278
            <div class="col-lg-12">
279
                <table class="table table-border table-condensed table-bordered"
280
                       id="lead-table">
281
                    <thead>
282
                    <tr>
283
                        <th>Source</th>
284
                        <th>First Name</th>
285
                        <th>Last Name</th>
286
                        <th>Mobile</th>
287
                        <th>Address</th>
288
                        <th>City</th>
289
                        <th>State</th>
290
                        <th>Created By</th>
291
                        <th>Status</th>
292
                        <th>Created On</th>
293
                        <th>Updated On</th>
294
                        <th>ScheduleTimestamp</th>
295
                        <th>Closure Timestamp</th>
296
                        <th>Assign To</th>
297
                        <th>view</th>
298
                        <th>Action</th>
299
                        <th></th>
300
                    </tr>
301
                    </thead>
302
                    <tbody>
303
                        #if(!$lead.isEmpty())
304
                            #foreach( $request in $lead )
305
 
306
                                #if($request.getColor() == "Green")
307
                                <tr class="open-lead" bgcolor="#98FB98" data="$request.getId()">
308
 
309
                                #else
310
                                <tr class="open-lead" bgcolor="$request.getColor()"
311
                                    data="$request.getId()">
312
 
313
                                #end
314
                                #parse("edit-lead.vm")
315
 
316
                            </tr>
317
 
318
                            #end
319
 
320
                        #else
321
                        <tr>
322
                            <td colspan="12" style="text-align: center;">NO MATCHING
323
                                DATA FOUND FOR CRITERIA
324
                            </td>
325
                        </tr>
326
                        #end
327
                    </tbody>
328
                </table>
329
            </div>
330
        </div>
331
    </div>
332
 
333
 
334
    <div id="fetchLeadActivityData" class="modal" role="dialog">
335
        <div class="modal-dialog">
336
            <div class="modal-content"></div>
337
        </div>
338
    </div>
339
 
340
 
341
    <div id="editLeadData" class="modal" role="dialog">
342
        <div class="modal-dialog">
343
            <div class="modal-content">
344
                <div class="modal-header">
345
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
346
                    <h4 class="modal-title">Edit Lead</h4>
347
                </div>
31371 tejbeer 348
                <div class="modal-body" style="height:500px; overflow:auto">
30601 amit.gupta 349
                    <div id="lead-edit-request">
31371 tejbeer 350
 
351
 
31409 tejbeer 352
                         <div class="row" id = "lead-detail-view">
30601 amit.gupta 353
                            <div class="col-lg-3">
32464 tejbeer 354
                             <label style="font-weight:bold">Outlet Name</label>
355
 
30601 amit.gupta 356
                                <div class="input-group">
31371 tejbeer 357
									 <input placeholder="Outlet Name" id="outletName" name="outletName"
358
									          type="text" value="" class="form-control input-sm">                             
359
 
360
                                </div>
361
                            </div>
362
 
363
                            <div class="col-lg-4 form-group">
364
                            <label style="font-weight:bold">Front</label>
365
                                 <input type="hidden" class="frontp" value="">
366
			                            <input type="file" class="frontp" placeholder="Front" id = "frontp" name="frontp"
367
			                                   value="">
368
                            </div>
369
 
370
                            <div class="col-lg-4 form-group">
371
                             <label style="font-weight:bold">Internal With Market</label>
372
 
373
                                 <input type="hidden" class="internalMarket" value="">
374
			                            <input type="file" class="internalMarket" placeholder="Internal With Market" id = "internalMarket"  name="internalMarket"
375
			                                   value="">
376
                            </div>
377
 
378
                           <div class="col-lg-4 form-group">
379
                            <label style="font-weight:bold">Internal Long Shot</label>
380
 
381
                                 <input type="hidden" class="leftShot" value="">
382
			                            <input type="file" class="leftShot" placeholder="Internal Long Shot"   id = "leftShot"  name="leftShot"
383
			                                   value="">
384
                            </div>
385
 
386
                             <div class="col-lg-4 form-group">
387
                               <label style="font-weight:bold">Internal Left Wall</label>
388
                                 <input type="hidden" class="leftWall" value="">
389
			                            <input type="file" class="leftWall" placeholder="Internal Left Wall" id = "leftWall"   name="leftWall"
390
			                                   value="">
391
                            </div>
392
 
393
 
394
 
395
                           <div class="col-lg-4 form-group">
396
                            <label style="font-weight:bold">Internal Right Wall</label>
397
 
398
                                 <input type="hidden" class="rightWall" value="">
399
			                            <input type="file" class="rightWall" placeholder="Internal Right Wall" id = "rightWall"   name="rightWall"
400
			                                   value="">
401
                            </div>
402
 
403
 
404
 
405
 
406
                            <div class="col-lg-3 form-group">
407
                                <input id="counterSize" placeholder="Counter Size"
408
                                       name="counterSize" type="text" value=""
409
                                       class="form-control input-sm">
410
                            </div>
411
 
412
                           <div class="col-lg-5 form-group">
413
 
32464 tejbeer 414
                            <table class="table table-border table-condensed table-bordered" id = "editbrandtable">
31371 tejbeer 415
                            <tr>
416
                              <th>Brand</th>
417
                            <th>Value</th>
418
                            </tr>
419
 
32464 tejbeer 420
                              #foreach($brand in $brandsDisplays)
31371 tejbeer 421
                              <tr>
32464 tejbeer 422
                              <td>$brand.getName()</td>
423
                              <td>     <input type="number" class="$brand.getName()" placeholder="Value"  name="$brand.getName()"
31371 tejbeer 424
			                                   value="0"> </td>
425
                              </tr>
426
 
427
 
428
                               #end
429
                               </table>
430
                               </div>
431
                                <div class="col-lg-2 form-group">
432
 
433
                               <button type="button" class="btn btn-default lead-detail-entry">Submit</button>
434
                               </div>
435
 
436
                        </div>
437
                       <div class="row">
438
                            <div class="col-lg-3">
439
                                <div class="input-group">
30601 amit.gupta 440
                                    <select class="form-control input-sm" id="assignTo"
441
                                            name="assignTo" placeholder="Assign">
442
                                        <option value="" disabled selected>Assign To</option>
443
                                        #foreach($authUser in $authUsers)
444
                                            <option value="$authUser.getId()">$authUser.getFirstName() $authUser.getLastName()</option>
445
                                        #end
446
                                    </select>
447
                                </div>
448
                            </div>
449
 
450
                            <div class="col-lg-3 form-group">
451
                                <input placeholder="Remark" id="remark" name="remark"
452
                                       type="text" value="" class="form-control input-sm">
453
                            </div>
454
 
455
                            <div class="col-lg-3 form-group">
456
                                <select id="reason" name="reason" placeholder="Reason"
457
                                        class="form-control input-sm">
458
                                    <option value="" disabled selected>Reason</option>
459
                                    <option value="No budget">No budget</option>
460
                                    <option value="No authority to take decision">No
461
                                        authority to take decision
462
                                    </option>
463
                                    <option value="No need for new business">No need for
464
                                        new business
465
                                    </option>
466
                                    <option value="Not ready in near future">Not ready in
467
                                        near future
468
                                    </option>
469
                                    <option value="No store availability">No store
470
                                        availability
471
                                    </option>
472
                                    <option value="Duplicate Number"> Duplicate Number</option>
473
                                </select>
474
                            </div>
475
 
476
                            <div class="col-lg-3 form-group">
477
                                <select id="editStatus" name="editStatus" placeholder="Status"
478
                                        class="form-control input-sm" onchange="editStatusAction()">
479
                                    <option value="" disabled selected>Status</option>
480
                                    <option value="followUp">Follow Up</option>
481
                                    <option value="notInterested">Not Interested</option>
482
                                    <option value="finalized">Finalized</option>
483
                                </select>
484
                            </div>
485
 
486
                            <div class="col-lg-3 form-group">
487
                                <input id="editScheduleTime" placeholder="scheduleTime"
488
                                       name="editScheduleTime" type="text" value=""
489
                                       class="form-control input-sm">
490
                            </div>
31249 tejbeer 491
 
492
                                  <div class="col-lg-3 form-group">
493
                                <select class="form-control input-sm" id="communicationType" name="communicationType"
494
                                        placeholder="Communication Type">
495
                                    <option value="" disabled selected>Communication Type</option>
496
                                    #foreach($communicationType in $communicationTypes)
497
                                        <option value="$communicationType">$communicationType</option> #end
498
                                </select>
499
                                    </div>
500
 
30601 amit.gupta 501
                        </div>
502
                    </div>
503
                </div>
504
 
505
                <div class="modal-footer">
506
                    <button type="button" data-dismiss="modal"
507
                            class="btn btn-default cancel-lead-request">Cancel
508
                    </button>
509
                    <button type="button" class="btn btn-default lead-edit-request">Submit</button>
510
 
511
                </div>
512
 
513
            </div>
514
        </div>
515
    </div>
516
 
517
 
518
    <div id="newEntryLeadModal" class="modal">
519
        <div class="modal-dialog">
520
 
521
            <!-- Modal content-->
522
            <div class="modal-content">
523
                <div class="modal-header">
524
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
525
                    <h4 class="modal-title">Create Lead</h4>
526
                </div>
32464 tejbeer 527
                <div class="modal-body" style="height:500px; overflow:auto">
30601 amit.gupta 528
                    <div id="lead-request">
529
                        <div class="row">
530
                            <div class="col-lg-3">
531
                                <div class="input-group">
532
                                    <input placeholder="First Name" name="firstName" id="firstName"
533
                                           type="text" class="form-control input-sm">
534
                                </div>
535
                            </div>
536
 
537
                            <div class="col-lg-3 form-group">
538
                                <input placeholder="Last Name" id="lastName" name="lastName"
539
                                       type="text" value="" class="form-control input-sm">
540
                            </div>
541
 
542
                            <div class="col-lg-3 form-group">
543
                                <input placeholder="mobile" id="mobile" name="mobile"
544
                                       type="number" value="" class="form-control input-sm">
545
                            </div>
546
                        </div>
547
 
548
                        <div class="row">
549
                            <div class="col-lg-3 form-group">
550
                                <input id="address" name="address" placeholder="address"
551
                                       id="address" type="text" value="" class="form-control input-sm">
552
                            </div>
553
                            <div class="col-lg-3 form-group">
554
                                <input id="city" name="city" placeholder="city" type="text"
555
                                       value="" class="form-control input-sm">
556
                            </div>
557
                            <div class="col-lg-3 form-group">
558
                                <select class="form-control input-sm" id="state" name="state"
559
                                        placeholder="State">
560
                                    <option value="" disabled selected>State</option>
561
                                    #foreach($stateName in $stateNames)
562
                                        <option value="$stateName">$stateName</option> #end
563
                                </select>
564
                            </div>
565
                        </div>
566
 
567
                        <div class="row">
568
 
569
                            <div class="col-lg-3 form-group">
570
                                <select id="status" name="status" placeholder="Status"
571
                                        class="form-control input-sm" onchange="statusAction()">
572
                                    <option value="" disabled selected>Status</option>
573
                                    <option value="followUp">Follow Up</option>
574
                                    <option value="notInterested">Not Interested</option>
575
                                    <option value="finalized">Finalized</option>
576
                                </select>
577
                            </div>
578
 
579
                            <div class="col-lg-3 form-group">
580
                                <input id="scheduleTime" placeholder="scheduleTime"
581
                                       name="scheduleTime" type="text" value=""
582
                                       class="form-control input-sm">
583
                            </div>
584
 
585
                            <div class="col-lg-3 form-group">
586
                                <input id="createRemark" name="createRemark"
587
                                       placeholder="Remark" type="text" value=""
588
                                       class="form-control input-sm">
589
                            </div>
590
                        </div>
591
 
592
                        <div class="row">
31249 tejbeer 593
 
594
                           <div class="col-lg-3 form-group">
595
                                <select class="form-control input-sm" id="communicationTye" name="communicationType"
596
                                        placeholder="Communication Type">
597
                                    <option value="" disabled selected>Communication Type</option>
598
                                    #foreach($communicationType in $communicationTypes)
599
                                        <option value="$communicationType">$communicationType</option> #end
600
                                </select>
601
                            </div>
602
 
30601 amit.gupta 603
                            <div class="col-lg-3 form-group">
604
                                <select class="form-control input-sm" id="createAssignTo"
605
                                        name="createAssignTo" placeholder="Assign">
606
                                    <option value="" disabled selected>Assign To</option>
607
                                    #foreach($authUser in $authUsers)
608
                                        <option value="$authUser.getId()">$authUser.getFirstName() $authUser.getLastName()</option>
609
                                    #end
610
                                </select>
611
                            </div>
612
 
613
                            <div class="col-lg-3 form-group">
614
                                <select class="form-control input-sm" id="leadSource"
615
                                        name="leadSource" placeholder="Source">
616
                                    <option value="" disabled selected>Source</option>
617
                                    <option value="SELF">SELF</option>
618
                                    <option value="NEWSPAPER">NEWSPAPER</option>
619
                                    <option value="INTERNET">INTERNET</option>
620
                                    <option value="PARTNER">PARTNER</option>
621
                                </select>
622
                            </div>
623
                        </div>
32464 tejbeer 624
 
625
 
626
 
627
                           <div class="row">
628
                            <div class="col-lg-3">
629
                             <label style="font-weight:bold">Outlet Name</label>
630
 
631
                                <div class="input-group">
632
									 <input placeholder="Outlet Name" id="outletName" name="leadoutletName"
633
									          type="text" value="" class="form-control input-sm">                             
634
 
635
                                </div>
636
                            </div>
30601 amit.gupta 637
 
32464 tejbeer 638
                            <div class="col-lg-4 form-group">
639
                            <label style="font-weight:bold">Front</label>
640
                                 <input type="hidden" class="frontph" value="">
641
			                            <input type="file" class="frontp" placeholder="Front" id = "frontp" name="frontp"
642
			                                   value="">
643
                            </div>
644
 
645
                            <div class="col-lg-4 form-group">
646
                             <label style="font-weight:bold">Internal With Market</label>
647
 
648
                                 <input type="hidden" class="internalMarketh" value="">
649
			                            <input type="file" class="internalMarket" placeholder="Internal With Market" id = "internalMarket"  name="internalMarket"
650
			                                   value="">
651
                            </div>
652
 
653
                           <div class="col-lg-4 form-group">
654
                            <label style="font-weight:bold">Internal Long Shot</label>
655
 
656
                                 <input type="hidden" class="leftShoth" value="">
657
			                            <input type="file" class="leftShot" placeholder="Internal Long Shot"   id = "leftShot"  name="leftShot"
658
			                                   value="">
659
                            </div>
660
 
661
                             <div class="col-lg-4 form-group">
662
                               <label style="font-weight:bold">Internal Left Wall</label>
663
                                 <input type="hidden" class="leftWallh" value="">
664
			                            <input type="file" class="leftWall" placeholder="Internal Left Wall" id = "leftWall"   name="leftWall"
665
			                                   value="">
666
                            </div>
667
 
668
 
669
 
670
                           <div class="col-lg-4 form-group">
671
                            <label style="font-weight:bold">Internal Right Wall</label>
672
 
673
                                 <input type="hidden" class="rightWallh" value="">
674
			                            <input type="file" class="rightWall" placeholder="Internal Right Wall" id = "rightWall"   name="rightWall"
675
			                                   value="">
676
                            </div>
677
 
678
 
679
 
680
 
681
                            <div class="col-lg-3 form-group">
682
                                <input id="counterSize" placeholder="Counter Size"
683
                                       name="leadcounterSize" type="text" value=""
684
                                       class="form-control input-sm">
685
                            </div>
686
 
687
                           <div class="col-lg-5 form-group">
688
 
689
                            <table class="table table-border table-condensed table-bordered" id = "brandtable">
690
                            <tr>
691
                              <th>Brand</th>
692
                            <th>Value</th>
693
                            </tr>
694
 
695
 
696
 
697
                               #foreach($brand in $brandsDisplays)
698
                              <tr>
699
                              <td>$brand.getName()</td>
700
                              <td>     <input type="number" class="$brand.getName()" placeholder="Value"  name="$brand.getName()"
701
			                                   value="0"> </td>
702
                              </tr>
703
                              #end
704
                               </table>
705
 
706
                        </div>
707
 
708
 
30601 amit.gupta 709
                        <form>
32464 tejbeer 710
                            <div class="row" style="margin-bottom: 12px; padding:12px">
30601 amit.gupta 711
                                <form class="form-horizontal">
32464 tejbeer 712
                                       <div class="col-lg-6">
713
                                        <labelfor="excelfile">Ivory Template:</label>
30601 amit.gupta 714
                                        <a class="btn btn-primary" id="uploadIvoryLead"> Download Template </a>
715
                                    </div>
716
                                </form>
32464 tejbeer 717
 
718
                               <div class="col-lg-6 form-group">
30601 amit.gupta 719
                                    <div class="input-group">
720
                                        <input type="file" class="form-control input-sm fileLeadGenerate"
721
                                               name="fileLeadGenerate" value="Upload CSv">
722
                                        <span class="input-group-btn">
723
				    		<button type="button" class="btn btn-primary submitLeadGenerate">
29445 manish 724
							    Uplaod
725
							</button>
32464 tejbeer 726
						  </span>
30601 amit.gupta 727
                                    </div>
728
                                </div>
729
                            </div>
28200 tejbeer 730
 
30601 amit.gupta 731
                        </form>
28200 tejbeer 732
 
30601 amit.gupta 733
                    </div>
734
                </div>
735
 
32464 tejbeer 736
 
737
            </div>
738
 
739
                 <div class="modal-footer">
30601 amit.gupta 740
                    <button type="button" data-dismiss="modal"
741
                            class="btn btn-default cancel-lead-request">Cancel
742
                    </button>
743
                    <button type="button" class="btn btn-default lead-request">Submit</button>
744
 
745
                </div>
746
        </div>
747
    </div>
28200 tejbeer 748
</section>
749
 
750
 
25979 tejbeer 751
<script type="text/javascript">
30601 amit.gupta 752
    var editor;
753
    var searchCount = 0;
754
    var ab;
755
    $(document)
756
            .ready(
757
                    function () {
31214 amit.gupta 758
                        let table = $('#lead-table').DataTable({
759
                            orderCellsTop: true,
760
                            "lengthMenu": [10, 25, 50, 75, 100, 250, 1000],
28200 tejbeer 761
 
31214 amit.gupta 762
                            fixedHeader: true,
763
                            "bPaginate": true,
764
                            "bLengthChange": true,
765
                            "bFilter": true,
766
                            "bInfo": false,
767
                            "bAutoWidth": false,
28200 tejbeer 768
 
31214 amit.gupta 769
                            "columnDefs": [{
770
                                type: 'date-euro',
771
                                targets: 12
772
                            }, {
773
                                type: 'date-euro',
774
                                targets: 11
775
                            }, {
776
                                type: 'date-euro',
777
                                targets: 10
778
                            }, {
779
                                type: 'date-euro',
780
                                targets: 9
781
                            }
28200 tejbeer 782
 
31214 amit.gupta 783
                            ]
784
                        });
785
 
30601 amit.gupta 786
                        $('#lead-table thead tr').clone(true).appendTo(
787
                                '#lead-table thead');
788
                        $('#lead-table thead tr:eq(1) th')
789
                                .each(
790
                                        function (i) {
791
                                            var title = $(this).text();
792
                                            $(this).html(
793
                                                    '<input type="text"  class="search-lead" style = "width:60%;" placeholder="Search '
794
                                                    + title
795
                                                    + '" />');
28200 tejbeer 796
 
30601 amit.gupta 797
                                            $('input', this)
798
                                                    .on(
799
                                                            'keyup change',
800
                                                            function () {
801
                                                                if (table
802
                                                                        .column(
803
                                                                                i)
804
                                                                        .search() !== this.value) {
805
                                                                    table
806
                                                                            .column(
807
                                                                                    i)
808
                                                                            .search(
809
                                                                                    this.value)
810
                                                                            .draw();
811
                                                                }
812
                                                            });
31214 amit.gupta 813
                                        });
29268 manish 814
 
29478 manish 815
 
29268 manish 816
 
30601 amit.gupta 817
                        var myPieChart = null;
818
                        $(document).on("keyup", ".search-lead",
819
                                function (e) {
820
                                    console.log('Currently applied global search:');
821
                                    if (myPieChart != null) {
822
                                        myPieChart.destroy();
823
                                    }
29268 manish 824
 
825
 
30601 amit.gupta 826
                                    myFunction(searchCount);
29268 manish 827
 
30601 amit.gupta 828
 
829
                                });
830
 
831
                        function myFunction() {
832
                            if (searchCount == 0) {
833
                                ab = setTimeout(function () {
834
                                    datatableChart();
835
                                }, 3000);
836
                                searchCount++;
837
                            } else {
838
                                clearTimeout(ab);
839
                                ab = setTimeout(function () {
840
                                    datatableChart();
841
                                }, 3000);
842
                            }
843
                        }
844
 
845
 
846
                        function datatableChart() {
847
 
848
 
849
                            $('#chart-leadstatus').remove();
850
 
851
                            let count = 0;
852
                            let ni = 0;
853
 
854
                            let fwup = 0;
855
                            let htld = 0;
856
                            let pend = 0;
857
                            let final = 0;
858
 
859
                            table.rows({
860
                                "search": "applied"
861
                            }).every(function () {
862
                                var data = this.data();
863
                                var status = data[8];
864
                                var hotLeads = data[16];
865
 
866
                                console.log("status" + status);
867
 
868
                                if (hotLeads == "Green") {
869
                                    htld++;
870
                                }
871
 
872
                                if (status == "notInterested") {
873
                                    ni++;
874
                                } else if (status == "followUp") {
875
                                    fwup++;
876
                                } else if (status == "pending") {
877
 
878
                                    pend++;
879
                                } else if (status == "finalized") {
880
 
881
                                    final++;
882
                                }
883
                                var count = table.rows({search: 'applied'}).count();
884
 
885
                            });
886
                            var ctx = document.getElementById('chart-lead-search').getContext('2d');
887
 
888
                            myPieChart = new Chart(ctx, {
889
                                "type": "pie",
890
                                "data": {
891
                                    "labels": [
892
                                        "notInterested",
893
                                        "followUp",
894
                                        "pending",
895
                                        "finalized",
896
                                        "HotLeads"
897
                                    ],
898
                                    "datasets": [
899
                                        {
900
                                            "data": [
901
                                                ni, fwup, pend, final, htld
902
                                            ],
903
                                            "backgroundColor": ["red", "#9ACD32", "pink", "blue", "green"],
904
                                            "label": "DataSet 1"
905
                                        }
906
                                    ]
907
                                },
908
                                "options": {
909
                                    "responsive": true,
910
                                    "legend": {
911
                                        "labels": {
912
                                            "fontColor": "black",
913
                                            "fontSize": 15
914
                                        },
915
                                        "position": "left"
916
                                    }
917
                                }
918
                            });
919
 
920
                            if (ni <= 0) {
921
                                myPieChart.getDatasetMeta(0).data[0].hidden = true;
922
                            }
923
                            if (fwup <= 0) {
924
                                myPieChart.getDatasetMeta(0).data[1].hidden = true;
925
                            }
926
                            if (pend <= 0) {
927
                                myPieChart.getDatasetMeta(0).data[2].hidden = true;
928
                            }
929
                            if (final <= 0) {
930
                                myPieChart.getDatasetMeta(0).data[3].hidden = true;
931
                            }
932
 
933
                            if (htld <= 0) {
934
                                myPieChart.getDatasetMeta(0).data[4].hidden = true;
935
                            }
936
 
937
                            myPieChart.update();
938
 
939
                        }
940
 
941
 
942
                    });
25979 tejbeer 943
</script>
29221 manish 944
 
29268 manish 945
<script type="text/javascript">
946
 
30601 amit.gupta 947
 
948
    var config = $chartLead;
949
 
950
    var ctx = document.getElementById('chart-leadstatus').getContext('2d');
951
    var bar = new Chart(ctx, config);
29268 manish 952
</script>