i need a professional and highly secured prompt for an ai to help me write the logic for my portfolio-mgmt/projects.php.
call the logic file mgmt/app/projects-mgmt.php .
i want the admin to be able to add project from portfolio-mgmt/projects.php and will show in projects.php. and project-details.php is to show the full details of the project written, that means if any project is clicked on projects.php , that particular project will be redirected to show its project-details.php completely.
when the add new project button is clicked, a popup form that has input that suits the projects.php and project-details.php .
create a database table for projects using sql fmt
make sure the TOTAL PROJECTS, ACTIVE DEPLOYMENTS, PENDING DRAFTS, TOTAL REACH,and the search filter and table to work effective without error.
on the top nav, let the image fetch from mgmt/app/settings.php
make the page mobile responsive, do not add any sidebar just use inc/sidebar.php
mgmt/app/settings.php
prepare("SELECT * FROM settings WHERE id = 1 LIMIT 1");
$stmt->execute();
return $stmt->fetch(PDO::FETCH_ASSOC);
}
/**
* Main Update Logic
*/
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['save_settings'])) {
require_once '../conn/pdo-conn.php';
// 1. Sanitize and Validate
$full_name = filter_var($_POST['full_name'], FILTER_SANITIZE_SPECIAL_CHARS);
$email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
$timezone = filter_var($_POST['timezone'], FILTER_SANITIZE_SPECIAL_CHARS);
$site_title = filter_var($_POST['site_title'], FILTER_SANITIZE_SPECIAL_CHARS);
$seo_description = filter_var($_POST['seo_description'], FILTER_SANITIZE_SPECIAL_CHARS);
$github = filter_var($_POST['github_username'], FILTER_SANITIZE_SPECIAL_CHARS);
$twitter = filter_var($_POST['twitter_username'], FILTER_SANITIZE_SPECIAL_CHARS);
$linkedin = filter_var($_POST['linkedin_username'], FILTER_SANITIZE_SPECIAL_CHARS);
$two_fa = isset($_POST['two_factor_enabled']) ? 1 : 0;
if (!$email) {
$_SESSION['error'] = "Invalid email format.";
header("Location: ../../portfolio-mgmt/settings.php");
exit;
}
// 2. Handle Avatar Upload
$avatar_name = null;
if (isset($_FILES['avatar']) && $_FILES['avatar']['error'] === UPLOAD_ERR_OK) {
$fileTmpPath = $_FILES['avatar']['tmp_name'];
$fileName = $_FILES['avatar']['name'];
$fileSize = $_FILES['avatar']['size'];
$fileNameCmps = explode(".", $fileName);
$fileExtension = strtolower(end($fileNameCmps));
$allowedExts = ['jpg', 'jpeg', 'png', 'webp'];
if (in_array($fileExtension, $allowedExts) && $fileSize <= 2097152) {
$uploadFileDir = '../../uploads/avatar/';
if (!is_dir($uploadFileDir)) mkdir($uploadFileDir, 0777, true);
$newFileName = uniqid() . '.' . $fileExtension;
$dest_path = $uploadFileDir . $newFileName;
if (move_uploaded_file($fileTmpPath, $dest_path)) {
$avatar_name = $newFileName;
}
}
}
// 3. Update Database
try {
$sql = "UPDATE settings SET
full_name = :fn, email = :em, timezone = :tz,
site_title = :st, seo_description = :sd,
github_username = :gh, twitter_username = :tw, linkedin_username = :li,
two_factor_enabled = :tfa";
if ($avatar_name) { $sql .= ", avatar = :av"; }
$sql .= " WHERE id = 1";
$stmt = $pdo->prepare($sql);
$params = [
':fn' => $full_name, ':em' => $email, ':tz' => $timezone,
':st' => $site_title, ':sd' => $seo_description,
':gh' => $github, ':tw' => $twitter, ':li' => $linkedin,
':tfa' => $two_fa
];
if ($avatar_name) { $params[':av'] = $avatar_name; }
if ($stmt->execute($params)) {
$_SESSION['success'] = "Settings updated successfully.";
}
} catch (PDOException $e) {
$_SESSION['error'] = "Database error: " . $e->getMessage();
}
header("Location: ../../portfolio-mgmt/settings.php");
exit;
}
portfolio-mgmt/projects.php
search
Project Manager
Manage and deploy your ecosystem projects from a central hub.
TOTAL PROJECTS
24
trending_up+3 this month
ACTIVE DEPLOYMENTS
18
check_circleAll healthy
PENDING DRAFTS
6
edit_noteReady for review
TOTAL REACH
128.4k
group+12% monthly
PROJECT IDENTITY
TECH STACK
STATUS
LAST UPDATED
ACTIONS
Nebula Core API
Backend microservice cluster
NODE.JSREDISPOSTGRES
Live
2 hours ago
Titan CRM
Customer relationship dashboard
REACTTAILWIND
Draft
Yesterday
Quantum Analytics
Real-time data visualization
PYTHOND3.JS
Live
3 days ago
Security Patch v4
Infrastructure security layer
RUSTGO
Live
Oct 24, 2023
Showing 4 of 24 projects
auto_awesome
AI Project Insights
Based on your activity, we recommend updating the "Nebula Core API" tech stack. A newer version of Node.js is available with significant performance improvements for your specific workload.
Cloud Storage
72.4 GB of 100 GB used
projects.php
Selected Works
A curation of digital products and engineering experiments, ranging from architectural systems to high-fidelity frontend experiences.
A real-time data visualization platform designed for high-frequency financial intelligence.
Next.jsD3.jsPostgres
The Project Context
In an era where data latency equals lost opportunity, Ethereal Analytics was born from the need for instantaneous clarity. We reimagined how enterprise users interact with millions of streaming data points, transforming cold numbers into a fluid, cinematic experience.
The Problem
Existing tools suffered from visual clutter and significant rendering delays, causing decision paralysis during high-volatility market events.
The Goal
To build a zero-latency visualization engine that scales across devices without sacrificing the aesthetic quality expected by premium users.
Experience the Live Demo
Interact with the real-time engine in a sandboxed environment.
Updating thousands of SVG elements every 100ms caused significant memory bloat. We solved this by implementing a hybrid Canvas/SVG approach, where background noise is pre-rendered on canvas while interactive elements remain as SVGs.
State Synchronization
Maintaining consistent state across multiple user sessions required a specialized Reducer pattern combined with optimistic UI updates to mask network jitter.
/
i need a professional and highly secured prompt for an ai to help me write the logic for my portfolio-mgmt/projects.php.
call the logic file mgmt/app/projects-mgmt.php .
i want the admin to be able to add project from portfolio-mgmt/projects.php and will show in projects.php. and project-details.php is to show the full details of the project written, that means if any project is clicked on projects.php , that particular project will be redirected to show its project-details.php completely.
when the add new project button is clicked, a popup form that has input that suits the projects.php and project-details.php .
create a database table for projects using sql fmt
make sure the TOTAL PROJECTS, ACTIVE DEPLOYMENTS, PENDING DRAFTS, TOTAL REACH,and the search filter and table to work effective without error.
on the top nav, let the image fetch from mgmt/app/settings.php
make the page mobile responsive, do not add any sidebar just use inc/sidebar.php
portfolio-mgmt/projects.php
search
Project Manager
Manage and deploy your ecosystem projects from a central hub.
TOTAL PROJECTS
24
trending_up+3 this month
ACTIVE DEPLOYMENTS
18
check_circleAll healthy
PENDING DRAFTS
6
edit_noteReady for review
TOTAL REACH
128.4k
group+12% monthly
PROJECT IDENTITY
TECH STACK
STATUS
LAST UPDATED
ACTIONS
Nebula Core API
Backend microservice cluster
NODE.JSREDISPOSTGRES
Live
2 hours ago
Titan CRM
Customer relationship dashboard
REACTTAILWIND
Draft
Yesterday
Quantum Analytics
Real-time data visualization
PYTHOND3.JS
Live
3 days ago
Security Patch v4
Infrastructure security layer
RUSTGO
Live
Oct 24, 2023
Showing 4 of 24 projects
auto_awesome
AI Project Insights
Based on your activity, we recommend updating the "Nebula Core API" tech stack. A newer version of Node.js is available with significant performance improvements for your specific workload.
Cloud Storage
72.4 GB of 100 GB used
projects.php
Selected Works
A curation of digital products and engineering experiments, ranging from architectural systems to high-fidelity frontend experiences.
A real-time data visualization platform designed for high-frequency financial intelligence.
Next.jsD3.jsPostgres
The Project Context
In an era where data latency equals lost opportunity, Ethereal Analytics was born from the need for instantaneous clarity. We reimagined how enterprise users interact with millions of streaming data points, transforming cold numbers into a fluid, cinematic experience.
The Problem
Existing tools suffered from visual clutter and significant rendering delays, causing decision paralysis during high-volatility market events.
The Goal
To build a zero-latency visualization engine that scales across devices without sacrificing the aesthetic quality expected by premium users.
Experience the Live Demo
Interact with the real-time engine in a sandboxed environment.
Updating thousands of SVG elements every 100ms caused significant memory bloat. We solved this by implementing a hybrid Canvas/SVG approach, where background noise is pre-rendered on canvas while interactive elements remain as SVGs.
State Synchronization
Maintaining consistent state across multiple user sessions required a specialized Reducer pattern combined with optimistic UI updates to mask network jitter.