edit-CbraedtlOLD

Use this form to update your profile which is shown on the Who Is Here Page

This is a 2 step form – first indicate which row you want to change by clicking YES in Column 3
Secondly, input your new information in column 4, or use the drag down boxes to select the value
[insert_php]
if (isset($_SESSION)) {
session_destroy();
}
$servername = ‘localhost’;
$username = ‘i3141100_wp3’;
$password = ‘j*^dRponS;UE’;
//$dbname = localhost;
$dbname = ‘i3141100_wp3’;
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error)
{
die(“Connection failed: ” . $conn->connect_error);
}
else
{
global $wpdb;
global $current_user;
global $wp;
session_start();
$resultsA = $wpdb->get_results (“SELECT fname, lname, lastyr, attendas, currstat, cphone,
othername, fbook, twitt, instag
FROM cbraepeople WHERE emailadd = ‘$current_user->user_email’ “,ARRAY_A);

$res1=FALSE;
$res2=FALSE;
$res3=FALSE;
$res4=FALSE;
$res5=FALSE;
$res6=FALSE;
$res7=FALSE;
$res8=FALSE;
$res9=FALSE;
$res10=FALSE;

//var_dump($resultsA);
// foreach($resultsA as $item) {
// echo $item[‘fname’];
// echo $item[‘lname’];}

foreach ($resultsA as $item)
{
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

echo “

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

echo “

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
//closes the foreach
}
//closes the else
}

[/insert_php]

Description Current Value Change it? Enter the value to change it to
“;
echo “First Name”;
echo “
“;
echo “$item[fname]”;
// $dbfname = $item[fname];
echo “
“;
echo ‘ ‘;
echo “
“;
echo ““;
echo “
“;
echo “Last Name”;
echo “
“;
echo “$item[lname]”;
echo “
“;
echo ‘ ‘;
echo “
“;
echo ““;
echo “
“;
echo “Last Year Attended”;
echo “
“;
echo “$item[lastyr]”;
echo “
“;
echo ‘ ‘;
echo “
“;
echo ““;
echo “
“;
echo “Attended As”;
echo “
“;
echo “$item[attendas]”;
echo “
“;
echo ‘ ‘;
echo “
“;
echo ““;

// echo ““;
echo “

“;
echo “Your Current Status”;
echo “
“;
echo “$item[currstat]”;
echo “
“;
echo ‘ ‘;
echo “
“;
echo ““;

//echo ““;
echo “

“;
echo “Your Cell Phone # – This is NOT DISCLOSED – Used by Site Manager for e.ticket only”;

echo “

“;
echo “$item[cphone]”;
echo “
“;
echo ‘ ‘;
echo “
“;
echo ““;
echo “
“;
echo “Other Name or Handles on Social Media”;
echo “
“;
echo “$item[othername]”;
echo “
“;
echo ‘ ‘;
echo “
“;
echo ““;
echo “
“;
echo “Are You On Facebook?”;
echo “
“;
echo “$item[fbook]”;
echo “
“;
echo ‘ ‘;
echo “
“;
echo ” “;

echo “

“;
echo “Are You On Twitter?”;
echo “
“;
echo “$item[twitt]”;
echo “
“;
echo ‘ ‘;
echo “
“;
echo ” “;
echo “
“;
echo “Are You On Instagram?”;
echo “
“;
echo “$item[instag]”;
echo “
“;
echo ‘ ‘;
echo “
“;
echo ” “;
echo “



