Reformat functions

This commit is contained in:
edsea
2025-10-12 00:07:59 +02:00
parent 414b6c5a3a
commit 0f160833f3
10 changed files with 77 additions and 56 deletions

View File

@@ -6,6 +6,7 @@ require_once($_SERVER['DOCUMENT_ROOT'] . '/db.php');
$conn = getConnection();
include($_SERVER['DOCUMENT_ROOT'] . '/inc/php/header.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/inc/php/resources.php'); // load languages
?>
<body>
@@ -15,8 +16,7 @@ include($_SERVER['DOCUMENT_ROOT'] . '/inc/php/header.php');
<h2 class="logo">📧 AI Email</h2>
<nav>
<ul>
<li><a href="/inc/php/generate.php">✍️ Generate</a></li>
<li><a href="/saved_emails.php">💾 Saved Emails</a></li>
<li><a href="/home.php">✍️ Generate</a></li>
<li><a href="/settings.php">⚙️ Settings</a></li>
<li><a href="/logout.php">🚪 Logout</a></li>
</ul>
@@ -28,44 +28,33 @@ include($_SERVER['DOCUMENT_ROOT'] . '/inc/php/header.php');
<header>
<h1>Welcome to AI Email Generator</h1>
<p>Effortlessly craft polished, professional emails in seconds.</p>
<button id="darkModeBtn">🌙 Toggle Dark Mode</button>
</header>
<section class="quick-actions">
<h2>⚡ Quick Actions</h2>
<div class="actions">
<a href="/inc/php/generate.php"><button>Start Generating Emails</button></a>
</div>
</section>
<section>
<div class="container">
<!-- adjust action depending on vhost/subfolder -->
<form action="/process.php" method="POST">
<label for="email_input">Your rough text:</label><br>
<textarea name="email_input" rows="6" cols="50" required></textarea><br><br>
<section class="connected-accounts">
<h2>📧 Connected Accounts</h2>
<p>Link your email provider to read & send directly:</p>
<div class="connect-buttons">
<a href="/connect/gmail.php"><button>Connect Gmail</button></a>
<a href="/connect/outlook.php"><button>Connect Outlook</button></a>
<a href="/connect/imap.php"><button>Other (IMAP/SMTP)</button></a>
</div>
</section>
<label for="tone">Select tone:</label>
<select name="tone" required>
<option value="formal">Formal</option>
<option value="casual">Casual</option>
<option value="persuasive">Persuasive</option>
<option value="angry">Angry</option>
</select><br><br>
<section class="inbox">
<h2>📥 Inbox</h2>
<p>(This will show your connected emails once integration is done)</p>
<table>
<tr><th>From</th><th>Subject</th><th>Date</th><th>Action</th></tr>
<tr>
<td>Alice</td>
<td>Hello about our meeting</td>
<td>2025-08-20</td>
<td><a href="/inbox/view.php?id=1"><button>View</button></a></td>
</tr>
<tr>
<td>Bob</td>
<td>Invoice Reminder</td>
<td>2025-08-19</td>
<td><a href="/inbox/view.php?id=2"><button>View</button></a></td>
</tr>
</table>
<label for="language">Language:</label>
<select name="language" required>
<?php foreach (getLanguages() as $lang): ?>
<option value="<?= htmlspecialchars($lang) ?>"><?= htmlspecialchars($lang) ?></option>
<?php endforeach; ?>
</select><br><br>
<button type="submit">Generate Email</button>
</form>
</div>
</section>
</main>
</div>