Initial Comit
This commit is contained in:
commit
b8c9c75cf8
2351 files changed
+1819654
No files matched your search
@@ -0,0 +1,43 @@
|
||||
# Product: Web API (server)
|
||||
# Version: 1.08
|
||||
# Developer: Aeric Poon
|
||||
# License: Open Source
|
||||
# Thanks to Erel, Anywhere Software for the great products and B4X community for encouragement and supports ;)
|
||||
# Lines starting with '#' are comments.
|
||||
# Backslash character at the end of line means that the command continues in the next line.
|
||||
|
||||
# Server Path
|
||||
ROOT_PATH=/v1/
|
||||
ROOT_URL=http://127.0.0.1
|
||||
|
||||
# Java server port
|
||||
ServerPort=19800
|
||||
SSLPort=0
|
||||
|
||||
# SSL Keystores
|
||||
SSL_KEYSTORE_DIR=/etc/letsencrypt/live/mydomain.com
|
||||
SSL_KEYSTORE_FILE=keystore.jks
|
||||
SSL_KEYSTORE_PASSWORD=xxxxxx
|
||||
|
||||
# Define App Constants
|
||||
HOME_TITLE=WEB API
|
||||
APP_TITLE=Web API
|
||||
APP_TRADEMARK=B4X
|
||||
APP_COPYRIGHT=Copyright B4X 2021
|
||||
|
||||
# DATABASE CONFIGURATION
|
||||
|
||||
# SQLite
|
||||
DbName=webapi.db
|
||||
DbType=sqlite
|
||||
DriverClass=com.sqlite.JdbcUrl
|
||||
JdbcUrl=jdbc:sqlite:webapi.db
|
||||
|
||||
# MySQL
|
||||
# DbName=webapi
|
||||
# DbType=mysql
|
||||
# DriverClass=com.mysql.jdbc.Driver
|
||||
# JdbcUrl=jdbc:mysql://localhost/webapi?characterEncoding=utf8&useSSL=false
|
||||
# User=root
|
||||
# Password=password
|
||||
# MaxPoolSize=100
|
||||
@@ -0,0 +1,78 @@
|
||||
# Product: SQL commands for Web API (for MySQL Backend)
|
||||
# Version: 1.08
|
||||
# Lines starting with '#' are comments.
|
||||
# Backslash character at the end of line means that the command continues in the next line.
|
||||
|
||||
# Check and create database
|
||||
CHECK_DATABASE=SELECT * FROM SCHEMATA WHERE SCHEMA_NAME = ?
|
||||
|
||||
CREATE_DATABASE=CREATE DATABASE {DBNAME} CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
|
||||
|
||||
USE_DATABASE=USE {DBNAME}
|
||||
|
||||
# DROP_TABLE_IF_EXIST_TBL_CATEGORY=DROP TABLE IF EXISTS `tbl_category`
|
||||
|
||||
CREATE_TABLE_TBL_CATEGORY=CREATE TABLE `tbl_category` ( \
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT, \
|
||||
`category_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, \
|
||||
PRIMARY KEY (`id`) \
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
|
||||
|
||||
INSERT_DUMMY_TBL_CATEGORY=INSERT INTO `tbl_category` (`category_name`) VALUES \
|
||||
('Hardwares'), \
|
||||
('Toys')
|
||||
|
||||
# DROP_TABLE_IF_EXIST_TBL_PRODUCTS=DROP TABLE IF EXISTS `tbl_products`
|
||||
|
||||
CREATE_TABLE_TBL_PRODUCTS=CREATE TABLE `tbl_products` ( \
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT, \
|
||||
`category_id` int(11) NOT NULL, \
|
||||
`product_code` varchar(12) COLLATE utf8mb4_unicode_ci DEFAULT NULL, \
|
||||
`product_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, \
|
||||
`product_price` decimal(10,2) DEFAULT '0.00', \
|
||||
PRIMARY KEY (`id`), \
|
||||
KEY `category_id` (`category_id`), \
|
||||
CONSTRAINT `tbl_products_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `tbl_category` (`id`) \
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
|
||||
|
||||
INSERT_DUMMY_TBL_PRODUCTS=INSERT INTO `tbl_products` \
|
||||
(`category_id`, `product_code`, `product_name`, `product_price`) VALUES \
|
||||
(2, 'T001', 'Teddy Bear', 99.9), \
|
||||
(1, 'H001', 'Hammer', 15.75), \
|
||||
(2, 'T002', 'Optimus Prime', 1000.00)
|
||||
|
||||
# CATEGORY
|
||||
GET_ALL_CATEGORIES=SELECT * FROM `tbl_category`
|
||||
GET_CATEGORY_BY_ID=SELECT * FROM `tbl_category` WHERE `id` = ?
|
||||
ADD_NEW_CATEGORY=INSERT INTO `tbl_category` (`category_name`) SELECT ?
|
||||
EDIT_CATEGORY_BY_ID=UPDATE `tbl_category` SET `category_name` = ? WHERE `id` = ?
|
||||
REMOVE_CATEGORY_BY_ID=DELETE FROM `tbl_category` WHERE `id` = ?
|
||||
GET_ID_BY_CATEGORY_NAME=SELECT `id` FROM `tbl_category` WHERE `category_name` = ?
|
||||
|
||||
# PRODUCT
|
||||
GET_ALL_PRODUCTS_BY_CATEGORY=SELECT * FROM `tbl_products` \
|
||||
WHERE `category_id` = ?
|
||||
GET_PRODUCT_BY_CATEGORY_AND_ID=SELECT * FROM `tbl_products` \
|
||||
WHERE `category_id` = ? AND `id` = ?
|
||||
ADD_NEW_PRODUCT_BY_CATEGORY=INSERT INTO `tbl_products` \
|
||||
(`category_id`, `product_code`, `product_name`, `product_price`) SELECT ?, ?, ?, ?
|
||||
EDIT_PRODUCT_BY_CATEGORY_AND_ID=UPDATE `tbl_products` \
|
||||
SET `category_id` = ?, `product_code` = ?, `product_name` = ?, `product_price` = ? \
|
||||
WHERE `category_id` = ? AND `id` = ?
|
||||
REMOVE_PRODUCT_BY_CATEGORY_AND_ID=DELETE FROM `tbl_products` \
|
||||
WHERE `category_id` = ? AND `id` = ?
|
||||
GET_ID_BY_CATEGORY_ID_AND_PRODUCT_NAME=SELECT `id` FROM `tbl_products` \
|
||||
WHERE `category_id` = ? AND `product_name` = ?
|
||||
|
||||
# SEARCH
|
||||
SEARCH_PRODUCT_BY_CATEGORY_CODE_AND_NAME_ONEWORD_ORDERED=SELECT P.id AS aa, \
|
||||
P.product_code AS bb, C.`category_name` AS cc, P.product_name AS dd, P.product_price AS ee \
|
||||
FROM `tbl_products` P JOIN `tbl_category` C ON P.`category_id` = C.`id` \
|
||||
WHERE C.`category_name` LIKE ? OR P.`product_code` LIKE ? OR P.`product_name` LIKE ?
|
||||
SEARCH_PRODUCT_BY_CATEGORY_CODE_AND_NAME_TWOWORDS_ORDERED=SELECT P.id AS aa, \
|
||||
P.product_code AS bb, C.`category_name` AS cc, P.product_name AS dd, P.product_price AS ee \
|
||||
FROM `tbl_products` P JOIN `tbl_category` C ON P.`category_id` = C.`id` \
|
||||
WHERE C.`category_name` LIKE ? OR P.`product_code` LIKE ? OR P.`product_name` LIKE ? \
|
||||
OR C.`category_name` LIKE ? OR P.`product_code` LIKE ? OR P.`product_name` LIKE ?
|
||||
|
||||
GET_LAST_INSERT_ID=SELECT LAST_INSERT_ID()
|
||||
@@ -0,0 +1,65 @@
|
||||
# Product: SQL commands for Web API (for SQLite Backend)
|
||||
# Version: 1.08
|
||||
# Lines starting with '#' are comments.
|
||||
# Backslash character at the end of line means that the command continues in the next line.
|
||||
|
||||
# Create tables
|
||||
CREATE_TABLE_TBL_CATEGORY=CREATE TABLE IF NOT EXISTS `tbl_category` ( \
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT, \
|
||||
`category_name` varchar(200) NULL \
|
||||
)
|
||||
|
||||
INSERT_DUMMY_TBL_CATEGORY=INSERT INTO `tbl_category` (`category_name`) VALUES \
|
||||
('Hardwares'), \
|
||||
('Toys')
|
||||
|
||||
CREATE_TABLE_TBL_PRODUCTS=CREATE TABLE IF NOT EXISTS `tbl_products` ( \
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT, \
|
||||
`category_id` INTEGER NOT NULL, \
|
||||
`product_code` varchar(12) NULL, \
|
||||
`product_name` varchar(200) NULL, \
|
||||
`product_price` decimal(10,2) DEFAULT '0.00', \
|
||||
FOREIGN KEY (`category_id`) REFERENCES `tbl_category` (`id`) \
|
||||
)
|
||||
|
||||
INSERT_DUMMY_TBL_PRODUCTS=INSERT INTO `tbl_products` \
|
||||
(`category_id`, `product_code`, `product_name`, `product_price`) VALUES \
|
||||
(2, 'T001', 'Teddy Bear', 99.9), \
|
||||
(1, 'H001', 'Hammer', 15.75), \
|
||||
(2, 'T002', 'Optimus Prime', 1000.00)
|
||||
|
||||
# CATEGORY
|
||||
GET_ALL_CATEGORIES=SELECT * FROM `tbl_category`
|
||||
GET_CATEGORY_BY_ID=SELECT * FROM `tbl_category` WHERE `id` = ?
|
||||
ADD_NEW_CATEGORY=INSERT INTO `tbl_category` (`category_name`) SELECT ?
|
||||
EDIT_CATEGORY_BY_ID=UPDATE `tbl_category` SET `category_name` = ? WHERE `id` = ?
|
||||
REMOVE_CATEGORY_BY_ID=DELETE FROM `tbl_category` WHERE `id` = ?
|
||||
GET_ID_BY_CATEGORY_NAME=SELECT `id` FROM `tbl_category` WHERE `category_name` = ?
|
||||
|
||||
# PRODUCT
|
||||
GET_ALL_PRODUCTS_BY_CATEGORY=SELECT * FROM `tbl_products` \
|
||||
WHERE `category_id` = ?
|
||||
GET_PRODUCT_BY_CATEGORY_AND_ID=SELECT * FROM `tbl_products` \
|
||||
WHERE `category_id` = ? AND `id` = ?
|
||||
ADD_NEW_PRODUCT_BY_CATEGORY=INSERT INTO `tbl_products` \
|
||||
(`category_id`, `product_code`, `product_name`, `product_price`) SELECT ?, ?, ?, ?
|
||||
EDIT_PRODUCT_BY_CATEGORY_AND_ID=UPDATE `tbl_products` \
|
||||
SET `category_id` = ?, `product_code` = ?, `product_name` = ?, `product_price` = ? \
|
||||
WHERE `category_id` = ? AND `id` = ?
|
||||
REMOVE_PRODUCT_BY_CATEGORY_AND_ID=DELETE FROM `tbl_products` \
|
||||
WHERE `category_id` = ? AND `id` = ?
|
||||
GET_ID_BY_CATEGORY_ID_AND_PRODUCT_NAME=SELECT `id` FROM `tbl_products` \
|
||||
WHERE `category_id` = ? AND `product_name` = ?
|
||||
|
||||
# SEARCH
|
||||
SEARCH_PRODUCT_BY_CATEGORY_CODE_AND_NAME_ONEWORD_ORDERED=SELECT P.id AS aa, \
|
||||
P.product_code AS bb, C.`category_name` AS cc, P.product_name AS dd, P.product_price AS ee \
|
||||
FROM `tbl_products` P JOIN `tbl_category` C ON P.`category_id` = C.`id` \
|
||||
WHERE C.`category_name` LIKE ? OR P.`product_code` LIKE ? OR P.`product_name` LIKE ?
|
||||
SEARCH_PRODUCT_BY_CATEGORY_CODE_AND_NAME_TWOWORDS_ORDERED=SELECT P.id AS aa, \
|
||||
P.product_code AS bb, C.`category_name` AS cc, P.product_name AS dd, P.product_price AS ee \
|
||||
FROM `tbl_products` P JOIN `tbl_category` C ON P.`category_id` = C.`id` \
|
||||
WHERE C.`category_name` LIKE ? OR P.`product_code` LIKE ? OR P.`product_name` LIKE ? \
|
||||
OR C.`category_name` LIKE ? OR P.`product_code` LIKE ? OR P.`product_name` LIKE ?
|
||||
|
||||
GET_LAST_INSERT_ID=SELECT LAST_INSERT_ROWID()
|
||||
@@ -0,0 +1,14 @@
|
||||
REM ================================================================
|
||||
REM Run this batch file in Windows Command Prompt as Administrator
|
||||
REM ================================================================
|
||||
|
||||
@ECHO OFF
|
||||
TITLE Web API server is starting...
|
||||
|
||||
REM CD C:\Java\jdk-11.0.1\bin
|
||||
REM java --module-path C:\Java\jdk-11.0.1\javafx\lib --add-modules ALL-MODULE-PATH -jar "C:\Development\B4J\WebAPI\Objects\webapi.jar"
|
||||
|
||||
C:
|
||||
CD C:\Program Files\Java\jdk1.8.0_181\bin
|
||||
java -jar "C:\Development\B4J\WebAPI\Objects\webapi.jar"
|
||||
::PAUSE
|
||||
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* Bootstrap v4.1.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2018 The Bootstrap Authors
|
||||
* Copyright 2011-2018 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weigLine truncated
|
||||
/*# sourceMappingURL=bootstrap.min.css.map */
|
||||
@@ -0,0 +1,5 @@
|
||||
/*!
|
||||
* Font Awesome Free 5.8.1 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
*/
|
||||
.fa,.fab,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{animation:fa-spin 2s infinite linear}.fa-pulse{animation:fa-spin 1s infinite steps(8)}@keyframes fa-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";transform:scaleX(-1)}.fa-flip-vertical{transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{transform:scale(-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adobe:before{content:"\f778"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}Line truncated
|
||||
@@ -0,0 +1,5 @@
|
||||
/*!
|
||||
* Font Awesome Free 5.8.1 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
*/
|
||||
@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:auto;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.fas{font-family:"Font Awesome 5 Free";font-weight:900}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 865 B |
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* Bootstrap v4.1.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery")):"function"==typeof define&&define.amd?define(["exports","jquery"],e):e(t.bootstrap={},t.jQuery)}(this,function(t,e){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function c(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},e=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(o).filter(function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))),e.forEach(function(t){var e,n,i;e=r,i=o[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return r}for(var r,n,o,a,l,f,h,u,d,p,g,m,_,v,E,y,b,T,C,w,I,D,A,S,O,N,k,L,P,x,j,M,R,H,W,F,U,B,K,V,Q,Y,G,q,z,X,J,Z,$,tt,et,nt,it,rt,ot,st,at,lt,ct,ft,ht,ut,dt,pt,gt=function(i){var e="transitionend";function t(t){var e=this,n=!1;return i(this).one(l.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||l.triggerTransitionEnd(e)},t),this}var l={TRANSITION_END:"bsTransitionEnd",getUID:function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");e&&"#"!==e||(e=t.getAttribute("href")||"");try{return 0<i(document).find(e).length?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=i(t).css("transition-duration");return parseFloat(e)?(e=e.split(",")[0],1e3*parseFloat(e)):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){i(t).trigger(e)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i],o=e[i],s=o&&l.isElement(o)?"element":(a=o,{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase());if(!new RegExp(r).test(s))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+s+'" but expected type "'+r+'".')}var a}};return i.fn.emulateTransitionEnd=t,i.event.special[l.TRANSITION_END]={bindType:e,delegateType:e,handle:function(t){if(i(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}},l}(e=e&&e.hasOwnProperty("default")?e.default:e),mt=(n="alert",a="."+(o="bs.alert"),l=(r=e).fn[n],f={CLOSE:"close"+a,CLOSED:"closed"+a,CLICK_DATA_API:"click"+a+".data-api"},h="alert",u="fade",d="show",p=function(){function i(t){this._element=t}var t=i.prototype;return t.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},t.dispose=function(){r.removeData(this._element,o),this._element=null},t._getRootElement=function(t){var e=gt.getSelectorFromElement(t),n=!1;return e&&(n=r(e)[0]),n||(n=r(t).closest("."+h)[0]),n},t._triggerCloseEvent=function(t){var e=r.Event(f.CLOSE);return r(t).trigger(e),e},t._removeElement=function(e){var n=this;if(r(e).removeClass(d),r(e).hasClass(u)){var t=gt.getTransitionDurationFromElement(e);r(e).one(gt.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(t)}else this._destroyElement(e)},t._destroyElement=function(t){r(t).detach().trigger(f.CLOSED).remove()},i._jQueryInterface=function(n){return this.each(function(){var t=r(this),e=t.data(o);e||(e=new i(this),t.data(o,e)),"close"===n&&e[n](this)})},i._handleDismiss=function(e){return function(t){t&&t.preventDefault(),e.close(this)}},s(i,null,[{key:"VERSION",get:function(){return"4.1.1"}}]),i}(),r(document).on(f.CLICK_DATA_API,'[data-dismiss="alert"]',p._handleDismiss(new p)),r.fn[n]=p._jQueryInterface,r.fn[n].Constructor=p,r.fn[n].noConflict=function(){return r.fn[n]=l,p._jQueryInterface},p),_t=(m="button",v="."+(_="bs.button"),E=".data-api",y=(g=e).fn[m],b="active",T="btn",w='[data-toggle^="button"]',I='[data-toggle="buttons"]',D="input",A=".active",S=".btn",O={CLICK_DATA_API:"click"+v+E,FOCUS_BLUR_DATA_API:(C="focus")+v+E+" blur"+v+E},N=function(){function n(t){this._element=t}var t=n.prototype;return t.toggle=function(){var t=!0,e=!0,n=g(this._element).closest(I)[0];if(n){var i=g(this._element).find(D)[0];if(i){if("radio"===i.type)if(i.checked&&g(this._element).hasClass(b))t=!1;else{var r=g(n).find(A)[0];r&&g(r).removeClass(b)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!g(this._element).hasClass(b),g(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!g(this._element).hasClass(b)),t&&g(this._element).toggleClass(b)},t.dispose=function(){g.removeData(this._element,_),this._element=null},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(_);t||(t=new n(this),g(this).data(_,t)),"toggle"===e&&t[e]()}Line truncated
|
||||
//# sourceMappingURL=bootstrap.bundle.min.js.map
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */
|
||||
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(l&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&w.isPlainObject(n)?n:{},a[t]=w.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(C(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(C(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;o<a;o++)(r=!t(e[o],o))!==s&&i.push(e[o]);return i},map:function(e,t,n){var r,i,o=0,s=[];if(C(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function C(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",I="\\["+M+"*("+R+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+M+"*\\]",W=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),F=new RegExp("^"+M+"*,"+M+"*"),_=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)Line truncated
|
||||
@@ -0,0 +1,50 @@
|
||||
$( document ).ready(function() {
|
||||
$("#btnsearch").click(function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/",
|
||||
data: $("form").serialize(),
|
||||
success: function(response)
|
||||
{
|
||||
if (response.s == "ok") {
|
||||
// console.log(response.r);
|
||||
var tbl_head = "";
|
||||
var tbl_body = "";
|
||||
if (response.r.length) {
|
||||
tbl_head = "<thead class=\"bg-light\"><th style=\"text-align: right\">#</th><th>Code</th><th>Category</th><th>Name</th><th style=\"text-align: right\">Price</th></thead>";
|
||||
tbl_body += "<tbody>";
|
||||
$.each(response.r, function() {
|
||||
var tbl_row = "";
|
||||
$.each(this, function(key, value) {
|
||||
if (key == "ee" || key == "aa")
|
||||
{
|
||||
tbl_row += "<td style=\"text-align: right\">"+value+"</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
tbl_row += "<td>"+value+"</td>";
|
||||
}
|
||||
});
|
||||
tbl_body += "<tr>"+tbl_row+"</tr>";
|
||||
});
|
||||
tbl_body += "</tbody>";
|
||||
}
|
||||
else
|
||||
{
|
||||
tbl_body = "<tr><td>No results</td></tr>";
|
||||
}
|
||||
$("#results table").html(tbl_head+tbl_body);
|
||||
}
|
||||
else {
|
||||
$(".alert").html(response.e);
|
||||
$(".alert").fadeIn();
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
$(".alert").html(thrownError);
|
||||
$(".alert").fadeIn();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user