/home/techb158/workloadmatch.com/Manager/Inc
Edit: /home/techb158/workloadmatch.com/Manager/Inc/Update_Profile.php (4923B)
The email address you entered is not valid';
}
$Phones =$_POST['Phone'];
$rx = "/
(1)?\D* # optional country code
(\d{3})?\D* # optional area code
(\d{3})\D* # first three
(\d{4}) # last four
(?:\D+|$) # extension delimiter or EOL
(\d*) # optional extension
/x";
preg_match($rx, $Phones, $matches);
if(!isset($matches[0])) return false;
$country = $matches[1];
$area = $matches[2];
$three = $matches[3];
$four = $matches[4];
$ext = $matches[5];
$Phones= $area.''.$three.''.$four;
//header('Location: profile.php?error='.$FUserNames .' '. $random_salt .' '. $LUserNames .' '. $Address .' '. $Phones .' '. $CollegeNames .' '. $Admin_ID .' '. $email .' '. $password);
// exit();
//$error_msg .= $FUserNames .' '. $Admin_ID .' '. $LUserNames;
// $error_msg .= $FUserNames .' '. $random_salt .' '. $LUserNames .' '. $Address .' '. $Phones .' '. $CompanyNames .' '. $Admin_ID .' '. $email .' '. $password ;
$user_n=$_SESSION['user_id'];
$stmt = $mysqli->prepare('SELECT * FROM manager_profile WHERE Manager_ID = ?');
$stmt->bind_param('s', $user_n);
$stmt->execute();
$result = $stmt->get_result();
//$row = $result->fetch_assoc();
$count =$result->num_rows;
if($count > 0)
{
if (empty($error_msg)) {
$stmt = $mysqli->prepare("UPDATE manager_profile SET First_Name=?, Last_Name=?, Company_Name=?, Email=?, Phone=?, College_Phone=?, Address=?, prof_lang=?, SMS_Carrier=? WHERE User_Name=? AND Manager_ID=?");
$stmt->bind_param('sssssssssss', $FUserNames, $LUserNames, $CompanyNames, $email, $Phones, $College_Phone, $Address, $prof_lang, $Access_Carrier, $Admin_ID, $user_n);
if (!$stmt->execute()) {
// header('Location: profile.php?error='.$mysqli->error);
set_flash_msg('Manager failure to update!', 'warning');
header('Location: profile.php');
exit();
}
}
set_flash_msg('Manager is Updated successfully. Thanks!', 'success');
header('Location: profile.php');
exit();
}
}else
{
set_flash_msg('all information are required!', 'warning');
header('Location: profile.php');
exit();
}
}else if(isset($_POST["submits"]) && $_POST["submits"]!="") {
if (isset ($_POST['p'])) {
$password = filter_input(INPUT_POST, 'p', FILTER_UNSAFE_RAW);
if (strlen($password) != 128) {
// The hashed pwd should be 128 characters long.
// If it's not, something really odd has happened
$error_msg .= '
Invalid password configuration.
';
}
$password = password_hash($password, PASSWORD_BCRYPT);
//$error_msg .= $FUserNames .' '. $Admin_ID .' '. $LUserNames;
$user_n=$_SESSION['user_id'];
$stmt = $mysqli->prepare('SELECT * FROM manager_profile WHERE Manager_ID = ?');
$stmt->bind_param('s', $user_n);
$stmt->execute();
$result = $stmt->get_result();
$row = $result->fetch_assoc();
$count =$result->num_rows;
if($count > 0)
{
if (empty($error_msg)) {
$stmt = $mysqli->prepare("UPDATE manager_profile SET Password=?, salt='' WHERE User_Name=? AND Manager_ID=?");
$stmt->bind_param('sss', $password, $row['User_Name'], $user_n);
if (!$stmt->execute()) {
// header('Location: profile.php?error='.$mysqli->error);
set_flash_msg('Manager password failure to update!', 'warning');
header('Location: profile.php');
exit();
}
}
set_flash_msg('Manager password is updated successfully. Thanks!', 'success');
header('Location: profile.php');
exit();
}
}else
{
set_flash_msg('all information are required!', 'warning');
header('Location: profile.php');
exit();
}
}