-
Notifications
You must be signed in to change notification settings - Fork 0
/
exp.php
320 lines (216 loc) · 10.1 KB
/
exp.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<!-- start connecting to database -->
<?php
include 'dbcon.php';
// check if user coming from http post request
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['order'])) { // check coming from login or signup form
$username = $_POST['name'];
$phonee = $_POST['phone'];
$email = $_POST['email'];
$orderingg = $_POST['ordering'];
}else {
// check the ordering form if valid or not befor sending info to database
$formErrors = array();
$username = $_POST['name'];
$phonee = $_POST['phone'];
$email = $_POST['email'];
$orderingg = $_POST['ordering'];
if (isset($username) ) {
// filter the user name from any script
$filteruser = filter_var($username,FILTER_SANITIZE_STRING);
if (strlen($filteruser) < 4 ) {// check if the character of user name is larg
$formErrors[] = 'الأسم يجيب ان يحتوي على اكثر من 4 احرف';
}
if (filter_var($username,FILTER_SANITIZE_STRING) != true){
$formErrors[] = 'يجب ان يكون الاسم نص فقط وان لا يحتوي على اي رموز';
}
if (!preg_match("~^[a-z0-9٠-٩\-+,()/'\s\p{Arabic}]{1,60}$~iu", $username)) {
$formErrors[] = 'الأسم يجيب ان يحتوي على اكثر من 4 احرف';
}
}
if (isset($phonee) ) {
// filter the user name from any script
$filterPhone = filter_var($phonee,FILTER_VALIDATE_INT);
if (!preg_match ("/^[0-9]*$/", $filterPhone) ){
$formErrors[] = 'الرقم الذي ادخلتة غير صحيح';
}
}
if (isset($email) ) {
// filter the user name from any script
$filterEmail = filter_var($email,FILTER_SANITIZE_EMAIL);
if (filter_var($filterEmail,FILTER_VALIDATE_EMAIL) != true){
$formErrors[] = 'البريد الالكتروني الذي ادخلتة غير مسموح';
}
}
if (isset($orderingg) ) {
// filter the user name from any script
$filterOrdering = filter_var($orderingg,FILTER_SANITIZE_STRING);
if (filter_var($orderingg,FILTER_SANITIZE_STRING) != true){
$formErrors[] = 'يجب ان يكون تفاصيل الطلب نص فقط وان لا يحتوي على اي رموز';
}
if (!preg_match("~^[a-z0-9٠-٩\-+,()/'\s\p{Arabic}]{1,60}$~iu", $orderingg)) {
$formErrors[] = 'يجب ان يكون تفاصيل الطلب نص فقط وان لا يحتوي على اي رموز';
}
}
// CHECK IF THERE IS NO ERROR PROCED THE ORDER ADD
if (empty($formErrors)) {
// $query = "INSERT orderr(name, phone, email , ordering )
// VALUES(?, ?, ? , ?)";
// $stmt = $con->prepare($query);
// $stmt->execute([$username, $phonee, $email , $orderingg]);
// insert order info into the datebase VALUES(:zuser, :zpass , :zmail , :zname)");
$type= ' تنظيم المعارض والمؤتمرات';
$stmt = $con->prepare("INSERT INTO
orderr(name, phone, email , ordering ,orderType)
VALUES(:zuser, :zphone , :zmail , :zordering , :ztype)");
$stmt->execute(array(
'zuser' => $username,
'zphone' => $phonee,
'zmail' => $email,
'zordering' => $orderingg,
'ztype' => $type
));
// echo success message
$succesMsg = 'تم إرسال طلبك سيتم التواصل معك في اقرب وقت ';
$to = "[email protected]";
$subject = "Email Subject";
$message .= 'From : '. $type.',<br>';
$message .= 'Name : '. $username.',<br>';
$message .= 'Phone : '. $phonee.',<br>';
$message .= 'Email : '. $email.',<br>';
$message .= 'Ordering : '. $orderingg.',<br>';
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: <'. $email .'>' . "\r\n";
mail($to,$subject,$message,$headers);
?>
<script type="text/javascript">
window.alert("The order have been sent");
</script>
<?php
}
}
}
?>
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="imgs/logo.png" type="image/png">
<title>SequenceSa</title>
<link rel="stylesheet" href="css/normalize.css" />
<link rel="stylesheet" href="css/style.css" />
<!-- Font Awesome -->
<link rel="stylesheet" href="css/all.min.css" />
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;700&display=swap" rel="stylesheet" /><link href="https://unpkg.com/[email protected]/dist/aos.css" rel="stylesheet">
<link rel='stylesheet' href='css/aos.css'>
<style>
.banner-image {
background-image: url('imgs/banner-img1.png');
background-size: cover;
}
#flag:hover a
{
background-color: #201c50;
}
#flag:hover a::before
{
height: 0;
width: 0;
background-color: #201c50;
}
</style>
</head>
<body>
<!-- Start Header -->
<div class="header fixed-top" id="header">
<div class="container">
<a href="index.php" class="logo"><img src="imgs/seq.png" alt=""></a>
<ul class="main-nav">
<li style="border-bottom: solid 5px #1ab7a4; "><a href="index.php#about">من نحن</a></li>
<li style="border-bottom: solid 5px #fcb611; "><a href="index.php#services">خدماتنا</a></li>
<li style="border-bottom: solid 5px #e93995; "><a href="index.php#clients">عملائنا</a></li>
<li style="border-bottom: solid 5px #fff; "><a href="index.php#contact">تواصل معنا</a></li>
<li id="flag" style="margin-right: 20px;"><a href="en/index.php">en 🇬🇧</a></li>
</ul>
</div>
</div>
<!-- End Header -->
<!-- Start Events -->
<div class="events" style="margin-top:70px;" >
<!-- <div class="dots dots-up"></div>
<div class="dots dots-down"></div> -->
<h1 class="org" data-aos="zoom-in-down">
تنظيم المعارض والمؤتمرات
</h3>
<div class="container">
<div class="info">
<p class="title text-white" style=" line-height: 1.5;" data-aos="zoom-in-up" style="text-align: right;">
نخطط للحدث ، نعد جميع التفاصيل التشغيلية والتقنية
نصمم وننفذ مساحات ابادعية مميزة لمعارض عملائنا
نوفر شاشات العرض الضخمة ، انظمة الصوت ، انظمة الاضاءة المتقدمة
اللوحات الخارجية والداخلية الالكترونية ، الخدمات اللوجستية للفعاليات والمؤتمرات .
</p>
</div>
</div>
</div>
<!-- End Events -->
<div class="submit" id="contact" >
<h2 class="main-title">قدم طلبك الأن</h2>
<div class="container" >
<form class="order" up="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST" >
<input required data-aos="zoom-in" name="name" type="text" class="feedback-input" style=" border:2px solid #1ab7a4;" placeholder="الأســم" />
<input required data-aos="zoom-in-down" name="phone" type="text" class="feedback-input" style=" border:2px solid #fcb611;" placeholder="رقم الجوال" />
<input data-aos="zoom-in-up" name="email" type="text" class="feedback-input" style=" border:2px solid #e93995;" placeholder="البريد الألكتروني" />
<textarea required data-aos="zoom-in" name="ordering" class="feedback-input" style=" border:2px solid #f2f2f2;" placeholder="تفاصيل الطلب"></textarea>
<input
data-aos="fade-up"type="submit" value="ارسال طلبك"/>
</form>
</div>
<!-- Start Footer -->
<div class="footer" style=" direction: ltr;">
<div class="container">
<main class="gridfoot">
<div class="boxfoot">
<a href="mailto:[email protected]" target="_blank" rel="noopener noreferrer">
<h1 style="color:#fff; font-size:20px;">
<i class="fa fa-envelope"></i> :
</h1>
</a>
</div>
<div class="boxfoot">
<a href="https://wa.me/+966592345687">
<h1 style="color:#fff; font-size:20px;">
<i class="fab fa-whatsapp"></i> :
+966592345687
</h1>
</a>
</div>
<div class="boxfoot">
<a href="https://instagram.com/sequencessa?igshid=YmMyMTA2M2Y=">
<h1 style="color:#fff; font-size:20px;">
<i class="fab fa-instagram"></i> :
@Sequencessa
</h1>
</a>
</div>
</main>
</div>
<p class="copyright" >© 2023 SequenceSa. All Rights Reserved.</p>
</div>
<!-- End Footer -->
<script src="js/main.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src='js/aos.js'>
</script>
<script src="js/script.js"></script>
</body>
</html>