-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
159 lines (115 loc) · 5.6 KB
/
index.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
<?php require 'config.php'; ?>
<?php require BL . 'functions/validate.php'; ?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="<?php echo ASSETS; ?>css/bootstrap.min.css" >
<link href="https://fonts.googleapis.com/css?family=Montserrat|Open+Sans&display=swap" rel="stylesheet">
<link rel="stylesheet" href="<?php echo ASSETS; ?>css/style.css" >
<title>Home Page</title>
</head>
<body>
<div class="cont-main" style="background:url(<?php echo ASSETS . 'images/bg-1.jpg'; ?>);
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
">
<div class="container">
<div class="row">
<div class="col-sm-12">
<?php
if (isset($_POST['submit'])) {
$service = $_POST['service'];
$city = $_POST['city'];
$mobile = $_POST['mobile'];
$notes = sanitizeString($_POST['notes']);
$name = sanitizeString($_POST['name']);
$email = sanitizeString($_POST['email']);
if (checkEmpty($mobile) && checkEmpty($name)) {
$sql = "INSERT INTO orders (`order_name`,`order_email`,`order_mobile`,`order_serv_id`,`order_city_id`,`order_notes`)
VALUES ('$name','$email','$mobile','$service','$city','$notes')
";
$success_message = db_insert($sql);
header("refresh:1;url=" . BU);
/* header("location:".BU); */
} else {
$error_message = "Please Type Your Name And Your Mobile";
}
}
?>
<form class="row" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>" class="mt-5" >
<?php require BL . 'functions/error.php'; ?>
<div class="col-sm-6 ">
<div class="form-group mt-3">
<label for="serv" class="font-1">Choose Service</label>
<select name="service" id="serv" class="form-control font-1">
<?php $data = getRows('services');
$x = 1; ?>
<?php foreach ($data as $row) { ?>
<option value="<?php echo $row['serv_id']; ?>">
<?php echo $row['serv_name']; ?>
</option>
<?php } ?>
</select>
</div>
</div>
<div class="col-sm-6 ">
<div class="form-group mt-3">
<label for="serv" class="font-1">Choose City</label>
<select name="city" id="serv" class="form-control font-1">
<?php $dataCity = getRows('cities');
$x = 1; ?>
<?php foreach ($dataCity as $row) { ?>
<option value="<?php echo $row['city_id']; ?>">
<?php echo $row['city_name']; ?>
</option>
<?php } ?>
</select>
</div>
</div>
<div class="col-md-4 col-sm-12">
<div class="form-group">
<label for="serv" class="font-1">Type Your Name *</label>
<input type="text" name="name" class="form-control font-1 bg-base">
</div>
</div>
<div class="col-md-4 col-sm-12">
<div class="form-group ">
<label for="serv" class="font-1">Type Your Email</label>
<input type="email" name="email" class="form-control font-1 bg-base">
</div>
</div>
<div class="col-md-4 col-sm-12">
<div class="form-group ">
<label for="serv" class="font-1">Type Your Mobile *</label>
<input type="text" name="mobile" class="form-control font-1 bg-base">
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label for="serv" class="font-1">Type Notes</label>
<textarea name="notes" class="form-control font-1 bg-base" rows="5"></textarea>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<button type="submit" name="submit" class="btn btn-success form-control">Send</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="<?php echo ASSETS; ?>js/jquery-3.4.1.min.js" ></script>
<script src="<?php echo ASSETS; ?>js/popper.min.js" ></script>
<script src="<?php echo ASSETS; ?>js/bootstrap.min.js" ></script>
</body>
</html>