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