Example #1
0
        echo $row['upload'] . " (" . userdetailslink($row['username'], $row['name']) . " " . $row['email'] . " " . $row['username'] . " " . $row['groupname'] . " " . $row['company'] . " " . $row['address'] . " " . $row['city'] . ")";
    }
    echo "</td>";
    echo "<td>";
    if ($row = mysql_fetch_assoc($up_yesterday)) {
        echo $row['upload'] . " (" . userdetailslink($row['username'], $row['name']) . " " . $row['email'] . " " . $row['username'] . " " . $row['groupname'] . " " . $row['company'] . " " . $row['address'] . " " . $row['city'] . ")";
    }
    echo "</td>";
    echo "<td>";
    if ($row = mysql_fetch_assoc($up_last7days)) {
        echo $row['upload'] . " (" . userdetailslink($row['username'], $row['name']) . " " . $row['email'] . " " . $row['username'] . " " . $row['groupname'] . " " . $row['company'] . " " . $row['address'] . " " . $row['city'] . ")";
    }
    echo "</td>";
    echo "<td>";
    if ($row = mysql_fetch_assoc($up_last30days)) {
        echo $row['upload'] . " (" . userdetailslink($row['username'], $row['name']) . " " . $row['email'] . " " . $row['username'] . " " . $row['groupname'] . " " . $row['company'] . " " . $row['address'] . " " . $row['city'] . ")";
    }
    echo "</td>";
    echo "</tr>";
}
echo "</table>";
mysql_free_result($up_today);
mysql_free_result($up_yesterday);
mysql_free_result($up_last7days);
mysql_free_result($up_last30days);
echo "<hr/><p>Current group settings</p>";
$result = mysql_query('select rr1.groupname, (select value from radgroupcheck r2 where attribute="Lucent-Max-Shared-Users" and r2.groupname = r1.groupname)  "Max Concurrent Users", (select (value/1000000) from radgroupcheck r5 where attribute="CS-Output-Octets-Daily" and r5.groupname = r1.groupname)  "Max Daily Down", (select (value/1000000) from radgroupcheck r6 where attribute="CS-Input-Octets-Daily" and r6.groupname = r1.groupname)  "Max Daily Up", (select (value/1000000) from radgroupcheck r7 where attribute="CS-Output-Octets-Weekly" and r7.groupname = r1.groupname)  "Max Weekly Down", (select (value/1000000) from radgroupcheck r8 where attribute="CS-Input-Octets-Weekly" and r8.groupname = r1.groupname)  "Max Weekly Up", (select value from radgroupcheck r9 where attribute="xian-Output-Megabytes-Daily-Work-Hours" and r9.groupname = r1.groupname)  "Max Business Hours Down", (select value from radgroupcheck r10 where attribute="xian-Input-Megabytes-Daily-Work-Hours" and r10.groupname = r1.groupname)  "Max Business Hours Up", (select value from radgroupreply rr2 where attribute ="Session-Timeout" and rr2.groupname = rr1.groupname) "Session Timeout", (select value from radgroupreply rr3 where attribute ="WISPr-Bandwidth-Max-Up" and rr3.groupname = rr1.groupname) "WISPr-Bandwidth-Max-Up", (select value from radgroupreply rr4 where attribute ="WISPr-Bandwidth-Max-Down" and rr4.groupname = rr1.groupname) "WISPr-Bandwidth-Max-Down" from radgroupreply rr1 left join radgroupcheck r1 on rr1.groupname = r1.groupname group by rr1.groupname;');
echo "<table><tr><th>Group</th><th>Working Hours Up</th><th>Working Hours Down</th><th>Bandwidth Up</th><th>Bandwidth Down</th><th>Session Timeout</th><th>Concurrent Users</th><th>Daily Up</th><th>Daily Down</th><th>Weekly Up</th><th>Weekly Down</th></tr>";
while ($row = mysql_fetch_assoc($result)) {
    echo "<tr>";
    echo "<td>" . $row['groupname'] . "</td>";
Example #2
0
    }
    return $result;
}
function userdetailslink($mac)
{
    return '<a href="http://172.16.1.3/daloradius/mng-edit.php?username='******'">' . $mac . '</a>';
}
echo "<table><tr><th>Username</th><th>Group</th><th>Name</th><th>Email</th><th>Primary device</th><th>Organization</th><th>Computername</th><th>Vendor</th><th>Notes</th><th>Creation date</th></tr>";
function users()
{
    return 'SELECT distinct(radcheck.username) as username,radusergroup.groupname as groupname, userinfo.lastname as name, userinfo.email as email, userinfo.mobilephone as primarydev, userinfo.company as org, userinfo.address as hostname, userinfo.city as vendor, userinfo.notes as notes, userinfo.creationdate as creationdate FROM radcheck LEFT JOIN radusergroup ON radcheck.username=radusergroup.username LEFT JOIN userinfo ON radcheck.username=userinfo.username GROUP by radcheck.Username order by creationdate;';
}
$all_users = query(users());
while ($row = mysql_fetch_assoc($all_users)) {
    echo "<tr>";
    echo '<td>' . userdetailslink($row['username']) . '</a></td>';
    echo '<td>' . $row['groupname'] . '</td>';
    echo '<td>' . $row['name'] . '</td>';
    echo '<td>' . $row['email'] . '</td>';
    echo '<td>' . $row['primarydev'] . '</td>';
    echo '<td>' . $row['org'] . '</td>';
    echo '<td>' . $row['hostname'] . '</td>';
    echo '<td>' . $row['vendor'] . '</td>';
    echo '<td>' . $row['notes'] . '</td>';
    echo '<td>' . $row['creationdate'] . '</td>';
    echo "</tr>";
}
mysql_free_result($all_users);
?>