-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
138 lines (131 loc) · 6.02 KB
/
index.php
File metadata and controls
138 lines (131 loc) · 6.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Reporting</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<link rel="stylesheet" src="style.css"/>
<link rel="stylesheet" href="https://fr.wikipedia.org/w/load.php?debug=false&lang=fr&modules=ext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.sectionAnchor%7Cmediawiki.skinning.interface%7Cskins.vector.styles&only=styles&skin=vector"/>
<script async="" src="https://fr.wikipedia.org/w/load.php?debug=false&lang=fr&modules=startup&only=scripts&skin=vector"></script>
<!-- Chargement de la feuille de style -->
</head>
<body class="mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-4 ns-subject page-Wikipédia_Accueil_principal rootpage-Wikipédia_Accueil_principal vector-nav-directionality skin-vector action-view">
<article class="mw-body" role="main">
<h1 id="firstHeading" class="firstHeading" lang="fr">Members of the DTU-C Scientific Committee</h1>
<?php
// chargement de l'adresse du google spread sheet
$spreadsheet_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vR_iFxMy5BqMHZ_nuyJimpVVlIsEkGkmKzVTThS82epj--S9agLqTJza0SyLUlxZD_MNcMwmP1u8WD5/pub?output=csv";
// message d'erreur en as de time out
if(!ini_set('default_socket_timeout', 15)) echo "<!-- unable to change socket timeout -->";
// Boucle qui charge les données du google spreadsheet dans une variable de type array()
if (($handle = fopen($spreadsheet_url, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$spreadsheet_data[] = $data;
}
fclose($handle);
asort($spreadsheet_data);
$france=0;
$tunisie=0;
$international=0;
$nationalites=array();
echo "<ol>";
foreach($spreadsheet_data as $requested_member){
if($requested_member[9]=='yes'){
array_push($nationalites,$requested_member[4]);
echo "<li>";
echo "<a href='";
echo "https://scholar.google.fr/scholar?q=author:\"";
echo urlencode($requested_member[0]);
echo ", ";
echo urlencode($requested_member[1]);
echo "\"' >";
echo "$requested_member[1] ";
echo strtoupper($requested_member[0]);
echo "</a>";
//echo ", <a href='mailto:$requested_member[2]'>$requested_member[2]</a>";
echo ", $requested_member[3]";
echo ", $requested_member[4]";
echo "<img class='flag' src='flags-mini/$requested_member[6].png' width='25px' height='15px' title='flag of $requested_member[4]' alt=', $requested_member[4]'>";
if($requested_member[6]=='fr'){
$france++;
}
elseif($requested_member[6]=='tn'){
$tunisie++;
}
else {
$international++;
}
echo "</li>";
}
}
echo "</ol>";
echo "There are $france members from France, $tunisie members from Tunisia and $international members from other countries in the Scientific Committee";
$tableau_des_frequences=array_count_values($nationalites);
}
else
die("Problem reading csv");
?>
<div id="piechart" style="width: 1080px; height: 500px;">
<script>
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Members of de CS', 'Nb per country'],
<?php
$count=0;
foreach($tableau_des_frequences as $key => $value) {
echo "\n['" . $key . "', " . $value . "]";
//echo "$count sur ".count($tableau_des_frequences);
if(++$count < count($tableau_des_frequences)) echo ",";
}
?>
]);
var options = {
title: 'Distribution of reviewers / country',
showTooltip: true,
showInfoWindow: true
};
var pie = new google.visualization.PieChart(document.getElementById('piechart'));
pie.draw(data, options);
}
</script>
</div>
<div id="regions_div" style="width: 800px; height: 600px">
<script type="text/javascript">
google.charts.load('current', {
'packages':['geochart'],
// Note: you will need to get a mapsApiKey for your project.
// See: https://developers.google.com/chart/interactive/docs/basic_load_libs#load-settings
'mapsApiKey': 'AIzaSyD-9tSrke72PouQMnMX-a7eZSW0jkFMBWY'
});
google.charts.setOnLoadCallback(drawRegionsMap);
function drawRegionsMap() {
var data = google.visualization.arrayToDataTable([
['Country', 'Reviewers'],
<?php
$count=0;
foreach($tableau_des_frequences as $key => $value) {
echo "['" . $key . "', " . $value . "]";
//echo "$count sur ".count($tableau_des_frequences);
if(++$count < count($tableau_des_frequences)) echo ",";
echo "\n ";
}
?>
]);
var options = {};
var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
chart.draw(data, options);
}
</script>
</div>
</article>
<footer>
Find this reporting template for your own project
<a href="https://github.com/geraldkembellec/ScientificCommitteeAnalytics">
on https://github.com/geraldkembellec/ScientificCommitteeAnalytics
</a>
</footer>
</body>
</html>