/home/techb158/workloadmatch.com/workloadmatch.com/Teacher
Edit: /home/techb158/workloadmatch.com/workloadmatch.com/Teacher/Update_Reference_Follow_Up.php (7384B)
prepare('SELECT * FROM Broker_Profile WHERE Broker_ID = ?');
$stmt->bind_param('s', $Broker_ID);
$stmt->execute();
$result = $stmt->get_result();
//$row = $result->fetch_assoc();
$count =$result->num_rows;
if($count > 0)
{
$query = "SELECT * FROM Reference_File_Follow_UP Where Reference_ID_Follow_UP ='".$Reference_ID_Follow_UP."' AND Broker_Receiver_ID ='".$Broker_ID."'";
$result = $mysqli->query($query);
$Reference = $result->fetch_assoc();
$Reference_ID = $Reference['Reference_ID'];
$Client_ID = $Reference['Client_ID'];
//$Category_ID = $Reference['Category_ID'];
$Category_Sender_ID = $Reference['Category_Sender_ID'];
$Category_Receiver_ID = $Reference['Category_Receiver_ID'];
$Admin_ID = $Reference['Admin_ID'];
$Master_ID = $Reference['Master_ID'];
//$Manager_ID = $Reference['Manager_ID'];
$Manager_Sender_ID = $Reference['Manager_Sender_ID'];
$Manager_Receiver_ID = $Reference['Manager_Receiver_ID'];
$Broker_Sender_ID = $Reference['Broker_Sender_ID'];
$Broker_Receiver_ID = $Reference['Broker_Receiver_ID'];
$User_Type_ID = $Reference['User_Type_ID'];
$Transaction_Type_ID = $Reference['Transaction_Type_ID'];
$Transaction_Type = $Reference['Transaction_Type'];
$Best_Time_Call = $Reference['Best_Time_Call'];
$query = "SELECT * FROM Client_Profile Where Client_ID ='".$Client_ID."'";
$result = $mysqli->query($query);
$Managers = $result->fetch_assoc();
//$Client_ID = $Managers['Client_ID'];
$First_Name = $Managers['First_Name'];
$Last_Name = $Managers['Last_Name'];
$Client_Name = $First_Name .''. $Last_Name;
$queryd = "SELECT * FROM Broker_Profile Where Broker_ID ='".$Broker_Sender_ID."'";
$resultd = $mysqli->query($queryd);
$rowd = $resultd->fetch_assoc();
$Broker_Email = $rowd['Email'];
$Broker_Name = $rowd['First_Name'] .' '.$rowd['Last_Name'];
///////////////////////////////////////////////////////////////////////////////////
$querye = "SELECT * FROM Broker_Profile Where Broker_ID ='".$Broker_Receiver_ID."'";
$resulte = $mysqli->query($querye);
$rowe = $resulte->fetch_assoc();
$Broker_Receiver_Email = $rowe['Email'];
$Broker_Receiver_Name = $rowe['First_Name'] .' '.$rowe['Last_Name'];
$queryes = "SELECT * FROM Manager_Profile Where Manager_ID='".$Manager_Receiver_ID."'";
$resultes = $mysqli->query($queryes);
$rowes = $resultes->fetch_assoc();
$Manager_Receiver_Email = $rowes['Email'];
//$query = "SELECT * FROM Broker_Profile Where Broker_ID ='".$Broker_ID."'";
//$result = $mysqli->query($query);
//$row = $result->fetch_assoc();
//$Category_ID = $row['Category_ID'];
//$Admin_ID = $row['Admin_ID'];
//$Manager_ID = $row['Manager_ID'];
//$Broker_ID = $row['Broker_ID'];
//$User_Type_ID = $row['User_Type_ID'];
$query = "SELECT * FROM Sub_Categories Where Sub_Category_ID ='".$Transaction_Type_ID."'";
$resultw = $mysqli->query($query);
$roww = $resultw->fetch_assoc();
$Sub_Category_Type = $roww['Sub_Category_Type'];
$datetime =date("Y/m/d") . ' ' . date('H:i:s') ;
//$Best_Time_Call = date("Y-m-d", strtotime($Best_Time_Call));
if ($Client_ID > 0) {
//header('Location: followup.php?error='.$Reference_ID.'-'. $Client_ID.'-'. $Category_Sender_ID.'-'. $Category_Receiver_ID.'-'. $Admin_ID.'-'. $Master_ID.'-'. $Manager_Sender_ID.'-'.$Manager_Receiver_ID.'-'. $Broker_Sender_ID.'-'. $Broker_Receiver_ID.'-'. $User_Type_ID.'-'. $Transaction_Type_ID.'-'. $Sub_Category_Type.'-'. $Transaction_Amount.'-'. $Note.'-'. $datetime.'-'. $Best_Time_Call.'-'.$Reference_Status);
//exit();
//$Reference_ID= mysqli_insert_id($mysqli);
// if ($insert_stmt = $mysqli->prepare("INSERT INTO Reference_File_Follow_UP (Reference_ID, Client_ID, Category_ID, Admin_ID, Master_ID, Manager_ID, Broker_Sender_ID, Broker_Receiver_ID, User_Type_ID, Transaction_Type_ID, Transaction_Type, Transaction_Amount, Note, Reg_Date, Best_time_contact,Reference_Status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) {
//$insert_stmt->bind_param('ssssssssssssssss',$Reference_ID, $Client_ID, $Category_ID, $Admin_ID, $Master_ID, $Manager_ID, $Broker_Sender_ID, $Broker_Receiver_ID, $User_Type_ID, $Transaction_Type_ID, $Sub_Category_Type, $Transaction_Amount, $Note, $datetime, $Best_Time_Call, $Reference_Status);
if ($insert_stmt = $mysqli->prepare("INSERT INTO Reference_File_Follow_UP (Reference_ID, Client_ID, Category_Sender_ID, Category_Receiver_ID, Admin_ID, Master_ID, Manager_Sender_ID, Manager_Receiver_ID,Broker_Sender_ID, Broker_Receiver_ID, User_Type_ID, Transaction_Type_ID, Transaction_Type, Transaction_Amount, Note, Reg_Date, Best_time_contact,Reference_Status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) {
$insert_stmt->bind_param('ssssssssssssssssss',$Reference_ID, $Client_ID, $Category_Sender_ID, $Category_Receiver_ID, $Admin_ID, $Master_ID, $Manager_Sender_ID,$Manager_Receiver_ID, $Broker_Sender_ID, $Broker_Receiver_ID, $User_Type_ID, $Transaction_Type_ID, $Sub_Category_Type, $Transaction_Amount, $Note, $datetime, $Best_Time_Call,$Reference_Status);
// Execute the prepared query.
if (! $insert_stmt->execute()) {
//header('Location: followup.php?error='.$insert_stmt->error);
header('Location: followup.php?error=Failure to Update Reference!');
exit();
}else
{
$subject = "New Follow Up";
$uri = 'https://'. $_SERVER['HTTP_HOST'] ;
$message = '
ImmoValet: New Follow Up
Dear "'.$Broker_Receiver_Name.'",
You have received a new follow up, please go to Account Login to view it.
"'."Thank you for choosing ImmoValet.".'"
';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= 'From: '.$Broker_Name.'<'.$Broker_Email.'>' . "\r\n";
$headers .= 'CC: '.$Broker_Name.'<'.$Manager_Receiver_Email.'>' . "\r\n";
$headers .= 'Bcc: support
' . "\r\n";
mail($Broker_Receiver_Email,$subject,$message,$headers);
header('Location: followup.php?error=The Reference has been Updated!');
exit();
}
}
}else{
header('Location: followup.php?error=Client Name is not exist.');
exit();
}
//header('Location: reference.php?error=Client Name is already exist.');
//exit();
//foreach ($_POST['Transaction_Type'] as $Transaction_Type)
//{
// $Transaction_Type= $Transaction_Type;
//}
}
}else{
header('Location: followup.php?error=Registration failure please insert all informaion!');
exit();
}
}