Auto commit: 2025-10-05T21:53:53.351Z

This commit is contained in:
Flatlogic Bot 2025-10-05 21:53:53 +00:00
parent bc0214fda0
commit 1c7e1e6f25
15 changed files with 878 additions and 148 deletions

130
admin.php Normal file
View File

@ -0,0 +1,130 @@
<?php
require_once 'header.php';
// Oturumun başlatıldığından emin olalım (header.php içinde zaten olabilir, ama burada garantiye alalım)
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
// 1. Erişim Kontrolü: Kullanıcı giriş yapmamışsa veya rolü 'admin' değilse, ana sayfaya yönlendir.
if (!isset($_SESSION['loggedin']) || $_SESSION['role'] !== 'admin') {
header('Location: /index.php');
exit;
}
require_once 'db/config.php';
$users = [];
$requests = [];
$error_message = '';
try {
$pdo = db();
// 2. Veritabanından tüm kullanıcıları çek
$stmt_users = $pdo->query('SELECT id, name, surname, email, role, created_at FROM users ORDER BY created_at DESC');
$users = $stmt_users->fetchAll(PDO::FETCH_ASSOC);
// 3. Veritabanından tüm influencer isteklerini çek
$stmt_requests = $pdo->query('
SELECT
ir.id, ir.client_name, ir.client_surname, ir.client_phone, ir.message, ir.status, ir.created_at,
u.name as influencer_name, u.surname as influencer_surname
FROM influencer_requests ir
JOIN users u ON ir.influencer_user_id = u.id
ORDER BY ir.created_at DESC
');
$requests = $stmt_requests->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
// Geliştirme aşamasında hatayı görmek faydalı olabilir
$error_message = "Veritabanı hatası: " . $e->getMessage();
}
?>
<div class="container mt-5">
<?php if ($error_message): ?>
<div class="alert alert-danger">
<p><?php echo htmlspecialchars($error_message); ?></p>
</div>
<?php endif; ?>
<div class="mb-5">
<h2>Influencer Talepleri</h2>
<p>İşletmelerden gelen en son talepler.</p>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Talep Eden</th>
<th>Telefon</th>
<th>Influencer</th>
<th>Durum</th>
<th>Tarih</th>
<th>Mesaj</th>
</tr>
</thead>
<tbody>
<?php if (empty($requests)): ?>
<tr>
<td colspan="7">Henüz hiç talep gelmemiş.</td>
</tr>
<?php else: ?>
<?php foreach ($requests as $request): ?>
<tr>
<td><?php echo htmlspecialchars($request['id']); ?></td>
<td><?php echo htmlspecialchars($request['client_name'] . ' ' . $request['client_surname']); ?></td>
<td><?php echo htmlspecialchars($request['client_phone']); ?></td>
<td><?php echo htmlspecialchars($request['influencer_name'] . ' ' . $request['influencer_surname']); ?></td>
<td><span class="badge bg-primary"><?php echo htmlspecialchars($request['status']); ?></span></td>
<td><?php echo htmlspecialchars(date("d.m.Y H:i", strtotime($request['created_at']))); ?></td>
<td><?php echo htmlspecialchars($request['message']); ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<div class="mb-5">
<h2>Kullanıcı Yönetimi</h2>
<p>Sisteme kayıtlı tüm kullanıcıların listesi.</p>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Ad</th>
<th>Soyad</th>
<th>E-posta</th>
<th>Rol</th>
<th>Kayıt Tarihi</th>
</tr>
</thead>
<tbody>
<?php if (empty($users)): ?>
<tr>
<td colspan="6">Sistemde hiç kullanıcı bulunamadı.</td>
</tr>
<?php else: ?>
<?php foreach ($users as $user): ?>
<tr>
<td><?php echo htmlspecialchars($user['id']); ?></td>
<td><?php echo htmlspecialchars($user['name']); ?></td>
<td><?php echo htmlspecialchars($user['surname']); ?></td>
<td><?php echo htmlspecialchars($user['email']); ?></td>
<td><?php echo htmlspecialchars($user['role']); ?></td>
<td><?php echo htmlspecialchars(date("d.m.Y H:i", strtotime($user['created_at']))); ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php require_once 'footer.php'; ?>

55
apply.php Normal file
View File

@ -0,0 +1,55 @@
<?php
require_once 'header.php';
require_once 'db/config.php';
if (!isset($_SESSION['loggedin']) || $_SESSION['role'] !== 'talent') {
header('Location: /dashboard.php');
exit;
}
$user_id = $_SESSION['user_id'];
$message = '';
$pdo = db();
// Handle form submission
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$bio = $_POST['bio'] ?? '';
$category = $_POST['category'] ?? '';
try {
$stmt = $pdo->prepare("UPDATE users SET bio = ?, category = ?, profile_status = 'pending' WHERE id = ?");
$stmt->execute([$bio, $category, $user_id]);
$message = '<div class="alert alert-success">Profiliniz başarıyla güncellendi. Başvurunuz incelenmek üzere gönderildi.</div>';
} catch (PDOException $e) {
$message = '<div class="alert alert-danger">Profil güncellenirken bir hata oluştu: ' . $e->getMessage() . '</div>';
}
}
// Fetch current user data
$stmt = $pdo->prepare("SELECT bio, category FROM users WHERE id = ?");
$stmt->execute([$user_id]);
$user = $stmt->fetch(PDO::FETCH_ASSOC);
?>
<div class="container mt-5">
<h1>Başvuru Yap / Profili Düzenle</h1>
<p>Influencer profilinizi tamamlamak veya güncellemek için aşağıdaki formu doldurun.</p>
<?php echo $message; ?>
<form action="" method="POST">
<div class="mb-3">
<label for="category" class="form-label">Kategori</label>
<input type="text" class="form-control" id="category" name="category" value="<?php echo htmlspecialchars($user['category'] ?? ''); ?>" placeholder="Örn: Moda, Teknoloji, Seyahat">
</div>
<div class="mb-3">
<label for="bio" class="form-label">Biyografi</label>
<textarea class="form-control" id="bio" name="bio" rows="6" placeholder="Kendinizden, içeriklerinizden ve hedef kitlenizden bahsedin."><?php echo htmlspecialchars($user['bio'] ?? ''); ?></textarea>
</div>
<button type="submit" class="btn btn-primary">Kaydet ve Başvuruyu Gönder</button>
<a href="/dashboard.php" class="btn btn-secondary">Panele Dön</a>
</form>
</div>
<?php require_once 'footer.php'; ?>

