Location: PHPKode > projects > ProPHP > ProPHP/content/admin/admin.php
<?php
/*****************************************************************
************* BKWORKS PRO PHP V 0.5 BETA 1 ***********************
******************** BRYAN KOOIENGA ******************************
****************** DECEMBER 20, 2007 *****************************
*****************************************************************/
	
	if(!defined("INDEX")) {
		header("location: ../../?view=home"); # If it's not the index calling the script, then we head to the homepage.
	}
	include('include/functions.php');
	if(is_admin("$username")) { # The user is an admin
?>
<center>
<h3>Admin Panel!</h3>
<b>Current Users</b>
<table width="100%">
    <tr>
        <td>Site URL / Username</td>
        <td>Ad Servs</td>
        <td>Suspend Account<br />
        (X = Suspend, Y = Restore)</td>
        <td>Delete Account</td>
    </tr>
    <?php
        $query = "SELECT * FROM sites"; # Let's see everyone
        $results = mysql_query($query) or die("can't query because " . mysql_error());
        while($working_object = mysql_fetch_object($results)) {
        echo "<tr>
            <td>" . $working_object -> site_url . "</td>
            <td>" . $working_object -> ad_servs . "</td>
            <td><a href=\"?view=admin_suspend&amp;account=" . $working_object -> site_number . "\">";
            if($working_object -> acct_status != 1 && $working_object -> site_url != "admin") { 
                echo "X"; 
            }
            if($working_object -> acct_stats == 1 && $working_object -> site_url != "admin") { 
                echo "Y"; 
            }
            echo "</a></td>
            <td>";
            if($working_object -> site_url != "admin") { echo "<a href=\"?view=admin_delete&amp;account=" . $working_object -> site_number . "\">X</a>"; }
            echo "</td>
        </tr>";
        }
        $query = "SELECT * FROM settings"; # Lets the admin set settings for the software.
        $results = mysql_query($query);
        $results = mysql_fetch_object($results);
    ?>
</table>
<hr />
<form action="?view=admin_settings" method="post">
<b>General Settings</b><br /><br />
Installation URL:<br />
(http://www.yourwebsite.com/ProPHP - without trailing slash)<br />
<input type="text" name="url" value="<?php echo $results -> install_url; ?>" size="55" /><br /><br />
Successful Registration Message:<br />
<input type="text" name="registration_success" value="<?=$results -> reg_success_msg; ?>" size="55" /><br />
Please <a>click here</a> to logon.<br /><br />
<input type="submit" value="Submit Values" />
</form>
<br /><br />
Please report any bugs to <a href="http://forum.bkworksproducts.info/viewforum.php?f=7">the BKWorks Products Bug-Exterminator</a><br />
Make sure to note the version (<?=$version; ?>).
<?php
} else {
	echo '<h3 align="center">ACCESS IS DENIED!</h3>';
}
?>
Return current item: ProPHP