Subversion Repositories SmartDukaan

Rev

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

Rev 15093 Rev 15128
Line 1... Line 1...
1
<h1>Admin Dashboard</h1>
1
<h1>Admin Dashboard</h1>
2
<div id="registrations_chart_div" style="width:1200; height:300"></div>
2
<div id="registrations_chart_div" style="width:1200; height:300"></div>
3
<div id="clicks_chart_div" style="width:1200px; height:300px"></div>
3
<div id="clicks_chart_div" style="width:1200px; height:300px"></div>
4
<div id="orders_chart_div" style="width:1200px; height:300px"></div>
4
<div id="orders_chart_div" style="width:1200px; height:300px"></div>
5
<div id="brand_preferences_chart_div" style="width:1200px; height:300px"></div>
5
<div id="brand_preferences_chart_div" style="width:1200px; height:300px"></div>
-
 
6
<div class="row">
6
<div id="devices_chart_div" style="width:600px; height:300px"></div>
7
  <div id="devices_chart_div" class="col-xs-6" style="width:400px; height:300px"></div>
-
 
8
  <div id="preferences_chart_div" class="col-xs-6" style="width:400px; height:300px"></div>
-
 
9
</div>
7
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
10
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
8
<script type="text/javascript">
11
<script type="text/javascript">
9
	var dailysignups = [];
12
	var dailysignups = [];
10
	<?php foreach ($userbase as $key => $value):?>
13
	<?php foreach ($userbase as $key => $value):?>
11
		var temp = [new Date('<?php echo $value[0]['date'];?>') , <?php echo $value[0]['count'];?>];
14
		var temp = [new Date('<?php echo $value[0]['date'];?>') , <?php echo $value[0]['count'];?>];
Line 24... Line 27...
24
	var devices = [];
27
	var devices = [];
25
	devices.push(['Version Code','Number of Devices']);	
28
	devices.push(['Version Code','Number of Devices']);	
26
	<?php foreach ($devices as $key => $value):?>
29
	<?php foreach ($devices as $key => $value):?>
27
		var temp = ["<?php echo $value['devices']['versioncode'];?>" , <?php echo $value[0]['count'];?>];
30
		var temp = ["<?php echo $value['devices']['versioncode'];?>" , <?php echo $value[0]['count'];?>];
28
		devices.push(temp);
31
		devices.push(temp);
29
	<?php endforeach;?>
32
	<?php endforeach;?>  
30
  var brandpreferences = [];
33
  var brandpreferences = [];
31
  <?php foreach ($preferences_set as $key => $value):?>
34
  <?php foreach ($preferences_set as $key => $value):?>
32
    var temp = ["<?php echo $value[0]['date'];?>" , <?php echo $value[0]['count'];?>];
35
    var temp = [new Date("<?php echo $value[0]['date'];?>") , <?php echo $value[0]['count'];?>];
33
    brandpreferences.push(temp);
36
    brandpreferences.push(temp);
34
  <?php endforeach;?>
37
  <?php endforeach;?>
-
 
38
  var preferences = [];
-
 
39
  preferences.push(['Brand Preferences Set','Number of Users']); 
-
 
40
  preferences.push(['Yes','<?php echo $usersWithBrandPreferencesSet[0][0]['count'];?>']); 
-
 
41
  preferences.push(['No','<?php echo ($totalUsers[0][0]['count'] - $usersWithBrandPreferencesSet[0][0]['count']);?>']); 
35
 
42
	
36
	google.load('visualization', '1', {packages: ['corechart', 'line']});
43
  google.load('visualization', '1', {packages: ['corechart', 'line']});
37
	google.setOnLoadCallback(drawBasic);
44
	google.setOnLoadCallback(drawBasic);
38
 
45
 
