Beispiel #1
0
function generate_image($lang, $idx)
{
    global $LANGUAGES;
    $up_to_date = get_stats($idx, $lang, 'uptodate');
    $up_to_date = $up_to_date[0];
    //
    $outdated = @get_stats($idx, $lang, 'outdated');
    $outdated = $outdated[0];
    //
    $missing = get_stats($idx, $lang, 'notrans');
    $missing = $missing[0];
    //
    $no_tag = @get_stats($idx, $lang, 'norev');
    $no_tag = $no_tag[0];
    $data = array($up_to_date, $outdated, $missing, $no_tag);
    $percent = array();
    $total = array_sum($data);
    // Total ammount in EN manual (to calculate percentage values)
    $total_files_lang = $total - $missing;
    // Total ammount of files in translation
    foreach ($data as $value) {
        $percent[] = round($value * 100 / $total);
    }
    $legend = array($percent[0] . '%% up to date (' . $up_to_date . ')', $percent[1] . '%% outdated (' . $outdated . ')', $percent[2] . '%% missing (' . $missing . ')', $percent[3] . '%% without EN-Revision (' . $no_tag . ')');
    $title = 'Details for ' . $LANGUAGES[$lang] . ' PHP Manual';
    $graph = new PieGraph(530, 300);
    $graph->SetShadow();
    $graph->title->Set($title);
    $graph->title->Align('left');
    $graph->title->SetFont(FF_FONT1, FS_BOLD);
    $graph->legend->Pos(0.02, 0.18, "right", "center");
    $graph->subtitle->Set('(Total: ' . $total_files_lang . ' files)');
    $graph->subtitle->Align('left');
    $graph->subtitle->SetColor('darkred');
    $t1 = new Text(date('m/d/Y'));
    $t1->SetPos(522, 294);
    $t1->SetFont(FF_FONT1, FS_NORMAL);
    $t1->Align("right", 'bottom');
    $t1->SetColor("black");
    $graph->AddText($t1);
    $p1 = new PiePlot3D($data);
    $p1->SetSliceColors(array("#68d888", "#ff6347", "#dcdcdc", "#f4a460"));
    if ($total_files_lang != $up_to_date) {
        $p1->ExplodeAll();
    }
    $p1->SetCenter(0.35, 0.55);
    $p1->value->Show(false);
    $p1->SetLegends($legend);
    $graph->Add($p1);
    $graph->Stroke("../www/images/revcheck/info_revcheck_php_{$lang}.png");
}
Beispiel #2
0
function site_stats($site_name)
{
    global $lang, $config;
    if ($config['generate_statistics']) {
        $ga = new gapi($config['ga_email'], $config['ga_password']);
        //get profile ids
        $ga->requestAccountData();
        foreach ($ga->getResults() as $result) {
            $config[filename((string) $result)]['profile_id'] = $result->getProfileId();
        }
        if (isset($config[$site_name]['profile_id'])) {
            $profile_id = $config[$site_name]['profile_id'];
            //current week visits
            $arr['visits'] = get_visits($ga, $profile_id, $config['from'], $config['to']);
            $arr['prior_visits'] = get_visits($ga, $profile_id, $config['prior_from'], $config['prior_to']);
            $arr['st'] = get_stats($arr['visits'], $arr['prior_visits']);
            $arr['image_path'] = generate_image($lang[$site_name], $arr['visits']);
            $arr['image_name'] = basename($arr['image_path']);
            return $arr;
        }
    }
}
Beispiel #3
0
    1. Redistributions of source code must retain the above copyright notice,
       this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.

    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    POSSIBILITY OF SUCH DAMAGE.
