Subversion Repositories SmartDukaan

Rev

Rev 29221 | Rev 29288 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 29221 Rev 29268
Line 88... Line 88...
88
						</select>
88
						</select>
89
					</div>
89
					</div>
90
 
90
 
91
					<div class="col-lg-2">
91
					<div class="col-lg-2">
92
						<button class="btn btn-primary show-lead" type="button"
92
						<button class="btn btn-primary show-lead" type="button"
93
							style="width: 25%; border-radius: 0px;">Submit</button>
93
							>Submit</button>
94
					</div>
94
					</div>
-
 
95
					
95
				</div>
96
				</div>
96
			</td>
97
			</td>
97
		</tr>
98
		</tr>
98
 
99
 
99
		<tr>
100
		<tr>
Line 108... Line 109...
108
							<option value="green">green</option>
109
							<option value="green">green</option>
109
 
110
 
110
						</select>
111
						</select>
111
					</div>
112
					</div>
112
 
113
 
113
					<div class="col-lg-2">
114
					<div class="col-lg-1">
114
						<button class="btn btn-primary show-colowise-lead" type="button"
115
						<button class="btn btn-primary show-colowise-lead" type="button"
115
							style="width: 25%; border-radius: 0px;">Submit</button>
116
							>Submit</button>
116
					</div>
117
					</div>
-
 
118
			    </div>
-
 
119
			   </td>
-
 
120
			</tr>
-
 
121
	    <tr>
-
 
122
	    <td align="left">
-
 
123
	       <div class="row">
-
 
124
		          <div class="row col-lg-5" style="width:518px;height:272px;">
-
 
125
	             	<canvas id="chart-leadstatus"  style="width:auto"></canvas>
-
 
126
	             	
-
 
127
	             	<canvas id="chart-lead-search" class=""  style="width:auto"></canvas>
-
 
128
	            
-
 
129
                  </div>
-
 
130
           
-
 
131
         <div class="col-lg-8">
-
 
132
           <table class="table table-border table-condensed table-bordered" id="lead-weakwise-table" style="width:100%">
-
 
133
 
-
 
134
             <thead class="row htable" style="background:#F5F5F5;">
-
 
135
 
-
 
136
           <tr style="color:black;">
-
 
137
                <th></th>
-
 
138
                <th>Week 4</th>
-
 
139
                <th>Week 3</th>
-
 
140
                 <th>Week 2</th>
-
 
141
                  <th colspan="7">Week</th>
-
 
142
                  <th></th>
-
 
143
                 </tr>
-
 
144
 
-
 
145
              <tr style="color:black;">
-
 
146
                <th>Created By</th>
-
 
147
                <th>$weekDates.get(0) - $weekDates.get(1)</th>
-
 
148
                <th>$weekDates.get(2) - $weekDates.get(3)</th>
-
 
149
                 <th>$weekDates.get(4) - $weekDates.get(5)</th>
-
 
150
                 
-
 
151
                 #foreach($lwDay in $lwDays )
-
 
152
                 <th>$lwDay.getMonth().format($dateMonthChYear)</th>
-
 
153
                 #end
-
 
154
                 
-
 
155
                  <th>Result</th>
-
 
156
               </tr>
-
 
157
             </thead>
-
 
158
               <tbody>
-
 
159
                #foreach($leadLastEntry in $leadLasts.entrySet())
-
 
160
               <tr>
-
 
161
            
-
 
162
               <td>
-
 
163
               $leadLastEntry.getKey()
-
 
164
               </td>
-
 
165
              #if($leadLastEntry.getValue())
-
 
166
              <td>
-
 
167
               $leadLastEntry.getValue()
-
 
168
               </td>
-
 
169
               #else
-
 
170
               <td style="background:#ff9999;"> 0</td>
-
 
171
               #end
-
 
172
              #if($leadThirds.get($leadLastEntry.getKey()))
-
 
173
               <td>
-
 
174
                 $leadThirds.get($leadLastEntry.getKey())
-
 
175
               </td>
-
 
176
               #else
-
 
177
               <td style="background:#ff9999;">  0
-
 
178
               </td>
-
 
179
               #end
-
 
180
               #if( $leadSeconds.get($leadLastEntry.getKey()))
-
 
181
                <td>
-
 
182
               $leadSeconds.get($leadLastEntry.getKey())
-
 
183
               </td>
-
 
184
               #else
-
 
185
               <td style="background:#ff9999;">0 </td>
-
 
186
               #end
-
 
187
               
-
 
188
              
-
 
189
                #foreach($lwDay in $lwDays )
-
 
190
           
-
 
191
                #if($leadFirsts.get($leadLastEntry.getKey()).get($lwDay.getMonth()))
-
 
192
               <td>
-
 
