$result    = array();
    $result[0] = cleanText($b[0][0]);
    $result[1] = cleanText($b[0][1]);
    $result[2] = cleanText($b[0][2]);
    $result[3] = cleanText($b[0][3]);
    return $result;
}

// Input
////////////////////////////////////////////////////////////////////////////////////////////////////
$cat = "styles"; // Default is styles
if (isset($_GET['cat'])) { $cat = strip_tags($_GET['cat']); }

// Now do the actual scraping
////////////////////////////////////////////////////////////////////////////////////////////////////
$counts = getCounts($cat);

// If it's the public count we're doing we need to remove issues count.
$issues_counts = array(0,0,0,0);
if ($cat == "_nonprivate") { $issues_counts = getCounts("issues"); }	

// Output
////////////////////////////////////////////////////////////////////////////////////////////////////
// Order is OPEN, GREEN, SNH, YELLOW
echo ($counts[3]-$issues_counts[3])."\n";
echo ($counts[0]-$issues_counts[0])."\n";
echo ($counts[1]-$issues_counts[1])."\n";
echo ($counts[2]-$issues_counts[2])."\n";
?>
Example #2
0
<?php 
include_once 'public.php';
echo '系统首页', "<hr>";
$id = isset($_GET['id']) ? $_GET['id'] : '';
if (empty($id)) {
    redirect('login.html', 3, 'kong请先登录!');
}
connect();
if ($user = checkStatus($id)) {
    $page = isset($_GET['page']) ? $_GET['page'] : 1;
    //设置每页显示的数量
    $length = 5;
    //获取当前满足条件的记录数有多少
    $counts = getCounts();
    //计算前一页和后一页
    $prev = $page <= 1 ? 1 : $page - 1;
    //前一页
    //求出总页数
    $pages = ceil($counts / $length);
    //下一页
    $next = $page >= $pages ? $pages : $page + 1;
    $students = getStudents($page, $length);
} else {
    redirect('login.html', 3, '您还没有登录或者登录已经失效,请重新登录!');
}
?>
	<div id ="all" style="width:100%;height:100%;float:left">
		<div id="header" style="width:100%;height:20px;float:left">
			<div id="userinfo" style="width:50%;float:left;text-align:right">
				欢迎<?php 
echo $user['u_username'];
Example #3
0
        while ($row = mysql_fetch_assoc($result)) {
            $size_shirt = getNiceSize($row['size_shirt']);
            echo "<tr style='margin:3px 0;'><td>" . $row['fname'] . "</td><td>" . $row['lname'] . "</td><td>" . $size_shirt . "</td></tr>\n";
        }
        echo "</table>";
    } else {
        echo "No size information.";
    }
}
if ($_SESSION['foc'] == true) {
    echo "<h1>Misc. Tools</h1>";
    switch ($_GET['tool']) {
        case 'sizing':
            echo "<h2>Sizing information</h2>";
            echo "<p><b>" . getCounts() . "</b> out of <b>" . getNumLeaders() . "</b> leaders have submitted sizes.</p>";
            echo "<p>Sort by: <a href='misctools.php?tool=sizing&sort=size_shirt'>shirt size</a> <a href='misctools.php?tool=sizing&sort=lname'>last name</a></p>";
            displayAllSizing("size_shirt");
            getCounts();
            break;
        case 'add_sponsor':
            echo "<h2>Add a sponsor</h2>";
            echo "<p>Coming soon!</p>";
            break;
        default:
            echo "<p>Choose one of the tools to the left or below:</p>";
            echo "<p><a href='misctools.php?tool=add_sponsor'>Add a sponsor</a>, <a href='misctools.php?tool=sizing'>View submitted sizing information</a></p>";
    }
} else {
    echo "Please <a href='index.php'>Login</a></p>";
}
include "footer.php";
Example #4
0
function getNumberOfIntervalUsers($f_params, $event)
{
    //NOTE elgg_system_log is not reliable! it can be regularly archived by a widget logrotate which means you have only data from last week, month or year.
    $intervalsql = sqlGetInterval("esl.time_created", $f_params);
    //use last_login to only get logged in users
    $sql = " SELECT count(*) AS count" . $intervalsql . " FROM elgg_users_entity AS eue";
    if ($f_params['startEpoch'] > 0 || $f_params['endEpoch'] > 0 || $f_params['intervalTime'] > 0) {
        $sql .= " INNER JOIN elgg_system_log AS esl";
    }
    $sql .= " WHERE eue.last_login > 0";
    //to count as a user the user must created before $endEpoch and not deleted before $startEpoch
    if ($f_params['endEpoch'] > 0) {
        $sql .= " AND eue.guid=esl.performed_by_guid";
        $sql .= " AND esl.object_class='ElggUser'";
        $sql .= " AND esl.object_type='user'";
        $sql .= " AND esl.event='" . $event . "'";
        $sql .= " AND esl.time_created<=" . $f_params['endEpoch'];
    }
    $sql = sqlExcludeUserGuids($sql, "eue.guid", $f_params);
    $sql = sqlAddMemberOfGroupConstraint($sql, "eue.guid", $f_params);
    $sql = sqlAddGroupBy($sql, "", "intervalnumber", 0, $f_params);
    $sql = sqlAddOrderBy($sql, "", "intervalnumber", 0, $f_params);
    return getCounts($sql, $f_params);
}