185
assets/css/custom.css Normal file
View File

@ -0,0 +1,185 @@
/* Beni de Unlu Yap - Custom CSS */
:root {
--primary-color: #5A67D8; /* Indigo */
--accent-color: #38B2AC; /* Teal */
--bg-light: #F7FAFC;
--surface-white: #FFFFFF;
--text-dark: #2D3748;
--text-medium: #4A5568;
--border-color: #E2E8F0;
}
body {
font-family: 'Inter', sans-serif;
color: var(--text-medium);
background-color: var(--bg-light);
margin: 0;
line-height: 1.6;
}
h1, h2, h3 {
font-family: 'Georgia', serif;
color: var(--text-dark);
font-weight: 700;
}
.container {
max-width: 960px;
margin: 2rem auto;
padding: 0 1.5rem;
}
/* Header */
header {
background-color: var(--surface-white);
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
padding: 1rem 1.5rem;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1200px;
margin: 0 auto;
}
nav .logo {
font-family: 'Georgia', serif;
font-size: 1.5rem;
font-weight: 700;
color: var(--primary-color);
text-decoration: none;
}
nav ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
gap: 1.5rem;
}
nav a {
text-decoration: none;
color: var(--text-dark);
font-weight: 500;
transition: color 0.3s ease;
}
nav a:hover {
color: var(--primary-color);
}
/* Hero Section */
.hero {
background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
color: var(--surface-white);
text-align: center;
padding: 5rem 1.5rem;
}
.hero h1 {
font-size: 3rem;
color: var(--surface-white);
margin-bottom: 1rem;
}
.hero p {
font-size: 1.2rem;
margin-bottom: 2rem;
}
/* Buttons */
.btn {
display: inline-block;
background-color: var(--primary-color);
color: var(--surface-white);
padding: 0.8rem 1.5rem;
border-radius: 0.5rem;
text-decoration: none;
font-weight: 700;
border: none;
cursor: pointer;
transition: background-color 0.3s ease;
}
.btn:hover {
background-color: #434190;
}
/* Forms */
.form-group {
margin-bottom: 1.5rem;
}
.form-group label {
display: block;
font-weight: 700;
margin-bottom: 0.5rem;
color: var(--text-dark);
}
.form-group input,
.form-group textarea {
width: 100%;
padding: 0.8rem;
border: 1px solid var(--border-color);
border-radius: 0.5rem;
font-size: 1rem;
}
.form-group input:focus,
.form-group textarea:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.3);
}
/* Sections */
section {
padding: 3rem 0;
border-bottom: 1px solid var(--border-color);
}
.features-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 2rem;
margin-top: 2rem;
}
.feature-item {
background: var(--surface-white);
padding: 2rem;
border-radius: 0.5rem;
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
/* Footer */
footer {
text-align: center;
padding: 2rem 0;
color: var(--text-medium);
}
/* Alerts */
.errors, .success {
padding: 1rem;
margin-bottom: 1rem;
border-radius: 0.5rem;
border: 1px solid;
}
.errors {
background-color: #FED7D7;
color: #9B2C2C;
border-color: #F56565;
}
.success {
background-color: #C6F6D5;
color: #2F855A;
border-color: #68D391;
}

1
assets/js/main.js Normal file
View File

@ -0,0 +1 @@
// Beni de Unlu Yap - Main JS file

43
dashboard.php Normal file
View File

@ -0,0 +1,43 @@
<?php
require_once 'header.php';
if (!isset($_SESSION['loggedin']) || !isset($_SESSION['user_id'])) {
header('Location: /login.php');
exit;
}
$user_role = $_SESSION['role'] ?? 'talent';
?>
<div class="container mt-5">
<h1>Panelim</h1>
<p>Hoş geldin, <strong><?php echo htmlspecialchars($_SESSION['user_name']); ?></strong>!</p>
<p>Burası sizin kişisel paneliniz. Projeyle ilgili işlemlerinizi buradan yönetebilirsiniz.</p>
<hr>
<?php if ($user_role === 'talent'): ?>
<div class="list-group">
<a href="/apply.php" class="list-group-item list-group-item-action">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Başvuru Yap / Profili Düzenle</h5>
</div>
<p class="mb-1">Profil bilgilerinizi (biyografi, kategori vb.) buradan doldurabilir veya güncelleyebilirsiniz.</p>
</a>
<a href="/status.php" class="list-group-item list-group-item-action">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Başvuru Durumunu Kontrol Et</h5>
</div>
<p class="mb-1">Profilinizin onay durumunu buradan takip edebilirsiniz.</p>
</a>
</div>
<?php elseif ($user_role === 'agency'): ?>
<p>Ajans paneli özellikleri yakında burada olacak.</p>
<?php elseif ($user_role === 'admin'): ?>
<p>Yönetim işlemleri için <a href="/admin.php">Admin Paneli</a>'ni kullanabilirsiniz.</p>
<?php endif; ?>
</div>
<?php require_once 'footer.php'; ?>

46
db/migrate.php Normal file
View File

@ -0,0 +1,46 @@
<?php
require 'config.php';
try {
// Connect to MySQL server to ensure DB exists
$pdo_server = new PDO("mysql:host=" . DB_HOST, DB_USER, DB_PASS);
$pdo_server->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo_server->exec("CREATE DATABASE IF NOT EXISTS `" . DB_NAME . "` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
echo "Database '" . DB_NAME . "' checked/created.\n";
// Connect to the specific database
$pdo = db();
echo "Database connected successfully.\n";
// Ensure users table exists with a minimal schema
$pdo->exec("\n CREATE TABLE IF NOT EXISTS `users` (\n `id` INT AUTO_INCREMENT PRIMARY KEY,\n `email` VARCHAR(100) NOT NULL UNIQUE,\n `password` VARCHAR(255) NOT NULL,\n `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;\n ");
echo "Base 'users' table checked/created.\n";
// --- Add columns if they don't exist ---
$columns = [
'name' => "ADD COLUMN `name` VARCHAR(50) NOT NULL AFTER `id`",
'surname' => "ADD COLUMN `surname` VARCHAR(50) NOT NULL AFTER `name`",
'role' => "ADD COLUMN `role` ENUM('talent', 'agency', 'admin') NOT NULL DEFAULT 'talent' AFTER `password`",
'bio' => "ADD COLUMN `bio` TEXT AFTER `role`",
'category' => "ADD COLUMN `category` VARCHAR(100) AFTER `bio`",
'profile_status' => "ADD COLUMN `profile_status` VARCHAR(50) NOT NULL DEFAULT 'new' AFTER `category`"
];
foreach ($columns as $column_name => $add_sql) {
$stmt = $pdo->query("SHOW COLUMNS FROM `users` LIKE '$column_name'");
if ($stmt->fetch(PDO::FETCH_ASSOC)) {
echo "Column '$column_name' already exists.\n";
} else {
$pdo->exec("ALTER TABLE `users` $add_sql;");
echo "Column '$column_name' added successfully.\n";
}
}
// Create 'influencer_requests' table if not exists
$pdo->exec("\n CREATE TABLE IF NOT EXISTS `influencer_requests` (\n `id` INT AUTO_INCREMENT PRIMARY KEY,\n `influencer_user_id` INT NOT NULL,\n `client_name` VARCHAR(255) NOT NULL,\n `client_surname` VARCHAR(255) NOT NULL,\n `client_phone` VARCHAR(50) NOT NULL,\n `message` TEXT,\n `status` VARCHAR(50) NOT NULL DEFAULT 'new',\n `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (`influencer_user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;\n ");
echo "Table 'influencer_requests' checked/created.\n";
} catch (PDOException $e) {
die("Error: " . $e->getMessage());
}

7
footer.php Normal file
View File

@ -0,0 +1,7 @@
</main>
<footer>
<p>&copy; <?php echo date('Y'); ?> Beni de Ünlü Yap. Tüm hakları saklıdır.</p>
</footer>
<script src="/assets/js/main.js"></script>
</body>
</html>

31
header.php Normal file
View File

@ -0,0 +1,31 @@
<?php session_start(); ?>
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Beni de Ünlü Yap</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Georgia:wght@700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/assets/css/custom.css">
</head>
<body>
<header>
<nav>
<a href="/" class="logo">Beni de Ünlü Yap</a>
<ul>
<li><a href="/">Ana Sayfa</a></li>
<li><a href="/influencers.php">Influencerlar</a></li>
<?php if (isset($_SESSION['loggedin'])): ?>
<li><a href="/dashboard.php">Panel</a></li>
<?php if (isset($_SESSION['role']) && $_SESSION['role'] === 'admin'): ?>
<li><a href="/admin.php">Admin Paneli</a></li>
<?php endif; ?>
<li><a href="/logout.php">Çıkış Yap</a></li>
<?php else: ?>
<li><a href="/login.php">Giriş Yap</a></li>
<li><a href="/register.php">Kayıt Ol</a></li>
<?php endif; ?>
</ul>
</nav>
</header>
<main>

200
index.php
View File

@ -1,150 +1,54 @@
<?php <?php require_once 'header.php'; ?>
declare(strict_types=1);
@ini_set('display_errors', '1');
@error_reporting(E_ALL);
@date_default_timezone_set('UTC');
$phpVersion = PHP_VERSION; <div class="hero">
$now = date('Y-m-d H:i:s'); <div class="container">
?> <h1>Şöhretin Kapısını Arala</h1>
<!doctype html> <p>Tek bir başvuru ile Türkiye'nin en iyi ajanslarına ulaş.</p>
<html lang="en"> <a href="/register.php" class="btn btn-primary">Hemen Başvur</a>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>New Style</title>
<?php
// Read project preview data from environment
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
?>
<?php if ($projectDescription): ?>
<!-- Meta description -->
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
<!-- Open Graph meta tags -->
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<!-- Twitter meta tags -->
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<?php endif; ?>
<?php if ($projectImageUrl): ?>
<!-- Open Graph image -->
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<!-- Twitter image -->
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<?php endif; ?>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<style>
:root {
--bg-color-start: #6a11cb;
--bg-color-end: #2575fc;
--text-color: #ffffff;
--card-bg-color: rgba(255, 255, 255, 0.01);
--card-border-color: rgba(255, 255, 255, 0.1);
}
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
text-align: center;
overflow: hidden;
position: relative;
}
body::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
animation: bg-pan 20s linear infinite;
z-index: -1;
}
@keyframes bg-pan {
0% { background-position: 0% 0%; }
100% { background-position: 100% 100%; }
}
main {
padding: 2rem;
}
.card {
background: var(--card-bg-color);
border: 1px solid var(--card-border-color);
border-radius: 16px;
padding: 2rem;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}
.loader {
margin: 1.25rem auto 1.25rem;
width: 48px;
height: 48px;
border: 3px solid rgba(255, 255, 255, 0.25);
border-top-color: #fff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.hint {
opacity: 0.9;
}
.sr-only {
position: absolute;
width: 1px; height: 1px;
padding: 0; margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap; border: 0;
}
h1 {
font-size: 3rem;
font-weight: 700;
margin: 0 0 1rem;
letter-spacing: -1px;
}
p {
margin: 0.5rem 0;
font-size: 1.1rem;
}
code {
background: rgba(0,0,0,0.2);
padding: 2px 6px;
border-radius: 4px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
footer {
position: absolute;
bottom: 1rem;
font-size: 0.8rem;
opacity: 0.7;
}
</style>
</head>
<body>
<main>
<div class="card">
<h1>Analyzing your requirements and generating your website…</h1>
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
<span class="sr-only">Loading…</span>
</div>
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
<p class="hint">This page will update automatically as the plan is implemented.</p>
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
</div> </div>
</main> </div>
<footer>
Page updated: <?= htmlspecialchars($now) ?> (UTC) <section id="about" class="container">
</footer> <h2>Hakkımızda</h2>
</body> <p>Beni de Ünlü Yap, oyuncu, model ve influencer adaylarını doğru ajanslarla buluşturan bir platformdur. Profilini oluştur, başvurunu yap ve hayallerine bir adım daha yaklaş.</p>
</html> </section>
<section id="features" class="container">
<h2>Nasıl Çalışır?</h2>
<div class="features-grid">
<div class="feature-item">
<h3>1. Profilini Oluştur</h3>
<p>Kişisel bilgilerini, yeteneklerini ve fotoğraflarını ekleyerek dikkat çekici bir profil oluştur.</p>
</div>
<div class="feature-item">
<h3>2. Tek Tıkla Başvur</h3>
<p>Hazırladığın profil ile sistemdeki tüm ajanslara aynı anda, tek bir tıkla başvurunu gönder.</p>
</div>
<div class="feature-item">
<h3>3. Süreci Takip Et</h3>
<p>Başvurunun hangi aşamada olduğunu (inceleniyor, onaylandı, reddedildi) panelinden anlık olarak takip et.</p>
</div>
</div>
</section>
<section id="contact" class="container">
<h2>İletişim</h2>
<p>Soru ve önerileriniz için bize ulaşın.</p>
<form>
<div class="form-group">
<label for="contact-name">Adınız</label>
<input type="text" id="contact-name" name="name">
</div>
<div class="form-group">
<label for="contact-email">E-posta</label>
<input type="email" id="contact-email" name="email">
</div>
<div class="form-group">
<label for="contact-message">Mesajınız</label>
<textarea id="contact-message" name="message" rows="5"></textarea>
</div>
<button type="submit" class="btn">Gönder</button>
</form>
</section>
<?php require_once 'footer.php'; ?>

34
influencers.php Normal file
View File

@ -0,0 +1,34 @@
<?php
require_once 'header.php';
require_once 'db/config.php';
$pdo = db();
$stmt = $pdo->prepare("SELECT id, name, surname, email FROM users WHERE role = ?");
$stmt->execute(['talent']);
$influencers = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<div class="container mt-5">
<h1 class="mb-4">Influencerlar</h1>
<div class="row">
<?php if (empty($influencers)): ?>
<div class="col">
<p>Henüz sisteme kayıtlı bir influencer bulunmuyor.</p>
</div>
<?php else: ?>
<?php foreach ($influencers as $influencer): ?>
<div class="col-md-4 mb-4">
<div class="card">
<div class="card-body">
<h5 class="card-title"><?php echo htmlspecialchars($influencer['name'] . ' ' . $influencer['surname']); ?></h5>
<p class="card-text"><?php echo htmlspecialchars($influencer['email']); ?></p>
<a href="request_form.php?influencer_id=<?php echo $influencer['id']; ?>" class="btn btn-primary">İstek Gönder</a>
</div>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<?php require_once 'footer.php'; ?>

70
login.php Normal file
View File

@ -0,0 +1,70 @@
<?php
require_once 'header.php';
require_once 'db/config.php';
$errors = [];
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$email = $_POST['email'] ?? '';
$password = $_POST['password'] ?? '';
if (empty($email)) {
$errors[] = 'E-posta zorunludur.';
}
if (empty($password)) {
$errors[] = 'Şifre zorunludur.';
}
if (empty($errors)) {
try {
$pdo = db();
$stmt = $pdo->prepare("SELECT * FROM users WHERE email = ?");
$stmt->execute([$email]);
$user = $stmt->fetch();
if ($user && password_verify($password, $user['password'])) {
$_SESSION['loggedin'] = true;
$_SESSION['user_id'] = $user['id'];
$_SESSION['user_name'] = $user['name'];
$_SESSION['role'] = $user['role'];
header('Location: /dashboard.php');
exit;
} else {
$errors[] = 'Geçersiz e-posta veya şifre.';
}
} catch (PDOException $e) {
$errors[] = "Veritabanı hatası: " . $e->getMessage();
}
}
}
?>
<div class="container">
<h1>Giriş Yap</h1>
<?php if (!empty($errors)):
?>
<div class="errors">
<?php foreach ($errors as $error):
?>
<p><?php echo htmlspecialchars($error); ?></p>
<?php endforeach;
?>
</div>
<?php endif;
?>
<form action="/login.php" method="post">
<div class="form-group">
<label for="email">E-posta</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="password">Şifre</label>
<input type="password" id="password" name="password" required>
</div>
<button type="submit" class="btn">Giriş Yap</button>
</form>
</div>
<?php require_once 'footer.php'; ?>