193
               $leadFirsts.get($leadLastEntry.getKey()).get($lwDay.getMonth())
-
 
194
              
-
 
195
               </td>
-
 
196
               #else
-
 
197
               <td style="background:#ff9999;">0</td>
-
 
198
               #end
-
 
199
 
-
 
200
               #end
-
 
201
           
-
 
202
           #if($leadFirsts.get($leadLastEntry.getKey()).get($lastDate))
-
 
203
             
-
 
204
             #if($leadFirsts.get($leadLastEntry.getKey()).get($lastDate) >= 5)
-
 
205
               <td style="color:green;">Appreciate</td>
-
 
206
               
-
 
207
               #else
-
 
208
               
-
 
209
               <td>Meet more prospects</td>
-
 
210
               #end
-
 
211
               #else
-
 
212
              <td style="color:red;">
-
 
213
                 No leads created yesterday
-
 
214
               </td>
-
 
215
               #end
-
 
216
               
-
 
217
               </tr>
-
 
218
 
-
 
219
              #end
-
 
220
               </tbody>
-
 
221
 
-
 
222
            </table>
-
 
223
         </div>
-
 
224
          </div>
-
 
225
                 
-
 
226
                 
117
				</div>
227
				</div>
118
			</td>
228
			</td>
119
		</tr>
229
		</tr>
120
	</table>
230
	</table>
-
 
231
	
-
 
232
	
121
 
233
 
122
	<div id="lead-request-table">
234
	<div id="lead-request-table">
123
		<div class="row">
235
		<div class="row">
124
			<div class="col-lg-12">
236
			<div class="col-lg-12">
125
				<table class="table table-border table-condensed table-bordered"
237
				<table class="table table-border table-condensed table-bordered"
Line 218... Line 330...
218
								<div class="input-group">
330
								<div class="input-group">
219
									<select class="form-control input-sm" id="assignTo"
331
									<select class="form-control input-sm" id="assignTo"
220
										name="assignTo" placeholder="Assign">
332
										name="assignTo" placeholder="Assign">
221
										<option value="" disabled selected>Assign To</option>
333
										<option value="" disabled selected>Assign To</option>
222
										#foreach($authUser in $authUsers)
334
										#foreach($authUser in $authUsers)
223
										<option value="$authUser.getId()">$authUser.getFirstName()</option>
335
										<option value="$authUser.getId()">$authUser.getFirstName() $authUser.getLastName()</option>
224
										#end
336
										#end
225
									</select>
337
									</select>
226
								</div>
338
								</div>
227
							</div>
339
							</div>
228
 
340
 
Line 359... Line 471...
359
							<div class="col-lg-3 form-group">
471
							<div class="col-lg-3 form-group">
360
								<select class="form-control input-sm" id="createAssignTo"
472
								<select class="form-control input-sm" id="createAssignTo"
361
									name="createAssignTo" placeholder="Assign">
473
									name="createAssignTo" placeholder="Assign">
362
									<option value="" disabled selected>Assign To</option>
474
									<option value="" disabled selected>Assign To</option>
363
									#foreach($authUser in $authUsers)
475
									#foreach($authUser in $authUsers)
364
									<option value="$authUser.getId()">$authUser.getFirstName()</option>
476
									<option value="$authUser.getId()">$authUser.getFirstName() $authUser.getLastName()</option>
365
									#end
477
									#end
366
								</select>
478
								</select>
367
							</div>
479
							</div>
368
 
480
 
369
							<div class="col-lg-3 form-group">
481
							<div class="col-lg-3 form-group">
Line 401... Line 513...
401
<script type="text/javascript">
513
<script type="text/javascript">
402
	var editor;
514
	var editor;
403
	$(document)
515
	$(document)
