One Hat Cyber Team
Your IP :
3.23.129.146
Server IP :
87.118.122.21
Server :
Linux svdm-server5.de 6.1.0-17-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30) x86_64
Server Software :
Apache
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
users
/
svd-saarleute
/
www
/
_go_biz
/
app
/
Classes
/
View File Name :
GoBizUpdater900.php
<?php namespace App\Classes; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; class GoBizUpdater900 { public function runUpdate() { // "campaigns" table is exist or not if (!Schema::hasTable('campaigns')) { DB::statement("CREATE TABLE `campaigns` ( `id` int UNSIGNED NOT NULL, `campaign_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `campaign_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `campaign_desc` text COLLATE utf8mb4_unicode_ci NOT NULL, `status` int NOT NULL DEFAULT '1', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"); DB::statement("ALTER TABLE `campaigns` ADD PRIMARY KEY (`id`)"); DB::statement("ALTER TABLE `campaigns` MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT"); } // "campaign_emails" table is exist or not if (!Schema::hasTable('campaign_emails')) { DB::statement("CREATE TABLE `campaign_emails` ( `id` int UNSIGNED NOT NULL, `campaign_email_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `campaign_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `group_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `subject` text COLLATE utf8mb4_unicode_ci NOT NULL, `body` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `status` int NOT NULL DEFAULT '1', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"); DB::statement("ALTER TABLE `campaign_emails` ADD PRIMARY KEY (`id`)"); DB::statement("ALTER TABLE `campaign_emails` MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT"); } // "groups" table is exist or not if (!Schema::hasTable('groups')) { DB::statement("CREATE TABLE `groups` ( `id` int UNSIGNED NOT NULL, `group_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `group_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `group_desc` text COLLATE utf8mb4_unicode_ci NOT NULL, `emails` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `status` int NOT NULL DEFAULT '1', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"); DB::statement("ALTER TABLE `groups` ADD PRIMARY KEY (`id`)"); DB::statement("ALTER TABLE `groups` MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT"); } // "backups" table is exist or not if (!Schema::hasTable('backups')) { DB::statement("CREATE TABLE `backups` ( `id` int UNSIGNED NOT NULL, `backup_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `version` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `file_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `path` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `status` int NOT NULL DEFAULT '1', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"); DB::statement("ALTER TABLE `backups` ADD PRIMARY KEY (`id`)"); DB::statement("ALTER TABLE `backups` MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT"); DB::statement("ALTER TABLE `backups` ADD `type` VARCHAR(191) NOT NULL DEFAULT 'file' AFTER `backup_id`"); } // "jobs" table is exist or not if (!Schema::hasTable('jobs')) { DB::statement("CREATE TABLE `jobs` ( `id` bigint UNSIGNED NOT NULL, `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `attempts` tinyint UNSIGNED NOT NULL, `reserved_at` int UNSIGNED DEFAULT NULL, `available_at` int UNSIGNED NOT NULL, `created_at` int UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"); DB::statement("ALTER TABLE `jobs` ADD PRIMARY KEY (`id`), ADD KEY `jobs_queue_index` (`queue`)"); DB::statement("ALTER TABLE `jobs` MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT"); } // Check "mailgun_smtp_username" column exists in config table or not $mailgunSMTPUsername = DB::table('config')->where('id', 58)->exists(); if (!$mailgunSMTPUsername) { DB::statement("INSERT INTO `config` (`config_key`, `config_value`) VALUES ('mailgun_smtp_username', 'YOUR_MAILGUN_SMTP_USERNAME')"); } // Check "mailgun_smtp_password" column exists in config table or not $mailgunSMTPPassword = DB::table('config')->where('id', 59)->exists(); if (!$mailgunSMTPPassword) { DB::statement("INSERT INTO `config` (`config_key`, `config_value`) VALUES ('mailgun_smtp_password', 'YOUR_MAILGUN_SMTP_PASSWORD')"); } // Check "mailgun_from_address" column exists in config table or not $mailgunFromAddress = DB::table('config')->where('id', 60)->exists(); if (!$mailgunFromAddress) { DB::statement("INSERT INTO `config` (`config_key`, `config_value`) VALUES ('mailgun_from_address', 'YOUR_FROM_ADDRESS')"); } // Check "cronjob_dates_in_array" column exists in config table or not $cronjobDatesInArray = DB::table('config')->where('id', 61)->exists(); if (!$cronjobDatesInArray) { DB::statement("INSERT INTO `config` (`config_key`, `config_value`) VALUES ('cronjob_dates_in_array', '[10, 5, 3, 1, -1, -7]')"); } // Check "cron_hour" column exists in config table or not $cronHour = DB::table('config')->where('id', 62)->exists(); if (!$cronHour) { DB::statement("INSERT INTO `config` (`config_key`, `config_value`) VALUES ('cron_hour', '10')"); } // Check "demo_mode" column exists in config table or not $demoMode = DB::table('config')->where('id', 63)->exists(); if (!$demoMode) { DB::statement("INSERT INTO `config` (`config_key`, `config_value`) VALUES ('demo_mode', 'off')"); } // Insert themes in themes table DB::statement("INSERT INTO `themes` (`theme_id`, `theme_code`, `theme_thumbnail`, `theme_name`, `theme_description`, `theme_price`) VALUES ('588969111125', 'makeup', 'makeup-artist.png', 'Makeup Artist', 'vCard', 'Free')"); DB::statement("INSERT INTO `themes` (`theme_id`, `theme_code`, `theme_thumbnail`, `theme_name`, `theme_description`, `theme_price`) VALUES ('588969111126', 'chef', 'chef.png', 'Chef', 'vCard', 'Free')"); DB::statement("INSERT INTO `themes` (`theme_id`, `theme_code`, `theme_thumbnail`, `theme_name`, `theme_description`, `theme_price`) VALUES ('588969111127', 'developer', 'developer.png', 'Developer', 'vCard', 'Free')"); DB::statement("INSERT INTO `themes` (`theme_id`, `theme_code`, `theme_thumbnail`, `theme_name`, `theme_description`, `theme_price`) VALUES ('588969111128', 'lawyer', 'lawyer.png', 'Lawyer', 'vCard', 'Free')"); DB::statement("INSERT INTO `themes` (`theme_id`, `theme_code`, `theme_thumbnail`, `theme_name`, `theme_description`, `theme_price`) VALUES ('588969111129', 'doctor', 'doctor.png', 'Doctor', 'vCard', 'Free')"); DB::statement("INSERT INTO `themes` (`theme_id`, `theme_code`, `theme_thumbnail`, `theme_name`, `theme_description`, `theme_price`) VALUES ('588969111130', 'spa', 'spa.png', 'Spa', 'vCard', 'Free')"); } }