4
This commit is contained in:
parent
02f1818a16
commit
2969b7d345
@ -1,9 +1,11 @@
|
||||
/* General Body & Typography */
|
||||
body {
|
||||
background-color: #F9FAFB;
|
||||
color: #1F2937;
|
||||
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
|
||||
background-color: #F9FAFB; /* Gray-50 */
|
||||
color: #1F2937; /* Gray-800 */
|
||||
}
|
||||
|
||||
/* Gradient Text */
|
||||
.gradient-text {
|
||||
background: linear-gradient(to right, #6366F1, #EC4899);
|
||||
-webkit-background-clip: text;
|
||||
@ -12,27 +14,64 @@ body {
|
||||
text-fill-color: transparent;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn-primary {
|
||||
background-color: #6366F1;
|
||||
border-color: #6366F1;
|
||||
padding: 0.75rem 1.5rem;
|
||||
border-radius: 0.5rem;
|
||||
font-weight: 600;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background-color: #4f52c4;
|
||||
border-color: #4f52c4;
|
||||
background-color: #4F46E5; /* Darker Indigo */
|
||||
border-color: #4F46E5;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
/* Hero Section */
|
||||
.hero-section {
|
||||
padding: 6rem 0;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.editor-section {
|
||||
background-color: #F9FAFB;
|
||||
/* Editor Section */
|
||||
.editor-section, .editor-section-locked {
|
||||
padding: 4rem 0;
|
||||
background-color: #F9FAFB; /* Gray-50 */
|
||||
}
|
||||
|
||||
.card {
|
||||
.editor-section .card, .editor-section-locked .card {
|
||||
border: none;
|
||||
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
||||
border-radius: 0.5rem;
|
||||
box-shadow: 0 10px 25px rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
.editor-section-locked a {
|
||||
color: #6366F1;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.editor-section-locked a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
/* Form Controls */
|
||||
.form-control {
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid #D1D5DB; /* Gray-300 */
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
border-color: #6366F1;
|
||||
box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
footer {
|
||||
border-top: 1px solid #E5E7EB; /* Gray-200 */
|
||||
}
|
||||
@ -2,19 +2,56 @@
|
||||
require_once __DIR__ . '/config.php';
|
||||
|
||||
try {
|
||||
// Connect without specifying a database
|
||||
$pdo = new PDO('mysql:host='.DB_HOST, DB_USER, DB_PASS, [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
// First, ensure the database exists
|
||||
$pdo = new PDO('mysql:host=' . DB_HOST, DB_USER, DB_PASS, [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
|
||||
]);
|
||||
$pdo->exec("CREATE DATABASE IF NOT EXISTS ".DB_NAME);
|
||||
echo "Database created successfully (if it didn't exist).\n";
|
||||
$pdo->exec("CREATE DATABASE IF NOT EXISTS " . DB_NAME);
|
||||
|
||||
// Now connect to the database and run migrations
|
||||
// Now, connect to the actual database
|
||||
$pdo = db();
|
||||
$sql = file_get_contents(__DIR__ . '/migrations/001_create_users_table.sql');
|
||||
$pdo->exec($sql);
|
||||
echo "Migration successful!\n";
|
||||
echo "Successfully connected to database: " . DB_NAME . "\n";
|
||||
|
||||
// 1. Create migrations tracking table if it doesn't exist
|
||||
$pdo->exec("CREATE TABLE IF NOT EXISTS `migrations` (
|
||||
`migration` VARCHAR(255) NOT NULL,
|
||||
PRIMARY KEY (`migration`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;");
|
||||
|
||||
// 2. Get all migrations that have been run
|
||||
$run_migrations_stmt = $pdo->query("SELECT `migration` FROM `migrations`");
|
||||
$run_migrations = $run_migrations_stmt->fetchAll(PDO::FETCH_COLUMN);
|
||||
|
||||
// 3. Get all available migration files
|
||||
$migration_files = glob(__DIR__ . '/migrations/*.sql');
|
||||
sort($migration_files);
|
||||
|
||||
$migrations_run_this_time = 0;
|
||||
|
||||
// 4. Loop through files and run any new migrations
|
||||
foreach ($migration_files as $file) {
|
||||
$migration_name = basename($file);
|
||||
if (!in_array($migration_name, $run_migrations)) {
|
||||
echo "Running migration: " . $migration_name . "...\n";
|
||||
|
||||
$sql = file_get_contents($file);
|
||||
$pdo->exec($sql);
|
||||
|
||||
// Record the migration
|
||||
$stmt = $pdo->prepare("INSERT INTO `migrations` (`migration`) VALUES (?)");
|
||||
$stmt->execute([$migration_name]);
|
||||
|
||||
echo " -> Success.\n";
|
||||
$migrations_run_this_time++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($migrations_run_this_time === 0) {
|
||||
echo "All migrations are up to date.\n";
|
||||
} else {
|
||||
echo "Finished running " . $migrations_run_this_time . " new migration(s).\n";
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
die("Migration failed: " . $e->getMessage() . "\n");
|
||||
}
|
||||
}
|
||||
|
||||
8
db/migrations/002_create_user_content_table.sql
Normal file
8
db/migrations/002_create_user_content_table.sql
Normal file
@ -0,0 +1,8 @@
|
||||
CREATE TABLE IF NOT EXISTS `user_content` (
|
||||
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
||||
`user_id` INT NOT NULL,
|
||||
`content` JSON NOT NULL,
|
||||
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
413
index.php
413
index.php
@ -1,89 +1,79 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
// CONFIG
|
||||
$content_file = __DIR__ . '/db/content.json';
|
||||
session_start();
|
||||
require_once 'db/config.php';
|
||||
|
||||
// Default content
|
||||
$default_content = [
|
||||
'hero_title' => 'Build Your Dream Website',
|
||||
'hero_subtitle' => 'Visually design, customize, and publish beautiful, responsive websites. No code required.',
|
||||
'features_title' => 'Powerful Features',
|
||||
'features' => [
|
||||
[
|
||||
'icon' => 'bi-grid-1x2-fill',
|
||||
'title' => 'Drag & Drop Builder',
|
||||
'description' => 'Easily build and customize your site with our intuitive visual editor.'
|
||||
],
|
||||
[
|
||||
'icon' => 'bi-palette-fill',
|
||||
'title' => 'Beautiful Templates',
|
||||
'description' => 'Choose from a variety of professionally designed templates to get started.'
|
||||
],
|
||||
[
|
||||
'icon' => 'bi-phone-fill',
|
||||
'title' => 'Fully Responsive',
|
||||
'description' => 'Your website will look stunning on any device, from desktops to smartphones.'
|
||||
]
|
||||
],
|
||||
'about_title' => 'About Us',
|
||||
'about_text' => 'We are a passionate team dedicated to making web creation accessible to everyone. Our mission is to empower you to bring your ideas to life online, without needing to write a single line of code. Join us on this journey!'
|
||||
];
|
||||
$is_logged_in = isset($_SESSION['user_id']);
|
||||
$content = [];
|
||||
|
||||
// Load content from JSON file if it exists
|
||||
if (file_exists($content_file)) {
|
||||
$json_content = file_get_contents($content_file);
|
||||
$content = json_decode($json_content, true);
|
||||
// Merge with defaults to ensure all keys are present
|
||||
$content = array_merge($default_content, $content);
|
||||
if ($is_logged_in) {
|
||||
$pdo = db();
|
||||
$stmt = $pdo->prepare("SELECT content FROM user_content WHERE user_id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user_content_row = $stmt->fetch();
|
||||
|
||||
if ($user_content_row) {
|
||||
$content = json_decode($user_content_row['content'], true);
|
||||
} else {
|
||||
// New user, so create default content for them
|
||||
$default_content_json = file_get_contents('db/content.json');
|
||||
$content = json_decode($default_content_json, true);
|
||||
|
||||
$insert_stmt = $pdo->prepare("INSERT INTO user_content (user_id, content) VALUES (?, ?)");
|
||||
$insert_stmt->execute([$_SESSION['user_id'], $default_content_json]);
|
||||
}
|
||||
} else {
|
||||
$content = $default_content;
|
||||
// User is not logged in, show default content
|
||||
$content = json_decode(file_get_contents('db/content.json'), true);
|
||||
}
|
||||
|
||||
// Handle POST request to update content
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
// Update Hero
|
||||
if (isset($_POST['hero_title'])) {
|
||||
$content['hero_title'] = htmlspecialchars($_POST['hero_title']);
|
||||
}
|
||||
if (isset($_POST['hero_subtitle'])) {
|
||||
$content['hero_subtitle'] = htmlspecialchars($_POST['hero_subtitle']);
|
||||
}
|
||||
|
||||
// Update About
|
||||
if (isset($_POST['about_title'])) {
|
||||
$content['about_title'] = htmlspecialchars($_POST['about_title']);
|
||||
}
|
||||
if (isset($_POST['about_text'])) {
|
||||
$content['about_text'] = htmlspecialchars($_POST['about_text']);
|
||||
}
|
||||
// Handle content updates
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && $is_logged_in) {
|
||||
$pdo = db();
|
||||
|
||||
// Update Features Title
|
||||
if (isset($_POST['features_title'])) {
|
||||
$content['features_title'] = htmlspecialchars($_POST['features_title']);
|
||||
}
|
||||
// Fetch existing content to merge
|
||||
$stmt = $pdo->prepare("SELECT content FROM user_content WHERE user_id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$current_content_json = $stmt->fetchColumn();
|
||||
$current_content = json_decode($current_content_json, true);
|
||||
|
||||
// Update Features
|
||||
if (isset($_POST['features']) && is_array($_POST['features'])) {
|
||||
$updated_features = [];
|
||||
foreach ($_POST['features'] as $feature_data) {
|
||||
$updated_features[] = [
|
||||
'icon' => htmlspecialchars($feature_data['icon']),
|
||||
'title' => htmlspecialchars($feature_data['title']),
|
||||
'description' => htmlspecialchars($feature_data['description'])
|
||||
];
|
||||
}
|
||||
$content['features'] = $updated_features;
|
||||
}
|
||||
// Update with new values from POST
|
||||
$current_content['hero_title'] = $_POST['hero_title'] ?? $current_content['hero_title'];
|
||||
$current_content['hero_subtitle'] = $_POST['hero_subtitle'] ?? $current_content['hero_subtitle'];
|
||||
$current_content['features_title'] = $_POST['features_title'] ?? $current_content['features_title'];
|
||||
$current_content['feature_1_title'] = $_POST['feature_1_title'] ?? $current_content['feature_1_title'];
|
||||
$current_content['feature_1_text'] = $_POST['feature_1_text'] ?? $current_content['feature_1_text'];
|
||||
$current_content['feature_2_title'] = $_POST['feature_2_title'] ?? $current_content['feature_2_title'];
|
||||
$current_content['feature_2_text'] = $_POST['feature_2_text'] ?? $current_content['feature_2_text'];
|
||||
$current_content['feature_3_title'] = $_POST['feature_3_title'] ?? $current_content['feature_3_title'];
|
||||
$current_content['feature_3_text'] = $_POST['feature_3_text'] ?? $current_content['feature_3_text'];
|
||||
$current_content['about_title'] = $_POST['about_title'] ?? $current_content['about_title'];
|
||||
$current_content['about_text'] = $_POST['about_text'] ?? $current_content['about_text'];
|
||||
|
||||
$new_content_json = json_encode($current_content, JSON_PRETTY_PRINT);
|
||||
|
||||
// Update the database
|
||||
$update_stmt = $pdo->prepare("UPDATE user_content SET content = ? WHERE user_id = ?");
|
||||
$update_stmt->execute([$new_content_json, $_SESSION['user_id']]);
|
||||
|
||||
file_put_contents($content_file, json_encode($content, JSON_PRETTY_PRINT));
|
||||
|
||||
// Redirect to avoid form resubmission
|
||||
header("Location: " . $_SERVER['REQUEST_URI']);
|
||||
header("Location: " . $_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Default values
|
||||
$hero_title = htmlspecialchars($content['hero_title'] ?? 'Build Your Dream Website');
|
||||
$hero_subtitle = htmlspecialchars($content['hero_subtitle'] ?? 'Visually design, customize, and publish beautiful, responsive websites. No code required.');
|
||||
$features_title = htmlspecialchars($content['features_title'] ?? 'Features');
|
||||
$feature_1_title = htmlspecialchars($content['feature_1_title'] ?? 'Visual Editor');
|
||||
$feature_1_text = htmlspecialchars($content['feature_1_text'] ?? 'Design and customize your site with a powerful, intuitive drag-and-drop editor.');
|
||||
$feature_2_title = htmlspecialchars($content['feature_2_title'] ?? 'Responsive Templates');
|
||||
$feature_2_text = htmlspecialchars($content['feature_2_text'] ?? 'Start with professionally designed, mobile-friendly templates that look great on any device.');
|
||||
$feature_3_title = htmlspecialchars($content['feature_3_title'] ?? 'One-Click Publishing');
|
||||
$feature_3_text = htmlspecialchars($content['feature_3_text'] ?? 'Go live instantly. We handle the hosting, security, and scaling for you.');
|
||||
$about_title = htmlspecialchars($content['about_title'] ?? 'About Us');
|
||||
$about_text = htmlspecialchars($content['about_text'] ?? 'We believe creating a website should be simple and accessible to everyone. Our mission is to empower creators with tools that are both powerful and easy to use.');
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@ -91,150 +81,167 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>webCreatorSaas</title>
|
||||
<meta name="description" content="Built with Flatlogic Generator">
|
||||
<meta name="keywords" content="saas website builder, no-code website builder, drag and drop editor, custom website design, responsive web design, small business websites, portfolio websites, Flatlogic Generator">
|
||||
<meta property="og:title" content="webCreatorSaas">
|
||||
<meta property="og:description" content="Built with Flatlogic Generator">
|
||||
<meta property="og:image" content="">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="">
|
||||
|
||||
<!-- Bootstrap 5 CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<!-- Bootstrap Icons -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<!-- Custom CSS -->
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<body class="bg-light">
|
||||
|
||||
<!-- Header -->
|
||||
<?php require_once __DIR__ . '/partials/navigation.php'; ?>
|
||||
<?php include 'partials/navigation.php'; ?>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main>
|
||||
<!-- Hero Section -->
|
||||
<section class="hero-section text-center">
|
||||
<div class="container">
|
||||
<h1 class="display-4 fw-bold gradient-text"><?php echo htmlspecialchars($content['hero_title']); ?></h1>
|
||||
<p class="lead my-4"><?php echo htmlspecialchars($content['hero_subtitle']); ?></p>
|
||||
<a href="#" class="btn btn-primary btn-lg">Start Building for Free</a>
|
||||
<main>
|
||||
<!-- Hero Section -->
|
||||
<header class="hero-section text-white text-center py-5">
|
||||
<div class="container">
|
||||
<h1 class="display-4 fw-bold"><?php echo $hero_title; ?></h1>
|
||||
<p class="lead"><?php echo $hero_subtitle; ?></p>
|
||||
<a href="#editor" class="btn btn-lg btn-light text-primary fw-bold">Get Started</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Features Section -->
|
||||
<section id="features" class="py-5">
|
||||
<div class="container">
|
||||
<div class="text-center mb-5">
|
||||
<h2 class="fw-bold"><?php echo $features_title; ?></h2>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Features Section -->
|
||||
<section id="features" class="py-5">
|
||||
<div class="container">
|
||||
<div class="text-center mb-5">
|
||||
<h2 class="display-5 fw-bold"><?php echo htmlspecialchars($content['features_title']); ?></h2>
|
||||
</div>
|
||||
<div class="row g-4">
|
||||
<?php foreach ($content['features'] as $feature): ?>
|
||||
<div class="col-md-4">
|
||||
<div class="text-center p-4">
|
||||
<i class="<?php echo htmlspecialchars($feature['icon']); ?> gradient-text" style="font-size: 3rem;"></i>
|
||||
<h4 class="fw-bold my-3"><?php echo htmlspecialchars($feature['title']); ?></h4>
|
||||
<p class="text-muted"><?php echo htmlspecialchars($feature['description']); ?></p>
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card h-100 text-center p-4">
|
||||
<div class="mb-3">
|
||||
<i class="bi bi-palette-fill fs-1 text-primary"></i>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- About Section -->
|
||||
<section id="about" class="py-5 bg-light">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8 text-center">
|
||||
<h2 class="display-5 fw-bold"><?php echo htmlspecialchars($content['about_title']); ?></h2>
|
||||
<p class="lead my-4"><?php echo htmlspecialchars($content['about_text']); ?></p>
|
||||
<h5 class="card-title fw-bold"><?php echo $feature_1_title; ?></h5>
|
||||
<p class="card-text"><?php echo $feature_1_text; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Editor Section -->
|
||||
<section class="editor-section">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<div class="card p-4 p-md-5">
|
||||
<h2 class="text-center mb-4"><i class="bi bi-pencil-square me-2"></i>Live Editor</h2>
|
||||
<p class="text-center text-muted mb-4">Change the text in the sections above.</p>
|
||||
<form method="POST" action="index.php">
|
||||
<fieldset class="mb-4">
|
||||
<legend class="h5">Hero Section</legend>
|
||||
<div class="mb-3">
|
||||
<label for="hero_title" class="form-label">Title</label>
|
||||
<input type="text" class="form-control form-control-lg" id="hero_title" name="hero_title" value="<?php echo htmlspecialchars($content['hero_title']); ?>">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="hero_subtitle" class="form-label">Subtitle</label>
|
||||
<textarea class="form-control" id="hero_subtitle" name="hero_subtitle" rows="3"><?php echo htmlspecialchars($content['hero_subtitle']); ?></textarea>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="mb-4">
|
||||
<legend class="h5">Features Section</legend>
|
||||
<div class="mb-3">
|
||||
<label for="features_title" class="form-label">Section Title</label>
|
||||
<input type="text" class="form-control" id="features_title" name="features_title" value="<?php echo htmlspecialchars($content['features_title']); ?>">
|
||||
</div>
|
||||
<?php foreach ($content['features'] as $index => $feature): ?>
|
||||
<div class="mb-3 border-top pt-3">
|
||||
<label class="form-label fw-bold">Feature <?php echo $index + 1; ?></label>
|
||||
<div class="mb-2">
|
||||
<label for="feature_icon_<?php echo $index; ?>" class="form-label small">Icon (Bootstrap Icon Class)</label>
|
||||
<input type="text" class="form-control" id="feature_icon_<?php echo $index; ?>" name="features[<?php echo $index; ?>][icon]" value="<?php echo htmlspecialchars($feature['icon']); ?>">
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label for="feature_title_<?php echo $index; ?>" class="form-label small">Title</label>
|
||||
<input type="text" class="form-control" id="feature_title_<?php echo $index; ?>" name="features[<?php echo $index; ?>][title]" value="<?php echo htmlspecialchars($feature['title']); ?>">
|
||||
</div>
|
||||
<div>
|
||||
<label for="feature_description_<?php echo $index; ?>" class="form-label small">Description</label>
|
||||
<textarea class="form-control" id="feature_description_<?php echo $index; ?>" name="features[<?php echo $index; ?>][description]" rows="2"><?php echo htmlspecialchars($feature['description']); ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="mb-4">
|
||||
<legend class="h5">About Section</legend>
|
||||
<div class="mb-3">
|
||||
<label for="about_title" class="form-label">Title</label>
|
||||
<input type="text" class="form-control" id="about_title" name="about_title" value="<?php echo htmlspecialchars($content['about_title']); ?>">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="about_text" class="form-label">Text</label>
|
||||
<textarea class="form-control" id="about_text" name="about_text" rows="4"><?php echo htmlspecialchars($content['about_text']); ?></textarea>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-primary btn-lg">Update All Content</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card h-100 text-center p-4">
|
||||
<div class="mb-3">
|
||||
<i class="bi bi-phone-fill fs-1 text-primary"></i>
|
||||
</div>
|
||||
<h5 class="card-title fw-bold"><?php echo $feature_2_title; ?></h5>
|
||||
<p class="card-text"><?php echo $feature_2_text; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card h-100 text-center p-4">
|
||||
<div class="mb-3">
|
||||
<i class="bi bi-cloud-arrow-up-fill fs-1 text-primary"></i>
|
||||
</div>
|
||||
<h5 class="card-title fw-bold"><?php echo $feature_3_title; ?></h5>
|
||||
<p class="card-text"><?php echo $feature_3_text; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="container py-5">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md text-center">
|
||||
<p class="text-muted">© <?php echo date("Y"); ?> webCreatorSaas. Built with love by Flatlogic.</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</section>
|
||||
|
||||
<!-- About Section -->
|
||||
<section id="about" class="py-5 bg-white">
|
||||
<div class="container">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-6">
|
||||
<h2 class="fw-bold"><?php echo $about_title; ?></h2>
|
||||
<p><?php echo $about_text; ?></p>
|
||||
</div>
|
||||
<div class="col-md-6 text-center">
|
||||
<i class="bi bi-gem fs-1 text-primary"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Editor Section -->
|
||||
<section id="editor" class="py-5">
|
||||
<div class="container">
|
||||
<?php if ($is_logged_in): ?>
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h3 class="mb-0 fw-bold"><i class="bi bi-pencil-square"></i> Live Editor</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="index.php">
|
||||
<fieldset class="mb-4">
|
||||
<legend class="fs-5 fw-bold border-bottom pb-2 mb-3">Hero Section</legend>
|
||||
<div class="mb-3">
|
||||
<label for="hero_title" class="form-label">Title</label>
|
||||
<input type="text" class="form-control" id="hero_title" name="hero_title" value="<?php echo $hero_title; ?>">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="hero_subtitle" class="form-label">Subtitle</label>
|
||||
<input type="text" class="form-control" id="hero_subtitle" name="hero_subtitle" value="<?php echo $hero_subtitle; ?>">
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="mb-4">
|
||||
<legend class="fs-5 fw-bold border-bottom pb-2 mb-3">Features Section</legend>
|
||||
<div class="mb-3">
|
||||
<label for="features_title" class="form-label">Section Title</label>
|
||||
<input type="text" class="form-control" id="features_title" name="features_title" value="<?php echo $features_title; ?>">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="mb-3">
|
||||
<label for="feature_1_title" class="form-label">Feature 1 Title</label>
|
||||
<input type="text" class="form-control" id="feature_1_title" name="feature_1_title" value="<?php echo $feature_1_title; ?>">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="feature_1_text" class="form-label">Feature 1 Text</label>
|
||||
<textarea class="form-control" id="feature_1_text" name="feature_1_text" rows="3"><?php echo $feature_1_text; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="mb-3">
|
||||
<label for="feature_2_title" class="form-label">Feature 2 Title</label>
|
||||
<input type="text" class="form-control" id="feature_2_title" name="feature_2_title" value="<?php echo $feature_2_title; ?>">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="feature_2_text" class="form-label">Feature 2 Text</label>
|
||||
<textarea class="form-control" id="feature_2_text" name="feature_2_text" rows="3"><?php echo $feature_2_text; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="mb-3">
|
||||
<label for="feature_3_title" class="form-label">Feature 3 Title</label>
|
||||
<input type="text" class="form-control" id="feature_3_title" name="feature_3_title" value="<?php echo $feature_3_title; ?>">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="feature_3_text" class="form-label">Feature 3 Text</label>
|
||||
<textarea class="form-control" id="feature_3_text" name="feature_3_text" rows="3"><?php echo $feature_3_text; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="mb-4">
|
||||
<legend class="fs-5 fw-bold border-bottom pb-2 mb-3">About Section</legend>
|
||||
<div class="mb-3">
|
||||
<label for="about_title" class="form-label">Title</label>
|
||||
<input type="text" class="form-control" id="about_title" name="about_title" value="<?php echo $about_title; ?>">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="about_text" class="form-label">Text</label>
|
||||
<textarea class="form-control" id="about_text" name="about_text" rows="4"><?php echo $about_text; ?></textarea>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<button type="submit" class="btn btn-primary fw-bold w-100 py-2">Save Changes</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="editor-locked text-center p-5 bg-white rounded shadow-sm">
|
||||
<i class="bi bi-lock-fill fs-1 text-primary"></i>
|
||||
<h3 class="mt-3 fw-bold">Editor Locked</h3>
|
||||
<p class="text-muted">Please <a href="login.php">log in</a> or <a href="register.php">create an account</a> to edit the page content.</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<?php include 'partials/footer.php'; ?>
|
||||
|
||||
<!-- Bootstrap 5 JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Custom JS -->
|
||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user