1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
if(isset($_POST['send']))
{
unset($_POST['send']);
if(!empty($_FILES['file']['name'])){
$file['files']=$_FILES['file'];
$file['destination']='contact_us_attachment';
$_POST['file']=upload_file($file);
}
$table['table']='contact_us';
$table['values']=$_POST;
if(mysqli_insert($table))
{
foreach($ADMIN_EMAIL as $val)
{
$EMAIL['email']=$val;
$EMAIL['title']="New enquiry recieved from website";
$EMAIL['body']="<h3>Hi admin,</h3><br>
<p> you recieved a new enquiry<p>
<table>
<tbody>
<tr>
<th>Type of member</th>
<th>:</th>
<td>{$_POST['type']}</td>
</tr>
<tr>
<th>Topic</th>
<th>:</th>
<td>{$_POST['topic']}</td>
</tr>
<tr>
<th>Email</th>
<th>:</th>
<td>{$_POST['email']}</td>
</tr>
<tr>
<th>Mobile</th>
<th>:</th>
<td>{$_POST['mobile']}</td>
</tr>
<tr>
<th>Subject</th>
<th>:</th>
<td>{$_POST['subject']}</td>
</tr>
<tr>
<th>Message</th>
<th>:</th>
<td>{$_POST['message']}</td>
</tr>
<tr>
<th>File</th>
<th>:</th>
<td><a href='$URL/contact_us_attachment/{$_POST['file']}'>{$_POST['file']}</a></td>
</tr>
<tr>
<th>Sent on</th>
<th>:</th>
<td>".strftime('%d %b %Y %H:%M:%S',strtotime(date('Y-m-d H:i:s')))."</td>
</tr>
</tbody>
</table>
";
$mail_print=send_mail($EMAIL);
}
$success=true;
}
else
{
$success=false;
}
}
?> |
Partager