39
	function drawBasic() {
46
	function drawBasic() {
40
      var data = new google.visualization.DataTable();
47
      var data = new google.visualization.DataTable();
41
      data.addColumn('date', 'Date');
48
      data.addColumn('date', 'Date');
Line 44... Line 51...
44
      var options1 = {
51
      var options1 = {
45
        hAxis: {
52
        hAxis: {
46
          title: 'Date',
53
          title: 'Date',
47
        },
54
        },
48
        vAxis: {
55
        vAxis: {
49
          title: 'User Registrations'
56
          title: 'Daily User activations'
50
        }
57
        }
51
      };
58
      };
52
 
59
 
53
      var chart1 = new google.visualization.LineChart(document.getElementById('registrations_chart_div'));
60
      var chart1 = new google.visualization.LineChart(document.getElementById('registrations_chart_div'));
54
      chart1.draw(data, options1);
61
      chart1.draw(data, options1);
Line 60... Line 67...
60
      var options2 = {
67
      var options2 = {
61
        hAxis: {
68
        hAxis: {
62
          title: 'Date',
69
          title: 'Date',
63
        },
70
        },
64
        vAxis: {
71
        vAxis: {
65
          title: 'Number of Clicks'
72
          title: 'Daily clicks'
66
        }
73
        }
67
      };
74
      };
68
 
75
 
69
      var chart2 = new google.visualization.LineChart(document.getElementById('clicks_chart_div'));
76
      var chart2 = new google.visualization.LineChart(document.getElementById('clicks_chart_div'));
70
      chart2.draw(clicksdata, options2);
77
      chart2.draw(clicksdata, options2);
Line 76... Line 83...
76
      var options3 = {
83
      var options3 = {
77
        hAxis: {
84
        hAxis: {
78
          title: 'Date',
85
          title: 'Date',
79
        },
86
        },
80
        vAxis: {
87
        vAxis: {
81
          title: 'Number of Orders'
88
          title: 'Daily orders'
82
        }
89
        }
83
      };
90
      };
84
 
91
 
85
      var chart3 = new google.visualization.LineChart(document.getElementById('orders_chart_div'));
92
      var chart3 = new google.visualization.LineChart(document.getElementById('orders_chart_div'));
86
      chart3.draw(ordersdata, options3);
93
      chart3.draw(ordersdata, options3);
87
 
94
 
88
 
95
 
89
      var brandpreferencesdata = new google.visualization.DataTable();      
96
      var brandpreferencesdata = new google.visualization.DataTable();      
90
      brandpreferencesdata.addColumn('date', 'Date');
97
      brandpreferencesdata.addColumn('date', 'Date');
91
      brandpreferencesdata.addColumn('number', 'Brand Preferences Set');      
98
      brandpreferencesdata.addColumn('number', 'Brand Preferences Set');      
92
      brandpreferencesdata.addRows(dailyorders);
99
      brandpreferencesdata.addRows(brandpreferences);
93
      var options5 = {
100
      var options5 = {
94
        hAxis: {
101
        hAxis: {
95
          title: 'Date',
102
          title: 'Date',
96
        },
103
        },
97
        vAxis: {
104
        vAxis: {
98
          title: 'Number of Users who set Brand Preferences'
105
          title: 'Daily brand preferences'
99
        }
106
        }
100
      };
107
      };
101
 
108
 
102
      var chart5 = new google.visualization.LineChart(document.getElementById('brand_preferences_chart_div'));
109
      var chart5 = new google.visualization.LineChart(document.getElementById('brand_preferences_chart_div'));
103
      chart5.draw(brandpreferencesdata, options5);
110
      chart5.draw(brandpreferencesdata, options5);
104
 
111
 
105
 
112
 
106
		var devicesdata = google.visualization.arrayToDataTable(devices);
113
  		var devicesdata = google.visualization.arrayToDataTable(devices);
107
		var options4 = {
114
  		var options4 = {
108
			title: 'Version Codes'
115
  			title: 'Version Codes'
109
		};
116
  		};
110
		var chart4 = new google.visualization.PieChart(document.getElementById('devices_chart_div'));
117
  		var chart4 = new google.visualization.PieChart(document.getElementById('devices_chart_div'));
111
		chart4.draw(devicesdata, options4);
118
  		chart4.draw(devicesdata, options4);
-
 
119
 
-
 
120
      var preferencesdata = google.visualization.arrayToDataTable(preferences);
-
 
121
      var options6 = {
-
 
122
        title: 'Brand Preferences'
-
 
123
      };
-
 
124
      var chart6 = new google.visualization.PieChart(document.getElementById('preferences_chart_div'));
-
 
125
      chart6.draw(preferencesdata, options6);
112
    }
126
    }
113
    </script>
127
    </script>