6
logout.php Normal file
View File

@ -0,0 +1,6 @@
<?php
session_start();
session_unset();
session_destroy();
header('Location: /');
exit;

87
register.php Normal file
View File

@ -0,0 +1,87 @@
<?php
require_once 'header.php';
require_once 'db/config.php';
$errors = [];
$success = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$name = $_POST['name'] ?? '';
$email = $_POST['email'] ?? '';
$password = $_POST['password'] ?? '';
$password_confirm = $_POST['password_confirm'] ?? '';
if (empty($name)) {
$errors[] = 'Ad Soyad zorunludur.';
}
if (empty($email)) {
$errors[] = 'E-posta zorunludur.';
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$errors[] = 'Geçersiz e-posta formatı.';
}
if (empty($password)) {
$errors[] = 'Şifre zorunludur.';
}
if ($password !== $password_confirm) {
$errors[] = 'Şifreler eşleşmiyor.';
}
if (empty($errors)) {
try {
$pdo = db();
$stmt = $pdo->prepare("SELECT id FROM users WHERE email = ?");
$stmt->execute([$email]);
if ($stmt->fetch()) {
$errors[] = 'Bu e-posta adresi zaten kayıtlı.';
} else {
$hashed_password = password_hash($password, PASSWORD_DEFAULT);
$stmt = $pdo->prepare("INSERT INTO users (name, email, password) VALUES (?, ?, ?)");
$stmt->execute([$name, $email, $hashed_password]);
$success = 'Başarıyla kayıt oldunuz! Giriş yapabilirsiniz.';
}
} catch (PDOException $e) {
$errors[] = "Veritabanı hatası: " . $e->getMessage();
}
}
}
?>
<div class="container">
<h1>Kayıt Ol</h1>
<?php if (!empty($errors)): ?>
<div class="errors">
<?php foreach ($errors as $error): ?>
<p><?php echo htmlspecialchars($error); ?></p>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ($success): ?>
<div class="success">
<p><?php echo htmlspecialchars($success); ?></p>
</div>
<?php else: ?>
<form action="/register.php" method="post">
<div class="form-group">
<label for="name">Ad Soyad</label>
<input type="text" id="name" name="name" required>
</div>
<div class="form-group">
<label for="email">E-posta</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="password">Şifre</label>
<input type="password" id="password" name="password" required>
</div>
<div class="form-group">
<label for="password_confirm">Şifre Tekrar</label>
<input type="password" id="password_confirm" name="password_confirm" required>
</div>
<button type="submit" class="btn">Kayıt Ol</button>
</form>
<?php endif; ?>
</div>
<?php require_once 'footer.php'; ?>

