Header set X-Content-Type-Options "nosniff" Header set X-Frame-Options "SAMEORIGIN" Header set X-XSS-Protection "1; mode=block" Header set Referrer-Policy "strict-origin-when-cross-origin" EOD; // database.sql $files[$base_dir . '/database.sql'] = <<<'EOD' SET FOREIGN_KEY_CHECKS = 0; DROP TABLE IF EXISTS `activity_logs`; DROP TABLE IF EXISTS `newsletter_subscribers`; DROP TABLE IF EXISTS `contact_inquiries`; DROP TABLE IF EXISTS `career_applications`; DROP TABLE IF EXISTS `careers`; DROP TABLE IF EXISTS `blogs`; DROP TABLE IF EXISTS `blog_categories`; DROP TABLE IF EXISTS `downloads`; DROP TABLE IF EXISTS `faqs`; DROP TABLE IF EXISTS `testimonials`; DROP TABLE IF EXISTS `export_countries`; DROP TABLE IF EXISTS `certificates`; DROP TABLE IF EXISTS `quality_standards`; DROP TABLE IF EXISTS `infrastructure`; DROP TABLE IF EXISTS `videos`; DROP TABLE IF EXISTS `gallery`; DROP TABLE IF EXISTS `product_images`; DROP TABLE IF EXISTS `products`; DROP TABLE IF EXISTS `subcategories`; DROP TABLE IF EXISTS `categories`; DROP TABLE IF EXISTS `hero_sliders`; DROP TABLE IF EXISTS `admin_users`; DROP TABLE IF EXISTS `roles`; DROP TABLE IF EXISTS `website_settings`; SET FOREIGN_KEY_CHECKS = 1; CREATE TABLE `roles` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `role_name` VARCHAR(50) NOT NULL UNIQUE, `permissions` TEXT NULL, `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO `roles` (`id`, `role_name`, `permissions`) VALUES (1, 'Super Admin', 'all'), (2, 'Manager', 'manage_content,manage_inquiries'), (3, 'Editor', 'manage_content'); CREATE TABLE `admin_users` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `role_id` INT UNSIGNED NOT NULL, `name` VARCHAR(100) NOT NULL, `email` VARCHAR(150) NOT NULL UNIQUE, `password` VARCHAR(255) NOT NULL, `reset_token` VARCHAR(64) NULL, `reset_token_expire` DATETIME NULL, `status` ENUM('active', 'inactive') DEFAULT 'active', `last_login` DATETIME NULL, `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, FOREIGN KEY (`role_id`) REFERENCES `roles`(`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO `admin_users` (`id`, `role_id`, `name`, `email`, `password`, `status`) VALUES (1, 1, 'System Administrator', 'admin@ashapuraagro.com', '$2y$10$w0954S18d9jNIsyv05eBTuN8Kj/8M.4WkEygY9YI38/6Yn4O9s7iS', 'active'); CREATE TABLE `website_settings` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `setting_key` VARCHAR(100) NOT NULL UNIQUE, `setting_value` LONGTEXT NULL, `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO `website_settings` (`setting_key`, `setting_value`) VALUES ('site_title', 'Ashapura Agro - Premium Agricultural Exporters & Processors'), ('site_email', 'info@ashapuraagro.com'), ('site_phone', '+91 98765 43210'), ('site_address', 'Plot No. 45-48, Industrial Agro Park, Highway Zone, Gujarat, India'), ('smtp_host', 'smtp.hostinger.com'), ('smtp_port', '465'), ('smtp_user', 'no-reply@ashapuraagro.com'), ('smtp_pass', 'EncryptedPass@2026'), ('smtp_crypto', 'ssl'); CREATE TABLE `hero_sliders` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `title` VARCHAR(255) NOT NULL, `subtitle` VARCHAR(255) NULL, `image` VARCHAR(255) NOT NULL, `btn_text` VARCHAR(50) NULL, `btn_link` VARCHAR(255) NULL, `sort_order` INT DEFAULT 0, `status` ENUM('active', 'inactive') DEFAULT 'active', `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO `hero_sliders` (`title`, `subtitle`, `image`, `btn_text`, `btn_link`, `sort_order`) VALUES ('Purity Harvested From Nature', 'Global Exporters of Organic Spices, Grains & Oil Seeds', 'hero-1.jpg', 'Explore Products', '/products', 1), ('State-of-the-Art Processing', 'Advanced Sorting & Packaging Infrastructure', 'hero-2.jpg', 'Our Infrastructure', '/infrastructure', 2); CREATE TABLE `categories` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `name` VARCHAR(150) NOT NULL, `slug` VARCHAR(180) NOT NULL UNIQUE, `description` TEXT NULL, `image` VARCHAR(255) NULL, `status` ENUM('active', 'inactive') DEFAULT 'active', `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO `categories` (`id`, `name`, `slug`, `description`, `image`) VALUES (1, 'Spices & Herbs', 'spices-herbs', 'Premium grade whole and grounded spices sourced directly from farms.', 'cat-spices.jpg'), (2, 'Oil Seeds', 'oil-seeds', 'High purity sesame seeds, mustard seeds, and sunflower seeds.', 'cat-seeds.jpg'); CREATE TABLE `products` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `category_id` INT UNSIGNED NOT NULL, `subcategory_id` INT UNSIGNED NULL, `title` VARCHAR(255) NOT NULL, `slug` VARCHAR(280) NOT NULL UNIQUE, `short_description` TEXT NULL, `full_description` LONGTEXT NULL, `specifications` LONGTEXT NULL, `main_image` VARCHAR(255) NOT NULL, `featured` TINYINT(1) DEFAULT 0, `meta_title` VARCHAR(255) NULL, `meta_description` TEXT NULL, `status` ENUM('active', 'inactive') DEFAULT 'active', `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (`category_id`) REFERENCES `categories`(`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE `product_images` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `product_id` INT UNSIGNED NOT NULL, `image_path` VARCHAR(255) NOT NULL, `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (`product_id`) REFERENCES `products`(`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO `products` (`id`, `category_id`, `title`, `slug`, `short_description`, `full_description`, `main_image`, `featured`) VALUES (1, 1, 'Natural Cumin Seeds', 'natural-cumin-seeds', 'Machine cleaned and color sorted 99.5% pure cumin seeds.', 'Full detailed analysis and parameters of natural cumin seeds exported globally.', 'cumin.jpg', 1), (2, 2, 'Hulled Sesame Seeds', 'hulled-sesame-seeds', 'Mechanically hulled sesame seeds with maximum purity.', 'Processed under hygienic conditions conforming to ISO standards.', 'sesame.jpg', 1); CREATE TABLE `contact_inquiries` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `type` ENUM('contact', 'quote') DEFAULT 'contact', `name` VARCHAR(150) NOT NULL, `email` VARCHAR(150) NOT NULL, `phone` VARCHAR(50) NOT NULL, `subject` VARCHAR(255) NULL, `message` TEXT NOT NULL, `product_name` VARCHAR(255) NULL, `ip_address` VARCHAR(45) NULL, `status` ENUM('new', 'read', 'archived') DEFAULT 'new', `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE `newsletter_subscribers` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `email` VARCHAR(150) NOT NULL UNIQUE, `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE `activity_logs` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `admin_id` INT UNSIGNED NULL, `action` VARCHAR(255) NOT NULL, `ip_address` VARCHAR(45) NOT NULL, `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (`admin_id`) REFERENCES `admin_users`(`id`) ON DELETE SET NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE `careers` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `job_title` VARCHAR(255) NOT NULL, `department` VARCHAR(100) NOT NULL, `location` VARCHAR(100) NOT NULL, `job_type` VARCHAR(50) DEFAULT 'Full-time', `description` LONGTEXT NOT NULL, `status` ENUM('active', 'inactive') DEFAULT 'active', `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; CREATE TABLE `career_applications` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `career_id` INT UNSIGNED NOT NULL, `full_name` VARCHAR(150) NOT NULL, `email` VARCHAR(150) NOT NULL, `phone` VARCHAR(50) NOT NULL, `resume_path` VARCHAR(255) NOT NULL, `cover_letter` TEXT NULL, `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (`career_id`) REFERENCES `careers`(`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; EOD; // config/database.php $files[$base_dir . '/config/database.php'] = <<<'EOD' PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci" ]; self::$instance = new PDO($dsn, DB_USER, DB_PASS, $options); } catch (PDOException $e) { error_log("Database Connection Error: " . $e->getMessage()); die("System Connection Failure. Please verify config/database.php details."); } } return self::$instance; } } EOD; // config/config.php $files[$base_dir . '/config/config.php'] = <<<'EOD' MAX_FILE_SIZE) return null; $filename = uniqid('ashapura_', true) . '.' . $ext; $target_path = UPLOAD_DIR . $target_folder . '/' . $filename; if (!is_dir(dirname($target_path))) { mkdir(dirname($target_path), 0755, true); } if (move_uploaded_file($file['tmp_name'], $target_path)) { return $filename; } return null; } function log_activity(int $admin_id, string $action): void { $db = Database::getConnection(); $stmt = $db->prepare("INSERT INTO activity_logs (admin_id, action, ip_address) VALUES (?, ?, ?)"); $stmt->execute([$admin_id, $action, $_SERVER['REMOTE_ADDR'] ?? '127.0.0.1']); } function get_setting(string $key): string { $db = Database::getConnection(); $stmt = $db->prepare("SELECT setting_value FROM website_settings WHERE setting_key = ?"); $stmt->execute([$key]); return $stmt->fetchColumn() ?: ''; } EOD; // includes/csrf.php $files[$base_dir . '/includes/csrf.php'] = <<<'EOD' '; } EOD; // includes/header.php $files[$base_dir . '/includes/header.php'] = <<<'EOD' <?= htmlspecialchars($title ?? 'Ashapura Agro') ?> EOD; // includes/navbar.php $files[$base_dir . '/includes/navbar.php'] = <<<'EOD' EOD; // includes/footer.php $files[$base_dir . '/includes/footer.php'] = <<<'EOD' EOD; // index.php $files[$base_dir . '/index.php'] = <<<'EOD' query("SELECT * FROM hero_sliders WHERE status = 'active' ORDER BY sort_order ASC")->fetchAll(); $categories = $db->query("SELECT * FROM categories WHERE status = 'active' LIMIT 6")->fetchAll(); $products = $db->query("SELECT * FROM products WHERE featured = 1 AND status = 'active' LIMIT 8")->fetchAll(); require_once __DIR__ . '/includes/header.php'; require_once __DIR__ . '/includes/navbar.php'; ?>

