Location: PHPKode > projects > PhpProMembers > phpProMembers3/public_html/admin/waiting_approve.php
<?php 
	$page_account = "admin";
	require_once('include.php'); 
?>
<?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;
}

$colname_Recordset1 = "1";
if (isset($HTTP_GET_VARS['id'])) {
  $colname_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['id'] : addslashes($HTTP_GET_VARS['id']);
}
mysql_select_db($database_dbConnection, $dbConnection);
$query_Recordset1 = sprintf("SELECT * FROM members_waiting_approval WHERE id = %s", $colname_Recordset1);
$Recordset1 = mysql_query($query_Recordset1, $dbConnection) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

$insertSQL = sprintf("INSERT INTO members (first_name, last_name, address1, address2, city, `state`, postal_code, country, telephone_number, e_mail_address, website, user_name, user_password, name_on_card, billing_address1, billing_address2, billing_city, billing_state, billing_postal_code, billing_country) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($row_Recordset1['first_name'], "text"),
                       GetSQLValueString($row_Recordset1['last_name'], "text"),
                       GetSQLValueString($row_Recordset1['address1'], "text"),
                       GetSQLValueString($row_Recordset1['address2'], "text"),
                       GetSQLValueString($row_Recordset1['city'], "text"),
                       GetSQLValueString($row_Recordset1['state'], "text"),
                       GetSQLValueString($row_Recordset1['postal_code'], "text"),
                       GetSQLValueString($row_Recordset1['country'], "text"),
                       GetSQLValueString($row_Recordset1['telephone_number'], "text"),
                       GetSQLValueString($row_Recordset1['e_mail_address'], "text"),
                       GetSQLValueString($row_Recordset1['website'], "text"),
                       GetSQLValueString($row_Recordset1['user_name'], "text"),
                       GetSQLValueString($row_Recordset1['user_password'], "text"),
                       GetSQLValueString($row_Recordset1['name_on_card'], "text"),
                       GetSQLValueString($row_Recordset1['billing_address1'], "text"),
                       GetSQLValueString($row_Recordset1['billing_address2'], "text"),
                       GetSQLValueString($row_Recordset1['billing_city'], "text"),
                       GetSQLValueString($row_Recordset1['billing_state'], "text"),
                       GetSQLValueString($row_Recordset1['billing_postal_code'], "text"),
                       GetSQLValueString($row_Recordset1['billing_country'], "text"));
$Result1 = mysql_query($insertSQL, $dbConnection) or die(mysql_error());

$insertSQL = sprintf("INSERT INTO memberships (user_name, payment_type, package, start_date, paid_until_date, active) VALUES (%s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($row_Recordset1['user_name'], "text"),
                       GetSQLValueString($row_Recordset1['payment_type'], "text"),
                       GetSQLValueString($row_Recordset1['account_type_name'], "text"),
                       GetSQLValueString($row_Recordset1['start_date'], "date"),
                       GetSQLValueString($row_Recordset1['paid_until_date'], "date"),
                       "1");
$Result1 = mysql_query($insertSQL, $dbConnection) or die(mysql_error());

$delete_Recordset1 = sprintf("DELETE FROM members_waiting_approval WHERE id = %s", $colname_Recordset1);
$Recordset1 = mysql_query($delete_Recordset1, $dbConnection) or die(mysql_error());				   
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#CCCCCC">
<div align="center"><font color="#000000" size="2" face="Arial, Helvetica, sans-serif"><strong>Member 
  Has Been Added To The Database!</strong></font></div>
</body>
</html>


Return current item: PhpProMembers