-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom.php
More file actions
162 lines (144 loc) · 6.01 KB
/
Copy pathcustom.php
File metadata and controls
162 lines (144 loc) · 6.01 KB
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
<?php
$title = 'شخصیدوزی';
require_once 'includes/header.php';
?>
<!-- Hero -->
<section class="custom-hero">
<div class="custom-hero-content">
<h1>ثبت سفارش شخصیدوزی</h1>
<h3>لباس شما بازتابی از شخصیت، زیبایی و سبک خاص شما خواهد بود</h3>
</div>
</section>
<!-- Process -->
<section class="custom-process">
<h2>با فرآیندی ساده، گام به گام همراهتان هستیم</h2>
<div class="process-container">
<div class="process-step">
<img src="images/custom-process-step1.svg">
<p>ثبت درخواست آنلاین</p>
</div>
<div class="process-step">
<img src="images/custom-process-step2.svg">
<p>جلسه مشاوره اختصاصی</p>
</div>
<div class="process-step">
<img src="images/custom-process-step3.svg">
<p>تایید طراحی نهایی</p>
</div>
<div class="process-step">
<img src="images/custom-process-step4.svg">
<p>دوخت و پرو لباس</p>
</div>
<div class="process-step">
<img src="images/custom-process-step5.svg">
<p>تحویل لباس رویایی شما</p>
</div>
</div>
</section>
<!-- Custom Form Section -->
<section class="custom-form-section">
<h2>جلسه مشاوره اختصاصی خود را حالا رزرو کنید.</h2>
<form id="customForm" action="custom_form.php" method="POST">
<div class="form-row">
<input type="text" id="name" name="name" placeholder="نام" required>
<select id="type" name="type" required>
<option value="">انتخاب نوع جلسه</option>
<option value="online">آنلاین</option>
<option value="inPerson">حضوری</option>
</select>
</div>
<div class="form-row">
<input type="tel" id="phone" name="phone" placeholder="شماره تلفن همراه" pattern="^09[0-9]{9}$" required>
<input type="email" id="email" name="email" placeholder="ایمیل" required>
</div>
<div class="form-row">
<textarea id="message" name="message" placeholder="پیام شما"></textarea>
</div>
<div class="form-row">
<button type="submit" class="secondary-btn">ثبت و ارسال درخواست</button>
</div>
</form>
</section>
<!-- Customer Reviews Carousel -->
<section class="customer-reviews">
<h2>نظرات مشتریان عزیز</h2>
<div class="carousel-container">
<div class="review-carousel-track">
<?php include 'db/reviews-carousel.php'; ?>
<?php if ($reviews->num_rows > 0) {
while ($row = $reviews->fetch_assoc()) { ?>
<div class="review-card">
<div class="review-content">
<p><?php echo $row['نظر_مشتری']; ?></p>
<h4><?php echo $row['نام_مشتری']; ?></h4>
</div>
<img src='images/reviews/<?php echo $row['تصویر_نظر']; ?>'>
</div>
<?php }
} else {
echo '<p>در حال حاضر چیزی برای نمایش وجود ندارد!</p>';
}
?>
</div>
</div>
</section>
<!-- js code for form validation -->
<script>
document.getElementById('customForm').addEventListener('submit', function(e) {
var name = document.getElementById('name').value;
var type = document.getElementById('type').value;
var phone = document.getElementById('phone').value;
var email = document.getElementById('email').value;
var message = document.getElementById('message').value;
if (name.trim() === '' || phone.trim() === '' || email.trim() === '') {
alert('لطفا تمام فیلدها را پر کنید.');
e.preventDefault();
}
if (type.trim() === '') {
alert('لطفا نوع جلسه را انتخاب کنید.');
e.preventDefault();
}
var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(email)) {
alert('لطفا یک آدرس ایمیل معتبر وارد کنید.');
e.preventDefault();
}
});
</script>
<!-- Review carousel -->
<script>
document.addEventListener("DOMContentLoaded", () => {
const carousels = document.querySelectorAll('.carousel-container'); // Select all carousel containers
carousels.forEach(carousel => {
const track = carousel.querySelector('.carousel-track');
const prevButton = carousel.querySelector('.prev');
const nextButton = carousel.querySelector('.next');
// Check if the elements exist for this carousel
if (!track || !prevButton || !nextButton) {
console.warn('Carousel elements are missing in one of the containers.');
return;
}
// Scroll amount
const scrollAmount = 300;
// Move carousel left
prevButton.addEventListener('click', () => {
track.scrollBy({ left: scrollAmount, behavior: 'smooth' });
});
// Move carousel right
nextButton.addEventListener('click', () => {
track.scrollBy({ left: -scrollAmount, behavior: 'smooth' });
});
// Disable buttons when at start or end
const updateButtonState = () => {
const maxScrollLeft = track.scrollWidth - track.clientWidth;
prevButton.disabled = track.scrollLeft === 0;
nextButton.disabled = track.scrollLeft >= maxScrollLeft;
};
// Attach the scroll event to update button state
track.addEventListener('scroll', updateButtonState);
// Initialize button state
updateButtonState();
});
});
</script>
<?php require_once 'includes/footer.php'; ?>