Example #1
0
$mysqldb->query("SELECT COUNT(*) as commentn FROM articles WHERE Approved = 'N' AND ParentID>0");
$row = $mysqldb->fetchObject();
$pendingcomments = $row->commentn;
$mysqldb->query("SELECT count(*) as qy from articles WHERE Approved = 'Q'");
$row = $mysqldb->fetchObject();
$pendingquestions = $row->qy;
$mysqldb->query("SELECT count(*) as qn from articles WHERE Approved = 'A'");
$row = $mysqldb->fetchObject();
$respondedquestions = $row->qn;
$totalarticles = $pendingarticles + $approvedarticles;
$totalcomments = $approvedcomments + $pendingcomments;
$totalquestions = $respondedquestions + $pendingquestions;
// if all is good, we've got our count variables
$mysqlstat = explode('  ', mysql_stat());
$rwxcheck = permcheck();
head_page($page_title);
menu_options($title, $vnum, $viewop, $pid, $keys, $adfl);
contentinit($title);
echo <<<_EOF
<font color="red">{$rwxcheck}</font>
<br />
<table>
<tr>
<td><a href="pending.php?acq=a">Pending Articles</a></td><td><a href="a_pendinga.php">{$pendingarticles}</a></td>
</tr>
<tr>
<td>Approved Articles</td><td>{$approvedarticles}</td>
</tr>
<tr>
<td>Total Articles</td><td>{$totalarticles}</td>
</tr>
Example #2
0
<?php

//authors.php
$title = 'Author Page';
$vnum = '';
$viewop = '';
$pid = '';
$keys = '';
$adfl = '';
include 'config/config.php';
include 'functions.php';
head_page($title);
menu_options($title, $vnum, $viewop, $pid, $keys, $adfl);
contentinit($title);
echo 'Welcome';
if (isset($_SESSION['first_name'])) {
    echo ", {$_SESSION['first_name']}!";
    if (isset($_SESSION['user_id'])) {
        $aid = $_SESSION['user_id'];
    }
    $authorsql = "SELECT AuthorID FROM authors WHERE AuthorID = '{$aid}'";
    $result = mysql_query($authorsql);
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $authorid = "{$row['AuthorID']}";
    }
    include 'aal.php';
} else {
    echo <<<_EOF
 Guest<br />
<p>Feel free to create a guest <a href="./saa.php">article</a>, or <a href="login.php">Login<a/>.</p>
_EOF;
<?php

// View Registered Users
//includes
include './config/config.php';
include 'functions.php';
include "./classes/mysql.class.php";
//starting database
$mysqldb = new mysql();
$mysqldb->connect();
$mysqldb->select();
//variables
$adfl = TRUE;
$pagetitle = 'View Registered Users';
head_page($pagetitle);
menu_options($pagetitle, $vnum, $viewop, $pid, $keys, $adfl);
contentinit($pagetitle);
// Number of Records to show per page:
$display = DB_MAX_REC;
// Determine where in the db results to start returning results
if (isset($_GET['s'])) {
    // Already determined
    $start = mifi($_GET['s']);
} else {
    $start = 0;
}
$query = "SELECT CONCAT(au.LastName, ', ', au.FirstName) AS name, au.AuthorID, DATE_FORMAT(RegistrationDate, '%M %d, %Y') AS dr,(SELECT COUNT(*) FROM articles AS a WHERE a.AuthorID=au.AuthorID AND a.Approved='N' AND a.ParentID='0') AS pending, (SELECT COUNT(*) FROM articles AS a WHERE a.AuthorID=au.AuthorID AND a.Approved='S' AND a.ParentID='0') AS saved, (SELECT COUNT(*) FROM articles AS a WHERE a.AuthorID=au.AuthorID AND a.Approved='Y' AND a.ParentID='0') AS approved, (SELECT COUNT(*) FROM articles AS a WHERE a.AuthorID=au.AuthorID AND  a.ParentID='0') AS total FROM authors AS au";
$viewquery = $query . " LIMIT {$start}, {$display}";
// That's the end of our query making.
$mysqldb->query($query);
$num_records = $mysqldb->numRows($query);