Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Added getSiteData to site model to get names for object id's

givanz9380b1ac97f3
diff --git a/app/sql/mysqli/site.sql b/app/sql/mysqli/site.sql
index 7517d17..5f0f75c 100755
--- a/app/sql/mysqli/site.sql
+++ b/app/sql/mysqli/site.sql
@@ -1,4 +1,4 @@
--- Languages
+-- Sites
-- get all sites
@@ -41,7 +41,51 @@
SELECT *
FROM site as _ WHERE site_id = :site_id;
END
-
+
+ -- get site data
+
+ PROCEDURE getSiteData(
+ IN site ARRAY,
+ OUT fetch_one,
+ OUT fetch_one,
+ OUT fetch_one,
+ OUT fetch_one,
+ OUT fetch_one,
+ OUT fetch_one
+ )
+ BEGIN
+ -- country
+ SELECT
+ name
+ FROM country as country_id WHERE country_id = :site.country_id;
+
+ -- Region
+ SELECT
+ name
+ FROM region as region_id WHERE region_id = :site.region_id;
+
+ -- language
+ SELECT
+ name
+ FROM language as language_id WHERE language_id = :site.language_id;
+
+ -- currency
+ SELECT
+ name
+ FROM currency as currency_id WHERE currency_id = :site.currency_id;
+
+ -- weight_type
+ SELECT
+ unit
+ FROM weight_type_content as weight_type WHERE weight_type_id = :site.weight_type_id;
+
+ -- length_type
+ SELECT
+ unit
+ FROM length_type_content AS length_type WHERE length_type_id = :site.length_type_id;
+
+ END
+
-- add site
PROCEDURE add(
diff --git a/app/sql/pgsql/site.sql b/app/sql/pgsql/site.sql
index 7517d17..5f0f75c 100755
--- a/app/sql/pgsql/site.sql
+++ b/app/sql/pgsql/site.sql
@@ -1,4 +1,4 @@
--- Languages
+-- Sites
-- get all sites
@@ -41,7 +41,51 @@
SELECT *
FROM site as _ WHERE site_id = :site_id;
END
-
+
+ -- get site data
+
+ PROCEDURE getSiteData(
+ IN site ARRAY,
+ OUT fetch_one,
+ OUT fetch_one,
+ OUT fetch_one,
+ OUT fetch_one,
+ OUT fetch_one,
+ OUT fetch_one
+ )
+ BEGIN
+ -- country
+ SELECT
+ name
+ FROM country as country_id WHERE country_id = :site.country_id;
+
+ -- Region
+ SELECT
+ name
+ FROM region as region_id WHERE region_id = :site.region_id;
+
+ -- language
+ SELECT
+ name
+ FROM language as language_id WHERE language_id = :site.language_id;
+
+ -- currency
+ SELECT
+ name
+ FROM currency as currency_id WHERE currency_id = :site.currency_id;
+
+ -- weight_type
+ SELECT
+ unit
+ FROM weight_type_content as weight_type WHERE weight_type_id = :site.weight_type_id;
+
+ -- length_type
+ SELECT
+ unit
+ FROM length_type_content AS length_type WHERE length_type_id = :site.length_type_id;
+
+ END
+
-- add site
PROCEDURE add(
diff --git a/app/sql/sqlite/site.sql b/app/sql/sqlite/site.sql
index 7517d17..5f0f75c 100755
--- a/app/sql/sqlite/site.sql
+++ b/app/sql/sqlite/site.sql
@@ -1,4 +1,4 @@
--- Languages
+-- Sites
-- get all sites
@@ -41,7 +41,51 @@
SELECT *
FROM site as _ WHERE site_id = :site_id;
END
-
+
+ -- get site data
+
+ PROCEDURE getSiteData(
+ IN site ARRAY,
+ OUT fetch_one,
+ OUT fetch_one,
+ OUT fetch_one,
+ OUT fetch_one,
+ OUT fetch_one,
+ OUT fetch_one
+ )
+ BEGIN
+ -- country
+ SELECT
+ name
+ FROM country as country_id WHERE country_id = :site.country_id;
+
+ -- Region
+ SELECT
+ name
+ FROM region as region_id WHERE region_id = :site.region_id;
+
+ -- language
+ SELECT
+ name
+ FROM language as language_id WHERE language_id = :site.language_id;
+
+ -- currency
+ SELECT
+ name
+ FROM currency as currency_id WHERE currency_id = :site.currency_id;
+
+ -- weight_type
+ SELECT
+ unit
+ FROM weight_type_content as weight_type WHERE weight_type_id = :site.weight_type_id;
+
+ -- length_type
+ SELECT
+ unit
+ FROM length_type_content AS length_type WHERE length_type_id = :site.length_type_id;
+
+ END
+
-- add site
PROCEDURE add(
diff --git a/install/sql/insert/site/site.sql b/install/sql/insert/site/site.sql
index 7b51424..b9815c1 100755
--- a/install/sql/insert/site/site.sql
+++ b/install/sql/insert/site/site.sql
@@ -1,2 +1,2 @@
INSERT INTO `site` (`site_id`, `key`, `name`, `host`, `theme`, `template`, `settings`) VALUES
-(1, 'default','Default','*.*.*', 'landing', '', '{"description":{"1":{"title": "Vvveb","description": "The next generation website builder","meta-keywords": "cms, page builder, drag and drop, ecommerce, ecommerce platform, designer, developer, php, bootstrap 5","meta-description": "Powerful and easy to use drag and drop website builder for blogs, presentation or ecommerce stores","phone-number": "+55 (111) 123 777"}},"address":"West 21st Street Brooklyn NY","admin-email":"[email protected]","contact-email":"[email protected]","logo":"logo.png","logo-sticky":"logo.png","logo-dark":"logo-white.png","logo-dark-sticky":"logo-white.png","favicon":"favicon.ico","post_large_width":"800","post_large_height":"0","post_medium_width":"400","post_medium_height":"0","post_thumb_width":"150","post_thumb_height":"0","product_large_width":"800","product_large_height":"0","product_medium_width":"400","product_medium_height":"0","product_thumb_width":"150","product_thumb_height":"0","date_format":"F j, Y","time_format":"g:i A", "country_id":"222","region_id":"3553","language_id":"1","currency_id":"1","language":"en_US","currency":"USD","invoice_format":"I-{year2}-{month}-{order_id}-{user_id}-{customer_order_id}","order_id_format":"{rand-str-12}-{year2}"}');
\ No newline at end of file
+(1, 'default','Default','*.*.*', 'landing', '', '{"description":{"1":{"title": "Vvveb","description": "The next generation website builder","meta-keywords": "cms, page builder, drag and drop, ecommerce, ecommerce platform, designer, developer, php, bootstrap 5","meta-description": "Powerful and easy to use drag and drop website builder for blogs, presentation or ecommerce stores","phone-number": "+55 (111) 123 777"}},"address":"West 21st Street Brooklyn NY","admin-email":"[email protected]","contact-email":"[email protected]","logo":"logo.png","logo-sticky":"logo.png","logo-dark":"logo-white.png","logo-dark-sticky":"logo-white.png","favicon":"favicon.ico","post_large_width":"800","post_large_height":"0","post_medium_width":"400","post_medium_height":"0","post_thumb_width":"150","post_thumb_height":"0","product_large_width":"800","product_large_height":"0","product_medium_width":"400","product_medium_height":"0","product_thumb_width":"150","product_thumb_height":"0","date_format":"F j, Y","time_format":"g:i A", "country_id":"223","region_id":"3655","language_id":"1","currency_id":"1","language":"en_US","currency":"USD","invoice_format":"I-{year2}-{month}-{order_id}-{user_id}-{customer_order_id}","order_id_format":"{rand-str-12}-{year2}","language_id":"1","currency_id":"1","length_type_id":"1","weight_type_id":"1","order_status_id":"1"}');
\ No newline at end of file