75
request_form.php Normal file
View File

@ -0,0 +1,75 @@
<?php
require_once 'header.php';
require_once 'db/config.php';
$influencer_id = $_GET['influencer_id'] ?? null;
$message = '';
if (!$influencer_id) {
die("Influencer bulunamadı.");
}
// Fetch influencer details to display
$pdo = db();
$stmt = $pdo->prepare("SELECT name, surname FROM users WHERE id = ? AND role = 'talent'");
$stmt->execute([$influencer_id]);
$influencer = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$influencer) {
die("Belirtilen influencer bulunamadı veya bir yetenek değil.");
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$client_name = $_POST['client_name'] ?? '';
$client_surname = $_POST['client_surname'] ?? '';
$client_phone = $_POST['client_phone'] ?? '';
$request_message = $_POST['message'] ?? '';
if ($client_name && $client_surname && $client_phone) {
try {
$insert_stmt = $pdo->prepare("
INSERT INTO influencer_requests
(influencer_user_id, client_name, client_surname, client_phone, message)
VALUES (?, ?, ?, ?, ?)
");
$insert_stmt->execute([$influencer_id, $client_name, $client_surname, $client_phone, $request_message]);
$message = '<div class="alert alert-success">Talebiniz başarıyla gönderildi.</div>';
} catch (PDOException $e) {
$message = '<div class="alert alert-danger">Talebiniz gönderilirken bir hata oluştu: ' . $e->getMessage() . '</div>';
}
} else {
$message = '<div class="alert alert-danger">Lütfen tüm zorunlu alanları doldurun.</div>';
}
}
?>
<div class="container mt-5">
<h1 class="mb-4">Influencer için Talep Oluştur</h1>
<p><strong>Influencer:</strong> <?php echo htmlspecialchars($influencer['name'] . ' ' . $influencer['surname']); ?></p>
<?php echo $message; ?>
<form action="" method="POST">
<input type="hidden" name="influencer_id" value="<?php echo htmlspecialchars($influencer_id); ?>">
<div class="mb-3">
<label for="client_name" class="form-label">Adınız</label>
<input type="text" class="form-control" id="client_name" name="client_name" required>
</div>
<div class="mb-3">
<label for="client_surname" class="form-label">Soyadınız</label>
<input type="text" class="form-control" id="client_surname" name="client_surname" required>
</div>
<div class="mb-3">
<label for="client_phone" class="form-label">Telefon Numaranız</label>
<input type="tel" class="form-control" id="client_phone" name="client_phone" required>
</div>
<div class="mb-3">
<label for="message" class="form-label">Mesajınız</label>
<textarea class="form-control" id="message" name="message" rows="4"></textarea>
</div>
<button type="submit" class="btn btn-primary">Talebi Gönder</button>
<a href="influencers.php" class="btn btn-secondary">Geri Dön</a>
</form>
</div>
<?php require_once 'footer.php'; ?>

56
status.php Normal file
View File

@ -0,0 +1,56 @@
<?php
require_once 'header.php';
require_once 'db/config.php';
if (!isset($_SESSION['loggedin']) || $_SESSION['role'] !== 'talent') {
header('Location: /dashboard.php');
exit;
}
$user_id = $_SESSION['user_id'];
$pdo = db();
// Fetch current user status
$stmt = $pdo->prepare("SELECT profile_status FROM users WHERE id = ?");
$stmt->execute([$user_id]);
$status = $stmt->fetchColumn();
$status_message = '';
$status_class = 'alert-secondary';
switch ($status) {
case 'new':
$status_message = 'Henüz bir başvuru yapmadınız. Lütfen profil bilgilerinizi doldurun.';
$status_class = 'alert-warning';
break;
case 'pending':
$status_message = 'Başvurunuz alınmıştır ve şu anda incelenmektedir.';
$status_class = 'alert-info';
break;
case 'approved':
$status_message = 'Tebrikler! Başvurunuz onaylanmıştır.';
$status_class = 'alert-success';
break;
case 'rejected':
$status_message = 'Başvurunuz maalesef reddedilmiştir.';
$status_class = 'alert-danger';
break;
default:
$status_message = 'Durumunuz belirlenemedi.';
}
?>
<div class="container mt-5">
<h1>Başvuru Durumu</h1>
<p>Profilinizin ve başvurunuzun güncel durumu aşağıdadır.</p>
<div class="alert <?php echo $status_class; ?>" role="alert">
<h4 class="alert-heading">Durum: <?php echo htmlspecialchars(ucfirst($status)); ?></h4>
<p><?php echo $status_message; ?></p>
</div>
<a href="/dashboard.php" class="btn btn-primary">Panele Dön</a>
</div>
<?php require_once 'footer.php'; ?>