Ashapura Agro

Premium Quality Agriculture Commodities Processed to Global Standards

Featured Products

Contact Our Export Team

404

Page Not Found

"; break; } EOD; // admin/login.php $files[$base_dir . '/admin/login.php'] = <<<'EOD' prepare("SELECT * FROM admin_users WHERE email = ? AND status = 'active' LIMIT 1"); $stmt->execute([$email]); $user = $stmt->fetch(); if ($user && password_verify($password, $user['password'])) { session_regenerate_id(true); $_SESSION['admin_id'] = $user['id']; $_SESSION['admin_name'] = $user['name']; log_activity((int)$user['id'], "Admin Logged In"); header("Location: dashboard.php"); exit(); } else { $error = "Invalid credentials."; } } } ?> Admin Login | Ashapura Agro

Ashapura Admin

EOD; // admin/dashboard.php $files[$base_dir . '/admin/dashboard.php'] = <<<'EOD' Dashboard - Ashapura Admin

Welcome to Ashapura Admin Dashboard

Logged in as:

Logout EOD; // admin/logout.php $files[$base_dir . '/admin/logout.php'] = <<<'EOD' $content) { file_put_contents($filepath, $content); } // 4. Create ZIP Archive $zip_filename = __DIR__ . '/ashapura-agro.zip'; $zip = new ZipArchive(); if ($zip->open($zip_filename, ZipArchive::CREATE | ZipArchive::OVERWRITE) === TRUE) { $files_to_zip = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($base_dir), RecursiveIteratorIterator::LEAVES_ONLY ); foreach ($files_to_zip as $name => $file) { if (!$file->isDir()) { $filePath = $file->getRealPath(); $relativePath = substr($filePath, strlen($base_dir) + 1); $zip->addFile($filePath, $relativePath); } } $zip->close(); echo "

✅ Success! Project ZIP Created.

"; echo "

👉 CLICK HERE TO DOWNLOAD ashapura-agro.zip

"; } else { echo "

❌ Error: Unable to build zip file.

"; }