404
			.ready(
516
			.ready(
405
					function() {
517
					function() {
-
 
518
					
-
 
519
					
-
 
520
				
406
						console.log($('#lead-table tbody tr').length)
521
						console.log($('#lead-table tbody tr').length)
407
						if ($('#lead-table tbody tr').length > 1) {
522
					
408
							$('#lead-table thead tr').clone(true).appendTo(
523
							$('#lead-table thead tr').clone(true).appendTo(
409
									'#lead-table thead');
524
									'#lead-table thead');
410
							$('#lead-table thead tr:eq(1) th')
525
							$('#lead-table thead tr:eq(1) th')
411
									.each(
526
									.each(
412
											function(i) {
527
											function(i) {
413
												var title = $(this).text();
528
												var title = $(this).text();
414
												$(this).html(
529
												$(this).html(
415
														'<input type="text" style = "width:60%;" placeholder="Search '
530
														'<input type="text"  class="search-lead" style = "width:60%;" placeholder="Search '
416
																+ title
531
																+ title
417
																+ '" />');
532
																+ '" />');
418
 
533
 
419
												$('input', this)
534
												$('input', this)
420
														.on(
535
														.on(
Line 455... Line 570...
455
									type : 'date-euro',
570
									type : 'date-euro',
456
									targets : 9
571
									targets : 9
457
								}
572
								}
458
 
573
 
459
								]
574
								]
460
 
-
 
461
							});
575
							});
-
 
576
							
462
						}
577
							
-
 
578
					var  myPieChart = null;
-
 
579
						$(document).on("keyup", ".search-lead",
-
 
580
                function (e) {
-
 
581
		           	console.log('Currently applied global search:');
-
 
582
		         if(myPieChart!=null){
-
 
583
        myPieChart.destroy();
-
 
584
    }
-
 
585
		           	datatableChart();
-
 
586
		           	
-
 
587
	           	});
-
 
588
 
-
 
589
 
-
 
590
function datatableChart() {
-
 
591
 
-
 
592
$('#chart-leadstatus').remove();
-
 
593
   
-
 
594
		let count = 0;
-
 
595
		let ni =0;
-
 
596
		
-
 
597
		let fwup = 0;
-
 
598
		let pend = 0;
-
 
599
		let final = 0;
-
 
600
		
-
 
601
		table.rows({
-
 
602
			"search" : "applied"
-
 
603
		}).every(function() {
-
 
604
			
-
 
605
			var data = this.data();
-
 
606
			
-
 
607
			console.log("data"+data);
-
 
608
			var status = data[8];
-
 
609
			
-
 
610
			console.log("status"+status);
-
 
611
			
-
 
612
			if(status=="notInterested"){
-
 
613
			ni++;
-
 
614
			}
-
 
615
			else if(status=="followUp"){
-
 
616
			
-
 
617
			fwup++;
-
 
618
			}
-
 
619
			else if(status=="pending"){
-
 
620
			
-
 
621
			pend++;
-
 
622
			}
-
 
623
			else if(status=="finalized"){
-
 
624
			
-
 
625
			final++;
-
 
626
			}
-
 
627
			
-
 
628
			console.log("All"+ni + fwup + pend+ final);
-
 
629
 
-
 
630
                 var count= table.rows( {search:'applied'} ).count();
-
 
631
 
-
 
632
                console.log("count"+count);
-
 
633
 
-
 
634
                });
-
 
635
                
-
 
636
     
-
 
637
 
-
 
638
	 var ctx = document.getElementById('chart-lead-search').getContext('2d');
-
 
639
	
-
 
640
        myPieChart = new Chart(ctx, {
-
 
641
            "type":"pie",
-
 
642
       "data":{
-
 
643
       
-
 
644
         "labels":[
-
 
645
            "notInterested",
-
 
646
            "followUp",
-
 
647
            "pending",
-
 
648
            "finalized"
-
 
649
                  ],
-
 
650
       "datasets":[
-
 
651
           {
-
 
652
            "data":[
-
 
653
                ni,fwup,pend,final
-
 
654
               ],
-
 
655
         "backgroundColor":["red","#9ACD32","pink","blue"],
-
 
656
         "label":"DataSet 1"
-
 
657
           }
-
 
658
                 ]
-
 
659
              },
-
 
660
        "options":{
-
 
661
          "responsive":true,
-
 
662
              "legend":{
-
 
663
        "labels":{
-
 
664
            "fontColor":"black",
-
 
665
           "fontSize":15
-
 
666
           },
-
 
667
          "position":"left"
-
 
668
                 }
-
 
669
         }});
-
 
670
         
-
 
671
         if(ni <= 0){
-
 
672
         myPieChart.getDatasetMeta(0).data[0].hidden = true;    
-
 
673
           }
-
 
674
         if(fwup <= 0){
-
 
675
         myPieChart.getDatasetMeta(0).data[1].hidden=true;
-
 
676
         }
-
 
677
         if(pend <= 0){
-
 
678
         myPieChart.getDatasetMeta(0).data[2].hidden=true;
-
 
679
         }
-
 
680
         if(final <= 0){
-
 
681
         myPieChart.getDatasetMeta(0).data[3].hidden=true;
-
 
682
         }
-
 
683
         
-
 
684
         myPieChart.update();
-
 
685
 
-
 
686
	}
-
 
687
 
463
 
688
 
464
					});
689
					});
465
</script>
690
</script>
466
 
691
 
-
 
692
<script type="text/javascript">
-
 
693
 
-
 
694
    
-
 
695
        var config = $chartLead;
-
 
696
      
-
 
697
        var ctx = document.getElementById('chart-leadstatus').getContext('2d');
-
 
698
       var bar = new Chart(ctx, config);
-
 
699
</script>