[insert_php]
if(isset($_POST[‘posting’]))
{
// get the posting variables
$fname = $_POST[‘fname_update’];
$lname = $_POST[‘lname_update’];
$lastyr = $_POST[‘lastyr_update’];
$attendas = $_POST[‘attendas_update’];
$currstat = $_POST[‘currstat_update’];
$cphone = $_POST[‘cphone_update’];
$othername = $_POST[‘othername_update’];
$fbook = $_POST[‘fbook_update’];
$twitt = $_POST[‘twitt_update’];
$instag = $_POST[‘instag_update’];
$check1 = $_POST[‘check1’];
$check2 = $_POST[‘check2’];
$_SESSION[‘$check3’] = $_POST[‘check3’];
//$check3 = $_POST[‘check3’];
//$check4 = $_POST[‘check4’];
$_SESSION[‘$check4’] = $_POST[‘check4’];
$check5 = $_POST[‘check5’];
$check6 = $_POST[‘check6’];
$check7 = $_POST[‘check7’];
$check8 = $_POST[‘check8’];
$check9 = $_POST[‘check9’];
$check10 = $_POST[‘check10’];

//multiple conditional ifs
if ((!empty($fname)) && ($check1 = “YES”) && ($fname <> $item[fname]))
{
$results1 = $wpdb->get_results (“Update cbraepeople
set fname = ‘$fname’
where emailadd = ‘$current_user->user_email’ “);
$res1 = TRUE;
}
if ((!empty($lname)) && ($check2 = “YES”) && ($lname <> $item[lname]))
{
$results2 = $wpdb->get_results (“Update cbraepeople
set lname = ‘$lname’
where emailadd = ‘$current_user->user_email’ “);
$res2 = TRUE;
}
if ((!empty($lastyr)) && ($_SESSION[‘$check3’]= “YES”) && ($lastyr <> $item[lastyr]))
{
$results3 = $wpdb->get_results (“Update cbraepeople
set lastyr = ‘$lastyr’
where emailadd = ‘$current_user->user_email’ “);
$_SESSION[‘$res3’] = TRUE;
// $res3 = TRUE;
}
if ((!empty($attendas)) && ($_SESSION[‘$check4’] = “YES”) && ($attendas <> $item[attendas]))
{
$results4 = $wpdb->get_results (“Update cbraepeople
set attendas = ‘$attendas’
where emailadd = ‘$current_user->user_email’ “);
$_SESSION[‘$res4’] = TRUE;
$res4 = TRUE;
}
if ((!empty($currstat)) && ($check5 = “YES”) && ($currstat <> $item[currstat]))
{
$results5 = $wpdb->get_results (“Update cbraepeople
set currstat = ‘$currstat’
where emailadd = ‘$current_user->user_email’ “);
$res5 = TRUE;
}
if ( ($check6 = “YES”) && ($cphone <> $item[cphone]))
{
$results6 = $wpdb->get_results (“Update cbraepeople
set cphone = ‘$cphone’
where emailadd = ‘$current_user->user_email’ “);
$res6 = TRUE;
}
if ( ($check7 = “YES”) && ($othername <> $item[othername]))
{
$results7 = $wpdb->get_results (“Update cbraepeople
set othername = ‘$othername’
where emailadd = ‘$current_user->user_email’ “);
$res7 = TRUE;
}
if ((!empty($fbook)) && ($check8 = “YES”) && ($fbook <> $item[fbook]))
{
$results8 = $wpdb->get_results (“Update cbraepeople
set fbook = ‘$fbook’
where emailadd = ‘$current_user->user_email’ “);
$res8 = TRUE;
}
if ((!empty($twitt)) && ($check9 = “YES”) && ($twitt <> $item[twitt]))
{
$results9 = $wpdb->get_results (“Update cbraepeople
set twitt = ‘$twitt’
where emailadd = ‘$current_user->user_email’ “);
$res9 = TRUE;
}
if ((!empty($instag)) && ($check10 = “YES”) && ($instag <> $item[instag]))
{
$results10 = $wpdb->get_results (“Update cbraepeople
set instag = ‘$instag’
where emailadd = ‘$current_user->user_email’ “);
$res10 = TRUE;
}
if (($res1) or ($res2) or ($_SESSION[‘$res3’]) or ($_SESSION[‘$res4’]) or ($res5) or ($res6) or ($res7) or ($res8) or ($res9) or ($res10))
{
//
session_destroy();
wp_redirect( ‘ https://cedarbraealumni.ca/thankyou-edit/’,301 );
die();
// header(“Refresh:0”);

}
else

{

//this echo script is funky must be continuous string of lines
echo ‘‘;
$res1=FALSE;
$res2=FALSE;
$res3=FALSE;
$res4=FALSE;
$res5=FALSE;
$res6=FALSE;
$res7=FALSE;
$res8=FALSE;
$res9=FALSE;
$res10=FALSE;
$checks1=”NO”;
$checks2=”NO”;
$checks3=”NO”;
$checks4=”NO”;
$checks5=”NO”;
$checks6=”NO”;
$checks7=”NO”;
$checks8=”NO”;
$checks9=”NO”;
$checks10=”NO”;
resultsclear();
checksclear();
header(“Refresh:0”);

}
}
[/insert_php]