This repository has been archived by the owner on Apr 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
work.php
executable file
·120 lines (111 loc) · 4.87 KB
/
work.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
<?php
require_once('essentials/config.php');
?>
<?php
include "dbConfig.php";
$validation = new validation;
$queries = new queries;
$sendEmail = new sendEmail;
if (isset($_POST['submit'])) {
$validation->validate('fullName', 'Full Name', 'required|min_len|5');
$validation->validate('email', 'Email', 'required|min_len|10');
$validation->validate('phone', 'Phone', 'required|min_len|10');
$validation->validate('msg', 'Message', 'required|min_len|50');
if ($validation->run()) {
$fullName = $validation->input('fullName');
$email = $validation->input('email');
$msg = $validation->input('msg');
$phone = $validation->input('phone');
$url = "https://" . $_SERVER['SERVER_NAME'] . "/aanav/shop.php";
$subject = 'Thank you';
$body = '<p style="color:#66FCF1; font-size: 32px;" >Hi ' . $fullName . '</p><p style="color:grey; font-size: 16px;" > Thank you for .We will contact you as soon as possible</p>
<p><a style="background-color: #66FCF1;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;"
href="' . $url . '">Visit Site</a></p><p style="color:red; font-size: 10px;" > Need Help ? <a>Contact Us</a></p>';
if ($queries->query("INSERT INTO msg (name, email, phone, msg, type, created_date) VALUES
('$fullName', '$email', '$phone', '$msg', 'work', now()) ")) {
if ($sendEmail->send($fullName, $email, $subject, $body)) {
header("location: index.php");
}
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Work With Us</title>
<link href="https://fonts.googleapis.com/css?family=Karla:400,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/4.8.95/css/materialdesignicons.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="css/login.css">
</head>
<body>
<main>
<div class="container-fluid">
<div class="row">
<div class="col-sm-6 login-section-wrapper">
<div class="brand-wrapper">
<img src="img/logo_nav.png" alt="logo" class="logo">
</div>
<div class="login-wrapper my-auto">
<h1 class="login-title">Hello New Vendor</h1>
<form method="post">
<div class="form-group">
<label for="name">Name</label>
<input type="text" name="fullName" class="form-control" placeholder="Enter your name" required />
<div class="error text-center text-danger">
<?php if (!empty($validation->errors['fullName'])) : echo $validation->errors['fullName'];
endif; ?>
</div>
</div>
<div class="form-group mb-6">
<label for="email">Email</label>
<input type="email" name="email" class="form-control" placeholder="Enter your email" required />
<div class="error text-center text-danger">
<?php if (!empty($validation->errors['email'])) : echo $validation->errors['email'];
endif; ?>
</div>
</div>
<div class="form-group mb-6">
<label for="phone">Phone</label>
<input type="number" name="phone" class="form-control" placeholder="+91">
<div class="error text-center text-danger">
<?php if (!empty($validation->errors['phone'])) : echo $validation->errors['phone'];
endif; ?>
</div>
</div>
<div class="form-group mb-6">
<label for="msg">Your Message</label>
<textarea class="form-control" name="msg" placeholder="Your message" required></textarea>
<div class="error text-center text-danger">
<?php if (!empty($validation->errors['msg'])) : echo $validation->errors['msg'];
endif; ?>
</div>
</div>
<input name="submit" id="login" class="btn btn-block login-btn" type="submit" value="Apply">
</form>
<p class="login-wrapper-footer-text"><a href="index.php" class="text-reset">Back to home</a></p>
</div>
</div>
</div>
</div>
</main>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</body>
</html>