diff --git a/analyst_dashboard.php b/analyst_dashboard.php new file mode 100644 index 0000000..e329b69 --- /dev/null +++ b/analyst_dashboard.php @@ -0,0 +1,109 @@ +query("SELECT id, name, status, created_at FROM submissions ORDER BY created_at DESC"); + $submissions = $stmt->fetchAll(); +} catch (PDOException $e) { + $submissions = []; + // error_log($e->getMessage()); // It's good practice to log errors +} +?> + + + + + + Analyst Dashboard + + + + + + + + +
+
+

Analyst Dashboard

+
+ + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameSocial ProfilesIndustryGeo-LocationStatusActions
+ + No data submitted yet. +
+ + + + + + + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..de01d97 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,21 @@ +body { + background-color: #F8F9FA; +} + +.navbar-brand { + font-weight: bold; +} + +.form-control:focus { + border-color: #0D6EFD; + box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); +} + +.btn-primary { + background-color: #0D6EFD; + border-color: #0D6EFD; +} + +.toast { + border-radius: 0.5rem; +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..0640c39 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,7 @@ +document.addEventListener('DOMContentLoaded', function () { + var toastEl = document.getElementById('successToast'); + if (toastEl) { + var toast = new bootstrap.Toast(toastEl); + toast.show(); + } +}); diff --git a/db/migrate.php b/db/migrate.php new file mode 100644 index 0000000..3c2dca8 --- /dev/null +++ b/db/migrate.php @@ -0,0 +1,36 @@ + PDO::ERRMODE_EXCEPTION, + ]); + $pdo->exec('CREATE DATABASE IF NOT EXISTS '.DB_NAME); + echo "Database ".DB_NAME." created or already exists.\n"; +} catch (PDOException $e) { + echo "Error creating database: " . $e->getMessage() . "\n"; + // If the user already exists, we might not have permission to create a database. + // Let's assume the DB is there and try to connect anyway for the next step. +} + +// Now, connect to the database and run migrations +$pdo = db(); +$migrationsDir = __DIR__ . '/migrations'; +$files = glob($migrationsDir . '/*.sql'); + +sort($files); + +foreach ($files as $file) { + echo "Applying migration: " . basename($file) . "\n"; + $sql = file_get_contents($file); + try { + $pdo->exec($sql); + echo "Success\n"; + } catch (PDOException $e) { + echo "Error applying migration: " . $e->getMessage() . "\n"; + exit(1); + } +} + +echo "All migrations applied successfully.\n"; \ No newline at end of file diff --git a/db/migrations/001_create_submissions_table.sql b/db/migrations/001_create_submissions_table.sql new file mode 100644 index 0000000..d38309a --- /dev/null +++ b/db/migrations/001_create_submissions_table.sql @@ -0,0 +1,15 @@ + +CREATE TABLE IF NOT EXISTS submissions ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + status ENUM('new', 'processing', 'complete', 'error') NOT NULL DEFAULT 'new', + profile_url VARCHAR(255) NULL, + username VARCHAR(255) NULL, + company VARCHAR(255) NULL, + profile_image_url VARCHAR(255) NULL, + location VARCHAR(255) NULL, + industry VARCHAR(255) NULL, + geo_location VARCHAR(255) NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +); diff --git a/index.php b/index.php index 7205f3d..33ad0dc 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,90 @@ prepare("INSERT INTO submissions (name) VALUES (?)"); + $stmt->execute([$name]); + $success_toast = true; + } catch (PDOException $e) { + // For now, we'll just prevent the success toast on db error. + } + } +} ?> - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + Lead Enricher + + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ + + + +
+
+
+

Enrich Leads, Effortlessly

+

Submit a name, and our AI will find and classify their social profiles, industry, and location. Turn a simple name into a rich lead.

+
+
+
+
+ + +
+ +
+ By clicking Enrich Name, you agree to the terms of use. +
+
+
-
- + + + +
+ +
+ + + + + - + \ No newline at end of file