Location: PHPKode > projects > VampMan: V:tR Character Manager > vampman-1.0.2/phpnuke/modules/charactersheet/admin/charactersheet/main.php
<?php
if (!defined('ADMIN_FILE')) {
        die (_accessdenied);
}

function admin_dropdown($query, $selectname)
{
	global $dbi;
	$result = sql_query($query, $dbi);
	$display_block ="<select name=\"$selectname\">";
	while (list($res_id,$res_name) =sql_fetch_row($result,$dbi)) {

		$display_block .= "<option value=\"$res_id\">$res_name</option>\n";
	}

	$display_block .= "</select>";
	return $display_block;
}


$charformend = 
 "<input type=\"hidden\" name = \"op\" value=\"character_viewcharacter\">"
."<input type=\"hidden\" name = \"firstload\" value=\"1\">"
. "<input type=\"submit\" name=\"submit\" value=\""._edit."\" > "
. "<input type=\"submit\" name=\"submit\" value=\""._view."\" > "
. "</form >";




$query = "select id from ".$prefix."_character_xp where status = 'pending'";
$result = sql_query($query, $dbi) or die(_notresource);
$num = sql_num_rows($result);
if($num > 1)
	echo "<a href=\"admin.php?op=character_xprequest\"><b>$num "._PendingXPRequests."</b></a><br><br>";
elseif($num == 1)
	echo "<a href=\"admin.php?op=character_xprequest\"><b>"._PendingXPRequest."</b></a><br><br>";
else
	echo "<a href=\"admin.php?op=character_xprequest&mode2=all\">"._AllXPRequest."</a><br><br>";

$query = "select id from ".$prefix."_character_xpspend where status = 'pending'";
$result = sql_query($query, $dbi) or die(_notresource);
$num = sql_num_rows($result);
if($num > 1)
	echo "<a href=\"admin.php?op=character_xpspend\"><b>$num "._PendingXPSRequests."</b></a><br><br>";
elseif($num == 1)
	echo "<a href=\"admin.php?op=character_xpspend\"><b>"._PendingXPSRequest."</b></a><br><br>";
else
	echo "<a href=\"admin.php?op=character_xpspend&mode2=all\">"._AllXPSRequest."</a><br><br>";




$queryusers = "select distinct(b.userid), a.username from ".$prefix."_users a, ".$prefix."_character_characters b where a.user_id = b.userid and b.skip = 0 order by a.username";

echo "<table width=100%><tr><td>";
echo "<form action=\"admin.php\" method=\"post\">";

echo _byuser.": ";
echo admin_dropdown($queryusers,"charuserid");

echo "<input type=\"hidden\" name = \"op\" value=\"character_viewuser\">";
echo "<input type=\"submit\" value=\""._go."\" > ";
echo "</form ></td>";



$querychars = "SELECT charid,charname FROM ".$prefix."_character_characters where skip != '1' order by charname asc";
echo "<td><form action=\"admin.php\" method=\"post\">";
echo _bychar.": ";
echo admin_dropdown($querychars,"charid");



echo $charformend."</td></tr><tr width=100%>";

$querychars = "SELECT charid,charname FROM ".$prefix."_character_characters where active=1 order by charname asc";

echo "<td><form action=\"admin.php\" method=\"post\">";
echo _activechar.": ";
echo admin_dropdown($querychars,"charid");
echo $charformend. "</td>";
$querychars = "SELECT charid,charname FROM ".$prefix."_character_characters where skip != '1' and active=0 order by charname asc";

echo "<td><form action=\"admin.php\" method=\"post\">";
echo _inactivechar.": ";
echo admin_dropdown($querychars,"charid");

echo $charformend."</td></tr>";

$querychars = "SELECT charid,charname FROM ".$prefix."_character_characters where skip = '1' order by charname asc";

echo "<tr><td><form action=\"admin.php\" method=\"post\">";
echo _skippedchar.": ";
echo admin_dropdown($querychars,"charid");
echo $charformend."</td></tr></table>";



?>
Return current item: VampMan: V:tR Character Manager