<?php
// Start session
session_start();
// Enable error reporting for debugging
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Check if installation is complete
if (!file_exists('installed.php')) {
header('Location: install.php');
exit;
}
// Include database configuration
require_once 'admin/database/db_config.php';
// Include header
include 'includes/header.php';
// Process form submission
$message_sent = false;
$form_error = '';
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['contact_submit'])) {
// Get form data
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$subject = trim($_POST['subject']);
$message = trim($_POST['message']);
// Validate inputs
if (empty($name) || empty($email) || empty($subject) || empty($message)) {
$form_error = "All fields are required.";
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$form_error = "Invalid email format.";
} else {
// Insert into database
$stmt = $conn->prepare("INSERT INTO contact_messages (name, email, subject, message, created_at) VALUES (?, ?, ?, ?, NOW())");
// Check if table exists, if not create it
$table_check = $conn->query("SHOW TABLES LIKE 'contact_messages'");
if ($table_check->num_rows == 0) {
$create_table = "CREATE TABLE contact_messages (
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL,
subject VARCHAR(200) NOT NULL,
message TEXT NOT NULL,
status ENUM('new', 'read', 'replied') DEFAULT 'new',
created_at DATETIME NOT NULL,
updated_at DATETIME NULL
)";
$conn->query($create_table);
}
if ($stmt) {
$stmt->bind_param("ssss", $name, $email, $subject, $message);
if ($stmt->execute()) {
$message_sent = true;
$message_id = $stmt->insert_id;
// Create notification for admin
// First check if notifications table exists
$notif_table_check = $conn->query("SHOW TABLES LIKE 'notifications'");
if ($notif_table_check->num_rows == 0) {
// Create notifications table
$create_notif_table = "CREATE TABLE notifications (
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_id INT(11) NULL,
type VARCHAR(50) NOT NULL,
message TEXT NOT NULL,
is_read TINYINT(1) NOT NULL DEFAULT 0,
link VARCHAR(255) NULL,
created_at DATETIME NOT NULL,
reference_id INT(11) NULL,
reference_type VARCHAR(50) NULL
)";
$conn->query($create_notif_table);
}
// Insert notification
$notif_stmt = $conn->prepare("INSERT INTO notifications (user_id, type, message, link, created_at, reference_id, reference_type)
VALUES (NULL, 'contact', ?, 'admin/contact-messages.php', NOW(), ?, 'contact_message')");
$notif_message = "New contact message from {$name}: {$subject}";
$notif_stmt->bind_param("si", $notif_message, $message_id);
$notif_stmt->execute();
$notif_stmt->close();
// Optional: Send email notification to admin
$admin_email = isset($site_settings['admin_email']) ? $site_settings['admin_email'] : '[email protected]';
$headers = "From: $site_name <$email>\r\n";
$headers .= "Reply-To: $email\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$email_body = "<h3>New Contact Message</h3>
<p><strong>Name:</strong> $name</p>
<p><strong>Email:</strong> $email</p>
<p><strong>Subject:</strong> $subject</p>
<p><strong>Message:</strong><br>$message</p>";
// Check if mail-functions.php exists and include it if it does
if (file_exists('includes/mail-functions.php')) {
include_once 'includes/mail-functions.php';
if (function_exists('send_email')) {
send_email($admin_email, "New Contact Message: $subject", $email_body);
}
}
} else {
$form_error = "Error sending message. Please try again.";
}
$stmt->close();
} else {
$form_error = "Error preparing database. Please try again later.";
}
}
}
?>
<!-- Page Header -->
<div class="page-header">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-6">
<h1 class="page-title">Contact Us</h1>
<p class="page-description">Get in touch with our team for any inquiries</p>
</div>
<div class="col-lg-6">
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-lg-end">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Contact</li>
</ol>
</nav>
</div>
</div>
</div>
<!-- 3D Objects Animation -->
<div class="floating-shapes">
<div class="shape shape-1" data-parallax='{"y": 150, "x": 50}'></div>
<div class="shape shape-2" data-parallax='{"y": -100, "x": -70}'></div>
<div class="shape shape-3" data-parallax='{"y": 80, "x": -120}'></div>
<div class="shape shape-4" data-parallax='{"y": -50, "x": 100}'></div>
</div>
</div>
<!-- Contact Section -->
<section class="contact-section py-5">
<div class="container">
<!-- Contact Info Cards -->
<div class="row contact-info mb-5">
<div class="col-lg-4 mb-4">
<div class="contact-info-card wow fadeInUp" data-wow-delay="0.1s">
<div class="icon-box">
<i class="fas fa-map-marker-alt"></i>
</div>
<h3>Our Location</h3>
<p>Bhimpura No.1, Ballia<br>Uttar Pradesh, India</p>
</div>
</div>
<div class="col-lg-4 mb-4">
<div class="contact-info-card wow fadeInUp" data-wow-delay="0.2s">
<div class="icon-box">
<i class="fas fa-phone-alt"></i>
</div>
<h3>Call Us</h3>
<p>+91 9984878446<br></p>
</div>
</div>
<div class="col-lg-4 mb-4">
<div class="contact-info-card wow fadeInUp" data-wow-delay="0.3s">
<div class="icon-box">
<i class="fas fa-envelope"></i>
</div>
<h3>Email Us</h3>
<p>[email protected]<br>[email protected]</p>
</div>
</div>
</div>
<div class="row">
<!-- Contact Form -->
<div class="col-lg-6 mb-5 mb-lg-0">
<div class="contact-form-wrapper wow fadeInLeft" data-wow-delay="0.2s">
<div class="section-header mb-4">
<h6 class="section-badge">Get In Touch</h6>
<h2 class="section-title">Send Us A Message</h2>
<p class="section-text">Feel free to reach out to us with any questions, concerns, or inquiries. We're here to help!</p>
</div>
<?php if ($message_sent): ?>
<div class="alert alert-success" role="alert">
<i class="fas fa-check-circle me-2"></i> Thank you for your message! We will get back to you soon.
</div>
<?php elseif (!empty($form_error)): ?>
<div class="alert alert-danger" role="alert">
<i class="fas fa-exclamation-circle me-2"></i> <?php echo $form_error; ?>
</div>
<?php endif; ?>
<form id="contactForm" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>">
<div class="row">
<div class="col-md-6 mb-3">
<div class="form-group">
<label for="name" class="form-label">Your Name *</label>
<input type="text" class="form-control" id="name" name="name" required>
</div>
</div>
<div class="col-md-6 mb-3">
<div class="form-group">
<label for="email" class="form-label">Your Email *</label>
<input type="email" class="form-control" id="email" name="email" required>
</div>
</div>
</div>
<div class="mb-3">
<div class="form-group">
<label for="subject" class="form-label">Subject *</label>
<input type="text" class="form-control" id="subject" name="subject" required>
</div>
</div>
<div class="mb-4">
<div class="form-group">
<label for="message" class="form-label">Your Message *</label>
<textarea class="form-control" id="message" name="message" rows="5" required></textarea>
</div>
</div>
<button type="submit" name="contact_submit" class="btn btn-primary">Send Message</button>
</form>
</div>
</div>
<!-- Google Map -->
<div class="col-lg-6">
<div class="map-wrapper wow fadeInRight" data-wow-delay="0.2s">
<div class="section-header mb-4">
<h6 class="section-badge">Find Us</h6>
<h2 class="section-title">Our Location</h2>
<p class="section-text">Visit our campus at Bhimpura No.1, Ballia, Uttar Pradesh, India</p>
</div>
<div class="map-container">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3597.9012186904607!2d84.15095491501865!3d25.75933418364099!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3991ff999a4cd9d7%3A0xd6af301ae95e9318!2sBhimpura%2C%20Ballia%2C%20Uttar%20Pradesh!5e0!3m2!1sen!2sin!4v1618331610883!5m2!1sen!2sin" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- FAQ Section -->
<section class="faq-section py-5 bg-light">
<div class="container">
<div class="row justify-content-center mb-5">
<div class="col-lg-8 text-center">
<h6 class="section-badge wow fadeInUp" data-wow-delay="0.1s">FAQ</h6>
<h2 class="section-title wow fadeInUp" data-wow-delay="0.2s">Frequently Asked Questions</h2>
<p class="section-text wow fadeInUp" data-wow-delay="0.3s">Find answers to common questions about our courses, admission process, and more.</p>
</div>
</div>
<div class="row justify-content-center">
<div class="col-lg-10">
<div class="accordion" id="faqAccordion">
<div class="accordion-item wow fadeInUp" data-wow-delay="0.1s">
<h2 class="accordion-header" id="faqHeading1">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#faqCollapse1" aria-expanded="true" aria-controls="faqCollapse1">
How do I enroll in a course?
</button>
</h2>
<div id="faqCollapse1" class="accordion-collapse collapse show" aria-labelledby="faqHeading1" data-bs-parent="#faqAccordion">
<div class="accordion-body">
You can enroll in our courses by visiting our campus or registering online. Simply browse our course catalog, select the course you're interested in, and click on the "Enroll Now" button. Follow the registration process, make the payment, and you'll be enrolled in the course.
</div>
</div>
</div>
<div class="accordion-item wow fadeInUp" data-wow-delay="0.2s">
<h2 class="accordion-header" id="faqHeading2">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faqCollapse2" aria-expanded="false" aria-controls="faqCollapse2">
What are the payment options available?
</button>
</h2>
<div id="faqCollapse2" class="accordion-collapse collapse" aria-labelledby="faqHeading2" data-bs-parent="#faqAccordion">
<div class="accordion-body">
We accept various payment methods including credit/debit cards, net banking, UPI, and cash payments at our campus. We also offer installment options for select courses. Please contact our admissions team for more details on payment plans.
</div>
</div>
</div>
<div class="accordion-item wow fadeInUp" data-wow-delay="0.3s">
<h2 class="accordion-header" id="faqHeading3">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faqCollapse3" aria-expanded="false" aria-controls="faqCollapse3">
Do you provide job placement assistance?
</button>
</h2>
<div id="faqCollapse3" class="accordion-collapse collapse" aria-labelledby="faqHeading3" data-bs-parent="#faqAccordion">
<div class="accordion-body">
Yes, we provide job placement assistance to our students. We have partnerships with various companies and organizations that regularly hire our graduates. We conduct placement drives, provide resume building assistance, and offer interview preparation sessions to help our students secure employment.
</div>
</div>
</div>
<div class="accordion-item wow fadeInUp" data-wow-delay="0.4s">
<h2 class="accordion-header" id="faqHeading4">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faqCollapse4" aria-expanded="false" aria-controls="faqCollapse4">
Can I get a certificate after completing a course?
</button>
</h2>
<div id="faqCollapse4" class="accordion-collapse collapse" aria-labelledby="faqHeading4" data-bs-parent="#faqAccordion">
<div class="accordion-body">
Yes, all our courses come with a completion certificate. Upon successful completion of the course and passing the final assessment, you will receive a certificate that is recognized by the industry. These certificates can enhance your resume and improve your job prospects.
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<style>
/* Page Header */
.page-header {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
padding: 100px 0 100px;
color: white;
margin-bottom: 60px;
position: relative;
overflow: hidden;
}
.page-title {
font-size: 2.75rem;
font-weight: 700;
margin-bottom: 15px;
animation: fadeInUp 1s ease;
}
.page-description {
font-size: 1.2rem;
opacity: 0.9;
animation: fadeInUp 1s ease 0.2s;
animation-fill-mode: both;
}
.breadcrumb {
background: transparent;
padding: 0;
margin: 0;
animation: fadeInRight 1s ease 0.3s;
animation-fill-mode: both;
}
.breadcrumb-item a {
color: rgba(255, 255, 255, 0.8);
text-decoration: none;
transition: color 0.3s ease;
}
.breadcrumb-item a:hover {
color: white;
}
.breadcrumb-item.active {
color: white;
}
.breadcrumb-item+.breadcrumb-item::before {
color: rgba(255, 255, 255, 0.5);
}
/* 3D Floating Shapes */
.floating-shapes {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 1;
pointer-events: none;
overflow: hidden;
}
.shape {
position: absolute;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(5px);
border-radius: 15px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
animation: float 8s infinite ease-in-out;
}
.shape-1 {
width: 100px;
height: 100px;
top: 20%;
left: 15%;
animation-delay: 0s;
transform: rotateZ(25deg);
}
.shape-2 {
width: 150px;
height: 150px;
top: 60%;
left: 75%;
animation-delay: 2s;
transform: rotateZ(-15deg);
}
.shape-3 {
width: 80px;
height: 80px;
top: 30%;
left: 85%;
animation-delay: 4s;
transform: rotateZ(45deg);
}
.shape-4 {
width: 120px;
height: 120px;
top: 70%;
left: 25%;
animation-delay: 6s;
transform: rotateZ(-30deg);
}
@keyframes float {
0%, 100% {
transform: translateY(0) rotateZ(0deg);
}
50% {
transform: translateY(-20px) rotateZ(10deg);
}
}
.container {
position: relative;
z-index: 2;
}
/* Contact Info Cards */
.contact-info-card {
background-color: white;
border-radius: 15px;
padding: 30px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
text-align: center;
height: 100%;
transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.contact-info-card:hover {
transform: translateY(-10px);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}
.icon-box {
width: 70px;
height: 70px;
background-color: rgba(var(--primary-rgb), 0.1);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 20px;
}
.icon-box i {
font-size: 1.8rem;
color: var(--primary-color);
}
.contact-info-card h3 {
font-size: 1.25rem;
font-weight: 700;
margin-bottom: 15px;
color: #1a202c;
}
.contact-info-card p {
font-size: 1rem;
color: #718096;
margin-bottom: 0;
line-height: 1.6;
}
/* Contact Form */
.contact-form-wrapper, .map-wrapper {
background-color: white;
border-radius: 15px;
padding: 40px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
height: 100%;
}
.section-badge {
display: inline-block;
padding: 5px 15px;
background-color: rgba(var(--primary-rgb), 0.1);
color: var(--primary-color);
font-weight: 600;
font-size: 0.85rem;
border-radius: 20px;
margin-bottom: 15px;
}
.section-title {
font-size: 2rem;
font-weight: 700;
margin-bottom: 15px;
color: #1a202c;
line-height: 1.3;
}
.section-text {
font-size: 1rem;
color: #718096;
margin-bottom: 30px;
line-height: 1.7;
}
.form-control {
border: 1px solid #e2e8f0;
padding: 12px 20px;
border-radius: 10px;
font-size: 0.95rem;
transition: all 0.3s ease;
}
.form-control:focus {
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}
.btn-primary {
background-color: var(--primary-color);
border-color: var(--primary-color);
padding: 12px 30px;
border-radius: 10px;
font-weight: 600;
transition: all 0.3s ease;
}
.btn-primary:hover {
background-color: var(--secondary-color);
border-color: var(--secondary-color);
transform: translateY(-3px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
/* Map */
.map-container {
border-radius: 15px;
overflow: hidden;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}
/* FAQ Section */
.accordion-item {
border: none;
margin-bottom: 15px;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
.accordion-button {
padding: 20px 25px;
font-weight: 600;
color: #1a202c;
background-color: white;
border: none;
box-shadow: none;
}
.accordion-button:not(.collapsed) {
color: var(--primary-color);
background-color: rgba(var(--primary-rgb), 0.05);
}
.accordion-button:focus {
box-shadow: none;
border-color: rgba(var(--primary-rgb), 0.1);
}
.accordion-button::after {
background-size: 16px;
color: var(--primary-color);
}
.accordion-body {
padding: 20px 25px;
background-color: white;
color: #718096;
line-height: 1.7;
}
/* Responsive */
@media (max-width: 991.98px) {
.page-header {
padding: 60px 0 80px;
}
.page-title {
font-size: 2.25rem;
}
.contact-form-wrapper, .map-wrapper {
padding: 30px;
}
.section-title {
font-size: 1.75rem;
}
}
@media (max-width: 767.98px) {
.page-header {
padding: 50px 0 70px;
}
.page-title {
font-size: 2rem;
}
.contact-info-card {
padding: 20px;
}
.icon-box {
width: 60px;
height: 60px;
}
.icon-box i {
font-size: 1.5rem;
}
}
@media (max-width: 575.98px) {
.page-header {
padding: 40px 0 60px;
}
.page-title {
font-size: 1.75rem;
}
.contact-form-wrapper, .map-wrapper {
padding: 20px;
}
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Initialize WOW.js for animations
new WOW().init();
// Initialize parallax effect for 3D shapes
const shapes = document.querySelectorAll('.shape');
shapes.forEach(shape => {
const data = shape.getAttribute('data-parallax');
if (data) {
const options = JSON.parse(data);
window.addEventListener('mousemove', function(e) {
const x = (window.innerWidth - e.pageX * options.x) / 90;
const y = (window.innerHeight - e.pageY * options.y) / 90;
shape.style.transform = `translateX(${x}px) translateY(${y}px)`;
});
}
});
// Form validation
const contactForm = document.getElementById('contactForm');
if (contactForm) {
contactForm.addEventListener('submit', function(e) {
const nameInput = document.getElementById('name');
const emailInput = document.getElementById('email');
const subjectInput = document.getElementById('subject');
const messageInput = document.getElementById('message');
let isValid = true;
// Simple validation
if (nameInput.value.trim() === '') {
isValid = false;
nameInput.classList.add('is-invalid');
} else {
nameInput.classList.remove('is-invalid');
}
if (emailInput.value.trim() === '' || !isValidEmail(emailInput.value)) {
isValid = false;
emailInput.classList.add('is-invalid');
} else {
emailInput.classList.remove('is-invalid');
}
if (subjectInput.value.trim() === '') {
isValid = false;
subjectInput.classList.add('is-invalid');
} else {
subjectInput.classList.remove('is-invalid');
}
if (messageInput.value.trim() === '') {
isValid = false;
messageInput.classList.add('is-invalid');
} else {
messageInput.classList.remove('is-invalid');
}
if (!isValid) {
e.preventDefault();
}
});
}
function isValidEmail(email) {
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return regex.test(email);
}
});
</script>
<?php
// Include footer
include 'includes/footer.php';
?>