mirror of
https://git.code.sf.net/p/quake/website
synced 2025-02-26 05:31:04 +00:00
let's see.... deleting members... adding members adds to plan
also, and see_plans doesn't show blank plans
This commit is contained in:
parent
1de3172fc8
commit
54fc733d67
3 changed files with 218 additions and 149 deletions
|
@ -20,14 +20,27 @@
|
||||||
|
|
||||||
$conn = mysql_connect (sqlHost, sqlUser, sqlPass);
|
$conn = mysql_connect (sqlHost, sqlUser, sqlPass);
|
||||||
if ($conn) {
|
if ($conn) {
|
||||||
$query = 'INSERT into members (u_username, u_fullname, u_email, u_password, u_addr1, u_phone, u_addr2, u_country, u_admin) VALUES (' .
|
$query1 = 'INSERT into members (u_username, u_fullname, u_email, u_password, u_addr1, u_phone, u_addr2, u_country, u_admin) VALUES (' .
|
||||||
" '$u_username', '$u_fullname', '$u_email', ENCRYPT('$u_password', '$u_username'), '$u_addr1', '$u_phone', '$u_addr2', '$u_country', '$u_admin')";
|
" '$u_username', '$u_fullname', '$u_email', ENCRYPT('$u_password', '$u_username'), '$u_addr1', '$u_phone', '$u_addr2', '$u_country', '$u_admin')";
|
||||||
|
|
||||||
$result = mysql_db_query (sqlDB, $query, $conn);
|
$result = mysql_db_query (sqlDB, $query1, $conn);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$numRows = mysql_affected_rows ($conn);
|
$numRows = mysql_affected_rows ($conn);
|
||||||
if ($numRows) {
|
if ($numRows) {
|
||||||
echo '<P>Your request has been processed successfully.';
|
echo '<P>User added to members dbase successfully.';
|
||||||
|
} else {
|
||||||
|
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
|
||||||
|
}
|
||||||
|
$query2 = 'INSERT into devel_plans (p_user, p_date, p_plan) VALUES (' .
|
||||||
|
"'$u_username', NOW(), 'None')";
|
||||||
|
$result = mysql_db_query (sqlDB, $query2, $conn);
|
||||||
|
if ($result) {
|
||||||
|
$numRows = mysql_affected_rows ($conn);
|
||||||
|
if ($numRows) {
|
||||||
|
echo '<P>User added to plan dbase successfully.';
|
||||||
} else {
|
} else {
|
||||||
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
|
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
|
||||||
}
|
}
|
||||||
|
|
56
members/deluser.php
Normal file
56
members/deluser.php
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
<? // Preamble
|
||||||
|
$pageName = "Admin - Delete User";
|
||||||
|
$focused = "home"; // Dock icon name to gets a border
|
||||||
|
$need = 'auth';
|
||||||
|
require("../parts/preamble.php"); // Load most of document
|
||||||
|
?>
|
||||||
|
<?
|
||||||
|
if ($u_username) {
|
||||||
|
need('sql');
|
||||||
|
|
||||||
|
$u_username = AddSlashes($u_username);
|
||||||
|
|
||||||
|
$conn = mysql_connect (sqlHost, sqlUser, sqlPass);
|
||||||
|
if ($conn) {
|
||||||
|
$query = "DELETE FROM members WHERE u_username = '$u_username'";
|
||||||
|
|
||||||
|
$result = mysql_db_query (sqlDB, $query1, $conn);
|
||||||
|
if ($result) {
|
||||||
|
$numRows = mysql_affected_rows ($conn);
|
||||||
|
if ($numRows) {
|
||||||
|
echo '<P>User removed from members dbase successfully.';
|
||||||
|
} else {
|
||||||
|
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
|
||||||
|
}
|
||||||
|
$query2 = "DELETE FROM devel_plans WHERE p_user = '$p_username'";
|
||||||
|
$result = mysql_db_query (sqlDB, $query2, $conn);
|
||||||
|
if ($result) {
|
||||||
|
$numRows = mysql_affected_rows ($conn);
|
||||||
|
if ($numRows) {
|
||||||
|
echo '<P>User removed from plan dbase successfully.';
|
||||||
|
echo '<P>This webpage will self-destruct in 30 seconds.';
|
||||||
|
} else {
|
||||||
|
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
|
||||||
|
}
|
||||||
|
mysql_close ($conn);
|
||||||
|
} else {
|
||||||
|
echo 'You suck, butthead.';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
?>
|
||||||
|
<FORM action="deluser.php" method="post">
|
||||||
|
<P>Good morning Mr. Phipps, who will we be deleting today?
|
||||||
|
<P>Username: <INPUT type="text" name="u_username" size="12"></INPUT>
|
||||||
|
</FORM>
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?
|
||||||
|
require (siteHome ."/parts/postamble.php"); // Finish this sucker up
|
||||||
|
?>
|
|
@ -4,7 +4,7 @@
|
||||||
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
||||||
if ($conn) {
|
if ($conn) {
|
||||||
$query = 'SELECT p_date, p_user, p_plan FROM devel_plans' .
|
$query = 'SELECT p_date, p_user, p_plan FROM devel_plans' .
|
||||||
' ORDER BY p_date DESC, p_user';
|
"WHERE p_plan <> 'None' ORDER BY p_date DESC, p_user";
|
||||||
$result = @mysql_db_query (sqlDB, $query, $conn);
|
$result = @mysql_db_query (sqlDB, $query, $conn);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$numRows = @mysql_num_rows ($result);
|
$numRows = @mysql_num_rows ($result);
|
||||||
|
|
Loading…
Reference in a new issue