Subversion Repositories SmartDukaan

Rev

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

Rev 29473 Rev 29478
Line 547... Line 547...
547
</section>
547
</section>
548
 
548
 
549
 
549
 
550
<script type="text/javascript">
550
<script type="text/javascript">
551
	var editor;
551
	var editor;
-
 
552
	var searchCount =0;
-
 
553
	var ab;
552
	$(document)
554
	$(document)
553
			.ready(
555
			.ready(
554
					function() {
556
					function() {
555
					
557
					
556
					
558
					
Line 615... Line 617...
615
					var  myPieChart = null;
617
					var  myPieChart = null;
616
						$(document).on("keyup", ".search-lead",
618
						$(document).on("keyup", ".search-lead",
617
                function (e) {
619
                function (e) {
618
		           	console.log('Currently applied global search:');
620
		           	console.log('Currently applied global search:');
619
		         if(myPieChart!=null){
621
		         if(myPieChart!=null){
620
        myPieChart.destroy();
622
                   myPieChart.destroy();
-
 
623
                      }
-
 
624
                      
-
 
625
                
-
 
626
                    myFunction(searchCount);
-
 
627
		        
621
    }
628
		       
622
		           	datatableChart();
629
		        
623
		           	
630
		        
-
 
631
		  
624
	           	});
632
	           	});
625
 
633
 
-
 
634
function myFunction() {
-
 
635
    if(searchCount == 0){
-
 
636
   ab = setTimeout(function(){datatableChart();}, 3000);
-
 
637
   searchCount++;
-
 
638
    }
-
 
639
      else {	     
-
 
640
            clearTimeout(ab);
-
 
641
		    ab = setTimeout(function(){datatableChart();}, 3000);
-
 
642
  }
-
 
643
}
-
 
644
 
626
 
645
 
627
function datatableChart() {
646
function datatableChart() {
628
 
647
 
-
 
648
 
629
$('#chart-leadstatus').remove();
649
$('#chart-leadstatus').remove();
630
   
650
   
631
		let count = 0;
651
		let count = 0;
632
		let ni =0;
652
		let ni =0;
633
		
653
		
Line 637... Line 657...
637
		let final = 0;
657
		let final = 0;
638
		
658
		
639
		table.rows({
659
		table.rows({
640
			"search" : "applied"
660
			"search" : "applied"
641
		}).every(function() {
661
		}).every(function() {
642
			
-
 
643
			var data = this.data();
662
			var data = this.data();
644
			
-
 
645
			console.log("data"+data);
-
 
646
			var status = data[8];
663
			var status = data[8];
647
			var hotLeads = data[16];
664
			var hotLeads = data[16];
648
			
665
			
649
			console.log("status"+status);
666
			console.log("status"+status);
650
			
667
			
Line 664... Line 681...
664
			}
681
			}
665
			else if(status=="finalized"){
682
			else if(status=="finalized"){
666
			
683
			
667
			final++;
684
			final++;
668
			}
685
			}
669
			
-
 
670
			console.log("All"+ni + fwup + pend+ final+htld);
-
 
671
 
-
 
672
                 var count= table.rows( {search:'applied'} ).count();
686
	   var count= table.rows( {search:'applied'} ).count();
673
 
-
 
674
                console.log("count"+count);
-
 
675
 
687
 
676
                });
688
                });
677
                
-
 
678
     
-
 
679
 
-
 
680
	 var ctx = document.getElementById('chart-lead-search').getContext('2d');
689
      var ctx = document.getElementById('chart-lead-search').getContext('2d');
681
	
690
	
682
        myPieChart = new Chart(ctx, {
691
        myPieChart = new Chart(ctx, {
683
            "type":"pie",
692
            "type":"pie",
684
       "data":{ 
693
       "data":{ 
685
         "labels":[
694
         "labels":[