function publicHomePageStatistics()
{
    // getting the jquery script from a host
    $markup = "<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-beta1/jquery.js\"></script>";
    $markup .= "<script src=\"numberCounting.js\"></script>";
    // opening table
    $markup .= '<table id="publicHomePageStatistics" style="width:1200px">';
    // displaying number of hours logged through CROMA in total
    $markup .= "<tr style='font-size:15pt; font-family: \"Open Sans\", sans-serif;'><td class=\"title\" style=\"text-align:center\"><h3><b>Hours Logged</b></h3></td>";
    // displaying number of outreaches logged through CROMA in total
    $markup .= "<td class=\"title\" style=\"text-align:center\"><h3><b>Outreaches Created</b></h3></td>";
    // displaying number of teams that have registered through CROMA in total
    $markup .= "<td class=\"title\" style=\"text-align:center\"><h3><b>Teams Registered</b></h3></td></tr>";
    // displaying number of hours logged through CROMA in total
    $markup .= "<tr style='color:#8E2115; font-size:30pt; font-family: \"Open Sans\", sans-serif;'><td class=\"number\" style=\"text-align:center\"><h3><div class=\"countUp\">";
    $markup .= dbGetTotalHours() . "</div></h3></td>";
    // displaying number of outreaches logged through CROMA in total
    $markup .= "<td class=\"number\" style=\"text-align:center\"><h3><div class=\"countUp\">";
    $markup .= dbGetNumTotalOutreach() . "</div></h3></td>";
    // displaying number of teams that have registered through CROMA in total
    $markup .= "<td class=\"number\" style=\"text-align:center\"><h3><div class=\"countUp\">";
    $markup .= dbGetNumTotalTeams() . "</div></h3></td></tr>";
    $markup .= "</table>";
    // closing array and returning it to display the data above for the user
    $retArray = array();
    $retArray['#markup'] = $markup;
    return $retArray;
}
Exemple #2
0
<?php

include '/var/www-croma/database/croma_dbFunctions.php';
include '/var/www-croma/database/drupalCompatibility.php';
$data['numHours'] = dbGetTotalHours();
$data['numOutreaches'] = dbGetNumTotalOutreach();
$data['numTeams'] = dbGetNumTotalTeams();
$json = json_encode($data);
echo $json;