*/
header("Last-Modified: " . gmdate("D, j M Y H:i:s") . " GMT");
header("Expires: " . gmdate("D, j M Y H:i:s", time()) . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
// HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", FALSE);
header("Pragma: no-cache");
// HTTP/1.0
require_once "guiconfig.inc";
require_once "system.inc";
include_once "includes/functions.inc.php";
echo get_stats();
Beispiel #4
0
 function get_xhr()
 {
     echo json_encode(get_stats());
 }
Beispiel #5
0
<?php

error_reporting(E_ALL);
require_once 'fuu.php';
if (isset($_GET['play'])) {
    $id = (int) $_GET['play'];
    increase_nb_play($id);
    play_insult($id);
}
$insult = get_random_insult();
$stats = get_stats();
increase_nb_view($insult['id']);
?>
<!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" xml:lang="fr" lang="fr">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />    
    <title>Fuu</title>

    <style type="text/css">

      body { 
      background-color: #303030;
      font-family: 'Lucida Grande',sans-serif;
      line-height: 1.5;
      font-size: 0.75em;
      color: #C0C0C0;
      text-align: center;
      }

      #wrapper { 
?>
                        <form action="index.php">
                            <input type="submit" value="back to home" class="btn btn-primary">
                        </form>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="exercises">
                        <h2>Exercises</h2>
                        <ul>
                            <li><a href="llquiz.php">Drug identification</a></li>
                            <li><a href="laskuquiz.php">Drug calculations</a></li>
                            <li><a href="conversionquiz.php">Unit conversions</a></li>
                            <li><a href="examquiz.php">Exam</a></li>
                        </ul>
                    </div>
                    <h2>Statistics</h2>
                    <?php 
get_stats($_SESSION['login_user'], 0);
?>
                </div>
            </div>
        </div>
    </div>
</div>

    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/scripts.js"></script>
  </body>
</html>
Beispiel #7
0
 function get()
 {
     $stats = get_stats();
     include "views/dashboard.php";
 }
function iterkeys($fp, $dumpmode = DUMPMODE_ONLYKEYS)
{
    $slabs = slabs_stats($fp);
    $stats = get_stats($fp, 'stats');
    ksort($slabs);
    printf("      %-40s %20s %10s %8s" . PHP_EOL, 'Key', 'Expire status', 'Size', 'Waste');
    foreach ($slabs as $num => $slab) {
        if ($num == 'total') {
            continue;
        }
        if ($slab['number']) {
            $lines = send_and_receive($fp, "stats cachedump {$num} {$slab['number']}");
            foreach ($lines as $line) {
                $m = array();
                if (preg_match('/^ITEM ([^\\s]+) \\[(\\d+) b; (\\d+) s\\]/', $line, $m)) {
                    $key = $m[1];
                    $size = $m[2];
                    $now = time();
                    $waste = (1.0 - (double) $size / $slab['chunk_size']) * 100;
                    $expiration_time = $m[3];
                    if ($expiration_time == $stats['time'] - $stats['uptime']) {
                        $status = '[never expire]';
                    } elseif ($now > $expiration_time) {
                        $status = '[expired]';
                    } else {
                        $status = $expiration_time - $now . 's left';
                    }
                    printf("ITEM  %-40s %20s %10s %7.0f%%" . PHP_EOL, $key, $status, $size, $waste);
                    // Get value
                    if ($dumpmode == DUMPMODE_KEYVALUES && $status != '[expired]') {
                        $lines = send_and_receive($fp, "get {$key}");
                        if (count($lines)) {
                            $info = $lines[0];
                            $data = $lines[1];
                            preg_match('/^VALUE ([^\\s]+) (\\d+) (\\d+)/', $info, $m);
                            $flags = $m[2];
                            printf("VALUE %-40s flags=%X" . PHP_EOL, $key, $flags);
                            printf("%s" . PHP_EOL, $data);
                        }
                    }
                    // Get value
                    if ($dumpmode == REMOVEMODE_EXPIRED && $status == '[expired]') {
                        $lines = send_and_receive($fp, "get {$key}");
                    }
                }
            }
        }
    }
}
<?php

namespace hypeJunction\Interactions;

$comment_guid = get_input('guid');
$comment = get_entity($comment_guid);
/* @var Comment $comment */
if ($comment instanceof Comment && $comment->canEdit()) {
    $entity = $comment->getContainerEntity();
    if ($comment->delete()) {
        if (elgg_is_xhr()) {
            $output = array('guid' => $comment_guid, 'stats' => get_stats($entity));
            echo json_encode($output);
        }
        system_message(elgg_echo('generic_comment:deleted'));
    } else {
        register_error(elgg_echo('generic_comment:notdeleted'));
    }
} else {
    register_error(elgg_echo('generic_comment:notfound'));
}
forward(REFERER);
    echo "Profile Url: {$profileUrl}\n";
    $portraitName = str_replace("http://cdn.dota2.com/apps/dota2/images/heroes/", "", $portraitUrl);
    $portraitArray[$hero] = $portraitName;
    echo "\n";
    foreach ($abilities as $ability) {
        $abilityNameNode = $xPath->evaluate($xpath_query['abilityName'], $ability);
        $abilityNameString = $abilityNameNode->item(0)->nodeValue;
        $abilityDescriptionNode = $xPath->evaluate($xpath_query['abilityDescription'], $ability);
        $abilityDescriptionString = $abilityDescriptionNode->item(0)->nodeValue;
        $abilityArray[$abilityNameString]['Description'] = array($abilityDescriptionString);
        // We can use this array shit to add other things like Mana Cost and numbers
    }
    $heroBio = $xPath->query($xpath_query['heroBio']);
    $heroBioString = trim($heroBio->item(0)->nodeValue);
    $stats = array();
    $stats = get_stats($xPath);
    $outputArray[$hero]['abilities'] = $abilityArray;
    $outputArray[$hero]['bio'] = $heroBioString;
    $outputArray[$hero]['stats'] = $stats;
}
$outputJson = json_encode($outputArray);
$portraitJson = json_encode($portraitArray);
$fp = fopen(DOCUMENT_ROOT . "resources/heroes.json", "w");
$retVal = fwrite($fp, $outputJson);
fclose($fp);
$portFp = fopen(DOCUMENT_ROOT . "resources/portrait.json", "w");
$retVal = fwrite($portFp, $portraitJson);
function get_stats($xPath)
{
    global $xpath_query;
    $attributeArray = array("str", "int", "agi");
Beispiel #11
0
function create_summary(&$project_table)
{
    global $xml_array_g, $current_session_g;
    # Present executive summary of all issues.  Project table is passed by reference
    print "\n<br /><br /><div id='pageTitle'>Quality Assurance Executive Summary: <strong>" . $current_session_g['project'] . "</strong> Activity for past 30 days</div><center><br />" . "<table border=0 width=300 cellpadding=3 cellspacing=2>\n";
    parse_xml_file(CT_XML_BUGS_FILE, CT_DROP_HISTORY, "PROJECT", CT_ASCENDING);
    $bug_table =& $xml_array_g;
    # Copy by reference, so don't call parse_xml_file again
    $bug_severity = explode(",", CT_BUG_SEVERITIES);
    $bug_status = explode(",", CT_BUG_STATUSES);
    $stats["change_requests_created"] = 0;
    $stats["change_requests_closed"] = 0;
    $stats["change_requests_deferred"] = 0;
    $stats["defect_reports_created"] = 0;
    $stats["defect_reports_closed"] = 0;
    $stats["defects_deferred"] = 0;
    $stats["average_lifespan_of_change_requests"] = 0;
    $mean_cnt["average_lifespan_of_defects"] = 0;
    $stats["average_lifespan_of_defects"] = 0;
    $mean_cnt["average_lifespan_of_change_requests"] = 0;
    foreach ($bug_table as $bug) {
        if ($bug["Project"] != $current_session_g["project"]) {
            continue;
        }
        if (isset($bug["Delete_Bug"])) {
            continue;
        }
        if (strtotime($bug["Submit_Time"]) >= strtotime("-30 days") and strtotime($bug["Submit_Time"]) <= strtotime("now")) {
            if (strstr($bug["Severity"], "Change Req")) {
                $stats["change_requests_created"]++;
            } else {
                $stats["defect_reports_created"]++;
            }
        }
        if (strtotime($bug["Last_Updated"]) >= strtotime("-30 days") and strtotime($bug["Last_Updated"]) <= strtotime("now")) {
            if (strstr($bug["Status"], "Closed")) {
                if (strstr($bug["Severity"], "Change Req")) {
                    $stats["change_requests_closed"]++;
                    $stats["average_lifespan_of_change_requests"] += strtotime($bug["Last_Updated"]) - strtotime($bug["Submit_Time"]);
                    $mean_cnt["average_lifespan_of_change_requests"]++;
                } else {
                    $stats["defect_reports_closed"]++;
                    $stats["average_lifespan_of_defects"] += strtotime($bug["Last_Updated"]) - strtotime($bug["Submit_Time"]);
                    $mean_cnt["average_lifespan_of_defects"]++;
                }
            } elseif (strstr($bug["Status"], "Deferred")) {
                if (strstr($bug["Severity"], "Change Req")) {
                    $stats["change_requests_deferred"]++;
                } else {
                    $stats["defects_deferred"]++;
                }
            }
        }
    }
    print "<tr><td colspan=2 align=left class='rowEven2'><b>" . $current_session_g['project'] . "</b></td></tr>\n";
    $rows = 0;
    foreach ($stats as $stat => $value) {
        if ($mean_cnt[$stat] != 0) {
            print "<tr><td align=right class='" . ($rows % 2 ? "rowOdd" : "rowEven") . "'>" . ucwords(strtr($stat, "_", " ")) . "</td><td class='" . ($rows++ % 2 ? "rowOdd" : "rowEven") . "'>" . (strstr($stat, "lifespan") ? get_stats($value / $mean_cnt[$stat]) : $value) . "</td></tr>\n";
        }
    }
    print "</table>\n</center><br /><br />";
}
Beispiel #12
0
    forward(REFERER);
}
if (elgg_is_active_plugin('hypeAttachments')) {
    hypeapps_attach_uploaded_files($comment, 'uploads', ['origin' => 'comment', 'container_guid' => $comment->guid, 'access_id' => $comment->access_id]);
}
if ($new_comment) {
    if ($entity->owner_guid != $poster->guid) {
        // Send a notification to the content owner
        $recipient = $entity->getOwnerEntity();
        $language = $recipient->language;
        $messages = (new NotificationFormatter($comment, $recipient, $language))->prepare();
        notify_user($recipient->guid, $poster->guid, $messages->subject, $messages->body, array('object' => $comment, 'action' => 'create', 'summary' => $messages->summary));
    }
    // Add to river
    elgg_create_river_item(array('view' => 'river/object/comment/create', 'action_type' => 'create', 'subject_guid' => $poster->guid, 'object_guid' => $comment->guid, 'target_guid' => $entity->guid));
}
if (elgg_is_xhr()) {
    elgg_push_context('comments');
    if ($comment_guid) {
        // editing a comment
        $view = elgg_view_entity($comment, ['full_view' => true]);
    } else {
        // new comment
        $view = elgg_view('framework/interactions/comments', array('entity' => $entity, 'comment' => $comment));
    }
    $output = array('guid' => $entity->guid, 'view' => $view, 'stats' => get_stats($entity));
    echo json_encode($output);
    elgg_pop_context();
}
system_message(elgg_echo('generic_comment:posted'));
forward($comment->getURL());
Beispiel #13
0
    $stats = array('*sum' => $first);
    foreach (file($file) as $line) {
        //r5887 | buildmob | 2011-08-23 13:08:25 -0700 (Tue, 23 Aug 2011) | 4 lines
        if (count(list($r, $u, $d, $n) = explode(' | ', $line)) < 4) {
            continue;
        }
        if ($stats[$u]) {
            $stats[$u]['commits']++;
            $stats[$u]['lines'] += (int) $n;
            $stats['*sum']['commits']++;
            $stats['*sum']['lines'] += (int) $n;
        } else {
            $stats[$u] = $first;
        }
    }
    return $stats;
}
function print_stats(array $stats, $sortby)
{
    print "users    commits  commit%  lines    line%  (sorted by {$sortby})\n";
    print "-------  -------  -------  -----  -------\n";
    uasort($stats, function ($a, $b) use($sortby) {
        return $b[$sortby] - $a[$sortby];
    });
    foreach ($stats as $user => $stat) {
        printf("% -10s% 6d% 8.1f%%% 7d% 8.1f%%\n", $user, $stat['commits'], $stat['commits'] / $stats['*sum']['commits'] * 100, $stat['lines'], $stat['lines'] / $stats['*sum']['lines'] * 100);
    }
    print "\n";
}
print_stats(get_stats('php://stdin'), $argc > 1 ? 'lines' : 'commits');
Beispiel #14
0
    echo VERSION;
    ?>
