コード例 #1
0
ファイル: bandwidth.php プロジェクト: shadow7412/azaka
<?php

include_once "../include/bandwidth.php";
include_once "../include/userobject.php";
$stats = new Bandwidth();
$u = new UserObject();
header("content-type: text/xml");
echo "<?xml version=\"1.0\" ?>";
if ($u->canAccess(1)) {
    echo "<bandwidth>\r\n\t<liveupload>{$stats->upload}</liveupload>\r\n\t<livedownload>{$stats->download}</livedownload>\r\n</bandwidth>";
} else {
    echo "<bandwidth>\r\n\t<liveupload>Unauthorised</liveupload>\r\n\t<livedownload>User</livedownload>\r\n</bandwidth>";
}
コード例 #2
0
ファイル: links.php プロジェクト: shadow7412/azaka
<?php

include_once "../include/userobject.php";
include_once "../include/linklist.php";
$u = new UserObject();
$u->db->qry("SELECT * FROM links");
header("content-type: text/xml");
echo "<links>";
while ($link = $u->db->fetchLast()) {
    if ($u->canAccess($link['reqaccess']) || $link['billoverride'] && $u->billable) {
        echo "\n\t<link><label>{$link['label']}</label><url>{$link['url']}</url></link>";
    }
}
echo "\n</links>";
コード例 #3
0
ファイル: internet.php プロジェクト: shadow7412/azaka
<?php

// <SETTINGS>
$netspacefile = '../../xml/netspace.xml';
// Netspace XML file
$updatefile = '../../xml/nslastupdate.dat';
// File with time file was last updated
$countuploads = true;
//true or false. Use true if your plan counts uploads, false if not
// </SETTINGS>
include_once "../include/userobject.php";
$u = new UserObject();
header("content-type: text/xml");
echo "<?xml version=\"1.0\" ?>";
if (file_exists($netspacefile) & $u->canAccess(1)) {
    $xml = simplexml_load_file($netspacefile);
    //Open (local) NetSpace XML
    $startdate = strtotime($xml["START_DATE"]);
    //startdate in seconds
    $enddate = strtotime($xml["END_DATE"]);
    //enddate in seconds
    if ($xml->PLAN->LIMIT[0]["NAME"] == "Peak") {
        $ontotal = $xml->PLAN->LIMIT[0]["MEGABYTES"] / 1000;
        //peak total
        $offtotal = $xml->PLAN->LIMIT[1]["MEGABYTES"] / 1000;
        //offpeak total
    } else {
        if ($xml->PLAN->LIMIT[0]["NAME"] == "Off Peak") {
            $offtotal = $xml->PLAN->LIMIT[0]["MEGABYTES"] / 1000;
            //offpeak total
            $ontotal = $xml->PLAN->LIMIT[1]["MEGABYTES"] / 1000;
コード例 #4
0
ファイル: shoutbox.php プロジェクト: shadow7412/azaka
<?php

include_once "../include/page.php";
include_once "../include/userobject.php";
$p = new Page("shoutbox", 0);
$u = new UserObject();
$p->addJs("\$(\"#accordion\").accordion({autoHeight:false, navigation:true})");
if (isset($_GET['message'])) {
    $p->db->qry("INSERT INTO shoutbox VALUES(default," . $u->id . ",default,\"" . $_GET['message'] . "\")");
}
if (isset($_GET['shout_id'])) {
    $p->db->qry("SELECT shoutbox.uid as idNumber FROM shoutbox WHERE id =" . $_GET['shout_id']);
    while ($number = $p->db->fetchLast()) {
        if ($u->id == $number['idNumber'] || $u->canAccess(2)) {
            $p->db->qry("DELETE FROM shoutbox WHERE id =" . $_GET['shout_id']);
        }
    }
}
$p->db->qry("SELECT shoutbox.id as shout_id, shoutbox.uid as idNumber, users.username as username, shoutbox.time as time, shoutbox.message as message FROM users,shoutbox WHERE shoutbox.uid = users.id ORDER BY time DESC");
echo "<div id=\"accordion\">";
while ($row = $p->db->fetchLast()) {
    echo "<h3><a>" . $row['username'] . " " . $row['time'] . "</a></h3>\n             <div>" . $row['message'];
    if ($u->id == $row['idNumber'] || $u->canAccess(2)) {
        echo "<div style=\"float: right; margin-right:4%;\"><input type=\"button\" onClick=\"grabContent('shoutbox', 'shout_id=" . $row['shout_id'] . "')\" class=\"ui-button ui-widget ui-state-default ui-corner-all\" value=\"Delete\"/></div>";
    }
    echo "</div>";
}
echo "</div>";
コード例 #5
0
ファイル: bills.php プロジェクト: shadow7412/azaka
<?php

include_once "../include/userobject.php";
$u = new UserObject();
$db = $u->db;
header("content-type: text/xml");
echo "<?xml version=\"1.0\" ?>";
if ($u->canAccess(1) && $u->billable) {
    echo "<bills>\r\n\t<owing>\n";
    $db->qry("SELECT username, SUM(amount) AS amount FROM users, `bills` WHERE uid = users.id AND `paid` = 0 AND `confirmed` = 0 GROUP BY username ORDER BY `uid` ASC");
    while ($row = $db->fetchLast()) {
        echo "\t\t<entry username = \"{$row['username']}\" amount = \"\${$row['amount']}\"/>\n";
    }
    echo "\t</owing>\r\n\t<unconfirmed>\n";
    $db->qry("SELECT username, SUM(amount) AS amount FROM users, `bills` WHERE uid = users.id AND `paid` = 1 AND `confirmed` = 0 GROUP BY username ORDER BY `uid` ASC");
    while ($row = $db->fetchLast()) {
        echo "\t\t<entry username = \"{$row['username']}\" amount = \"\${$row['amount']}\"/>\n";
    }
    echo "\t</unconfirmed>\r\n</bills>";
} else {
    echo "<bills><owing></owing><unconfirmed></unconfirmed></bills>";
}