/>
Submit Lookup "; // Do stuff
//////////////////////////////////
// LOOKUP member by email or ID number
// Get row load and display data
//
echo "email= ".$femail;
$stmt = $conn->prepare("SELECT * FROM $tablename WHERE supp_email=?");
$stmt->execute([$femail]);
$user = $stmt->fetch();
echo " ID ".$user[0];
$suppID = $user[0];
echo $suppID;
$suppStatus=$user[1];
echo $suppStatus;
$suppEmail = $user[2];
$suppFname= $user[3];
$suppMname = $user[4];
$suppLname = $user[5];
$suppSuffix = $user[6];
$suppAddr = $user[7];
$suppCity = $user[8];
$suppState = $user[9];
$suppZIP = $user[10];
$suppInstructio = $user[11];
$suppComment = $user[12];
$suppDcreate = $user[13];
$suppDverify = $user[14];
$suppDpaid = $user[15];
$suppPMT = $user[16];
$suppDremind = $user[17];
$suppDinact = $user[18];
$ffname="eddd";
echo " suppFname=".$suppFname;
// $supp = $user[];
// LoadElements();
?>
">
ID num:
Status: 1 char
First Name:
Mid Name:
Last Name:
Suffix:
Addr:
City:
State:
ZIP:
Instructor: Yes
Comment:
*/
?>
User0= ".$user[0];
echo " User1= ".$user[1];
echo " User2= ".$user[2];
echo " User3= ".$user[3];
echo " User4= ".$user[4];
echo " User5= ".$user[5];
echo " User6= ".$user[6];
echo " User7= ".$user[7];
echo " User8= ".$user[8];
echo " User9= ".$user[9];
*/
echo " End Submit Lookup "; // Do stuff
}
else if( $_POST['SubmitUpdate'] ) {
echo " SubmitUpdate "; // Do stuff
/*
if (empty($_POST["fname"])) {
$fnameErr = "First Name is required";
} else {
$fname = test_input($_POST["fname"]);
// check if name only contains letters and whitespace
if (!preg_match("/^[a-zA-Z-' ]*$/",$fname)) {
$fnameErr = "Only letters and white space allowed";
}
}
if (empty($_POST["lname"])) {
$lnameErr = "Last Name is required";
} else {
$lname = test_input($_POST["lname"]);
// check if name only contains letters and whitespace
// if (!preg_match("/^[a-zA-Z-' ]*$/",$lname)) {
// $lnameErr = "Only letters and white space allowed";
// }
}
if (empty($_POST["mailaddr"])) {
$mailaddrErr = "Mailing Address is required";
} else {
$mailaddr = test_input($_POST["mailaddr"]);
// check if name only contains letters and whitespace
// if (!preg_match("/^[a-zA-Z]{1,10}$/",$name)) {
// $nameErr = "Only alphanumeric and white space allowed";
}
if (empty($_POST["city"])) {
$cityErr = "City is required";
} else {
$city = test_input($_POST["city"]);
// check if city only contains alphanumeric and whitespace
// if (!preg_match("/^[a-zA-Z-' ]*$/",$city)) {
// $cityErr = "Only letters and white space allowed";
}
if (empty($_POST["state"])) {
$stateErr = "State is required";
} else {
$state = test_input($_POST["state"]);
// check if state only contains alphanureic and whitespace
// if (!preg_match("/^[a-zA-Z-' ]{1,10}$/",$state)) {
// $stateErr = "Only letters and white space allowed";
}
if (empty($_POST["inst"]))
{
$inst = "0";
} else
{
$inst = "1";
}
// $inst = test_input($_POST["inst"]);
if (empty($_POST["ZIP"]))
{
$ZIPErr = "ZIP is required";
} else
{
$ZIP = test_input($_POST["ZIP"]);
}
if (empty($_POST["comment"])) {
$commentErr = "Comment is required";
} else {
$comment = test_input($_POST["comment"]);
}
*/
echo " End SubmitUpdates "; // Do stuff
} //END SubmitUpdate ENTRIES
?>
query("SELECT count(*) FROM $tablename")->fetchColumn();$text = "Select";
echo " row count= ".$count." ";
if(count < 1)
break; // out of while()
// see if email address is already used
$stmt = $conn->prepare("SELECT * FROM $tablename WHERE supp_email=?");
$stmt->execute([$email]);
$user = $stmt->fetch();
if ($user)
{
echo "user=".$user." "; // email found
}
else
{
echo "no email "; // or not
echo "user=".$user." "; // email found
}
}
*/
function test_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
function checksum($data)
{
return "ABCD";
}
////////////////////////////////
// PDO
//
function OpenSupporterDatabase()
{
try
{
global $servername;
global $username;
global $password;
global $dbname;
global $tablename;
global $conn;
if ($conn != NULL)
$conn = NULL;
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// see how many rows of data are in the table
$count = $conn->query("SELECT count(*) FROM $tablename")->fetchColumn();$text = "Select";
echo "