-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontact_us.php
77 lines (68 loc) · 2.29 KB
/
contact_us.php
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
<?php
include ("db.php");
$exec_start = get_micro_time();
include_once 'includes/globales.php';
$queryTimer = new MicroTimer();
//contact us
$smarty->assign('DERCTION', 'rtl');
$smarty->assign('TEXTALIGN', 'right');
$smarty->assign('LAN_1', 'بلغ عن خطا او إتصل بإدارة الموقع');
$smarty->assign('LAN_2', 'إسمك');
$smarty->assign('LAN_3', 'بريدك الإلكتروني');
$smarty->assign('LAN_4', 'الموضوع');
$smarty->assign('LAN_5', 'الرسالة');
$smarty->assign('LAN_6', 'ادخل كود الامان');
$smarty->assign('LAN_9', '');
define("_EMTYCONTACT","تركت نمودج او اكثر فارغ");
define("_CORRECTEMAIL","اكتب بريدا إلكترونيا صحيحا");
define("_SECURITYCODE","كود الحماية غير متطابق");
define("_SUCCESSSEND","تم إرسال الرسالة لإدارة الموقع بنجاح نشكرك علي المراسلة");
define("_FAILED","فشل في الإرسال ");
$send = 1;
$success='';
$error ='';
if(isset($_POST['submit'])) {
$pfrom = $_POST['from'];
$pemail = $_POST['email'];
$psubject = $_POST['subject'];
$pmessage = $_POST['message'];
$pcaptcha = $_POST['captcha'];
$date = date("Y-m-d");
if(empty($_POST['from'])||empty($_POST['email'])|| empty($_POST['subject'])|| empty($_POST['message'])) {
$error = ""._EMTYCONTACT."";
$doop = 'no';
}
if(!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
$error = ""._CORRECTEMAIL."";
$doop = 'no';
}
if ($pcaptcha !== $_SESSION['captcha']) {
$error = ""._SECURITYCODE."";
$doop = 'no';
}
if(empty($doop)) {
$sql = "INSERT INTO quran_contactus (sender, email, subject, message, date , readed) VALUES('$pfrom', '$pemail', '$psubject', '$pmessage', '$date','no')";
$op = $db->query($sql);
//echo $db->id();
if($op) {
$success = ""._SUCCESSSEND."";
$send = 0;
} else {
$error = ""._FAILED."";
}
}
}
$method = isset($_GET['method']) ? $_GET['method'] : 1;
$smarty->assign('method',$method);
$smarty->assign('soranames',soranames());
$exec_end = get_micro_time();
$timer = get_exec_time($exec_end, $exec_start);
$smarty->assign ("timer",$timer);
$queryTimer->stop();
$smarty->assign('query_time',$queryTimer);
$smarty->assign('send', $send);
$smarty->assign('success', $success);
$smarty->assign('error', $error);
$smarty->display('contact_us.html');
?>