Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Leaderbord Warface</title>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" />
- <?php
- include 'index.php';
- include 'function.php';
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "myDB";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sqlCLAN = "SELECT DISTINCT nome_clan FROM leaderboard";
- $resultCLAN = $conn->query($sqlCLAN);
- if ($resultCLAN->num_rows > 0) {
- ?>
- <!-- load api -->
- <script type=botrugno"text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
- <script type="text/javascript">
- google.charts.load('current', {'packages':['line']});
- google.charts.setOnLoadCallback(drawChart);
- function drawChart() {
- <?php
- while( $rowCLAN = $resultCLAN->fetch_assoc() ){
- extract($rowCLAN);
- ?>
- var data = new google.visualization.DataTable();
- data.addColumn('date', 'Day');
- data.addColumn('number', '<?php echo $nome_clan; ?>');
- data.addRows([
- <?php
- $sql = "SELECT orario, cp FROM leaderboard WHERE nome_clan='$nome_clan'";
- $result = $conn->query($sql);
- echo $sql;
- while( $row = $result->fetch_assoc() ){
- extract($row);
- echo "[".get_stringa_date($orario).", {$cp}],";
- }
- ?>
- ]);
- var options = {
- chart: {
- title: 'Grafico di andamento leaderboard mensile',
- subtitle: 'in millions of cp'
- },
- width: 900,
- height: 500
- };
- var chart = new google.charts.Line(document.getElementById('linechart_material'));
- chart.draw(data, options);
- <?php
- }
- ?>
- }
- </script>
- <?php
- }else{
- echo "No clan found in database.";
- }
- ?>
- </head>
- <body style="font-family: Arial;border: 0 none;">
- <div id="linechart_material" style="width: 900px; height: 500px"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement