Language updates. New upload form. new classes.
This commit is contained in:
parent
4c2857b445
commit
8f3061ab99
62 changed files with 3107 additions and 1883 deletions
141
contact.php
141
contact.php
|
@ -1,69 +1,128 @@
|
|||
<?php
|
||||
require_once 'includes/globals.php';
|
||||
|
||||
// Initialize auto-fill variables
|
||||
$userName = '';
|
||||
$userEmail = '';
|
||||
|
||||
// Check if user details are available in the session
|
||||
if (isset($_SESSION['user'])) {
|
||||
$userName = $_SESSION['user']['firstName'] . ' ' . $_SESSION['user']['lastName'];
|
||||
$userEmail = $_SESSION['user']['email'];
|
||||
}
|
||||
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
use DJMixHosting\Telegram;
|
||||
|
||||
if ($_POST) {
|
||||
$name = $_POST['name'];
|
||||
$email = $_POST['email'];
|
||||
$formName = $_POST['name'];
|
||||
if ($formName != $userName) {
|
||||
$name = $userName . " (Orig: " . $formName . ")";
|
||||
} else {
|
||||
$name = $formName;
|
||||
}
|
||||
$formEmail = $_POST['email'];
|
||||
if ($formEmail != $userEmail) {
|
||||
$email = $userEmail . " (Orig: " . $formEmail . ")";
|
||||
} else {
|
||||
$email = $userEmail;
|
||||
}
|
||||
$message = $_POST['message'];
|
||||
$ipAddress = $_SERVER['REMOTE_ADDR'];
|
||||
require_once 'classes/Telegram.php';
|
||||
$telegram = new Telegram($config['notifications']['telegram']['token'], $config['notifications']['telegram']['chat_id']);
|
||||
$result = $telegram->send_message("Name: $name\nEmail: $email\nMessage: $message");
|
||||
$result = $telegram->send_message("Name: $name\nEmail: $email\nIP Address: $ipAddress\nMessage: $message");
|
||||
}
|
||||
$title = $locale['contactus'];
|
||||
require_once 'includes/header.php';
|
||||
if ($_POST) {
|
||||
if ($result['ok']) {
|
||||
echo '<div class="alert alert-success" role="alert">Message sent successfully</div>';
|
||||
} else {
|
||||
echo '<div class="alert alert-danger" role="alert">An error occurred while sending the message</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<section>
|
||||
<div class="container py-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<nav aria-label="breadcrumb" class="bg-body-tertiary rounded-3 p-3 mb-4">
|
||||
<ol class="breadcrumb mb-0">
|
||||
<li class="breadcrumb-item"><a href="/"><?php echo $locale['home']; ?></a></li>
|
||||
<li class="breadcrumb-item active"><a
|
||||
href="/contact.php"><?php echo $locale['contactus']; ?></a></li>
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
<!-- Custom CSS -->
|
||||
<style>
|
||||
|
||||
.contact-form {
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 0 20px rgba(0,0,0,0.1);
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
border-color: #0d6efd;
|
||||
box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
|
||||
}
|
||||
|
||||
.social-links a {
|
||||
color: #6c757d;
|
||||
margin: 0 10px;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
.social-links a:hover {
|
||||
color: #0d6efd;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<?php if ($_POST): ?>
|
||||
<div class="position-fixed top-0 start-50 translate-middle-x p-3" style="z-index: 1000">
|
||||
<div class="toast show" role="alert" aria-live="assertive" aria-atomic="true">
|
||||
<div class="toast-header <?php echo $result['ok'] ? 'bg-success' : 'bg-danger'; ?> text-white">
|
||||
<strong class="me-auto">Notification</strong>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="toast" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="toast-body">
|
||||
<?php echo $result['ok'] ? 'Message sent successfully!' : 'An error occurred while sending the message.'; ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="container py-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1><?php echo $locale['contactus']; ?></h1>
|
||||
<p>For any inquiries, please complete the form below.</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Breadcrumb -->
|
||||
<section>
|
||||
<div class="container py-3">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb mb-0">
|
||||
<li class="breadcrumb-item"><a href="/" class="text-decoration-none"><?php echo $locale['home']; ?></a></li>
|
||||
<li class="breadcrumb-item active"><?php echo $locale['contactus']; ?></li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Contact Section -->
|
||||
<div class="container py-5">
|
||||
<!-- Header -->
|
||||
<div class="row mb-5 text-center">
|
||||
<div class="col-lg-8 mx-auto">
|
||||
<h1 class="display-4 mb-3"><?php echo $locale['contactus']; ?></h1>
|
||||
<p class="lead text-muted">We'd love to hear from you. Send us a message and we'll respond as soon as possible.</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<form action="contact.php" method="post">
|
||||
<div class="mb-3">
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Contact Form -->
|
||||
<div class="col-lg-7 mb-4 mb-lg-0">
|
||||
<div class="contact-form">
|
||||
<h3 class="mb-4">Send us a Message</h3>
|
||||
<form action="/contact" method="post">
|
||||
<div class="mb-4">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name" required>
|
||||
<input type="text" class="form-control form-control-lg" id="name" name="name" value="<?php echo htmlspecialchars($userName); ?>" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="mb-4">
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<input type="email" class="form-control" id="email" name="email" required>
|
||||
<input type="email" class="form-control form-control-lg" id="email" name="email" value="<?php echo htmlspecialchars($userEmail); ?>" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="mb-4">
|
||||
<label for="message" class="form-label">Message</label>
|
||||
<textarea class="form-control" id="message" name="message" rows="3" required></textarea>
|
||||
<textarea class="form-control form-control-lg" id="message" name="message" rows="5" required></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
<button type="submit" class="btn btn-primary btn-lg px-5">Send Message</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
require_once 'includes/footer.php';
|
||||
</div>
|
||||
|
||||
<?php require_once 'includes/footer.php'; ?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue