Merge branch 'develop' into text-changes
This commit is contained in:
28
README.md
28
README.md
@@ -16,18 +16,19 @@
|
||||
</p>
|
||||
|
||||
## Topics
|
||||
- [Introduction](#introduction)
|
||||
- [Requirements](#requirements)
|
||||
- [Hosted Server Configurations](#hosted-server-configurations)
|
||||
- [Local Server Configurations](#local-server-configurations)
|
||||
- [Installation and Configuration](#installation-and-configuration)
|
||||
- [License](#license)
|
||||
- [Security Vulnerabilities](#security-vulnerabilities)
|
||||
- [Documentation & Demo](#documentation--demo)
|
||||
- [QloApps Documentation https://qloapps.com/qlo-reservation-system](#qloapps-documentation-httpsqloappscomqlo-reservation-system)
|
||||
- [QloApps Demo](#qloapps-demo)
|
||||
- [Contribute](#contribute)
|
||||
- [Credits](#credits)
|
||||
- [Topics](#topics)
|
||||
- [Introduction](#introduction)
|
||||
- [Requirements](#requirements)
|
||||
- [Hosted Server Configurations](#hosted-server-configurations)
|
||||
- [Local Server Configurations](#local-server-configurations)
|
||||
- [Installation and Configuration](#installation-and-configuration)
|
||||
- [License](#license)
|
||||
- [Security Vulnerabilities](#security-vulnerabilities)
|
||||
- [Documentation & Demo](#documentation--demo)
|
||||
- [QloApps Documentation https://qloapps.com/qlo-reservation-system](#qloapps-documentation-httpsqloappscomqlo-reservation-system)
|
||||
- [QloApps Demo](#qloapps-demo)
|
||||
- [Contribute](#contribute)
|
||||
- [Credits](#credits)
|
||||
|
||||
|
||||
### Introduction
|
||||
@@ -85,8 +86,7 @@ Please don't disclose security vulnerabilities publicly. If you find any securit
|
||||
|
||||
#### QloApps Documentation [https://qloapps.com/qlo-reservation-system](https://qloapps.com/qlo-reservation-system)
|
||||
#### QloApps Demo
|
||||
**FrontEnd** : https://demo.qloapps.com </br>
|
||||
**Backend** : https://demo.qloapps.com/adminhtl/index.php </br>
|
||||
**Link** : https://demo.qloapps.com </br>
|
||||
**username** : demo@demo.com </br>
|
||||
**Password** : demodemo </br>
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ class InstallControllerHttpSystem extends InstallControllerHttp
|
||||
'title' => $this->l('Required PHP parameters'),
|
||||
'success' => 1,
|
||||
'checks' => array(
|
||||
'phpversion' => $this->l('Minimum PHP 5.4.0 or later is required'),
|
||||
'phpversion' => $this->l('Minimum PHP 5.6.0 or later is required'),
|
||||
'upload' => $this->l('Cannot upload files'),
|
||||
'system' => $this->l('Cannot create new files and folders'),
|
||||
'gd' => $this->l('GD library is not installed'),
|
||||
@@ -133,7 +133,7 @@ class InstallControllerHttpSystem extends InstallControllerHttp
|
||||
'title' => $this->l('Recommended PHP parameters'),
|
||||
'success' => $this->tests['optional']['success'],
|
||||
'checks' => array(
|
||||
'new_phpversion' => sprintf($this->l('You are using PHP %s version. Soon, the latest PHP version supported by QloApps will be PHP 5.4. To make sure you’re ready for the future, we recommend you to upgrade to PHP 5.4 now!'), phpversion()),
|
||||
'new_phpversion' => sprintf($this->l('You are using PHP %s version. Soon, the latest PHP version supported by QloApps will be PHP 5.6. To make sure you’re ready for the future, we recommend you to upgrade to PHP 5.6 now!'), phpversion()),
|
||||
'register_globals' => $this->l('PHP register_globals option is enabled'),
|
||||
'gz' => $this->l('GZIP compression is not activated'),
|
||||
'mcrypt' => $this->l('Mcrypt extension is not enabled'),
|
||||
|
||||
@@ -24,15 +24,15 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
include_once(dirname(__FILE__).'/WishList.php');
|
||||
include_once (dirname(__FILE__).'/classes/BlockWishlistDb.php');
|
||||
include_once (dirname(__FILE__).'/WishList.php');
|
||||
|
||||
class BlockWishList extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
|
||||
private $html = '';
|
||||
|
||||
public function __construct()
|
||||
@@ -55,23 +55,11 @@ class BlockWishList extends Module
|
||||
$this->html = '';
|
||||
}
|
||||
|
||||
public function install($delete_params = true)
|
||||
public function install()
|
||||
{
|
||||
if ($delete_params)
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE))
|
||||
return (false);
|
||||
else if (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE))
|
||||
return (false);
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
foreach ($sql as $query)
|
||||
if ($query)
|
||||
if (!Db::getInstance()->execute(trim($query)))
|
||||
return false;
|
||||
}
|
||||
|
||||
$objBlockWishListDb = new BlockWishlistDb();
|
||||
if (!parent::install() ||
|
||||
!$objBlockWishListDb->createTables() ||
|
||||
!$this->registerHook('rightColumn') ||
|
||||
!$this->registerHook('productActions') ||
|
||||
!$this->registerHook('cart') ||
|
||||
@@ -79,19 +67,24 @@ class BlockWishList extends Module
|
||||
!$this->registerHook('header') ||
|
||||
!$this->registerHook('adminCustomers') ||
|
||||
!$this->registerHook('displayProductListFunctionalButtons') ||
|
||||
!$this->registerHook('top'))
|
||||
!$this->registerHook('top')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
/* This hook is optional */
|
||||
$this->registerHook('displayMyAccountBlock');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall($delete_params = true)
|
||||
public function uninstall($delete_data = true)
|
||||
{
|
||||
if (($delete_params && !$this->deleteTables()) || !parent::uninstall())
|
||||
$objBlockWishListDb = new BlockWishlistDb();
|
||||
if (!parent::uninstall()
|
||||
|| ($delete_data && !$objBlockWishListDb->dropTables())
|
||||
) {
|
||||
return false;
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -108,11 +101,12 @@ class BlockWishList extends Module
|
||||
|
||||
public function reset()
|
||||
{
|
||||
if (!$this->uninstall(false))
|
||||
if (!$this->uninstall(false)) {
|
||||
return false;
|
||||
if (!$this->install(false))
|
||||
}
|
||||
if (!$this->install()) {
|
||||
return false;
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
89
modules/blockwishlist/classes/BlockWishlistDb.php
Normal file
89
modules/blockwishlist/classes/BlockWishlistDb.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
class BlockWishListDb
|
||||
{
|
||||
public function getModuleSql()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."wishlist` (
|
||||
`id_wishlist` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`token` varchar(64) character set utf8 NOT NULL,
|
||||
`name` varchar(64) character set utf8 NOT NULL,
|
||||
`counter` int(10) unsigned NULL,
|
||||
`id_shop` int(10) unsigned default 1,
|
||||
`id_shop_group` int(10) unsigned default 1,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
`default` int(10) unsigned default 0,
|
||||
PRIMARY KEY (`id_wishlist`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."wishlist_email` (
|
||||
`id_wishlist` int(10) unsigned NOT NULL,
|
||||
`email` varchar(128) character set utf8 NOT NULL,
|
||||
`date_add` datetime NOT NULL
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."wishlist_product` (
|
||||
`id_wishlist_product` int(10) NOT NULL auto_increment,
|
||||
`id_wishlist` int(10) unsigned NOT NULL,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_product_attribute` int(10) unsigned NOT NULL,
|
||||
`quantity` int(10) unsigned NOT NULL,
|
||||
`priority` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_wishlist_product`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."wishlist_product_cart` (
|
||||
`id_wishlist_product` int(10) unsigned NOT NULL,
|
||||
`id_cart` int(10) unsigned NOT NULL,
|
||||
`quantity` int(10) unsigned NOT NULL,
|
||||
`date_add` datetime NOT NULL
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
);
|
||||
}
|
||||
|
||||
public function createTables()
|
||||
{
|
||||
if ($sql = $this->getModuleSql()) {
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'wishlist`,
|
||||
`'._DB_PREFIX_.'wishlist_email`,
|
||||
`'._DB_PREFIX_.'wishlist_product`,
|
||||
`'._DB_PREFIX_.'wishlist_product_cart`'
|
||||
);
|
||||
}
|
||||
}
|
||||
29
modules/blockwishlist/classes/index.php
Normal file
29
modules/blockwishlist/classes/index.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -1,36 +0,0 @@
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_wishlist` (
|
||||
`id_wishlist` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`token` varchar(64) character set utf8 NOT NULL,
|
||||
`name` varchar(64) character set utf8 NOT NULL,
|
||||
`counter` int(10) unsigned NULL,
|
||||
`id_shop` int(10) unsigned default 1,
|
||||
`id_shop_group` int(10) unsigned default 1,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
`default` int(10) unsigned default 0,
|
||||
PRIMARY KEY (`id_wishlist`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_wishlist_email` (
|
||||
`id_wishlist` int(10) unsigned NOT NULL,
|
||||
`email` varchar(128) character set utf8 NOT NULL,
|
||||
`date_add` datetime NOT NULL
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_wishlist_product` (
|
||||
`id_wishlist_product` int(10) NOT NULL auto_increment,
|
||||
`id_wishlist` int(10) unsigned NOT NULL,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_product_attribute` int(10) unsigned NOT NULL,
|
||||
`quantity` int(10) unsigned NOT NULL,
|
||||
`priority` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_wishlist_product`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_wishlist_product_cart` (
|
||||
`id_wishlist_product` int(10) unsigned NOT NULL,
|
||||
`id_cart` int(10) unsigned NOT NULL,
|
||||
`quantity` int(10) unsigned NOT NULL,
|
||||
`date_add` datetime NOT NULL
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
@@ -0,0 +1,423 @@
|
||||
<?php
|
||||
/**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
class HotelReservationSystemDb
|
||||
{
|
||||
public function getModuleSql()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`adult` smallint(6) NOT NULL,
|
||||
`children` smallint(6) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_information` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`room_num` varchar(225) NOT NULL,
|
||||
`id_status` int(11) NOT NULL,
|
||||
`floor` text NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_branch_info` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_category` int(10) unsigned NOT NULL,
|
||||
`phone` varchar(32) DEFAULT NULL,
|
||||
`email` varchar(128) NOT NULL,
|
||||
`check_in` varchar(255) DEFAULT NULL,
|
||||
`check_out` varchar(255) DEFAULT NULL,
|
||||
`rating` int(2) unsigned NOT NULL,
|
||||
`city` varchar(64) NOT NULL,
|
||||
`state_id` int(10) unsigned NOT NULL,
|
||||
`country_id` int(10) unsigned NOT NULL,
|
||||
`zipcode` varchar(12) NOT NULL,
|
||||
`address` text DEFAULT NULL,
|
||||
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`latitude` decimal(10,8) NOT NULL,
|
||||
`longitude` decimal(11,8) NOT NULL,
|
||||
`map_formated_address` text NOT NULL,
|
||||
`map_input_text` text NOT NULL,
|
||||
`active_refund` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_branch_info_lang` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`hotel_name` varchar(255) DEFAULT NULL,
|
||||
`short_description` text,
|
||||
`description` text,
|
||||
`policies` text,
|
||||
PRIMARY KEY (`id`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_image` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`hotel_image_id` varchar(32) NOT NULL,
|
||||
`cover` tinyint(1) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_branch_features` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`feature_id` varchar(255) DEFAULT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_features` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`parent_feature_id` int(10) unsigned NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL,
|
||||
`active` int(2) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_features_lang` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_cart_booking_data` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_cart` int(11) NOT NULL,
|
||||
`id_guest` int(11) NOT NULL,
|
||||
`id_order` int(11) NOT NULL,
|
||||
`id_customer` int(11) NOT NULL,
|
||||
`id_currency` int(11) NOT NULL,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_room` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`quantity` int(11) NOT NULL,
|
||||
`booking_type` tinyint(4) NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`is_back_order` tinyint(4) NOT NULL,
|
||||
`extra_demands` text NOT NULL,
|
||||
`date_from` datetime NOT NULL,
|
||||
`date_to` datetime NOT NULL,
|
||||
`is_refunded` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_booking_detail` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_order` int(11) NOT NULL,
|
||||
`id_order_detail` int(11) NOT NULL,
|
||||
`id_cart` int(11) NOT NULL,
|
||||
`id_room` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`id_customer` int(11) NOT NULL,
|
||||
`booking_type` tinyint(4) NOT NULL,
|
||||
`id_status` int(11) NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`check_in` datetime NOT NULL,
|
||||
`check_out` datetime NOT NULL,
|
||||
`date_from` datetime NOT NULL,
|
||||
`date_to` datetime NOT NULL,
|
||||
`total_price_tax_excl` decimal(20,6) NOT NULL,
|
||||
`total_price_tax_incl` decimal(20,6) NOT NULL,
|
||||
`total_paid_amount` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`is_back_order` tinyint(4) NOT NULL,
|
||||
`hotel_name` varchar(255) DEFAULT NULL,
|
||||
`room_type_name` varchar(255) DEFAULT NULL,
|
||||
`city` varchar(255) NOT NULL,
|
||||
`state` varchar(255) DEFAULT NULL,
|
||||
`country` varchar(255) DEFAULT NULL,
|
||||
`zipcode` varchar(12) DEFAULT NULL,
|
||||
`phone` varchar(32) DEFAULT NULL,
|
||||
`email` varchar(128) DEFAULT NULL,
|
||||
`check_in_time` varchar(32) DEFAULT NULL,
|
||||
`check_out_time` varchar(32) DEFAULT NULL,
|
||||
`room_num` varchar(225) DEFAULT NULL,
|
||||
`adult` smallint(6) NOT NULL DEFAULT '0',
|
||||
`children` smallint(6) NOT NULL DEFAULT '0',
|
||||
`is_refunded` tinyint(1) NOT NULL DEFAULT '0',
|
||||
-- `available_for_order` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_booking_demands` (
|
||||
`id_booking_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_htl_booking` int(11) NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
`unit_price_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`unit_price_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`total_price_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`total_price_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`price_calc_method` int(11) unsigned DEFAULT '0',
|
||||
`id_tax_rules_group` int(11) unsigned DEFAULT '0',
|
||||
`tax_computation_method` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_booking_demand`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_booking_demands_tax` (
|
||||
`id_booking_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_tax` int(11) NOT NULL,
|
||||
`unit_amount` DECIMAL(16, 6) NOT NULL DEFAULT '0.00',
|
||||
`total_amount` DECIMAL(16, 6) NOT NULL DEFAULT '0.00',
|
||||
PRIMARY KEY (`id_booking_demand`, `id_tax`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_status` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`status` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_allotment_type` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`type` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_advance_payment` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`payment_type` tinyint(4) NOT NULL,
|
||||
`value` decimal(20,6) NOT NULL,
|
||||
`id_currency` int(11) NOT NULL,
|
||||
`tax_include` tinyint(4) NOT NULL,
|
||||
`calculate_from` tinyint(4) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_order_refund_rules` (
|
||||
`id_refund_rule` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`payment_type` int(2) unsigned NOT NULL,
|
||||
`deduction_value_full_pay` decimal(20,6) NOT NULL,
|
||||
`deduction_value_adv_pay` decimal(20,6) NOT NULL,
|
||||
`days` decimal(35,0) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_refund_rule`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_order_refund_rules_lang` (
|
||||
`id_refund_rule` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) DEFAULT NULL,
|
||||
`description` text,
|
||||
PRIMARY KEY (`id_refund_rule`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_branch_refund_rules` (
|
||||
`id_hotel_refund_rule` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_refund_rule` int(10) unsigned NOT NULL,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_hotel_refund_rule`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_order_restrict_date` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`max_order_date` datetime NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_feature_pricing` (
|
||||
`id_feature_price` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`date_from` date NOT NULL,
|
||||
`date_to` date NOT NULL,
|
||||
`is_special_days_exists` tinyint(1) NOT NULL,
|
||||
`date_selection_type` tinyint(1) NOT NULL,
|
||||
`special_days` text,
|
||||
`impact_way` tinyint(1) NOT NULL,
|
||||
`impact_type` tinyint(1) NOT NULL,
|
||||
`impact_value` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_feature_price`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_feature_pricing_lang` (
|
||||
`id_feature_price` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`feature_price_name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_feature_price`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_feature_pricing_group` (
|
||||
`id_feature_price` int(10) unsigned NOT NULL,
|
||||
`id_group` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_feature_price`,`id_group`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_global_demand` (
|
||||
`id_global_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`id_tax_rules_group` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`price_calc_method` tinyint(1) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_global_demand`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_global_demand_lang` (
|
||||
`id_global_demand` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_global_demand`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_global_demand_advance_option` (
|
||||
`id_option` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_global_demand` int(11) NOT NULL,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_option`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_global_demand_advance_option_lang` (
|
||||
`id_option` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_option`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_demand_price` (
|
||||
`id_room_type_demand_price` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_global_demand` int(10) unsigned NOT NULL,
|
||||
`id_option` int(10) unsigned NOT NULL,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_type_demand_price`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_demand` (
|
||||
`id_room_type_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_global_demand` int(10) unsigned NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_type_demand`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_disable_dates` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_room_type` int(11) NOT NULL,
|
||||
`id_room` int(11) NOT NULL,
|
||||
`date_from` date NOT NULL,
|
||||
`date_to` date NOT NULL,
|
||||
`reason` text,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_access` (
|
||||
`id_profile` int(10) unsigned NOT NULL,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`access` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id_profile`, `id_hotel`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
);
|
||||
}
|
||||
|
||||
public function createTables()
|
||||
{
|
||||
if ($sql = $this->getModuleSql()) {
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_room_type`,
|
||||
`'._DB_PREFIX_.'htl_room_information`,
|
||||
`'._DB_PREFIX_.'htl_branch_info`,
|
||||
`'._DB_PREFIX_.'htl_branch_info_lang`,
|
||||
`'._DB_PREFIX_.'htl_image`,
|
||||
`'._DB_PREFIX_.'htl_branch_features`,
|
||||
`'._DB_PREFIX_.'htl_features`,
|
||||
`'._DB_PREFIX_.'htl_features_lang`,
|
||||
`'._DB_PREFIX_.'htl_cart_booking_data`,
|
||||
`'._DB_PREFIX_.'htl_booking_detail`,
|
||||
`'._DB_PREFIX_.'htl_booking_demands`,
|
||||
`'._DB_PREFIX_.'htl_booking_demands_tax`,
|
||||
`'._DB_PREFIX_.'htl_room_status`,
|
||||
`'._DB_PREFIX_.'htl_room_allotment_type`,
|
||||
`'._DB_PREFIX_.'htl_advance_payment`,
|
||||
`'._DB_PREFIX_.'htl_order_refund_rules`,
|
||||
`'._DB_PREFIX_.'htl_order_refund_rules_lang`,
|
||||
`'._DB_PREFIX_.'htl_branch_refund_rules`,
|
||||
`'._DB_PREFIX_.'htl_order_restrict_date`,
|
||||
`'._DB_PREFIX_.'htl_room_type_feature_pricing`,
|
||||
`'._DB_PREFIX_.'htl_room_type_feature_pricing_lang`,
|
||||
`'._DB_PREFIX_.'htl_room_type_feature_pricing_group`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand_lang`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand_advance_option`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand_advance_option_lang`,
|
||||
`'._DB_PREFIX_.'htl_room_type_demand_price`,
|
||||
`'._DB_PREFIX_.'htl_room_type_demand`,
|
||||
`'._DB_PREFIX_.'htl_room_disable_dates`,
|
||||
`'._DB_PREFIX_.'htl_access`'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
require_once 'classes/HotelReservationSystemDb.php';
|
||||
require_once 'classes/HotelRoomType.php';
|
||||
require_once 'classes/HotelRoomInformation.php';
|
||||
require_once 'classes/HotelBranchInformation.php';
|
||||
|
||||
@@ -25,7 +25,6 @@ include_once 'define.php';
|
||||
|
||||
class hotelreservationsystem extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'hotelreservationsystem';
|
||||
@@ -636,25 +635,19 @@ class hotelreservationsystem extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
$objModuleDb = new HotelReservationSystemDb();
|
||||
$objHtlHelper = new HotelHelper();
|
||||
if (!parent::install()
|
||||
|| !$objModuleDb->createTables()
|
||||
|| !$this->registerModuleHooks()
|
||||
|| !$this->callInstallTab()
|
||||
|| !$objHtlHelper->insertDefaultHotelEntries()
|
||||
|| !$objHtlHelper->insertHotelRoomAllotmentType()
|
||||
) {
|
||||
return false;
|
||||
} elseif (!$sql = Tools::file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if module should be populated while installation
|
||||
$objHtlHelper = new HotelHelper();
|
||||
if (isset($this->populateData) && $this->populateData) {
|
||||
if (!$objHtlHelper->createHotelRoomDefaultFeatures()
|
||||
|| !$objHtlHelper->insertHotelCommonFeatures()
|
||||
@@ -664,16 +657,6 @@ class hotelreservationsystem extends Module
|
||||
}
|
||||
}
|
||||
|
||||
if (!parent::install()
|
||||
|| !$this->callInstallTab()
|
||||
|| !$this->registerModuleHooks()
|
||||
|| !$objHtlHelper->insertDefaultHotelEntries()
|
||||
|| !$objHtlHelper->insertHotelRoomAllotmentType()
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -704,43 +687,6 @@ class hotelreservationsystem extends Module
|
||||
);
|
||||
}
|
||||
|
||||
public function deleteTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_room_type`,
|
||||
`'._DB_PREFIX_.'htl_room_information`,
|
||||
`'._DB_PREFIX_.'htl_branch_info`,
|
||||
`'._DB_PREFIX_.'htl_branch_info_lang`,
|
||||
`'._DB_PREFIX_.'htl_image`,
|
||||
`'._DB_PREFIX_.'htl_branch_features`,
|
||||
`'._DB_PREFIX_.'htl_features`,
|
||||
`'._DB_PREFIX_.'htl_features_lang`,
|
||||
`'._DB_PREFIX_.'htl_cart_booking_data`,
|
||||
`'._DB_PREFIX_.'htl_booking_detail`,
|
||||
`'._DB_PREFIX_.'htl_booking_demands`,
|
||||
`'._DB_PREFIX_.'htl_booking_demands_tax`,
|
||||
`'._DB_PREFIX_.'htl_room_status`,
|
||||
`'._DB_PREFIX_.'htl_room_allotment_type`,
|
||||
`'._DB_PREFIX_.'htl_advance_payment`,
|
||||
`'._DB_PREFIX_.'htl_order_refund_rules`,
|
||||
`'._DB_PREFIX_.'htl_order_refund_rules_lang`,
|
||||
`'._DB_PREFIX_.'htl_branch_refund_rules`,
|
||||
`'._DB_PREFIX_.'htl_order_restrict_date`,
|
||||
`'._DB_PREFIX_.'htl_room_type_feature_pricing`,
|
||||
`'._DB_PREFIX_.'htl_room_type_feature_pricing_lang`,
|
||||
`'._DB_PREFIX_.'htl_room_type_feature_pricing_group`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand_lang`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand_advance_option`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand_advance_option_lang`,
|
||||
`'._DB_PREFIX_.'htl_room_type_demand_price`,
|
||||
`'._DB_PREFIX_.'htl_room_type_demand`,
|
||||
`'._DB_PREFIX_.'htl_room_disable_dates`,
|
||||
`'._DB_PREFIX_.'htl_access`'
|
||||
);
|
||||
}
|
||||
|
||||
public function uninstallTab()
|
||||
{
|
||||
$moduleTabs = Tab::getCollectionFromModule($this->name);
|
||||
@@ -783,9 +729,10 @@ class hotelreservationsystem extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objModuleDb = new HotelReservationSystemDb();
|
||||
if (!parent::uninstall()
|
||||
|| !$this->deleteConfigVars()
|
||||
|| !$this->deleteTables()
|
||||
|| !$objModuleDb->dropTables()
|
||||
|| !$this->uninstallTab()
|
||||
) {
|
||||
return false;
|
||||
|
||||
@@ -1,363 +0,0 @@
|
||||
/**
|
||||
* 2010-2020 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright 2010-2020 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`adult` smallint(6) NOT NULL,
|
||||
`children` smallint(6) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_information` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`room_num` varchar(225) NOT NULL,
|
||||
`id_status` int(11) NOT NULL,
|
||||
`floor` text NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_branch_info` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_category` int(10) unsigned NOT NULL,
|
||||
`phone` varchar(32) DEFAULT NULL,
|
||||
`email` varchar(128) NOT NULL,
|
||||
`check_in` varchar(255) DEFAULT NULL,
|
||||
`check_out` varchar(255) DEFAULT NULL,
|
||||
`rating` int(2) unsigned NOT NULL,
|
||||
`city` varchar(64) NOT NULL,
|
||||
`state_id` int(10) unsigned NOT NULL,
|
||||
`country_id` int(10) unsigned NOT NULL,
|
||||
`zipcode` varchar(12) NOT NULL,
|
||||
`address` text DEFAULT NULL,
|
||||
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`latitude` decimal(10,8) NOT NULL,
|
||||
`longitude` decimal(11,8) NOT NULL,
|
||||
`map_formated_address` text NOT NULL,
|
||||
`map_input_text` text NOT NULL,
|
||||
`active_refund` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_branch_info_lang` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`hotel_name` varchar(255) DEFAULT NULL,
|
||||
`short_description` text,
|
||||
`description` text,
|
||||
`policies` text,
|
||||
PRIMARY KEY (`id`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_image` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`hotel_image_id` varchar(32) NOT NULL,
|
||||
`cover` tinyint(1) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_branch_features` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`feature_id` varchar(255) DEFAULT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_features` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`parent_feature_id` int(10) unsigned NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL,
|
||||
`active` int(2) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_features_lang` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_cart_booking_data` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_cart` int(11) NOT NULL,
|
||||
`id_guest` int(11) NOT NULL,
|
||||
`id_order` int(11) NOT NULL,
|
||||
`id_customer` int(11) NOT NULL,
|
||||
`id_currency` int(11) NOT NULL,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_room` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`quantity` int(11) NOT NULL,
|
||||
`booking_type` tinyint(4) NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`is_back_order` tinyint(4) NOT NULL,
|
||||
`extra_demands` text NOT NULL,
|
||||
`date_from` datetime NOT NULL,
|
||||
`date_to` datetime NOT NULL,
|
||||
`is_refunded` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_booking_detail` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_order` int(11) NOT NULL,
|
||||
`id_order_detail` int(11) NOT NULL,
|
||||
`id_cart` int(11) NOT NULL,
|
||||
`id_room` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`id_customer` int(11) NOT NULL,
|
||||
`booking_type` tinyint(4) NOT NULL,
|
||||
`id_status` int(11) NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`check_in` datetime NOT NULL,
|
||||
`check_out` datetime NOT NULL,
|
||||
`date_from` datetime NOT NULL,
|
||||
`date_to` datetime NOT NULL,
|
||||
`total_price_tax_excl` decimal(20,6) NOT NULL,
|
||||
`total_price_tax_incl` decimal(20,6) NOT NULL,
|
||||
`total_paid_amount` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`is_back_order` tinyint(4) NOT NULL,
|
||||
`hotel_name` varchar(255) DEFAULT NULL,
|
||||
`room_type_name` varchar(255) DEFAULT NULL,
|
||||
`city` varchar(255) NOT NULL,
|
||||
`state` varchar(255) DEFAULT NULL,
|
||||
`country` varchar(255) DEFAULT NULL,
|
||||
`zipcode` varchar(12) DEFAULT NULL,
|
||||
`phone` varchar(32) DEFAULT NULL,
|
||||
`email` varchar(128) DEFAULT NULL,
|
||||
`check_in_time` varchar(32) DEFAULT NULL,
|
||||
`check_out_time` varchar(32) DEFAULT NULL,
|
||||
`room_num` varchar(225) DEFAULT NULL,
|
||||
`adult` smallint(6) NOT NULL DEFAULT '0',
|
||||
`children` smallint(6) NOT NULL DEFAULT '0',
|
||||
`is_refunded` tinyint(1) NOT NULL DEFAULT '0',
|
||||
-- `available_for_order` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_booking_demands` (
|
||||
`id_booking_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_htl_booking` int(11) NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
`unit_price_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`unit_price_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`total_price_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`total_price_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`price_calc_method` int(11) unsigned DEFAULT '0',
|
||||
`id_tax_rules_group` int(11) unsigned DEFAULT '0',
|
||||
`tax_computation_method` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_booking_demand`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_booking_demands_tax` (
|
||||
`id_booking_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_tax` int(11) NOT NULL,
|
||||
`unit_amount` DECIMAL(16, 6) NOT NULL DEFAULT '0.00',
|
||||
`total_amount` DECIMAL(16, 6) NOT NULL DEFAULT '0.00',
|
||||
PRIMARY KEY (`id_booking_demand`, `id_tax`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_status` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`status` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_allotment_type` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`type` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_advance_payment` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`payment_type` tinyint(4) NOT NULL,
|
||||
`value` decimal(20,6) NOT NULL,
|
||||
`id_currency` int(11) NOT NULL,
|
||||
`tax_include` tinyint(4) NOT NULL,
|
||||
`calculate_from` tinyint(4) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_order_refund_rules` (
|
||||
`id_refund_rule` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`payment_type` int(2) unsigned NOT NULL,
|
||||
`deduction_value_full_pay` decimal(20,6) NOT NULL,
|
||||
`deduction_value_adv_pay` decimal(20,6) NOT NULL,
|
||||
`days` decimal(35,0) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_refund_rule`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_order_refund_rules_lang` (
|
||||
`id_refund_rule` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) DEFAULT NULL,
|
||||
`description` text,
|
||||
PRIMARY KEY (`id_refund_rule`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_branch_refund_rules` (
|
||||
`id_hotel_refund_rule` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_refund_rule` int(10) unsigned NOT NULL,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_hotel_refund_rule`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_order_restrict_date` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`max_order_date` datetime NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_feature_pricing` (
|
||||
`id_feature_price` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`date_from` date NOT NULL,
|
||||
`date_to` date NOT NULL,
|
||||
`is_special_days_exists` tinyint(1) NOT NULL,
|
||||
`date_selection_type` tinyint(1) NOT NULL,
|
||||
`special_days` text,
|
||||
`impact_way` tinyint(1) NOT NULL,
|
||||
`impact_type` tinyint(1) NOT NULL,
|
||||
`impact_value` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_feature_price`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_feature_pricing_lang` (
|
||||
`id_feature_price` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`feature_price_name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_feature_price`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `PREFIX_htl_room_type_feature_pricing_group` (
|
||||
`id_feature_price` int(10) unsigned NOT NULL,
|
||||
`id_group` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_feature_price`,`id_group`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_global_demand` (
|
||||
`id_global_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`id_tax_rules_group` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`price_calc_method` tinyint(1) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_global_demand`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_global_demand_lang` (
|
||||
`id_global_demand` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_global_demand`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_global_demand_advance_option` (
|
||||
`id_option` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_global_demand` int(11) NOT NULL,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_option`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_global_demand_advance_option_lang` (
|
||||
`id_option` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_option`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_demand_price` (
|
||||
`id_room_type_demand_price` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_global_demand` int(10) unsigned NOT NULL,
|
||||
`id_option` int(10) unsigned NOT NULL,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_type_demand_price`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_demand` (
|
||||
`id_room_type_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_global_demand` int(10) unsigned NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_type_demand`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_disable_dates` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_room_type` int(11) NOT NULL,
|
||||
`id_room` int(11) NOT NULL,
|
||||
`date_from` date NOT NULL,
|
||||
`date_to` date NOT NULL,
|
||||
`reason` text,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_access` (
|
||||
`id_profile` int(10) unsigned NOT NULL,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`access` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id_profile`, `id_hotel`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
131
modules/productcomments/classes/ProductCommentsDb.php
Normal file
131
modules/productcomments/classes/ProductCommentsDb.php
Normal file
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
/**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
class ProductCommentsDb
|
||||
{
|
||||
public function getModuleSql()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`id_guest` int(10) unsigned NULL,
|
||||
`title` varchar(64) NULL,
|
||||
`content` text NOT NULL,
|
||||
`customer_name` varchar(64) NULL,
|
||||
`grade` float unsigned NOT NULL,
|
||||
`validate` tinyint(1) NOT NULL,
|
||||
`deleted` tinyint(1) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`),
|
||||
KEY `id_product` (`id_product`),
|
||||
KEY `id_customer` (`id_customer`),
|
||||
KEY `id_guest` (`id_guest`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_criterion` (
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_product_comment_criterion_type` tinyint(1) NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment_criterion`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_criterion_product` (
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY(`id_product`, `id_product_comment_criterion`),
|
||||
KEY `id_product_comment_criterion` (`id_product_comment_criterion`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_criterion_lang` (
|
||||
`id_product_comment_criterion` INT(11) UNSIGNED NOT NULL ,
|
||||
`id_lang` INT(11) UNSIGNED NOT NULL ,
|
||||
`name` VARCHAR(64) NOT NULL ,
|
||||
PRIMARY KEY ( `id_product_comment_criterion` , `id_lang` )
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_criterion_category` (
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
`id_category` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY(`id_product_comment_criterion`, `id_category`),
|
||||
KEY `id_category` (`id_category`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_grade` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
`grade` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_product_comment_criterion`),
|
||||
KEY `id_product_comment_criterion` (`id_product_comment_criterion`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_usefulness` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`usefulness` tinyint(1) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_customer`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_report` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_customer`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"INSERT IGNORE INTO `"._DB_PREFIX_."product_comment_criterion` VALUES ('1', '1', '1');",
|
||||
|
||||
"INSERT IGNORE INTO `"._DB_PREFIX_."product_comment_criterion_lang` (`id_product_comment_criterion`, `id_lang`, `name`)
|
||||
(
|
||||
SELECT '1', l.`id_lang`, 'Quality'
|
||||
FROM `"._DB_PREFIX_."lang` l
|
||||
);",
|
||||
);
|
||||
}
|
||||
|
||||
public function createTables()
|
||||
{
|
||||
if ($sql = $this->getModuleSql()) {
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'product_comment`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion_product`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion_lang`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion_category`,
|
||||
`'._DB_PREFIX_.'product_comment_grade`,
|
||||
`'._DB_PREFIX_.'product_comment_usefulness`,
|
||||
`'._DB_PREFIX_.'product_comment_report`'
|
||||
);
|
||||
}
|
||||
}
|
||||
29
modules/productcomments/classes/index.php
Normal file
29
modules/productcomments/classes/index.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -1,75 +0,0 @@
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`id_guest` int(10) unsigned NULL,
|
||||
`title` varchar(64) NULL,
|
||||
`content` text NOT NULL,
|
||||
`customer_name` varchar(64) NULL,
|
||||
`grade` float unsigned NOT NULL,
|
||||
`validate` tinyint(1) NOT NULL,
|
||||
`deleted` tinyint(1) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`),
|
||||
KEY `id_product` (`id_product`),
|
||||
KEY `id_customer` (`id_customer`),
|
||||
KEY `id_guest` (`id_guest`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion` (
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_product_comment_criterion_type` tinyint(1) NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment_criterion`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion_product` (
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY(`id_product`, `id_product_comment_criterion`),
|
||||
KEY `id_product_comment_criterion` (`id_product_comment_criterion`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion_lang` (
|
||||
`id_product_comment_criterion` INT(11) UNSIGNED NOT NULL ,
|
||||
`id_lang` INT(11) UNSIGNED NOT NULL ,
|
||||
`name` VARCHAR(64) NOT NULL ,
|
||||
PRIMARY KEY ( `id_product_comment_criterion` , `id_lang` )
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion_category` (
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
`id_category` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY(`id_product_comment_criterion`, `id_category`),
|
||||
KEY `id_category` (`id_category`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_grade` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
`grade` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_product_comment_criterion`),
|
||||
KEY `id_product_comment_criterion` (`id_product_comment_criterion`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_usefulness` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`usefulness` tinyint(1) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_customer`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_report` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_customer`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_product_comment_criterion` VALUES ('1', '1', '1');
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_product_comment_criterion_lang` (`id_product_comment_criterion`, `id_lang`, `name`)
|
||||
(
|
||||
SELECT '1', l.`id_lang`, 'Quality'
|
||||
FROM `PREFIX_lang` l
|
||||
);
|
||||
|
||||
@@ -24,13 +24,14 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
include_once (dirname(__FILE__).'/classes/ProductCommentsDb.php');
|
||||
|
||||
class ProductComments extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
|
||||
private $_html = '';
|
||||
private $_postErrors = array();
|
||||
private $_filters = array();
|
||||
@@ -57,24 +58,11 @@ class ProductComments extends Module
|
||||
$this->description = $this->l('Allows users to post reviews and rate products on specific criteria.');
|
||||
}
|
||||
|
||||
public function install($keep = true)
|
||||
public function install()
|
||||
{
|
||||
if ($keep)
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE))
|
||||
return false;
|
||||
else if (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE))
|
||||
return false;
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", trim($sql));
|
||||
|
||||
foreach ($sql as $query)
|
||||
if (!Db::getInstance()->execute(trim($query)))
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
$objProductCommentsDb = new ProductCommentsDb();
|
||||
if (parent::install() == false ||
|
||||
!$objProductCommentsDb->createTables() ||
|
||||
!$this->registerHook('productTab') ||
|
||||
!$this->registerHook('extraProductComparison') ||
|
||||
!$this->registerHook('productTabContent') ||
|
||||
@@ -83,14 +71,17 @@ class ProductComments extends Module
|
||||
!$this->registerHook('displayProductListReviews') ||
|
||||
!Configuration::updateValue('PRODUCT_COMMENTS_MINIMAL_TIME', 30) ||
|
||||
!Configuration::updateValue('PRODUCT_COMMENTS_ALLOW_GUESTS', 0) ||
|
||||
!Configuration::updateValue('PRODUCT_COMMENTS_MODERATE', 1))
|
||||
!Configuration::updateValue('PRODUCT_COMMENTS_MODERATE', 1)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall($keep = true)
|
||||
public function uninstall($delete_data = true)
|
||||
{
|
||||
if (!parent::uninstall() || ($keep && !$this->deleteTables()) ||
|
||||
$objProductCommentsDb = new ProductCommentsDb();
|
||||
if (!parent::uninstall() || ($delete_data && !$objProductCommentsDb->dropTables()) ||
|
||||
!Configuration::deleteByName('PRODUCT_COMMENTS_MODERATE') ||
|
||||
!Configuration::deleteByName('PRODUCT_COMMENTS_ALLOW_GUESTS') ||
|
||||
!Configuration::deleteByName('PRODUCT_COMMENTS_MINIMAL_TIME') ||
|
||||
@@ -100,34 +91,24 @@ class ProductComments extends Module
|
||||
!$this->unregisterHook('header') ||
|
||||
!$this->unregisterHook('productTab') ||
|
||||
!$this->unregisterHook('top') ||
|
||||
!$this->unregisterHook('displayProductListReviews'))
|
||||
!$this->unregisterHook('displayProductListReviews')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function reset()
|
||||
{
|
||||
if (!$this->uninstall(false))
|
||||
if (!$this->uninstall(false)) {
|
||||
return false;
|
||||
if (!$this->install(false))
|
||||
}
|
||||
if (!$this->install()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteTables()
|
||||
{
|
||||
return Db::getInstance()->execute('
|
||||
DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'product_comment`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion_product`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion_lang`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion_category`,
|
||||
`'._DB_PREFIX_.'product_comment_grade`,
|
||||
`'._DB_PREFIX_.'product_comment_usefulness`,
|
||||
`'._DB_PREFIX_.'product_comment_report`');
|
||||
}
|
||||
|
||||
public function getCacheId($id_product = null)
|
||||
{
|
||||
return parent::getCacheId().'|'.(int)$id_product;
|
||||
@@ -496,7 +477,6 @@ class ProductComments extends Module
|
||||
return $helper->generateList($comments, $fields_list);
|
||||
}
|
||||
|
||||
|
||||
public function getConfigFieldsValues()
|
||||
{
|
||||
return array(
|
||||
|
||||
60
modules/wkabouthotelblock/classes/WkAboutHotelBlockDb.php
Normal file
60
modules/wkabouthotelblock/classes/WkAboutHotelBlockDb.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
class WkAboutHotelBlockDb
|
||||
{
|
||||
public function createTables()
|
||||
{
|
||||
if ($sqls = $this->getModuleSqls()) {
|
||||
foreach ($sqls as $query) {
|
||||
if ($query) {
|
||||
if (!DB::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getModuleSqls()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_interior_image` (
|
||||
`id_interior_image` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` text NOT NULL,
|
||||
`display_name` text NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_interior_image`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
);
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return DB::getInstance()->execute('
|
||||
DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_interior_image`;
|
||||
');
|
||||
}
|
||||
}
|
||||
@@ -18,4 +18,5 @@
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
require_once 'classes/WkAboutHotelBlockDb.php';
|
||||
require_once 'classes/WkHotelInteriorImage.php';
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/**
|
||||
* 2010-2020 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright 2010-2020 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_interior_image` (
|
||||
`id_interior_image` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` text NOT NULL,
|
||||
`display_name` text NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_interior_image`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
@@ -26,13 +26,12 @@ require_once dirname(__FILE__).'/define.php';
|
||||
|
||||
class WkAboutHotelBlock extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'wkabouthotelblock';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.1.7';
|
||||
$this->author = 'webkul';
|
||||
$this->author = 'Webkul';
|
||||
$this->need_instance = 0;
|
||||
|
||||
$this->bootstrap = true;
|
||||
@@ -90,24 +89,10 @@ class WkAboutHotelBlock extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
} elseif (!$sql = Tools::file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
$objAboutHotelBlockDb = new WkAboutHotelBlockDb();
|
||||
$objHtlInteriorImg = new WkHotelInteriorImage();
|
||||
if (!parent::install()
|
||||
|| !$objAboutHotelBlockDb->createTables()
|
||||
|| !$this->registerModuleHooks()
|
||||
|| !$this->callInstallTab()
|
||||
|| !$objHtlInteriorImg->insertModuleDemoData()
|
||||
@@ -161,9 +146,10 @@ class WkAboutHotelBlock extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objAboutHotelBlockDb = new WkAboutHotelBlockDb();
|
||||
if (!parent::uninstall()
|
||||
|| !$this->deleteHotelInterierImg()
|
||||
|| !$this->deleteTables()
|
||||
|| !$objAboutHotelBlockDb->dropTables()
|
||||
|| !$this->deleteConfigKeys()
|
||||
|| !$this->uninstallTab()
|
||||
) {
|
||||
@@ -207,12 +193,4 @@ class WkAboutHotelBlock extends Module
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_interior_image`'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
class WkFooterPaymentBlockDb
|
||||
{
|
||||
public function createTables()
|
||||
{
|
||||
if ($sqls = $this->getModuleSqls()) {
|
||||
foreach ($sqls as $query) {
|
||||
if ($query) {
|
||||
if (!DB::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getModuleSqls()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_footer_payment_block_info` (
|
||||
`id_payment_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_payment_block`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
);
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return DB::getInstance()->execute('
|
||||
DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_footer_payment_block_info`;
|
||||
');
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* 2010-2018 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright 2010-2018 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_footer_payment_block_info` (
|
||||
`id_payment_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_payment_block`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
@@ -22,18 +22,17 @@ if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__).'/classes/WkFooterPaymentBlockDb.php';
|
||||
require_once dirname(__FILE__).'/classes/WkFooterPaymentBlockInfo.php';
|
||||
|
||||
class WkFooterPaymentBlock extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'wkfooterpaymentblock';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.1.4';
|
||||
$this->author = 'webkul';
|
||||
$this->author = 'Webkul';
|
||||
$this->need_instance = 0;
|
||||
|
||||
$this->bootstrap = true;
|
||||
@@ -99,23 +98,9 @@ class WkFooterPaymentBlock extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
} elseif (!$sql = Tools::file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
$objFooterPaymentBlockDb = new WkFooterPaymentBlockDb();
|
||||
if (!parent::install()
|
||||
|| !$objFooterPaymentBlockDb->createTables()
|
||||
||!$this->registerHook('displayFooterPaymentInfo')
|
||||
||!$this->registerHook('displayAddModuleSettingLink')
|
||||
|| !$this->callInstallTab()
|
||||
@@ -128,13 +113,13 @@ class WkFooterPaymentBlock extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objFooterPaymentBlockDb = new WkFooterPaymentBlockDb();
|
||||
if (!parent::uninstall()
|
||||
|| !$this->uninstallTab()
|
||||
|| !$this->dropTables()
|
||||
|| !$objFooterPaymentBlockDb->dropTables()
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -150,13 +135,6 @@ class WkFooterPaymentBlock extends Module
|
||||
return true;
|
||||
}
|
||||
|
||||
private function dropTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS `'._DB_PREFIX_.'htl_footer_payment_block_info`'
|
||||
);
|
||||
}
|
||||
|
||||
public function insertDefaultModuleData()
|
||||
{
|
||||
$paymentNames = array(
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
class WkHotelFeaturesBlockDb
|
||||
{
|
||||
public function createTables()
|
||||
{
|
||||
if ($sqls = $this->getModuleSqls()) {
|
||||
foreach ($sqls as $query) {
|
||||
if ($query) {
|
||||
if (!DB::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getModuleSqls()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_features_block_data` (
|
||||
`id_features_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_features_block`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_features_block_data_lang` (
|
||||
`id_features_block` int(11) NOT NULL,
|
||||
`id_lang` int(11) NOT NULL,
|
||||
`feature_title` text NOT NULL,
|
||||
`feature_description` text NOT NULL,
|
||||
PRIMARY KEY (`id_features_block`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;"
|
||||
);
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return DB::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_features_block_data`,
|
||||
`'._DB_PREFIX_.'htl_features_block_data_lang`;
|
||||
');
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
/**
|
||||
* 2010-2020 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright 2010-2020 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_features_block_data` (
|
||||
`id_features_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_features_block`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_features_block_data_lang` (
|
||||
`id_features_block` int(11) NOT NULL,
|
||||
`id_lang` int(11) NOT NULL,
|
||||
`feature_title` text NOT NULL,
|
||||
`feature_description` text NOT NULL,
|
||||
PRIMARY KEY (`id_features_block`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 ;
|
||||
@@ -23,17 +23,17 @@ if (!defined('_PS_VERSION_')) {
|
||||
}
|
||||
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
require_once dirname(__FILE__).'/../wkhotelfeaturesblock/classes/WkHotelFeaturesBlockDb.php';
|
||||
require_once dirname(__FILE__).'/../wkhotelfeaturesblock/classes/WkHotelFeaturesData.php';
|
||||
|
||||
class WkHotelFeaturesBlock extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'wkhotelfeaturesblock';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '2.0.5';
|
||||
$this->author = 'webkul';
|
||||
$this->author = 'Webkul';
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
@@ -121,24 +121,10 @@ class WkHotelFeaturesBlock extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
} elseif (!$sql = Tools::file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
$objHotelFeaturesBlockDb = new WkHotelFeaturesBlockDb();
|
||||
$objFeaturesData = new WkHotelFeaturesData();
|
||||
if (!parent::install()
|
||||
|| !$objHotelFeaturesBlockDb->createTables()
|
||||
|| !$this->registerModuleHooks()
|
||||
|| !$this->callInstallTab()
|
||||
|| !$objFeaturesData->insertModuleDemoData()
|
||||
@@ -162,10 +148,11 @@ class WkHotelFeaturesBlock extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objHotelFeaturesBlockDb = new WkHotelFeaturesBlockDb();
|
||||
if (!parent::uninstall()
|
||||
|| !$this->deleteHotelAmenityImg()
|
||||
|| !$this->uninstallTab()
|
||||
|| !$this->deleteTables()
|
||||
|| !$objHotelFeaturesBlockDb->dropTables()
|
||||
|| !$this->deleteConfigKeys()
|
||||
) {
|
||||
return false;
|
||||
@@ -200,16 +187,7 @@ class WkHotelFeaturesBlock extends Module
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_features_block_data`,
|
||||
`'._DB_PREFIX_.'htl_features_block_data_lang`'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function uninstallTab()
|
||||
{
|
||||
$moduleTabs = Tab::getCollectionFromModule($this->name);
|
||||
|
||||
59
modules/wkhotelroom/classes/WkHotelRoomDb.php
Normal file
59
modules/wkhotelroom/classes/WkHotelRoomDb.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
class WkHotelRoomDb
|
||||
{
|
||||
public function createTables()
|
||||
{
|
||||
if ($sqls = $this->getModuleSqls()) {
|
||||
foreach ($sqls as $query) {
|
||||
if ($query) {
|
||||
if (!DB::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getModuleSqls()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_block_data` (
|
||||
`id_room_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL,
|
||||
`position` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_block`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;"
|
||||
);
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return DB::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_room_block_data`;
|
||||
');
|
||||
}
|
||||
}
|
||||
@@ -19,4 +19,5 @@
|
||||
*/
|
||||
|
||||
require_once _PS_MODULE_DIR_.'/hotelreservationsystem/define.php';
|
||||
require_once 'classes/WkHotelRoomDb.php';
|
||||
require_once 'classes/WkHotelRoomDisplay.php';
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* 2010-2020 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright 2010-2020 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_block_data` (
|
||||
`id_room_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL,
|
||||
`position` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_block`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
@@ -21,18 +21,17 @@
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__).'/define.php';
|
||||
|
||||
class WkHotelRoom extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'wkhotelroom';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.1.7';
|
||||
$this->author = 'webkul';
|
||||
$this->author = 'Webkul';
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
@@ -179,24 +178,9 @@ class WkHotelRoom extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
} elseif (!$sql = Tools::file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$objHotelRoomDb = new WkHotelRoomDb();
|
||||
if (!parent::install()
|
||||
|| !$objHotelRoomDb->createTables()
|
||||
|| !$this->registerModuleHooks()
|
||||
|| !$this->callInstallTab()
|
||||
) {
|
||||
@@ -230,24 +214,17 @@ class WkHotelRoom extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objHotelRoomDb = new WkHotelRoomDb();
|
||||
if (!parent::uninstall()
|
||||
|| !$this->uninstallTab()
|
||||
|| !$this->deleteTables()
|
||||
|| !$objHotelRoomDb->dropTables()
|
||||
|| !$this->deleteConfigKeys()
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_room_block_data`'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function deleteConfigKeys()
|
||||
{
|
||||
$configVars = array(
|
||||
|
||||
68
modules/wktestimonialblock/classes/WkTestimonialBlockDb.php
Normal file
68
modules/wktestimonialblock/classes/WkTestimonialBlockDb.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
class WkTestimonialBlockDb
|
||||
{
|
||||
public function createTables()
|
||||
{
|
||||
if ($sqls = $this->getModuleSqls()) {
|
||||
foreach ($sqls as $query) {
|
||||
if ($query) {
|
||||
if (!DB::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getModuleSqls()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_testimonials_block_data` (
|
||||
`id_testimonial_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`designation` text NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_testimonial_block`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_testimonials_block_data_lang` (
|
||||
`id_testimonial_block` int(11) NOT NULL,
|
||||
`id_lang` int(11) NOT NULL,
|
||||
`testimonial_content` text NOT NULL,
|
||||
PRIMARY KEY (`id_testimonial_block`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;"
|
||||
);
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return DB::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_testimonials_block_data`,
|
||||
`'._DB_PREFIX_.'htl_testimonials_block_data_lang`
|
||||
');
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/**
|
||||
* 2010-2020 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright 2010-2020 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_testimonials_block_data` (
|
||||
`id_testimonial_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`designation` text NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_testimonial_block`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_testimonials_block_data_lang` (
|
||||
`id_testimonial_block` int(11) NOT NULL,
|
||||
`id_lang` int(11) NOT NULL,
|
||||
`testimonial_content` text NOT NULL,
|
||||
PRIMARY KEY (`id_testimonial_block`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 ;
|
||||
@@ -22,12 +22,12 @@ if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__).'/../wktestimonialblock/classes/WkTestimonialBlockDb.php';
|
||||
require_once dirname(__FILE__).'/../wktestimonialblock/classes/WkHotelTestimonialData.php';
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
|
||||
class WkTestimonialBlock extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'wktestimonialblock';
|
||||
@@ -113,23 +113,10 @@ class WkTestimonialBlock extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
} elseif (!$sql = Tools::file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
}
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
$objTestimonialBlockDb = new WkTestimonialBlockDb();
|
||||
$objTestimonialData = new WkHotelTestimonialData();
|
||||
if (!parent::install()
|
||||
|| !$objTestimonialBlockDb->createTables()
|
||||
|| !$this->registerModuleHooks()
|
||||
|| !$this->callInstallTab()
|
||||
|| !$objTestimonialData->insertModuleDemoData()
|
||||
@@ -192,15 +179,6 @@ class WkTestimonialBlock extends Module
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_testimonials_block_data`,
|
||||
`'._DB_PREFIX_.'htl_testimonials_block_data_lang`'
|
||||
);
|
||||
}
|
||||
|
||||
public function uninstallTab()
|
||||
{
|
||||
$moduleTabs = Tab::getCollectionFromModule($this->name);
|
||||
@@ -215,9 +193,10 @@ class WkTestimonialBlock extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objTestimonialBlockDb = new WkTestimonialBlockDb();
|
||||
if (!parent::uninstall()
|
||||
|| !$this->deleteTestimonialUserImage()
|
||||
|| !$this->deleteTables()
|
||||
|| !$objTestimonialBlockDb->dropTables()
|
||||
|| !$this->uninstallTab()
|
||||
|| !$this->deleteConfigKeys()
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user