</i><br>
<i><a href="http://www.amule-project.net/">http://www.amule-project.net/</a></i><br>
<i>&lt;uberpenguin at hotpop dot com&gt;</i>

</body>
</html>
<?php 
}
/**
 * Write out the stats to the browser. I will probably change this later on
 * to be themable, but for now I lack the motivation...
 */
write_header();
$ret = get_stats();
if (!$ret) {
    echo $text["sigfileerr"];
} else {
    // html strings that are used over and over
    $nastring = "\t\t\t\t\t<td class=\"organize\">" . $text["na"] . "</td>\n\t\t\t\t</tr>\n";
    $titlecolstart = "\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"organize\">";
    $titlecolend = "</td>\n";
    $datacolstart = "\t\t\t\t\t<td class=\"organize\">";
    $datacolend = "</td>\n\t\t\t\t</tr>\n";
    $sectiontablestart = "\t<table class=\"sec\">\n\t\t" . "<tr class=\"secheader\">\n\t\t\t<td class=\"secheader\">";
    $sectiontablenext = "</td>\n\t\t</tr>\n";
    $sectionend = "\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t</table>" . "\n\t<p>\n";
    $innertable = "\t\t<tr class=\"secbody\">\n\t\t\t" . "<td class=\"secbody\">\n";
    $organizetable = "\t\t\t<table class=\"organize\">\n";
    // title
<?php

namespace hypeJunction\Interactions;

$id = (int) get_input('id');
$like = NULL;
if ($id) {
    $like = elgg_get_annotation_from_id($id);
    $entity = get_entity($like->entity_guid);
}
if (!$like) {
    $guid = get_input('guid');
    $entity = get_entity($guid);
    if ($entity) {
        $likes = elgg_get_annotations(array('guid' => $entity->guid, 'annotation_owner_guid' => elgg_get_logged_in_user_guid(), 'annotation_name' => 'likes'));
        $like = $likes[0];
    }
}
if ($like && $like->canEdit()) {
    $like->delete();
    if (elgg_is_xhr()) {
        echo json_encode(array('guid' => $entity->guid, 'stats' => get_stats($entity)));
    }
    system_message(elgg_echo('likes:deleted'));
    forward(REFERER);
}
register_error(elgg_echo('likes:notdeleted'));
forward(REFERER);
Beispiel #16
0
</style>

<div id="cev_results_header" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
	
<div id="cev_results" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
    <div class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"><?php 
echo get_lang('Statistics');
?>
</div><br />
    <div id="cev_cont_stats">
	

	
 <?php 
if ($result_to_print != "") {
    $rst = get_stats($user_id, $course_code);
    $foo_stats = '<strong>' . get_lang('Total') . ': </strong>' . $rst['total'] . '<br />';
    $foo_stats .= '<strong>' . get_lang('Average') . ': </strong>' . $rst['avg'] . '<br />';
    $foo_stats .= '<strong>' . get_lang('Quantity') . ' : </strong>' . $rst['times'] . '<br />';
    echo $foo_stats;
} else {
    echo Display::display_warning_message(get_lang('NoDataAvailable'));
}
echo '<p> Estadisticas de usuario no.: ' . $user_id . ' curso`: ' . $course_code . '</p>';
//// Conexi�n a la BD e inserci�n de datos //////////////////////
$enlace = mysql_connect('localhost', 'siec', 'siec2013');
if (!$enlace) {
    die('No pudo conectarse: ' . mysql_error());
}
mysql_select_db(siec) or die("Cannot select database!<br>" . mysql_error());
$fecha1 = $_GET['fecha1'];
<?php

include "header.php";
include "drugdbinit.php";
?>
            <div id="right">
                <div id="content">
                    <h2>Your stats</h2>                    
                       <?php 
print_r(get_stats($_SESSION['login_user'], 1));
tee_graafi();
echo '<div id="curve_chart" style="width: 900px; height: 500px; float: right" float:right></div>';
?>
      

					</script>					   
                </div >
            </div>
        </div>
    </div>
</body>
</html>
<?php 
function tee_graafi()
{
    echo '   <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">
      google.charts.load("current", {"packages":["corechart"]});
      google.charts.setOnLoadCallback(drawChart);

      function drawChart() {
Beispiel #18
0
    while ($row = $result->fetch_assoc()) {
        $endpoints[] = $row;
    }
} else {
    printf("error: %s\n", $mysqli->error);
}
$insertquery = "insert into fbpagestats(statname, endtime, stats, title, displaydate) values (?, ?, ?, ?,?)";
if ($stmt = $mysqli->prepare($insertquery)) {
    $stmt->bind_param("ssiss", $statname, $endtime, $stats, $title, $displaydate);
    $mysqli->query("start");
} else {
    printf("error: %s\n", $mysqli->error);
}
foreach ($endpoints as $endpointarray) {
    $endpoint = $endpointarray["endpoint"];
    $stats = get_stats($endpoint, $api_key, $sincedate, $untildate);
    $statarray = json_decode($stats, true);
    foreach ($statarray["data"] as $dataarray) {
        $statname = $dataarray["name"];
        $title = $dataarray["title"];
        foreach ($dataarray["values"] as $statvalue) {
            $stats = $statvalue["value"];
            $endtime = date("Y-m-d H:i:s", strtotime($statvalue["end_time"]));
            $displaydate = date("Y-m-d", strtotime("-1 day", strtotime($statvalue["end_time"])));
            $stmt->execute();
            printf("\ndate %s: stat %s: %s. display as %s.\n", $endtime, $title, $stats, $displaydate);
        }
    }
}
$stmt->close();
$mysqli->query("done");
Beispiel #19
0
require '_login.php';
require_once '../conn.php';
$filters = array();
$filters["id_vendedor"] = isset($_POST["filtro-vendedor"]) ? $_POST["filtro-vendedor"] : "";
$filters["type"] = "POSTVENTA";
$oE = new Encuesta();
if (isset($_POST["delete_encuesta"])) {
    $oE->delete($_POST["delete_encuesta"]);
}
$oV = new Vendedor();
$aVendedores = $oV->getVendedores();
$temp = $oE->getAll($filters);
$oE->processStats($filters);
$data = get_stats();
$data_1 = get_stats("resp0001");
$data_7 = get_stats("resp0007");
?>

<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Estadísticas</title>

		<script type="text/javascript" src="external/js/jquery.min.js"></script>
		<script type="text/javascript" src="../assets/js/bootstrap.js"></script>
		<style type="text/css">
${demo.css}
		</style>
		<script type="text/javascript">
$(function () {
function row($stat_name, $max_review_no = 0, $title = "")
{
    global $vars;
    global $gather_passes;
    if ($max_review_no >= $gather_passes) {
        print "Can't make row: passes count exceeded for {$stat_name}";
    }
    $title = empty($title) ? $stat_name : $title . " rate";
    printf("%1\$-40s", $title);
    for ($i = 0; $i <= $max_review_no; $i++) {
        print fancy($stat_name, $i) . "\t";
    }
    print "\n";
}
//Obtain live statistics from MySQL server
$vars = get_stats();
// ***** REPORT *****
print "=========================\n";
print "Details and explanations:\nhttp://astellar.com/mysql-health-check/metrics/\n";
print "=========================\n";
printf("%1\$-40s", "Per second averages:");
print "Uptime\tLive#1\tLive#2\n";
print "== Load ==\n";
printf("%1\$-40s", "Questions:");
print fancy("Questions") . "\t" . fancy("Questions", 1) . "\t" . fancy("Questions", 2) . "\n";
printf("%1\$-40s", "Queries:");
print fancy("Queries") . "\t" . fancy("Queries", 1) . "\t" . fancy("Queries", 2) . "\n";
print "== Rates ==\n";
printf("%1\$-40s", "Select rate:");
print fancy("Com_select") . "\t" . fancy("Com_select", 1) . "\t" . fancy("Com_select", 2) . "\n";
printf("%1\$-40s", "Insert rate:");
Beispiel #21
0
$form->addElement('text', 'from', get_lang('From'), array('id' => 'date_from'));
$form->addElement('text', 'to', get_lang('Until'), array('id' => 'date_to'));
$form->addElement('style_submit_button', 'reset', get_lang('Reset'), array('onclick' => "javascript:window.location='access_details.php?course=" . $courseId . "&student=" . $user_id . "&cidReq=" . $course_code . "';"));
$form->display();
?>
<div id="cev_results_header" class="ui-tabs ui-widget ui-widget-content ui-corner-all">

<div id="cev_results" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
    <div class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"><?php 
echo get_lang('Statistics');
?>
</div><br />
    <div id="cev_cont_stats">
        <?php 
if ($result_to_print != "") {
    $rst = get_stats($user_id, $courseId);
    $foo_stats = '<strong>' . get_lang('Total') . ': </strong>' . $rst['total'] . '<br />';
    $foo_stats .= '<strong>' . get_lang('Average') . ': </strong>' . $rst['avg'] . '<br />';
    $foo_stats .= '<strong>' . get_lang('Quantity') . ' : </strong>' . $rst['times'] . '<br />';
    echo $foo_stats;
} else {
    echo Display::display_warning_message(get_lang('NoDataAvailable'));
}
?>
    </div><br />
</div><br />

<div id="container-9">
    <ul>
        <li><a href="<?php 
echo api_get_path(WEB_AJAX_PATH) . 'myspace.ajax.php?a=access_detail&type=day&course=' . $courseId . '&student=' . $user_id;
Beispiel #22
0
                 $last_dir = $row['dir'];
             }
             echo '<tr><td>' . $row['name'] . '</td><td>' . $row['en_size'] . '</td><td>' . $row['trans_size'] . '</td><td>' . intval($row['en_size'] - $row['trans_size']) . '</td></tr>';
         }
         echo '</table>';
     }
     echo gen_date($DBLANG);
     break;
 case 'filesummary':
     $file_types = array(array(REV_UPTODATE, 'Up to date files'), array(REV_OUTDATED, 'Outdated files'), array(REV_WIP, 'Work in progress'), array(REV_NOREV, 'Files without revision number'), array(REV_NOTRANS, 'Files available for translation'));
     $file_summary_array = array(REV_UPTODATE => array(0, 0), REV_OUTDATED => array(0, 0), REV_NOREV => array(0, 0), REV_NOTRANS => array(0, 0), REV_WIP => array(0, 0));
     $file_summary_array[REV_UPTODATE] = get_stats($dbhandle, $lang, 'uptodate');
     $file_summary_array[REV_OUTDATED] = get_stats($dbhandle, $lang, 'outdated');
     $file_summary_array[REV_NOREV] = get_stats($dbhandle, $lang, 'norev');
     $file_summary_array[REV_NOTRANS] = get_stats($dbhandle, $lang, 'notrans');
     $file_summary_array[REV_WIP] = get_stats($dbhandle, $lang, 'wip');
     echo '<table border="0" cellpadding="4" cellspacing="1" style="text-align:center;">';
     echo '<tr><th>File status type</th><th>Number of files</th><th>Percent of files</th><th>Size of files (kB)</th><th>Percent of size</th></tr>';
     $percent = array(0, 0);
     foreach ($file_summary_array as $t => $a) {
         $percent[0] += $a[0];
         $percent[1] += $a[1];
     }
     foreach ($file_types as $num => $type) {
         $tmp_num_percent_0 = $percent[0] == 0 ? 0 : number_format($file_summary_array[$type[0]][0] * 100 / $percent[0], 2);
         $tmp_num_percent_1 = $percent[0] == 0 ? 0 : number_format($file_summary_array[$type[0]][1] * 100 / $percent[1], 2);
         echo '<tr>';
         echo '<td>' . $type[1] . '</td>';
         echo '<td>' . $file_summary_array[$type[0]][0] . '</td>';
         echo '<td>' . $tmp_num_percent_0 . '%</td>';
         echo '<td>' . $file_summary_array[$type[0]][1] . '</td>';
<?php

$stats = get_stats($_SESSION['id']);
?>
<div class="jumbotron">
	<h2><?php 
echo $_SESSION['usuario'];
?>
</h2>
</div>
        }
        $foo_print = grapher($sql_result, $start_date, $end_date, $type);
        echo $foo_print;
        break;
    case 'access_detail_by_date':
        $db = array('is_empty' => true);
        $start_date = isset($_REQUEST['startDate']) ? $_REQUEST['startDate'] : "";
        $end_date = isset($_REQUEST['endDate']) ? $_REQUEST['endDate'] : "";
        $user_id = isset($_REQUEST['student']) ? $_REQUEST['student'] : "";
        $course_code = isset($_REQUEST['course']) ? $_REQUEST['course'] : "";
        $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : "";
        $sql_result = get_connections_to_course_by_date($user_id, $course_code, $start_date, $end_date);
        if (is_array($sql_result) && count($sql_result) > 0) {
            $db['is_empty'] = false;
            $db['result'] = convert_to_string($sql_result);
            $rst = get_stats($user_id, $course_code, $start_date, $end_date);
            $foo_stats = '<strong>' . get_lang('Total') . ': </strong>' . $rst['total'] . '<br />';
            $foo_stats .= '<strong>' . get_lang('Average') . ': </strong>' . $rst['avg'] . '<br />';
            $foo_stats .= '<strong>' . get_lang('Quantity') . ' : </strong>' . $rst['times'] . '<br />';
            $db['stats'] = $foo_stats;
            $db['graph_result'] = grapher($sql_result, $start_date, $end_date, $type);
        } else {
            $db['result'] = Display::return_message(get_lang('NoDataAvailable'), 'warning');
            $db['graph_result'] = Display::return_message(get_lang('NoDataAvailable'), 'warning');
            $db['stats'] = Display::return_message(get_lang('NoDataAvailable'), 'warning');
        }
        header('Cache-Control: no-cache');
        echo json_encode($db);
        break;
}
exit;
Beispiel #25
0
     $body->set('factions', $factions);
     $body->set('yesno', $yesno);
     $body->set('skilltypes', $skilltypes);
     $body->set('bodytypes', $bodytypes);
     $body->set('races', $races);
     $body->set('classes', $classes);
     $body->set('specialattacks', $specialattacks);
     $body->set('faction_values', $faction_values);
     $body->set('pet', get_ispet());
     $vars = npc_info();
     if ($vars) {
         foreach ($vars as $key => $value) {
             $body->set($key, $value);
         }
     }
     $vars_ = get_stats();
     if ($vars_) {
         foreach ($vars_ as $key => $value) {
             $body->set($key, $value);
         }
     }
     break;
 case 45:
     // Change NPC level
     check_authorization();
     $body = new Template("templates/npc/npc.changelevelver.tmpl.php");
     $body->set('currzone', $z);
     $body->set('currzoneid', $zoneid);
     break;
 case 46:
     // Change NPC level
