//include("top.php");
switch($mode) {
case"logout":
include("pbhead.php");
$zion_username="";
$zion_password="";
$admin="";
prompt_login();
break;
case "score":
$schead="
";
$scmain="";
include("pbhead.php");
$res=exp_table(); //to recalculate the score
print("HOME | UPDATE PROFILE| SCORING | LOGOUT
");
if ($admin == 0) { print(" | Admin Control"); }
print("
");
$q = mysql_query("select idx from player_bios where userid = '$zion_username'");
$row=mysql_fetch_object($q);
$q2 = mysql_query("select * from crew where p_bio='$row->idx' and ship='$ship_num'");
$scmain.="
";
while($row2 = mysql_fetch_object($q2))
{
$schead .= "ID>$row2->Name
";
$q3 = mysql_query("select * from bonus where char_id = '$row2->ID' order by timestamp DESC LIMIT 20");
$scmain .= "
|
ID>$row2->Name |
Date | Post Title | Points Earned |
";
while($row3 = mysql_fetch_object($q3)) {
$tdate=date("m-d-y ",$row3->timestamp);
$scmain .= "$tdate | $row3->descr | $row3->points |
";
}
}
$scmain.="
";
print("$schead
$scmain");
break;
case "login":
include("pbhead.php");
prompt_login();
break;
case "login_test":
include("pbhead.php");
$q = mysql_query("select * from player_bios where userid = '$userd'");
$x = mysql_numrows($q);
if ($x <1) {print("Sorry, that name is not in our database."); exit;}
$row=mysql_fetch_object($q);
if ($passwd == $row->password) {
$zion_username = $userd;
$zion_password = $passwd;
if ($row->is_admin ==1) { $admin=1; }
//header("Location:pbup.php");
show_login();
}
else { print("Sorry, that was an incorrect password."); exit; }
break;
case "update":
$userfile = stripslashes($userfile);
$photodir = "pbios/";
if($userfile){
$ftype=explode(".",$_FILES['userfile']['name']);
$stock .=$photodir;
$stock .=$ftype[0];
$stock .=".";
$stock .=$ftype[1];
copy("$userfile","$stock") or die("$ftype[1] $stock -Photo Upload
Failed");
}
if ($userfile) {
$q = mysql_query("update player_bios set name = '$name', bio= '$fun',MSN='$msn',AOL='$aim', ICQ='$icq', YIM = '$yim', picture='$stock' where userid = '$zion_username'");
}
else
{
$q = mysql_query("update player_bios set name = '$name', bio= '$fun',MSN='$msn',AOL='$aim', ICQ='$icq', YIM = '$yim' where userid = '$zion_username'");
}
print("update complete");
case "profile":
include("pbhead.php");
if (!$zion_username) { header("location:pbup.php?mode=login");
}
else {//include("pbhead.php");
$q2=mysql_query("select * from player_bios where userid = '$zion_username'");
$row=mysql_fetch_object($q2);
print("Update Player Information
HOME | UPDATE PROFILE| SCORING | LOGOUT