PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'vbu'); // change this depending on your filename
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(
);
// get special data templates from the datastore
$specialtemplates = array(
);
// pre-cache templates used by all actions
$globaltemplates = array(
'orange',
);
// pre-cache templates used by specific actions
$actiontemplates = array(
);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
if (!$vbulletin->userinfo['userid'])
{
print_no_permission();
}
if (!is_member_of($vbulletin->userinfo, 6) AND !is_member_of($vbulletin->userinfo, 7) AND !
is_member_of($vbulletin->userinfo, 11))
{
print_no_permission();
}
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$navbits = array();
$navbits[$parent] = 'إضافة عضو';
$navbits = construct_navbits($navbits);
require_once('Connections/connection.php');
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue =
"")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form2")) {
$updateSQL = sprintf("UPDATE user SET usergroupid=%s, membergroupids=%s, displaygroupid=%s,
username=%s, password=%s, passworddate=%s, email=%s, styleid=%s, parentemail=%s, homepage=%s,
icq=%s, aim=%s, yahoo=%s, msn=%s, skype=%s, showvbcode=%s, showbirthday=%s, usertitle=%s,
customtitle=%s, joindate=%s, daysprune=%s, lastvisit=%s, lastactivity=%s, lastpost=%s,
lastpostid=%s, posts=%s, reputation=%s, reputationlevelid=%s, timezoneoffset=%s, pmpopup=%s,
avatarid=%s, avatarrevision=%s, profilepicrevision=%s, sigpicrevision=%s, options=%s,
birthday=%s, birthday_search=%s, maxposts=%s, startofweek=%s, ipaddress=%s, referrerid=%s,
languageid=%s, emailstamp=%s, threadedmode=%s, autosubscribe=%s, pmtotal=%s, pmunread=%s,
salt=%s, ipoints=%s, infractions=%s, warnings=%s, infractiongroupids=%s, infractiongroupid=%
s, adminoptions=%s, profilevisits=%s, friendcount=%s, friendreqcount=%s, vmunreadcount=%s,
vmmoderatedcount=%s, socgroupinvitecount=%s, socgroupreqcount=%s, pcunreadcount=%s,
pcmoderatedcount=%s, gmmoderatedcount=%s WHERE userid=%s",
GetSQLValueString($_POST['usergroupid'], "int"),
GetSQLValueString($_POST['membergroupids'], "text"),
GetSQLValueString($_POST['displaygroupid'], "int"),
GetSQLValueString($_POST['username'], "text"),
GetSQLValueString($_POST['password'], "text"),
GetSQLValueString($_POST['passworddate'], "date"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['styleid'], "int"),
GetSQLValueString($_POST['parentemail'], "text"),
GetSQLValueString($_POST['homepage'], "text"),
GetSQLValueString($_POST['icq'], "text"),
GetSQLValueString($_POST['aim'], "text"),
GetSQLValueString($_POST['yahoo'], "text"),
GetSQLValueString($_POST['msn'], "text"),
GetSQLValueString($_POST['skype'], "text"),
GetSQLValueString($_POST['showvbcode'], "int"),
GetSQLValueString($_POST['showbirthday'], "int"),
GetSQLValueString($_POST['usertitle'], "text"),
GetSQLValueString($_POST['customtitle'], "int"),
GetSQLValueString($_POST['joindate'], "int"),
GetSQLValueString($_POST['daysprune'], "int"),
GetSQLValueString($_POST['lastvisit'], "int"),
GetSQLValueString($_POST['lastactivity'], "int"),
GetSQLValueString($_POST['lastpost'], "int"),
GetSQLValueString($_POST['lastpostid'], "int"),
GetSQLValueString($_POST['posts'], "int"),
GetSQLValueString($_POST['reputation'], "int"),
GetSQLValueString($_POST['reputationlevelid'], "int"),
GetSQLValueString($_POST['timezoneoffset'], "text"),
GetSQLValueString($_POST['pmpopup'], "int"),
GetSQLValueString($_POST['avatarid'], "int"),
GetSQLValueString($_POST['avatarrevision'], "int"),
GetSQLValueString($_POST['profilepicrevision'], "int"),
GetSQLValueString($_POST['sigpicrevision'], "int"),
GetSQLValueString($_POST['options'], "int"),
GetSQLValueString($_POST['birthday'], "text"),
GetSQLValueString($_POST['birthday_search'], "date"),
GetSQLValueString($_POST['maxposts'], "int"),
GetSQLValueString($_POST['startofweek'], "int"),
GetSQLValueString($_POST['ipaddress'], "text"),
GetSQLValueString($_POST['referrerid'], "int"),
GetSQLValueString($_POST['languageid'], "int"),
GetSQLValueString($_POST['emailstamp'], "int"),
GetSQLValueString($_POST['threadedmode'], "int"),
GetSQLValueString($_POST['autosubscribe'], "int"),
GetSQLValueString($_POST['pmtotal'], "int"),
GetSQLValueString($_POST['pmunread'], "int"),
GetSQLValueString($_POST['salt'], "text"),
GetSQLValueString($_POST['ipoints'], "int"),
GetSQLValueString($_POST['infractions'], "int"),
GetSQLValueString($_POST['warnings'], "int"),
GetSQLValueString($_POST['infractiongroupids'], "text"),
GetSQLValueString($_POST['infractiongroupid'], "int"),
GetSQLValueString($_POST['adminoptions'], "int"),
GetSQLValueString($_POST['profilevisits'], "int"),
GetSQLValueString($_POST['friendcount'], "int"),
GetSQLValueString($_POST['friendreqcount'], "int"),
GetSQLValueString($_POST['vmunreadcount'], "int"),
GetSQLValueString($_POST['vmmoderatedcount'], "int"),
GetSQLValueString($_POST['socgroupinvitecount'], "int"),
GetSQLValueString($_POST['socgroupreqcount'], "int"),
GetSQLValueString($_POST['pcunreadcount'], "int"),
GetSQLValueString($_POST['pcmoderatedcount'], "int"),
GetSQLValueString($_POST['gmmoderatedcount'], "int"),
GetSQLValueString($_POST['userid'], "int"));
mysql_select_db($database_connection, $connection);
$Result1 = mysql_query($updateSQL, $connection) or die(mysql_error());
$updateGoTo = "vbu2.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE user SET usergroupid=%s WHERE userid=%s",
GetSQLValueString($_POST['usergroupid'], "int"),
GetSQLValueString($_POST['userid'], "int"));
mysql_select_db($database_connection, $connection);
$Result1 = mysql_query($updateSQL, $connection) or die(mysql_error());
}
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_connection, $connection);
$query_Recordset1 = "SELECT * FROM `user` where usergroupid = 4";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1,
$maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $connection) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<body>
<?php if ($totalRows_Recordset1 == 0) { // Show if recordset empty ?>
<p align="center"><strong>لايوجد
أعضاء في قائمة
الإنتظار </strong></p>
<?php } // Show if recordset empty ?>
<?php if ($totalRows_Recordset1 > 0) { // Show if recordset not empty ?>
<p></p>
<form method="post" name="form2" action="<?php echo $editFormAction; ?>">
<input type="hidden" name="MM_update" value="form2">
<input type="hidden" name="userid" value="<?php echo $row_Recordset1['userid']; ?>">
<table border="1">
<tr>
<td>userid</td>
<td>usergroupid</td>
<td>username</td>
<td>email</td>
<td>parentemail</td>
<td>homepage</td>
<td>skype</td>
<td>usertitle</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['userid']; ?></td>
<td><label>
<select name="usergroupid">
<option value="4" <?php if (!(strcmp(4, $row_Recordset1['usergroupid']))) {echo
"SELECTED";} ?>>في الإنتظار</option>
<option value="2" <?php if (!(strcmp(2, $row_Recordset1['usergroupid']))) {echo
"SELECTED";} ?>>تسجيل العضو</option>
</select>
</label></td>
<td><?php echo $row_Recordset1['username']; ?></td>
<td><?php echo $row_Recordset1['email']; ?></td>
<td><?php echo $row_Recordset1['parentemail']; ?></td>
<td><?php echo $row_Recordset1['homepage']; ?></td>
<td><?php echo $row_Recordset1['skype']; ?></td>
<td><?php echo $row_Recordset1['usertitle']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<input name="submit" type="submit" value="OK do it" />
</form>
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<p class="style1">programming by Sndan</p>
</form>
<?php } // Show if recordset not empty ?></body>
</html>
<?php
mysql_free_result($Recordset1);
?>
this is my phpcode... the file