Current Path : /home/c247essa/public_html/

Linux c22487.sgvps.net 3.12.18-clouder0 #1 SMP Tue Oct 9 18:14:47 EEST 2018 x86_64

Upload File :
Current File : /home/c247essa/public_html/ajax_actions.php
<?php 
include 'backend.php';
page_protect();
$err = array();
$msg = array();

foreach($_GET as $key => $value) {
	$get[$key] = filter($value);
}
if(isset($get['cmd']) && $get['cmd'] == 'Reply_to_msg') {

$the_msg = $get['ReplyMsg'];

if(empty($the_msg) ) {
echo "Please enter the reply message";
exit();
}
$to_id = $get['to_id'];
$recp =  $get['msg_from'];
if ($recp =='Writer' || $recp =='Admin'  ){
list($to_email)= mysql_query("select email from mu_members where id ='$to_id'") or die(mysql_error());		
 }else{
list($to_email)= mysql_query("select dep_email from departments where dep_name LIKE '%$recp%'") or die(mysql_error());		
 }
$sql_insert_re= "INSERT into `messages` 
			(`sender_id`, `to_id`, `to_dpt`,`msg_subject`, `message`, `order`, `date`,  `sent_to_email`, `is_read`, `sender_dpt`) VALUES ('$_SESSION[id]', '$get[to_id]', '$get[to_dpt]', 'RE - $get[msg_subject]', '$the_msg','$get[order]', '".date("Y-m-d H:i:s")."' , '$to_email', '0', '$get[msg_from]')";
			mysql_query($sql_insert_re) or die("Insertion Failed:" . mysql_error());			
	
//email
$message_to_dep = 
'
<html>
<body>
<div style="padding:10px; line-height:22px; -moz-border-radius: 5px;-webkit-border-radius: 5px;	border-radius: 5px; color:#003366;  background:#e6efee; border:1px solid #c4de95; font-family: Corbel; font-size:14px;">

 '.$the_msg.'

<br><br>
<span style="color:#253350; font-weight:bold; font-size:15px;">
Regards,<br>
Support Department, <br>
<strong><i>'.SITE_HOST_NAME.' </i></strong><br>
Email: '.$site_email.'
</span>
</div>

</body>
</html>
';
// send it 
    $to = $to_email;
    $from = "Message on order -  <$_SESSION[email]>";
    $subject = "Message from Writer on order: $get[order]"; 
    $headers  = "From: $from\r\n";
	$headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
	
    @mail($to, $subject, $message_to_dep, $headers.
    "X-Mailer: PHP/" . phpversion());
				
echo "Message sent successfully";
exit();
}
?>