<?php

include '../include/jpgraph/src/jpgraph.php';
include '../include/jpgraph/src/jpgraph_bar.php';
include '../include/init.inc.php';
include '../include/lib_revcheck.inc.php';
$idx = new SQLite3(SQLITE_DIR . 'rev.php.sqlite');
$language = revcheck_available_languages($idx);
sort($language);
$files_EN = count_en_files($idx);
foreach ($language as $lang) {
    $tmp = get_stats($idx, $lang, 'uptodate');
    $percent_tmp[] = round($tmp[0] * 100 / $files_EN);
    $legend_tmp[] = $lang;
}
$percent = array_values($percent_tmp);
$legend = array_values($legend_tmp);
echo "Generating PHP graphic for all languages...";
generate_image();
echo " Done.\n";
function generate_image()
{
    global $percent, $legend;
    // Create the graph. These two calls are always required
    $graph = new Graph(550, 250);
    $graph->SetScale("textlin");
    $graph->yaxis->scale->SetGrace(20);
    $graph->xaxis->SetLabelmargin(5);
    $graph->xaxis->SetTickLabels($legend);
    $graph->ygrid->SetFill(true, '#EFEFEF@0.5', '#BBCCFF@0.5');
    // Add a drop shadow
Beispiel #27
0
<?php

// calling the header.php
get_header();
?>
 

<!-- generated with index.php -->

	<div id="content">
		<div class="notable">	
		<!-- begin post -->

		<?php 
if (!empty($display_stats)) {
    get_stats(1);
    echo "<br />";
}
if ($posts & empty($display_stats)) {
    while (have_posts()) {
        the_post();
        ?>
   
		
		<div class="entry <?php 
        $cat = get_the_category();
        $cat = $cat[0];
        echo $cat->category_nicename;
        ?>
 notable-post">
			<div id="post-<?php 
Beispiel #28
0
 }
 if ($_GET['verbose']) {
     $verbose = $_GET['verbose'];
 } else {
     $verbose = 0;
 }
 if ($uuser->createip) {
     $sth = db_query("select * from u_users where createip = ? and aid != ?", array($uuser->createip, $uuser->aid));
     $u = $sth->fetch();
     if ($u) {
         echo "<h2>Accounts created from " . $uuser->createip . "</h2>\n";
         print_header();
         do {
             $bgcolor = $count % 2 ? "#F7F7F7" : "#ECECFF";
             $uu = new ForumUser($u['aid'], false);
             print_user($uu, get_stats($uu), $bgcolor);
             $count++;
         } while ($u = $sth->fetch());
         print_footer();
     }
     $sth->closeCursor();
 }
 echo "<h2>IP addresses</h2>\n";
 if ($verbose > 1) {
     $v2 = "class=selected";
 } else {
     if ($verbose > 0) {
         $v1 = "class=selected";
     } else {
         $v0 = "class=selected";
     }
Beispiel #29
0
<?php

require "sqlite.php";
print "<table>\n";
print "<tr><th>date</th><th>peak</th><th>off-peak</th><th>cost</th><th>alt. tar. diff.</th></tr>\n";
for ($i = -30; $i <= 0; $i++) {
    $t = time() + $i * 86400;
    $peak = false;
    if ($a = get_stats($i)) {
        $peak = $a[0];
        $off_peak = $a[1];
    } else {
        if (!open_sqlite($i)) {
            continue;
        }
        $res = @$sq->query('SELECT MIN(tar0),MAX(tar0),MIN(tar1),MAX(tar1) FROM edata');
        if (!$res instanceof Sqlite3Result) {
            close_sqlite();
            continue;
        }
        while ($r = $res->fetchArray(SQLITE3_NUM)) {
            //print(($r[1]-$r[0])*(0.2003+0.4144+0.0115)."\n");
            //print(($r[3]-$r[2])*(0.0691+0.2023+0.0115)."\n");
            $peak = $r[1] - $r[0];
            $off_peak = $r[3] - $r[2];
        }
        $res->finalize();
        close_sqlite();
        save_stats($i, array($peak, $off_peak));
    }
    if ($peak) {