Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once('common.php');
- if( installed() && (empty($_GET['act']) || empty($_GET['cat'])) )
- header("Location: $PSZ_APP_webpath/");
- if( installed() && isset($_GET['cat']) && $_GET['cat']!=$PSZ_APP_reset_code )
- header("Location: $PSZ_APP_webpath/");
- $ajax_return_error = "{\"error\": 1, \"message\": \"PSZ_APP_alert('%s', '%s')\"}";
- $ajax_return_success = "{\"success\": 1, \"url\": \"%s\"}";
- // ajax post
- if( is_ajax_request() || (isset($_GET['act']) && $_GET['act']=='reset' && $_GET['cat']==$PSZ_APP_reset_code) )
- {
- $quick_reinstallation = false;
- //$site_domain = get_site_domain();
- $site_domain = $_POST['domain'];
- // theme
- $themes = array(
- array('gomymobi: FREE', ',1,2,5,6,7,8,9,13,'),
- array('Premium Services', ',1,2,6,7,10,13,'),
- array('Material Portfolio', ',2,4,6,7,8,10,11,13,'),
- array('Great Products', ',1,2,4,6,7,8,9,10,11,13,'),
- array('Tasteeee', ',1,2,8,12,'),
- array('Gold Product', ',2,4,8,'),
- array('Digital Studio', ',1,2,6,13,'),
- array('App Coming Soon', ',1,2,7,13,'),
- array('Blue App', ',1,2,7,13,'),
- array('Blue Display', ',1,2,4,7,13,'),
- array('Vintage Business', ',2,3,4,13,'),
- array('My Resume', ',1,4,6,12,'),
- array('Solid Company', ',2,4,7,13,'),
- array('Converting Landing Pages', ',2,4,5,6,7,8,11,13,'),
- array('Green Homepage', ',2,4,6,13,'),
- array('Red Clean Portfolio', ',2,4,5,13,'),
- array('Domainer', ',1,2,5,6,7,9,12,13,'),
- array('Engage', ',1,2,4,5,8,13,'),
- array('Photo Blog', ',4,8,13,'),
- array('Grape App Landing', ',1,2,7,13,'),
- array('Guide Landing Page', ',2,5,6,7,8,10,11,13,'),
- array('Hold: Amazing Resume', ',4,8,12,13,'),
- array('Hydrogen: Photo Gallery', ',2,4,5,13,'),
- array('KreFolio: Startup Agency', ',1,2,4,5,6,7,8,13,'),
- array('Light: Clean Homepage', ',2,3,4,6,13,'),
- array('Magazine: Personal News', ',3,4,6,13,'),
- array('Oleose: App Landing Page', ',1,2,7,13,'),
- array('Outline: App Showcase', ',1,2,7,13,'),
- array('Seven: App Landing Page', ',1,2,5,13,'),
- array('Shield: Agency One Page', ',1,2,4,7,13,'),
- array('Sprint: Light Portfolio', ',2,4,5,7,8,13,'),
- array('Union: Project Team', ',1,2,4,5,13,'),
- array('Aesthetic: PRO Business', ',2,4,6,13,'),
- );
- /*array('One Page', 'Themes with 1 built-in page only'), // $i=1
- array('Business', 'Themes mainly built for onlines businesses or companies'),
- array('Simply', 'Very nice but simple themes'),
- array('Portfolio', 'Themes used to to create the stunning portfolio sites'),
- array('Red', ''), // 5
- array('Green', ''),
- array('Blue', ''),
- array('Orange', ''),
- array('Grey', ''),
- array('Pink', ''), // 10
- array('Purple', ''),
- array('Dark', ''),
- array('Light', '')*/
- if( $_GET['act']=='reset' && $_GET['cat']==$PSZ_APP_reset_code )
- {
- if( $_GET['cat']=='YOUR_SECRET_CODE_TO_REINSTALL_SYSTEM' || !$is_super_admin )
- {
- $pTemplate->assign_vars(array(
- 'ERROR_WORD' => 'Oops :’)',
- 'ERROR_TITLE' => __('Access denied'),
- 'ERROR_BODY' => __('You need the super administative privilege to access this area'),
- 'SYS_COPYRIGHT_TEXT'=> get_copyright()
- ));
- $pContent = $pTemplate->pparse_file( "template/errors.html" );
- die( $pTemplate->pparse($pContent) );
- }
- $quick_reinstallation = true;
- // replace with your correct information
- $_POST = array(
- 'dbhost' => 'localhost', // database server
- 'dbname' => 'dbname', // database name on above database server
- 'dbuser' => 'dbuser', // database user granted on above database name
- 'dbpasswd' => 'dbpasswd', // password of above database user
- 'fullname' => 'SAdmin', // name of super administrative account
- 'email' => "hello@gomymobi.com", // email of super administrative account
- 'password' => "hello@gomymobi.com", // password of super administrative account
- 'rpassword' => "hello@gomymobi.com", // reenter password of super administrative account
- 'import_sample_data' => 1,
- );
- delete_file($PSZ_APP_TRANSACTION_LOGS . $PSZ_APP_SYS['payment']['log_file'] . '.txt');
- }
- //print_r($PSZ_APP_SYS);exit;
- foreach($_POST as $k=>$v)
- {
- if( ($_POST[$k] = trim($v))=='' )
- die( sprintf($ajax_return_error, __('Error'), __('Please fill all required fields')) );
- }
- //print_r($_POST);exit;
- // validate email
- if( !is_email($_POST['email']) )
- die( sprintf($ajax_return_error, __('Email is Invalid'), __('Please check your email address again')) );
- // validate password
- if( $_POST['password'] != $_POST['rpassword'] )
- die( sprintf($ajax_return_error, __('Passwords are not Matched'), __('Please check your passwords again')) );
- $import_sample_data = $_POST['import_sample_data'];
- // no error, setup
- $keep_going_without_db = true;
- $dbhost = $_POST['dbhost'];
- $dbname = $_POST['dbname'];
- $dbuser = $_POST['dbuser'];
- $dbpasswd = $_POST['dbpasswd'];
- include_once($PSZ_APP_root_dir . 'includes/db.mysqli.php');
- //$db = new sql_db( $dbhost, $dbuser, $dbpasswd, $dbname, false );
- if( !$db->mysqli )
- {
- if( $quick_reinstallation )
- error_db_connection();
- die( sprintf($ajax_return_error, __('Error'), __('Could not connect to the database')) );
- }
- else
- {
- $table_sql = array();
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_FRONTPAGES` (
- `id` mediumint(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `slug` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `user_id` int(11) NOT NULL,
- `active` tinyint(1) NOT NULL DEFAULT '1',
- `settings` text COLLATE utf8_unicode_ci,
- `activated_time` int(11) NOT NULL DEFAULT '0',
- `uploaded_time` int(11) NOT NULL DEFAULT '0',
- `updated_time` int(11) NOT NULL DEFAULT '0',
- `deleted_time` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `slug` (`slug`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_PAYMENTS` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `transaction_id` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `status` varchar(30) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `buyer_id` int(11) NOT NULL,
- `seller_id` int(11) NOT NULL DEFAULT '0',
- `item_id` int(11) unsigned NOT NULL COMMENT 'plan_id / theme_id',
- `amount` float NOT NULL DEFAULT '0',
- `currency` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `period` tinyint(1) NOT NULL COMMENT 'plan period / theme prices',
- `paid_time` int(11) NOT NULL DEFAULT '0',
- `expire_time` int(11) NOT NULL DEFAULT '0',
- `auto_renew` tinyint(1) NOT NULL DEFAULT '1',
- `active` tinyint(1) NOT NULL DEFAULT '1',
- PRIMARY KEY (`id`),
- UNIQUE KEY `transaction_id` (`transaction_id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_PLANS` (
- `id` mediumint(6) NOT NULL AUTO_INCREMENT,
- `name` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `settings` text COLLATE utf8_unicode_ci,
- `active` tinyint(1) NOT NULL DEFAULT '1',
- `created_time` int(11) NOT NULL DEFAULT '0',
- `updated_time` int(11) NOT NULL DEFAULT '0',
- `user_id` mediumint(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_PLAN_OPTIONS` (
- `id` mediumint(9) NOT NULL AUTO_INCREMENT,
- `name` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `slug` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `description` text COLLATE utf8_unicode_ci,
- `type` tinyint(1) DEFAULT NULL,
- `sorting` mediumint(2) DEFAULT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `name` (`name`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_PLUGINS` (
- `id` mediumint(6) NOT NULL AUTO_INCREMENT,
- `name` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `version` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `slug` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `settings` text COLLATE utf8_unicode_ci,
- `author` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `homepage` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `user_id` mediumint(9) NOT NULL DEFAULT '0',
- `created_time` int(11) NOT NULL DEFAULT '0',
- `updated_time` int(11) NOT NULL DEFAULT '0',
- `activated_time` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_SITES` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `subdomain` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `domain` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `FTP_settings` text COLLATE utf8_unicode_ci,
- `shop_id` int(11) NOT NULL DEFAULT '0',
- `user_id` int(11) NOT NULL,
- `theme_id` int(11) NOT NULL,
- `created_time` int(11) NOT NULL DEFAULT '0',
- `updated_time` int(11) NOT NULL DEFAULT '0',
- `published_time` int(11) NOT NULL DEFAULT '0',
- `deleted_time` int(11) NOT NULL DEFAULT '0',
- `total_visits` int(11) NOT NULL DEFAULT '0',
- `total_pageviews` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `subdomain` (`subdomain`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_SITES_TRAFFIC` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `site_id` int(11) NOT NULL,
- `user_id` int(11) NOT NULL,
- `date` int(8) NOT NULL COMMENT 'Ymd',
- `visit` int(11) NOT NULL DEFAULT '0',
- `pageview` int(11) NOT NULL DEFAULT '1',
- PRIMARY KEY (`id`),
- UNIQUE KEY `site_id` (`site_id`,`date`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_LOGS` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `user_id` int(11) NOT NULL,
- `item_id` int(11) NOT NULL,
- `log_type` mediumint(3) NOT NULL,
- `time` int(11) NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_THEMES` (
- `id` mediumint(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `slug` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `category` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `user_id` int(11) NOT NULL,
- `downloadable` tinyint(1) NOT NULL DEFAULT '0',
- `status` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'for moderation: pending / passed',
- `price_per_time` float unsigned NOT NULL DEFAULT '0',
- `price_lifetime` float unsigned NOT NULL DEFAULT '0',
- `uploaded_time` int(11) NOT NULL DEFAULT '0',
- `updated_time` int(11) NOT NULL DEFAULT '0',
- `published_time` int(11) NOT NULL DEFAULT '0',
- `deleted_time` int(11) NOT NULL DEFAULT '0',
- `total_creations` int(11) NOT NULL DEFAULT '0',
- `total_previews` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `slug` (`slug`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_THEME_CATEGORIES` (
- `id` int(9) NOT NULL AUTO_INCREMENT,
- `name` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `slug` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `description` text COLLATE utf8_unicode_ci,
- `sorting` mediumint(5) NOT NULL,
- PRIMARY KEY (`id`),
- UNIQUE KEY `name` (`name`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_USERS` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `email` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
- `email_payout` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `fullname` varchar(80) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `password` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `account_type` tinyint(1) NOT NULL DEFAULT '1',
- `plan_id` mediumint(6) NOT NULL DEFAULT '1',
- `avatar` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `settings` text COLLATE utf8_unicode_ci,
- `require_password` tinyint(1) NOT NULL DEFAULT '1',
- `verify` tinyint(1) NOT NULL DEFAULT '0',
- `code` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `active` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'user is active or disabled',
- `registered_time` int(11) NOT NULL DEFAULT '0',
- `last_login` int(11) NOT NULL DEFAULT '0',
- `login_fail` tinyint(2) NOT NULL DEFAULT '0',
- `login_locked_time` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`email`),
- UNIQUE KEY `id` (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- // v.1.4
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_STORES` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `site_id` int(11) NOT NULL,
- `user_id` int(11) NOT NULL,
- `shop_theme_id` int(9) NOT NULL DEFAULT '1',
- `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
- `slug` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
- `phones` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
- `email` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
- `status` tinyint(1) NOT NULL DEFAULT '1',
- `payment` text COLLATE utf8_unicode_ci,
- `shipping_cost` float NOT NULL DEFAULT '0',
- `currency` char(3) COLLATE utf8_unicode_ci NOT NULL,
- `currency_position` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
- `sign_thousand` char(1) COLLATE utf8_unicode_ci NOT NULL,
- `sign_decimal` char(1) COLLATE utf8_unicode_ci NOT NULL,
- `decimals` tinyint(1) NOT NULL DEFAULT '2',
- `created_time` int(11) NOT NULL DEFAULT '0',
- `updated_time` int(11) NOT NULL DEFAULT '0',
- `published_time` int(11) NOT NULL DEFAULT '0',
- `deleted_time` int(11) NOT NULL DEFAULT '0',
- `logo` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
- `favicon` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
- `title` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
- `description` text COLLATE utf8_unicode_ci NOT NULL,
- `keywords` text COLLATE utf8_unicode_ci NOT NULL,
- `custom_header` text COLLATE utf8_unicode_ci NOT NULL,
- `custom_footer` text COLLATE utf8_unicode_ci NOT NULL,
- `options` longtext COLLATE utf8_unicode_ci,
- `widgets` longtext COLLATE utf8_unicode_ci,
- `visits` int(11) NOT NULL DEFAULT '0',
- `pageviews` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `site_id` (`site_id`,`user_id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_STORE_CATEGORIES` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `shop_id` int(11) NOT NULL,
- `user_id` int(11) NOT NULL,
- `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
- `slug` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
- `icon` text COLLATE utf8_unicode_ci,
- `parent` int(11) NOT NULL DEFAULT '0',
- `active` tinyint(1) NOT NULL DEFAULT '1',
- `pageviews` int(11) NOT NULL,
- `description` text COLLATE utf8_unicode_ci NOT NULL,
- `sorting` tinyint(2) NOT NULL DEFAULT '1',
- `created_time` int(11) NOT NULL DEFAULT '0',
- `updated_time` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `shop_id` (`shop_id`,`user_id`,`name`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_STORE_ITEMS` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `shop_id` int(11) NOT NULL,
- `user_id` int(11) NOT NULL,
- `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
- `slug` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
- `summary` text COLLATE utf8_unicode_ci,
- `description` text COLLATE utf8_unicode_ci NOT NULL,
- `stock` tinyint(1) NOT NULL DEFAULT '1',
- `featured` tinyint(1) NOT NULL DEFAULT '0',
- `active` tinyint(1) NOT NULL DEFAULT '1',
- `item_type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `item_sold` mediumint(6) NOT NULL DEFAULT '0',
- `price_regular` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
- `price_sale` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
- `schedule_start` datetime DEFAULT NULL,
- `schedule_end` datetime DEFAULT NULL,
- `parent` int(11) DEFAULT NULL,
- `sold_single` tinyint(1) NOT NULL DEFAULT '0',
- `price_subscription` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
- `subscription_per` char(1) COLLATE utf8_unicode_ci DEFAULT NULL,
- `subscription_period` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
- `subscription_for` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL,
- `signup_fee` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
- `trial` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
- `trial_period` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
- `digital` tinyint(1) NOT NULL DEFAULT '0',
- `shipping_cost` float NOT NULL DEFAULT '0',
- `downloadable` tinyint(1) NOT NULL DEFAULT '0',
- `download_type` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
- `files` text COLLATE utf8_unicode_ci NOT NULL,
- `sorting` mediumint(6) NOT NULL DEFAULT '0',
- `review` tinyint(1) NOT NULL DEFAULT '1',
- `images` text COLLATE utf8_unicode_ci NOT NULL,
- `created_time` int(11) NOT NULL DEFAULT '0',
- `updated_time` int(11) NOT NULL DEFAULT '0',
- `published_time` int(11) NOT NULL,
- `deleted_time` int(11) NOT NULL DEFAULT '0',
- `pageviews` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `shop_id` (`shop_id`,`user_id`,`name`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_STORE_ORDERS` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `shop_id` int(11) NOT NULL,
- `user_id` int(11) NOT NULL,
- `member_id` int(11) NOT NULL DEFAULT '0',
- `key` char(17) COLLATE utf8_unicode_ci NOT NULL,
- `transaction_id` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
- `buyer` text COLLATE utf8_unicode_ci,
- `items` longtext COLLATE utf8_unicode_ci,
- `payment` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
- `payment_detail` text COLLATE utf8_unicode_ci NOT NULL,
- `total` float NOT NULL,
- `ship` text COLLATE utf8_unicode_ci NOT NULL,
- `notes` text COLLATE utf8_unicode_ci NOT NULL,
- `status` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
- `created_time` int(11) NOT NULL,
- `updated_time` int(11) NOT NULL DEFAULT '0',
- `processed_time` int(11) NOT NULL DEFAULT '0',
- `deleted_time` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `key` (`key`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_STORE_PAGES` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `shop_id` int(11) NOT NULL,
- `user_id` int(11) NOT NULL,
- `name` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
- `slug` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
- `short` text COLLATE utf8_unicode_ci NOT NULL,
- `full` text COLLATE utf8_unicode_ci NOT NULL,
- `active` tinyint(1) NOT NULL DEFAULT '1',
- `sorting` mediumint(6) NOT NULL DEFAULT '0',
- `pageviews` int(11) unsigned NOT NULL,
- `created_time` int(11) NOT NULL,
- `updated_time` int(11) NOT NULL DEFAULT '0',
- `published_time` int(11) NOT NULL DEFAULT '0',
- `deleted_time` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique` (`shop_id`,`user_id`,`name`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_STORE_TAGS` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `shop_id` int(11) NOT NULL,
- `user_id` int(11) NOT NULL,
- `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
- `slug` varchar(80) COLLATE utf8_unicode_ci NOT NULL,
- `pageviews` int(11) NOT NULL,
- `created_time` int(11) NOT NULL,
- `updated_time` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `unique` (`shop_id`,`user_id`,`name`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- $table_sql[] = "CREATE TABLE IF NOT EXISTS `$PSZ_TABLE_STORE_TERMS` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `hosted_id` int(11) NOT NULL COMMENT 'item id',
- `value_id` int(11) NOT NULL COMMENT 'tag / category id',
- `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
- `created_time` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `term` (`hosted_id`,`value_id`,`type`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
- //$table_sql[] = "";
- $logs = array();
- $setup_time = time();
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES(1, 0, $PSZ_LOG_SYS_SETTING_UPDATED, $setup_time)";
- // add plans
- $plans = array(
- 1 => array(__('FREE'), 'YToyMTp7aToxO3M6NDoiRlJFRSI7aToyO3M6MjE6IkJ1aWxkIHlvdXIgZW1waXJlIE5PVyI7aTozO3M6NzI6IkVuam95IG91ciBtb2Rlcm4gdG9vbHMgdG8gY3JlYXRlIHlvdXIgYnVzaW5lc3Mgc2l0ZSBmb3IgRlJFRSBmb3JldmVyPGJyPiI7aTo0O3M6MToiMSI7aTo1O3M6MToiMCI7aTo2O3M6MToiMCI7aTo3O3M6MToiMCI7aTo4O3M6MToiMCI7aTo5O3M6MToiMSI7aToxMDtzOjE6IjEiO2k6MTI7czo4OiJKb2luIE5PVyI7aToxMztzOjI6Im5tIjtpOjE0O3M6NDoiYmx1ZSI7aToxNTtzOjQ6ImJsdWUiO2k6MTE7czoxOiIwIjtpOjE2O3M6MToiMCI7aToxNztzOjE6IjAiO2k6MTg7czoxOiIwIjtpOjE5O3M6MToiMCI7aToyMDtzOjE6IjEiO2k6MjE7czoxOiIwIjt9'),
- 2 => array(__('Starter'), 'YToyNTp7aToxO3M6NzoiU3RhcnRlciI7aToyO3M6MjM6IkJlc3QgZm9yIFNtYWxsIEJ1c2luZXNzIjtpOjM7czo3NzoiUHJlc2VudCB5b3VyIGJ1c2luZXNzIHRvIHRoZSB3b3JsZCB3aXRob3V0IGtub3dpbmcgY29kaW5nICZhbXA7IGRlc2lnbiBza2lsbHMiO2k6NDtzOjE6IjUiO2k6NTtzOjE6IjQiO2k6NjtzOjI6IjEwIjtpOjc7czoyOiIxOCI7aTo4O3M6MjoiMjUiO2k6OTtzOjE6IjAiO2k6MTA7czoxOiIxIjtpOjEyO3M6MTE6IkdldCBTdGFydGVkIjtpOjEzO3M6MjoibGciO2k6MTQ7czoxNToicmVkLXRodW5kZXJiaXJkIjtpOjE1O3M6MTI6InJlZC1mbGFtaW5nbyI7aToxMTtzOjE6IjAiO2k6MTY7czoxOiIxIjtpOjE3O3M6MToiMSI7aToxODtpOjE7aToxOTtzOjE6IjEiO2k6MjA7czoxOiIxIjtpOjIxO3M6MToiMSI7aToyMjtpOjE7aToyMztpOjEwO2k6MjQ7aTo1O2k6MjU7aTo1MDt9'),
- 3 => array(__('Business +'), 'YToyNTp7aToxO3M6MTA6IkJ1c2luZXNzICsiO2k6MjtzOjIwOiJGb3IgeW91ciBPbmxpbmUgU2hvcCI7aTozO3M6MTA1OiJFYXN5IHdheSB0byBidWlsZCB5b3VyIG9ubGluZSBzaG9wICZhbXA7IGdyZWF0IHNvbHV0aW9uIHRvIHNlbGwgeW91ciBhd2Vzb21lIHByb2R1Y3QgdG8gdGhlIHdvcmxkPGJyPjxicj4iO2k6NDtzOjM6IjEwMCI7aTo1O3M6MjoiMTAiO2k6NjtzOjI6IjI0IjtpOjc7czoyOiIzOSI7aTo4O3M6MjoiNjYiO2k6OTtzOjE6IjAiO2k6MTA7czoxOiIxIjtpOjEyO3M6MTA6IkJ1aWxkIFNob3AiO2k6MTM7czoyOiJsZyI7aToxNDtzOjE1OiJncmVlbi10dXJxdW9pc2UiO2k6MTU7czoxMjoiZ3JlZW4tanVuZ2xlIjtpOjExO3M6MToiMSI7aToxNjtzOjE6IjEiO2k6MTc7czoxOiIxIjtpOjE4O2k6MTtpOjE5O3M6MToiMSI7aToyMDtzOjE6IjEiO2k6MjE7czoxOiIxIjtpOjIyO2k6MTAwO2k6MjM7aTowO2k6MjQ7aTowO2k6MjU7aTowO30='),
- 4 => array(__('UNLIMITED'), 'YToyNTp7aToxO3M6OToiVU5MSU1JVEVEIjtpOjI7czoyNDoiRm9yIGdvbXltb2JpJ3MgUmVzZWxsZXJzIjtpOjM7czoxMTA6IkFjY2VzcyBVTkxJTUlURUQgaGlnaC1wb3dlcmVkIHRvb2xzIHRvIG1heGltaXplIHlvdXIgYnVzaW5lc3MnIGVmZmljaWVuY3kgYW5kIHByb2ZpdHMgd2l0aCBnb215bW9iaSdzIHBsYXRmb3JtIjtpOjQ7czoxOiIwIjtpOjU7czoyOiIxNSI7aTo2O3M6MjoiMzkiO2k6NztzOjI6IjY5IjtpOjg7czoyOiI5OSI7aTo5O3M6MjoiMTUiO2k6MTA7czoxOiIwIjtpOjEyO3M6NzoiQnV5IE5PVyI7aToxMztzOjI6ImxnIjtpOjE0O3M6MTM6InB1cnBsZS1zZWFuY2UiO2k6MTU7czoxMzoicHVycGxlLW1lZGl1bSI7aToxMTtzOjE6IjAiO2k6MTY7czoxOiIxIjtpOjE3O3M6MToiMSI7aToxODtpOjE7aToxOTtzOjE6IjEiO2k6MjA7czoxOiIxIjtpOjIxO3M6MToiMSI7aToyMjtpOjA7aToyMztpOjA7aToyNDtpOjA7aToyNTtpOjA7fQ==')
- );
- foreach($plans as $k=>$plan)
- {
- $table_sql[] = "INSERT INTO $PSZ_TABLE_PLANS(`id`, `name`, `settings`, `created_time`, `user_id`) VALUES(" . $k . ", '".$plan[0]."', '".$plan[1]."', ".$setup_time.", 1);";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES(1, $k, $PSZ_LOG_PLAN_CREATED, $setup_time)";
- }
- // add plan options
- $plans_options = array(
- array(__('Name'), __('Name of plan'), 2),
- array(__('Sub heading'), __('Sub heading for Name'), 2),
- array(__('Plan Description'), '', 3),
- array(__('Maximum sites'), __('Number of sites members may create'), 1),
- array(__('Monthly'), __('Monthly price'), 1),
- array(__('3 Months'), __('Price for 3 months plan'), 1),
- array(__('6 Months'), __('Price for 6 months plan'), 1),
- array(__('Annual'), __('Annual price'), 1),
- array(__('Price for First Month'), __('0: FREE for First Month'), 1),
- array(__(' Apply First Price to all periods '), __(' Apply "%s" to all periods '), 4),
- array(__('Featured'), __('This plan is featured?'), 4),
- array(__('Buy Button'), __('Label for Buy button'), 2),
- array(__('Button Size'), 'lg=Large\r\nnm=Normal\r\nsm=Small\r\nxs=Extra Small', 5),
- array(__('Button Color'), 'blue\r\nblue-hoki\r\nblue-steel\r\nblue-madison\r\nblue-chambray\r\nblue-ebonyclay\r\n\r\ngreen\r\ngreen-meadow\r\ngreen-seagreen\r\ngreen-turquoise\r\ngreen-haze\r\ngreen-jungle\r\n\r\nred\r\nred-pink\r\nred-sunglo\r\nred-intense\r\nred-thunderbird\r\nred-flamingo\r\n\r\nyellow\r\nyellow-gold\r\nyellow-casablanca\r\nyellow-crusta\r\nyellow-lemon\r\nyellow-saffron\r\n\r\npurple\r\npurple-plum\r\npurple-medium\r\npurple-studio\r\npurple-wisteria\r\npurple-seance\r\n\r\ngrey\r\ngrey-cascade\r\ngrey-silver\r\ngrey-steel\r\ngrey-cararra\r\ngrey-gallery', 5),
- array(__('Box Color'), 'blue\r\nblue-madison\r\nblue-chambray\r\nblue-ebonyclay\r\nblue-hoki\r\nblue-steel\r\nblue-soft\r\nblue-dark\r\nblue-sharp\r\n\r\ngreen\r\ngreen-meadow\r\ngreen-seagreen\r\ngreen-turquoise\r\ngreen-haze\r\ngreen-jungle\r\ngreen-sharp\r\ngreen-soft\r\n\r\ngrey\r\ngrey-steel\r\ngrey-cararra\r\ngrey-gallery\r\ngrey-cascade\r\ngrey-silver\r\ngrey-salsa\r\ngrey-salt\r\ngrey-mint\r\n\r\nred\r\nred-pink\r\nred-sunglo\r\nred-intense\r\nred-thunderbird\r\nred-flamingo\r\nred-soft\r\nred-haze\r\n\r\nyellow\r\nyellow-gold\r\nyellow-casablanca\r\nyellow-crusta\r\nyellow-lemon\r\nyellow-saffron\r\n\r\npurple\r\npurple-medium\r\npurple-plum\r\npurple-studio\r\npurple-wisteria\r\npurple-seance\r\npurple-intense\r\npurple-sharp\r\npurple-soft', 5),
- array(__('Custom Private Domain'), '', 4),
- array(__('Site Traffic Counter'), '', 4),
- array(__('Online Shop'), '', 4),
- array(__('Live Chat Support'), '', 4),
- array(__('Email Support'), '', 4),
- array(__('No Ads'), '', 4),
- array(__('Maximum stores'), __('Number of stores members may open'), 1),
- array(__('Maximum products'), __('Number of products per store members may create'), 1),
- array(__('Maximum categories'), __('Number of categories per store members may create'), 1),
- array(__('Maximum tags'), __('Number of tags per store members may create'), 1),
- );
- $i = 1;
- foreach($plans_options as $plans_option)
- {
- $table_sql[] = "INSERT INTO `$PSZ_TABLE_PLAN_OPTIONS`(`id`, `name`, `slug`, `description`, `type`, `sorting`) VALUES(" . $i . ", '".$plans_option[0]."', '".url_rewrite($plans_option[0])."', '".$plans_option[1]."', ".$plans_option[2].", ".$i++.");";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES(1, $i, $PSZ_LOG_PLAN_OPTION_CREATED, $setup_time)";
- }
- // frontpage
- $frontpage_name = __('Frontpage One');
- $table_sql[] = "INSERT INTO $PSZ_TABLE_FRONTPAGES(`id`, `name`, `slug`, `user_id`, `active`, `settings`, `activated_time`, `uploaded_time`) VALUES(1, '" . $frontpage_name . "', '" . url_rewrite($frontpage_name) . "', 1, 1, 'YToyOntzOjU6ImNvbG9yIjtzOjU6ImdyZWVuIjtzOjEzOiJtZW51X3Bvc2l0aW9uIjtzOjM6InRvcCI7fQ==', ".$setup_time.", ".$setup_time.");";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES(1, 1, $PSZ_LOG_FRONTPAGE_UPLOADED, $setup_time)";
- // theme categories
- $theme_categories = array(
- array('One Page', 'Themes with 1 built-in page only'), // $i=1
- array('Business', 'Themes mainly built for onlines businesses or companies'),
- array('Simply', 'Very nice but simple themes'),
- array('Portfolio', 'Themes used to to create the stunning portfolio sites'),
- array('Red', ''), // 5
- array('Green', ''),
- array('Blue', ''),
- array('Orange', ''),
- array('Grey', ''),
- array('Pink', ''), // 10
- array('Purple', ''),
- array('Dark', ''),
- array('Light', '')
- );
- $i = 1;
- foreach($theme_categories as $theme_category)
- {
- $table_sql[] = "INSERT INTO $PSZ_TABLE_THEME_CATEGORIES(`id`, `name`, `slug`, `description`, `sorting`) VALUES($i, '$theme_category[0]', '" . url_rewrite($theme_category[0]) . "', '" . $theme_category[1] . "', $i);";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES(1, $i, $PSZ_LOG_THEME_CAT_CREATED, $setup_time)";
- $i++;
- }
- $i = 1;
- $sample_commercial_theme_id = 0;
- foreach($themes as $theme)
- {
- $theme_dir = url_rewrite($theme[0]);
- if( file_exists("installer-sample-data/themes/$theme_dir") )
- {
- $table_sql[] = "INSERT INTO $PSZ_TABLE_THEMES(`id`, `name`, `slug`, `category`, `user_id`, `status`, `uploaded_time`, `published_time`) VALUES($i, '" . $theme[0] . "', '$theme_dir', '" . $theme[1] . "', 1, 'passed', ".$setup_time.", ".$setup_time.");";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES(1, $i, $PSZ_LOG_THEME_UPLOADED, $setup_time)";
- $i++;
- }
- }
- if( $import_sample_data )
- {
- $sample_commercial_theme_id = $i;
- $theme_name = __('gomymobi: Commercial');
- $table_sql[] = "INSERT INTO $PSZ_TABLE_THEMES(`id`, `name`, `slug`, `category`, `user_id`, `status`, `price_per_time`, `price_lifetime`, `uploaded_time`, `published_time`) VALUES($sample_commercial_theme_id, '" . $theme_name . "', 'gomymobi-commercial', ',1,3,5,6,7,8,9,13,', 1, 'passed', 1, 10, ".$setup_time.", ".$setup_time.");";
- // update total_creations of theme FREE
- $table_sql[] = "UPDATE $PSZ_TABLE_THEMES SET total_creations=3 WHERE id=1";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES(1, $sample_commercial_theme_id, $PSZ_LOG_THEME_UPLOADED, $setup_time)";
- }
- // admin account
- $table_sql[] = "INSERT INTO $PSZ_TABLE_USERS(`id`, `email`, `email_payout`, `fullname`, `password`, `account_type`, `plan_id`, `require_password`, `verify`, `active`, `registered_time`) VALUES(1, '$_POST[email]', 'billing@$site_domain', '$_POST[fullname]', '".md5($_POST['password'])."', $PSZ_TYPE_ADMIN, 4, 1, 1, 1, ".$setup_time.");";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES(1, 1, $PSZ_LOG_ADMIN_CREATED_USER, $setup_time)";
- // user accounts
- if( $import_sample_data )
- {
- $user_accounts = array(
- array("free.plan@$site_domain", __('Free Plan'), 1),
- array("starter.plan@$site_domain", __('Starter Plan'), 2),
- array("business.plan@$site_domain", __('Business+ Plan'), 3),
- array("unlimited.plan@$site_domain", __('ULIMITED Plan'), 4),
- array("expired.user@$site_domain", __('Expired User'), 2)
- );
- $i = 2;
- foreach($user_accounts as $user)
- {
- $table_sql[] = "INSERT INTO $PSZ_TABLE_USERS(`id`, `email`, `fullname`, `password`, `account_type`, `plan_id`, `require_password`, `verify`, `active`, `registered_time`) VALUES($i, '$user[0]', '$user[1]', '".md5($user[0])."', $PSZ_TYPE_MEMBER, $user[2], 1, 1, 1, ".$setup_time.");";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES(1, $i, $PSZ_LOG_ADMIN_CREATED_USER, $setup_time)";
- $i++;
- }
- // payments & sites & traffic
- $payments = array(
- array(strtoupper(PSZ_Random_String(4)), 'paid', 'plan', 2, 0, 1, 1, 'USD', 4, $setup_time, strtotime("+1 year", $setup_time), 1, 1),
- array(PSZ_Random_String(), 'completed', 'plan', 3, 0, 2, 0, '', 4, $setup_time, strtotime("+1 year", $setup_time), 1, 1),
- array(strtoupper(PSZ_Random_String(4)), 'paid', 'plan', 5, 0, 4, 15, 'USD', 1, $setup_time, strtotime("+1 month", $setup_time), 1, 1),
- array(strtoupper(PSZ_Random_String(4)), 'paid', 'plan', 6, 0, 2, 4, 'USD', 1, strtotime("-40 days", $setup_time), $setup_time, 0, 0),
- array(strtoupper(PSZ_Random_String(4)), 'paid', 'theme', 3, 1, $sample_commercial_theme_id, 1, 'USD', $THEME_PERIOD_PER_TIME, $setup_time, 0, 0, 1),
- array(strtoupper(PSZ_Random_String(4)), 'paid', 'theme', 5, 1, $sample_commercial_theme_id, 10, 'USD', $THEME_PERIOD_LIFETIME, $setup_time, 0, 1, 1)
- );
- foreach($payments as $payment)
- {
- $table_sql[] = "INSERT INTO $PSZ_TABLE_PAYMENTS(`transaction_id`, `status`, `type`, `buyer_id`, `seller_id`, `item_id`, `amount`, `currency`, `period`, `paid_time`, `expire_time`, `auto_renew`, `active`) VALUES('$payment[0]', '$payment[1]', '$payment[2]', $payment[3], $payment[4], $payment[5], $payment[6], '$payment[7]', $payment[8], $payment[9], $payment[10], $payment[11], $payment[12]);";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES($payment[3], $payment[5], $PSZ_LOG_PAYMENT_PLAN_CREATED, $setup_time)";
- }
- // traffic
- $today = date('j');
- $visit_1 = $visit_2 = $visit_3 = $pageview_1 = $pageview_2 = $pageview_3 = 0;
- for($i=1; $i<=$today; $i++)
- {
- $traffic_date = date('Ym') . str_pad($i, 2, '0', STR_PAD_LEFT);
- // site 1 from free user, traffic counter is disabled
- /* $visit = rand(100, 300);
- $pageview = rand(400, 1200);
- $visit_1 += $visit;
- $pageview_1 += $pageview;
- $table_sql[] = "INSERT INTO $PSZ_TABLE_SITES_TRAFFIC(`site_id`, `user_id`, `date`, `visit`, `pageview`) VALUES(1, 2, $traffic_date, $visit, $pageview);"; */
- $visit = rand(100, 300);
- $pageview = rand(400, 1200);
- $visit_2 += $visit;
- $pageview_2 += $pageview;
- $table_sql[] = "INSERT INTO $PSZ_TABLE_SITES_TRAFFIC(`site_id`, `user_id`, `date`, `visit`, `pageview`) VALUES(2, 3, $traffic_date, $visit, $pageview);";
- $visit = rand(100, 300);
- $pageview = rand(400, 1200);
- $visit_3 += $visit;
- $pageview_3 += $pageview;
- $table_sql[] = "INSERT INTO $PSZ_TABLE_SITES_TRAFFIC(`site_id`, `user_id`, `date`, `visit`, `pageview`) VALUES(3, 6, $traffic_date, $visit, $pageview);";
- }
- // sites
- $sites = array(
- array('Romantic Restaurant', 'restaurant', 2, $visit_1, $pageview_1, 0),
- array('Cinema', 'cinema', 3, $visit_2, $pageview_2, 1),
- array('Expired Site', 'expired-site', 6, $visit_3, $pageview_3, 0),
- );
- $i = 1;
- foreach($sites as $site)
- {
- $table_sql[] = "INSERT INTO $PSZ_TABLE_SITES(`name`, `subdomain`, `user_id`, `theme_id`, `created_time`, `published_time`, `total_visits`, `total_pageviews`, `shop_id`) VALUES('$site[0]', '$site[1]', $site[2], 1, $setup_time, $setup_time, $site[3], $site[4], $site[5]);";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES($site[2], $i, $PSZ_LOG_SITE_CREATED, $setup_time)";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES($site[2], $i, $PSZ_LOG_SITE_PUBLISHED, $setup_time)";
- $i++;
- }
- // store
- $store_id = 1;
- $store_site_id = 2;
- $store_user_id = 3;
- $store_payment = 'a:3:{s:4:"bacs";a:4:{s:6:"enable";s:1:"1";s:5:"title";s:20:"Direct Bank Transfer";s:11:"description";s:176:"Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order will not be shipped until the funds have cleared in our account.";s:8:"accounts";a:2:{i:0;a:3:{s:4:"name";s:23:"Ticket Account Holder 1";s:6:"number";s:6:"223344";s:4:"bank";a:4:{s:4:"name";s:11:"Bank Name 1";s:4:"code";s:5:"CODE1";s:4:"iban";s:0:"";s:5:"swift";s:6:"SWIFT1";}}i:1;a:3:{s:4:"name";s:23:"Ticket Account Holder 2";s:6:"number";s:6:"445566";s:4:"bank";a:4:{s:4:"name";s:11:"Bank Name 2";s:4:"code";s:5:"CODE2";s:4:"iban";s:5:"IBAN2";s:5:"swift";s:6:"SWIFT2";}}}}s:6:"paypal";a:7:{s:6:"enable";s:1:"1";s:7:"sandbox";s:1:"1";s:5:"title";s:6:"PayPal";s:11:"description";s:85:"Pay via PayPal; you can pay with your credit card if you do not have a PayPal account";s:5:"email";s:20:"billing@gomymobi.com";s:3:"pdt";s:59:"5tzXORMp-DzzyAdTsl1QmX3QSc7h1mJDtpHYqb58Ce2jhVoz4Rpm-TKPfUi";s:6:"prefix";s:13:"GTICKET-6717-";}s:3:"cod";a:3:{s:6:"enable";s:1:"1";s:5:"title";s:16:"Cash on Delivery";s:11:"description";s:28:"Pay with cash upon delivery.";}}';
- $options = 'a:2:{s:6:"social";a:2:{s:7:"heading";s:0:"";s:3:"url";a:16:{s:8:"facebook";s:27:"//www.facebook.com/gomymobi";s:7:"twitter";s:26:"//www.twitter.com/gomymobi";s:6:"google";s:69:"//plus.google.com/b/115321894007687351440/115321894007687351440/posts";s:8:"linkedin";s:0:"";s:7:"youtube";s:50:"//www.youtube.com/channel/UCh1A9Ll1zfNOzjRSh45g9nA";s:9:"instagram";s:0:"";s:9:"pinterest";s:0:"";s:6:"reddit";s:0:"";s:11:"stumbleupon";s:0:"";s:5:"skype";s:0:"";s:6:"tumblr";s:0:"";s:6:"github";s:0:"";s:8:"dribbble";s:0:"";s:7:"behance";s:0:"";s:7:"spotify";s:0:"";s:7:"dropbox";s:0:"";}}s:14:"theme_settings";a:12:{s:11:"theme_color";s:5:"green";s:12:"header_fixed";s:1:"1";s:17:"header_menu_pages";s:1:"1";s:15:"header_menu_new";s:1:"1";s:12:"featured_box";s:8:"homepage";s:14:"featured_width";s:4:"100%";s:15:"featured_height";s:5:"450px";s:12:"discount_box";s:3:"all";s:14:"discount_title";s:14:"In Discounting";s:11:"related_box";s:1:"1";s:13:"related_title";s:16:"Related Products";s:12:"footer_color";s:4:"dark";}}';
- $widgets = array (
- 0 =>
- array (
- 0 =>
- array (
- 'type' => 'category',
- 'title' => 'List',
- 'dropdown' => '0',
- 'show_counts' => '1',
- 'treeview' => '0',
- ),
- ),
- 1 =>
- array (
- 0 =>
- array (
- 'type' => 'text',
- 'title' => 'About Us',
- 'content' => '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam sit nonummy nibh euismod tincidunt ut laoreet dolore magna aliquarm erat
- sit volutpat. Nostrud exerci tation ullamcorper suscipit lobortis nisl aliquip commodo consequat. </p><p><br></p><p>Duis autem vel eum iriure dolor vulputate velit esse molestie
- at dolore.</p>',
- ),
- ),
- 2 =>
- array (
- 0 =>
- array (
- 'type' => 'page',
- 'title' => 'Information',
- 'sortby' => 'name',
- ),
- ),
- 3 =>
- array (
- 0 =>
- array (
- 'type' => 'text',
- 'title' => 'Latest Tweets',
- 'content' => '<a class="twitter-timeline" href="https://twitter.com/gomymobi">Tweets by gomymobi</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>',
- ),
- ),
- 4 =>
- array (
- 0 =>
- array (
- 'type' => 'text',
- 'title' => 'Our Contacts',
- 'content' => '<p>28, Lorem Lis Street, Park Ave, California, US<br/>
- Phone: 1800 323 3456<br/>
- Email: <b>hello@gomymobi.com</b></p>',
- ),
- ),
- );
- $widgets = serialize($widgets);
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORES(`site_id`, `user_id`, `name`, `slug`, `phones`, `email`, `status`, `payment`, `currency`, `currency_position`, `sign_thousand`, `sign_decimal`, `decimals`, `created_time`, `published_time`, `logo`, `favicon`, `title`, `options`, `widgets`) VALUES($store_site_id, $store_user_id, 'Sell Movie Tickets Online', 'ticket', '1900.1800', 'support@sellmoviesticket.com', 1, '$store_payment', 'USD', 'right', ',', '.', 2, $setup_time, $setup_time, 'http://www.gomymobi.com/app/uploads/media/public/logos/cinema.png', 'http://www.gomymobi.com/app/uploads/media/public/logos/cinema.png', 'Sell Movie Tickets Online', '$options', '$widgets');";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES($store_user_id, $store_id, $PSZ_LOG_SHOP_CREATED, $setup_time)";
- // store category
- $categories = array('3D', 'IMAX', 'Genre');
- $i = 1;
- foreach($categories as $category)
- {
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_CATEGORIES(`id`, `shop_id`, `user_id`, `name`, `slug`, `created_time`) VALUES($i, $store_id, $store_user_id, '$category', '" . url_rewrite($category) . "', $setup_time)";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES($store_user_id, $i, $PSZ_LOG_SHOP_CAT_CREATED, $setup_time)";
- $i++;
- }
- // 3D category term for Resident Evil
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_TERMS(`hosted_id`, `value_id`, `type`, `created_time`) VALUES(1, 1, 'category', $setup_time)";
- $categories = array('Action', 'Horror');
- foreach($categories as $category)
- {
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_CATEGORIES(`id`, `shop_id`, `user_id`, `name`, `slug`, `parent`, `created_time`) VALUES($i, $store_id, $store_user_id, '$category', '" . url_rewrite($category) . "', 3, $setup_time)";
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_TERMS(`hosted_id`, `value_id`, `type`, `created_time`) VALUES(1, $i, 'category', $setup_time)";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES($store_user_id, $i, $PSZ_LOG_SHOP_CAT_CREATED, $setup_time)";
- $i++;
- }
- // category terms for xXx: Return of Xander Cage
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_TERMS(`hosted_id`, `value_id`, `type`, `created_time`) VALUES(2, 2, 'category', $setup_time)";
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_TERMS(`hosted_id`, `value_id`, `type`, `created_time`) VALUES(2, 4, 'category', $setup_time)";
- // category terms for Monster Trucks
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_TERMS(`hosted_id`, `value_id`, `type`, `created_time`) VALUES(3, 1, 'category', $setup_time)";
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_TERMS(`hosted_id`, `value_id`, `type`, `created_time`) VALUES(3, 4, 'category', $setup_time)";
- // store items
- $items = array(
- array('Resident Evil: The Final Chapter', '<p>Picking up immediately after the events in Resident Evil: Retribution, Alice is the only survivor of what was meant to be humanity's final stand against the undead. Now, she must return to where the nightmare began - The Hive in Raccoon City, where the Umbrella Corporation is gathering its forces for a final strike against the only remaining survivors of the apocalypse.</p>', '<p>Picking up immediately after the events in Resident Evil: Retribution, Alice is the only survivor of what was meant to be humanity's final stand against the undead. Now, she must return to where the nightmare began - The Hive in Raccoon City, where the Umbrella Corporation is gathering its forces for a final strike against the only remaining survivors of the apocalypse.</p><p class="starringLabel" style="border: 0px; font-size: 12px; vertical-align: baseline; padding: 0px; margin: 15px 0px 0px; font-weight: bold; color: rgb(96, 96, 96) !important; line-height: 15px; display: block; font-family: Arial, Tahoma, Verdana; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">Starring<br>Milla Jovovich, Ali Larter, Shawn Roberts, Ruby Rose, Eoin Macken</p><div class="movieDatailsStaring" style="border: 0px; font-size: 12px; vertical-align: baseline; margin-top: -4px; display: block; line-height: 16px; color: rgb(0, 0, 0); font-family: Arial, Tahoma, Verdana; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);"></div><p><br></p><p align="center"><iframe class="note-video-clip" src="//www.youtube.com/embed/hfby7XwoBl0" frameborder="0" height="360" width="640"></iframe><br></p><ul style="border-width: 0px 0px 1px; border-top-style: initial; border-right-style: initial; border-bottom-style: solid; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: rgb(215, 212, 212); border-left-color: initial; border-image: initial; font-size: 12px; vertical-align: baseline; padding: 0px; margin-top: -8px; color: rgb(0, 0, 0); font-family: Arial, Tahoma, Verdana; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><li class="nobullet tight" style="border: 0px; font-size: 12px; vertical-align: baseline; margin: 0px; padding: 6.39063px 22.3906px; list-style: none; color: rgb(0, 0, 0); line-height: 12px; float: left; width: 595.188px;"><div class="detailName" style="border: 0px; font-size: 12px; vertical-align: baseline; width: 154px; float: left; font-family: Arial, Tahoma, Verdana; line-height: 16px;">Run Time</div><div class="detailContent" style="border: 0px; font-size: 12px; vertical-align: baseline; float: right; width: 368px; text-align: right; line-height: 16px;">1 hr. 45 min.</div></li><li class="alt nobullet tight" style="border: 0px; font-size: 12px; vertical-align: baseline; margin: 0px; padding: 6.39063px 22.3906px; list-style: none; color: rgb(0, 0, 0); line-height: 12px; float: left; width: 595.188px; background: rgb(228, 228, 227);"><div class="detailName" style="border: 0px; font-size: 12px; vertical-align: baseline; width: 154px; float: left; font-family: Arial, Tahoma, Verdana; line-height: 16px;">In Theaters</div><div class="detailContent" style="border: 0px; font-size: 12px; vertical-align: baseline; float: right; width: 368px; text-align: right; line-height: 16px;">Friday, January 27, 2017-Nationwide</div></li><li class="nobullet tight" style="border: 0px; font-size: 12px; vertical-align: baseline; margin: 0px; padding: 6.39063px 22.3906px; list-style: none; color: rgb(0, 0, 0); line-height: 12px; float: left; width: 595.188px;"><div class="detailName" style="border: 0px; font-size: 12px; vertical-align: baseline; width: 154px; float: left; font-family: Arial, Tahoma, Verdana; line-height: 16px;">MPAA Rating</div><div class="detailContent" style="border: 0px; font-size: 12px; vertical-align: baseline; float: right; width: 368px; text-align: right; line-height: 16px;">(R), for sequences of violence throughout</div></li><li class="alt nobullet tight" style="border: 0px; font-size: 12px; vertical-align: baseline; margin: 0px; padding: 6.39063px 22.3906px; list-style: none; color: rgb(0, 0, 0); line-height: 12px; float: left; width: 595.188px; background: rgb(228, 228, 227);"><div class="detailName" style="border: 0px; font-size: 12px; vertical-align: baseline; width: 154px; float: left; font-family: Arial, Tahoma, Verdana; line-height: 16px;">Genre</div><div class="detailContent" style="border: 0px; font-size: 12px; vertical-align: baseline; float: right; width: 368px; text-align: right; line-height: 16px;">Action/Adventure</div></li><li class="nobullet tight" style="border: 0px; font-size: 12px; vertical-align: baseline; margin: 0px; padding: 6.39063px 22.3906px; list-style: none; color: rgb(0, 0, 0); line-height: 12px; float: left; width: 595.188px;"><div class="detailName" style="border: 0px; font-size: 12px; vertical-align: baseline; width: 154px; float: left; font-family: Arial, Tahoma, Verdana; line-height: 16px;">Producer(s)</div><div class="detailContent" style="border: 0px; font-size: 12px; vertical-align: baseline; float: right; width: 368px; text-align: right; line-height: 16px;">Jeremy Bolt, Paul W.S. Anderson, Robert Kulzer, Samuel Hadida</div></li><li class="alt nobullet tight" style="border: 0px; font-size: 12px; vertical-align: baseline; margin: 0px; padding: 6.39063px 22.3906px; list-style: none; color: rgb(0, 0, 0); line-height: 12px; float: left; width: 595.188px; background: rgb(228, 228, 227);"><div class="detailName" style="border: 0px; font-size: 12px; vertical-align: baseline; width: 154px; float: left; font-family: Arial, Tahoma, Verdana; line-height: 16px;">Director(s)</div><div class="detailContent" style="border: 0px; font-size: 12px; vertical-align: baseline; float: right; width: 368px; text-align: right; line-height: 16px;">Paul W.S. Anderson</div></li><li class="nobullet tight" style="border: 0px; font-size: 12px; vertical-align: baseline; margin: 0px; padding: 6.39063px 22.3906px; list-style: none; color: rgb(0, 0, 0); line-height: 12px; float: left; width: 595.188px;"><div class="detailName" style="border: 0px; font-size: 12px; vertical-align: baseline; width: 154px; float: left; font-family: Arial, Tahoma, Verdana; line-height: 16px;">Writer(s)</div><div class="detailContent" style="border: 0px; font-size: 12px; vertical-align: baseline; float: right; width: 368px; text-align: right; line-height: 16px;">Paul W.S. Anderson</div></li><li class="alt nobullet tight" style="border: 0px; font-size: 12px; vertical-align: baseline; margin: 0px; padding: 6.39063px 22.3906px; list-style: none; color: rgb(0, 0, 0); line-height: 12px; float: left; width: 595.188px; background: rgb(228, 228, 227);"><div class="detailName" style="border: 0px; font-size: 12px; vertical-align: baseline; width: 154px; float: left; font-family: Arial, Tahoma, Verdana; line-height: 16px;">Studio</div><div class="detailContent" style="border: 0px; font-size: 12px; vertical-align: baseline; float: right; width: 368px; text-align: right; line-height: 16px;">Sony Pictures</div></li><li class="nobullet tight" style="border: 0px; font-size: 12px; vertical-align: baseline; margin: 0px; padding: 6.39063px 22.3906px; list-style: none; color: rgb(0, 0, 0); line-height: 12px; float: left; width: 595.188px;"><div class="detailName" style="border: 0px; font-size: 12px; vertical-align: baseline; width: 154px; float: left; font-family: Arial, Tahoma, Verdana; line-height: 16px;">Format(s)</div><div class="detailContent" style="border: 0px; font-size: 12px; vertical-align: baseline; float: right; width: 368px; text-align: right; line-height: 16px;">2D</div></li></ul><p><br></p>', "http://www.gomymobi.com/app/uploads/media/public/posters/Resident-Evil-The-Final-Chapter.jpg\r\nhttp://www.gomymobi.com/app/uploads/media/public/posters/Resident-Evil-The-Final-Chapter-2.jpg\r\nhttp://www.gomymobi.com/app/uploads/media/public/posters/Resident-Evil-The-Final-Chapter-3.jpg", 2),
- array('xXx: Return of Xander Cage', '<p>Xander Cage is left for dead after an incident, though he secretly returns to action for a new, tough assignment with his handler Augustus Gibbons.<br></p>', '<p align="center"><iframe class="note-video-clip" src="//www.youtube.com/embed/MQEFmHsseaU" frameborder="0" height="360" width="640"></iframe><br></p>', 'http://www.gomymobi.com/app/uploads/media/public/posters/xxx-return-of-xander-cage.jpg', 0),
- array('Monster Trucks', '<p>Looking for any way to get away from the life and town he was born into, Tripp (Lucas Till), a high school senior, builds a Monster Truck from bits and pieces of scrapped cars. After an accident at a nearby oil-drilling site displaces a strange and subterranean creature with a taste and a talent for speed, Tripp may have just found the key to getting out of town and a most unlikely friend.<br></p>', '<p align="center"><iframe class="note-video-clip" src="//www.youtube.com/embed/uQrj2M-2Uiw" frameborder="0" height="360" width="640"></iframe><br></p>', 'http://www.gomymobi.com/app/uploads/media/public/posters/Monster-Trucks-Squid.jpg', 0)
- );
- $i = 1;
- foreach($items as $item)
- {
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_ITEMS(`id`, `shop_id`, `user_id`, `name`, `slug`, `summary`, `description`, `featured`, `item_type`, `price_regular`, `shipping_cost`, `images`, `item_sold`, `created_time`, `published_time`) VALUES($i, $store_id, $store_user_id, '$item[0]', '" . url_rewrite($item[0]) . "', '$item[1]', '$item[2]', 1, 'single', '20', '5', '$item[3]', $item[4], $setup_time, $setup_time)";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES($store_user_id, $i, $PSZ_LOG_SHOP_ITEM_CREATED, $setup_time)";
- $i++;
- }
- $items = array(
- array(
- 'name' => 'Membership Accesses',
- 'sold' => 0,
- 'summary' => '<p>Pay monthly / yearly to watch unlimited movies.</p>',
- 'type' => 'group',
- 'parent' => 0,
- 'price_subscription' => '',
- 'subscription_per' => '',
- 'subscription_period' => '',
- 'subscription_for' => '',
- 'signup_fee' => '',
- 'trial' => '',
- 'trial_period' => '',
- 'digital' => 1,
- 'downloadable' => 0,
- 'files' => ''),
- array(
- 'name' => 'VIP: Monthly',
- 'sold' => 1,
- 'summary' => '<p>Pay monthly to watch your favorite movies.<br></p>',
- 'type' => 'subscription',
- 'parent' => 4,
- 'price_subscription' => 9,
- 'subscription_per' => 1,
- 'subscription_period' => 'month',
- 'subscription_for' => 0,
- 'signup_fee' => 3,
- 'trial' => 1,
- 'trial_period' => 'week',
- 'digital' => 1,
- 'downloadable' => 1,
- 'files' => 'http://www.gomymobi.com/app/uploads/media/stores/stores-starter.plan@gomymobi.com/VIP-monthly.zip')
- );
- foreach($items as $item)
- {
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_ITEMS(`id`, `shop_id`, `user_id`, `name`, `slug`, `item_sold`, `summary`, `item_type`, `parent`, `price_subscription`, `subscription_per`, `subscription_period`, `subscription_for`, `signup_fee`, `trial`, `trial_period`, `digital`, `downloadable`, `files`, `images`, `created_time`, `published_time`) VALUES($i, $store_id, $store_user_id, '$item[name]', '" . url_rewrite($item['name']) . "', '$item[sold]', '$item[summary]', '$item[type]', '$item[parent]', '$item[price_subscription]', '$item[subscription_per]', '$item[subscription_period]', '$item[subscription_for]', '$item[signup_fee]', '$item[trial]', '$item[trial_period]', $item[digital], $item[downloadable], '$item[files]', 'http://www.gomymobi.com/app/uploads/media/public/posters/Movies-Membership-Card.jpg', $setup_time, $setup_time)";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES($store_user_id, $i, $PSZ_LOG_SHOP_ITEM_CREATED, $setup_time)";
- $i++;
- }
- // store tag
- $items = array('Resident Evil', 'Raccoon City', 'Umbrella Corporation');
- $i = 1;
- foreach($items as $item)
- {
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_TAGS(`id`, `shop_id`, `user_id`, `name`, `slug`, `created_time`) VALUES($i, $store_id, $store_user_id, '$item', '" . url_rewrite($item) . "', $setup_time)";
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_TERMS(`hosted_id`, `value_id`, `type`, `created_time`) VALUES(1, $i, 'tag', $setup_time)";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES($store_user_id, $i, $PSZ_LOG_SHOP_TAG_CREATED, $setup_time)";
- $i++;
- }
- // store page
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_PAGES(`shop_id`, `user_id`, `name`, `slug`, `short`, `full`, `created_time`, `published_time`) VALUES($store_id, $store_user_id, 'About us', 'about-us', 'About us', '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam sit nonummy nibh euismod tincidunt ut laoreet dolore magna aliquarm erat sit volutpat. Nostrud exerci tation ullamcorper suscipit lobortis nisl aliquip commodo consequat.</p>', $setup_time, $setup_time)";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES($store_user_id, $i, $PSZ_LOG_SHOP_PAGE_CREATED, $setup_time)";
- // store order
- $items = array(
- array(
- 'key' => strtoupper(PSZ_Random_String(17)),
- 'transaction_id' => strtoupper(PSZ_Random_String(17)),
- 'buyer' => 'a:3:{s:8:"fullname";s:15:"Yoshie Dahlberg";s:5:"email";s:20:"test.buyer@gmail.com";s:5:"phone";s:9:"1800.1900";}',
- 'items' => 'a:1:{i:0;a:5:{s:2:"id";s:1:"1";s:4:"name";s:32:"Resident Evil: The Final Chapter";s:19:"purchase_unit_price";i:20;s:8:"quantity";s:1:"2";s:13:"shipping_cost";s:1:"5";}}',
- 'payment' => 'paypal',
- 'total' => 50,
- 'ship' => 'a:6:{s:8:"fullname";s:15:"Yoshie Dahlberg";s:5:"email";s:20:"test.buyer@gmail.com";s:5:"phone";s:9:"1800.1900";s:3:"fax";s:0:"";s:7:"company";s:0:"";s:7:"address";a:2:{i:1;s:34:"28 Lorem Lis Street, New York, USA";i:2;s:0:"";}}',
- 'notes' => '',
- 'status' => 'completed',
- 'created_time' => $setup_time,
- 'processed_time' => $setup_time),
- array(
- 'key' => strtoupper(PSZ_Random_String(17)),
- 'transaction_id' => '',
- 'buyer' => 'a:3:{s:8:"fullname";s:17:"Clementine Cadden";s:5:"email";s:20:"test.buyer@gmail.com";s:5:"phone";s:9:"1800.1900";}',
- 'items' => 'a:2:{i:0;a:5:{s:2:"id";s:1:"2";s:4:"name";s:26:"xXx: Return of Xander Cage";s:19:"purchase_unit_price";i:20;s:8:"quantity";s:1:"1";s:13:"shipping_cost";s:1:"5";}i:1;a:5:{s:2:"id";s:1:"3";s:4:"name";s:14:"Monster Trucks";s:19:"purchase_unit_price";i:20;s:8:"quantity";s:1:"1";s:13:"shipping_cost";s:1:"5";}}',
- 'payment' => 'cod',
- 'total' => 50,
- 'ship' => 'a:6:{s:8:"fullname";s:17:"Clementine Cadden";s:5:"email";s:20:"test.buyer@gmail.com";s:5:"phone";s:9:"1800.1900";s:3:"fax";s:0:"";s:7:"company";s:0:"";s:7:"address";a:2:{i:1;s:46:"28, Lorem Lis Street, Park Ave, California, US";i:2;s:0:"";}}',
- 'notes' => 'Call us before delivery',
- 'status' => 'pending',
- 'created_time' => $setup_time,
- 'processed_time' => 0),
- array(
- 'key' => strtoupper(PSZ_Random_String(17)),
- 'transaction_id' => '',
- 'buyer' => 'a:3:{s:8:"fullname";s:14:"Monthly Unpaid";s:5:"email";s:20:"test.buyer@gmail.com";s:5:"phone";s:0:"";}',
- 'items' => 'a:1:{i:0;a:10:{s:2:"id";s:1:"5";s:4:"name";s:12:"VIP: Monthly";s:19:"purchase_unit_price";i:9;s:8:"quantity";s:1:"1";s:16:"subscription_per";s:1:"1";s:19:"subscription_period";s:5:"month";s:16:"subscription_for";s:1:"0";s:10:"signup_fee";s:1:"3";s:5:"trial";s:1:"1";s:12:"trial_period";s:4:"week";}}',
- 'payment' => 'paypal',
- 'total' => 3,
- 'ship' => '',
- 'notes' => 'Must pay to see downloadable materials.',
- 'status' => 'pending',
- 'created_time' => $setup_time,
- 'processed_time' => 0),
- array(
- 'key' => strtoupper(PSZ_Random_String(17)),
- 'transaction_id' => strtoupper(PSZ_Random_String(17)),
- 'buyer' => 'a:3:{s:8:"fullname";s:12:"Monthly Paid";s:5:"email";s:20:"test.buyer@gmail.com";s:5:"phone";s:0:"";}',
- 'items' => 'a:1:{i:0;a:10:{s:2:"id";s:1:"5";s:4:"name";s:12:"VIP: Monthly";s:19:"purchase_unit_price";s:1:"9";s:8:"quantity";s:1:"1";s:16:"subscription_per";s:1:"1";s:19:"subscription_period";s:5:"month";s:16:"subscription_for";s:1:"0";s:10:"signup_fee";s:1:"3";s:5:"trial";s:1:"1";s:12:"trial_period";s:4:"week";}}',
- 'payment' => 'bacs',
- 'total' => 3,
- 'ship' => '',
- 'notes' => '',
- 'status' => 'completed',
- 'created_time' => $setup_time,
- 'processed_time' => $setup_time),
- );
- $i = 1;
- foreach($items as $item)
- {
- $table_sql[] = "INSERT INTO $PSZ_TABLE_STORE_ORDERS(`id`, `shop_id`, `user_id`, `key`, `transaction_id`, `buyer`, `items`, `payment`, `total`, `ship`, `notes`, `status`, `created_time`, `processed_time`) VALUES($i, $store_id, $store_user_id, '$item[key]', '$item[transaction_id]', '$item[buyer]', '$item[items]', '$item[payment]', '$item[total]', '$item[ship]', '$item[notes]', '$item[status]', $item[created_time], $item[processed_time])";
- $logs[] = "INSERT INTO $PSZ_TABLE_LOGS(`user_id`, `item_id`, `log_type`, `time`) VALUES($store_user_id, $i, $PSZ_LOG_SHOP_ORDER_RECIEVED, $setup_time)";
- $i++;
- }
- }
- // drop all tables first
- $db->sql_query("DROP TABLE IF EXISTS $PSZ_TABLE_FRONTPAGES, $PSZ_TABLE_PAYMENTS, $PSZ_TABLE_PLANS, $PSZ_TABLE_PLAN_OPTIONS, $PSZ_TABLE_SITES, $PSZ_TABLE_SITES_TRAFFIC, $PSZ_TABLE_LOGS, $PSZ_TABLE_THEMES, $PSZ_TABLE_THEME_CATEGORIES, $PSZ_TABLE_USERS, $PSZ_TABLE_STORES, $PSZ_TABLE_STORE_CATEGORIES, $PSZ_TABLE_STORE_ITEMS, $PSZ_TABLE_STORE_ORDERS, $PSZ_TABLE_STORE_TAGS, $PSZ_TABLE_STORE_PAGES, $PSZ_TABLE_STORE_TERMS;");
- // run queries
- foreach($table_sql as $sql) {
- $db->sql_query($sql);
- }
- foreach($logs as $sql) {
- $db->sql_query($sql);
- }
- // install SQL only
- //die(sprintf($ajax_return_success, $PSZ_APP_webpath . '/account/login/'));
- // delete current dirs
- $data_dirs = array($PSZ_DIR_FRONTPAGE, $PSZ_TABLE_THEMES, $PSZ_DIR_UPLOAD, $PSZ_DIR_SITES_LIVE, $PSZ_DIR_SITES_BUILDING);
- foreach($data_dirs as $dir) {
- xdelete($dir);
- new_folder("installer-sample-data/$dir");
- }
- // restore sample data
- if( $import_sample_data ) {
- reset($data_dirs);
- foreach($data_dirs as $dir)
- xcopy("installer-sample-data/$dir", $PSZ_APP_root_dir . $dir);
- }
- else {
- for($i=0; $i<3; $i++)
- xcopy("installer-sample-data/$data_dirs[$i]", $PSZ_APP_root_dir . $data_dirs[$i]);
- // delete commercial theme
- xdelete('themes/gomymobi-commercial');
- // create dirs
- new_folder($PSZ_DIR_SITES_LIVE);
- new_folder($PSZ_DIR_SITES_BUILDING);
- }
- // write configs to system file
- $sys_file_content = file_get_contents( $PSZ_APP_FILE_DB_DEFAULT_CONFIG );
- $sys_default_settings = get_default_app_settings();
- $sys_default_settings['sys']['domain'] = $_POST['domain'];
- $sys_default_settings['sys']['site_name'] = $_POST['domain'];
- if( !new_file($PSZ_APP_FILE_SYS_LIVE_CONFIG, str_replace(
- array('{{DB_HOST}}', '{{DB_NAME}}', '{{DB_USER}}', '{{DB_PASSWD}}', '{{SYS_DEFAULTS}}'),
- array($dbhost, $dbname, $dbuser, $dbpasswd, base64_encode(serialize($sys_default_settings))),
- $sys_file_content))
- )
- die( sprintf($ajax_return_error, __('Error'), __('Could not write system configurations to file.')) );
- // create htaccess file & robots.txt
- $site_protocol = 'http' . (is_SSL() ? 's' : '');
- $system_robots_file = 'User-agent: *
- Sitemap: ' . $site_protocol . '://www.{{SITE_DOMAIN_WITHOUT_WWW}}/sitemap/';
- new_file(
- '../robots.txt',
- str_replace( '{{SITE_DOMAIN_WITHOUT_WWW}}', $_POST['domain'], $system_robots_file)
- );
- new_file(
- '../.htaccess',
- str_replace_array(array(
- '{{SITE_DOMAIN_WITHOUT_WWW}}' => addcslashes($_POST['domain'], '.'),
- '{{APP_PATH}}' => $PSZ_APP_webpath,
- '{{PROTOCOL}}' => $site_protocol,
- '{{SSL_REDIRECT_SETTINGS}}' => ''
- ),
- file_get_contents('includes/htaccess_pattern_settings.config')
- )
- );
- // destroy current session, to delete states
- setcookie($PSZ_APP_COOKIE_REMEMBER, false, -1, '/');
- session_destroy();
- // success
- die(sprintf($ajax_return_success, $PSZ_APP_webpath . '/account/login/'));
- }
- exit;
- }
- /*$dbhost = 'localhost';
- $dbname = 'onlinepl_mainop';
- $dbuser = 'onlinepl_mainop';
- $dbpasswd = 'G[[@Kr$FSM@v';
- include_once($PSZ_APP_root_dir . 'includes/db.mysqli.php');*/
- /*if( isset($_GET['skip']) && $_GET['skip']=='ziparchive' )
- $skip_ziparchive = true;*/
- $pTemplate->assign_vars(array(
- 'DOMAIN' => get_site_domain($_SERVER['SERVER_NAME'])
- ));
- $pContent = $pTemplate->pparse_file( "$PSZ_DIR_BIZ_TEMPLATE/install.html" );
- //echo $pTemplate->pparse($pContent);
- die( $pTemplate->pparse($pContent, true, true, true) );
- exit;
- ?>
Add Comment
Please, Sign In to add comment