-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsupport.php
160 lines (134 loc) · 4.91 KB
/
support.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
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Support | CropConnect</title>
<link rel="icon" type="image/x-icon" href="images/cropconnect-favicon-color.ico">
<link rel="stylesheet" href="styles2.css">
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
max-width: 800px;
margin: 20px auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
label {
display: block;
margin-bottom: 8px;
}
input,
textarea,
button {
width: 100%;
padding: 10px;
margin-bottom: 15px;
box-sizing: border-box;
}
button {
background-color: #4caf50;
color: #fff;
border: none;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
.error-message {
color: #ff0000;
margin-bottom: 15px;
}
</style>
</head>
<body>
<div class="navbar">
<a href="farmer_portal.php" class="logo"><img src="cropconnect.png" alt="Company Logo"></a>
<a href="farmer_portal.php">Home</a>
<a href="my_products.php">My Products</a>
<a href="transactions.php">Transactions</a>
<a class="active" href="support.php">Support</a>
<div class="login-container">
<?php
echo '<div class="login-name">Welcome ' . $_SESSION['firstName'] . '</div>';
?>
<a href="logout.php">Logout</a>
</div>
</div>
<div class="container">
<h1>Support</h1>
<form id="contactForm" method="post" action="mailto: [email protected]">
<label for="name">Name:</label>
<input type="text" name="name" id="name" required>
<label for="number">Phone Number:</label>
<input type="tel" name="number" id="number" pattern="[0-9]{10}" required>
<label for="email">Email:</label>
<input type="email" name="email" id="email" required>
<label for="query">Query:</label>
<textarea name="query" id="query" rows="4" required></textarea>
<button type="button" onclick="submitForm()">Submit</button>
</form>
<div id="errorDisplay" class="error-message"></div>
<script>
function submitForm() {
var name = document.getElementById('name').value.trim();
var number = document.getElementById('number').value.trim();
var email = document.getElementById('email').value.trim();
var query = document.getElementById('query').value.trim();
var errorDisplay = document.getElementById('errorDisplay');
errorDisplay.innerHTML = '';
// Basic form validation
if (name === '' || number === '' || email === '' || query === '') {
errorDisplay.innerHTML = 'All fields are required';
} else if (!isValidPhoneNumber(number)) {
errorDisplay.innerHTML = 'Invalid phone number';
} else {
alert('Query submitted successfully!');
}
}
function isValidPhoneNumber(number) {
// Basic phone number validation (10 digits)
var regex = /^[0-9]{10}$/;
return regex.test(number);
}
</script>
</div>
<br><br><br><br><br><br><br><br>
<div class="footer-content">
<div class="footer-section"></div>
<div class="footer-section">
<h4>Navigation</h4>
<p><a href="index.php">Home</a></p>
<p><a href="cart.php">Cart</a></p>
<p><a href="categories.php">Categories</a></p>
<p><a href="contact.php">Contact Us</a></p>
</div>
<div class="footer-section">
<h4>Address</h4>
<p>Jaypee Institute Of Information And Technology<br>
A-10, Sector-62, ,Noida-201 309,
Uttar Pradesh, India.
</p>
</div>
<div class="footer-section">
<h4>Contact</h4>
<p>Phone: +91 120-2400973</p>
</div>
<div class="footer-section">
<h4>Legal</h4>
<p><a href="terms.php">Terms and Conditions</a></p>
</div>
<div class="footer-section"></div>
</div>
</body>
</html>