diff --git a/wms/contract/composer.json b/wms/contract/composer.json index da158f4b..09abf778 100644 --- a/wms/contract/composer.json +++ b/wms/contract/composer.json @@ -12,6 +12,7 @@ } ], "require": { - "tecnickcom/tcpdf": "^6.6" + "tecnickcom/tcpdf": "^6.6", + "phpoffice/phpspreadsheet": "^1.29" } } diff --git a/wms/contract/composer.lock b/wms/contract/composer.lock index 3f3992b1..bdc40884 100644 --- a/wms/contract/composer.lock +++ b/wms/contract/composer.lock @@ -4,8 +4,573 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c5a277735def820cc2b17b4a2b30976d", + "content-hash": "f9ceea0f00278e84ee8bc939092d4886", "packages": [ + { + "name": "ezyang/htmlpurifier", + "version": "v4.17.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/bbc513d79acf6691fa9cf10f192c90dd2957f18c", + "reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c", + "shasum": "" + }, + "require": { + "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0" + }, + "require-dev": { + "cerdic/css-tidy": "^1.7 || ^2.0", + "simpletest/simpletest": "dev-master" + }, + "suggest": { + "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.", + "ext-bcmath": "Used for unit conversion and imagecrash protection", + "ext-iconv": "Converts text to and from non-UTF-8 encodings", + "ext-tidy": "Used for pretty-printing HTML" + }, + "type": "library", + "autoload": { + "files": [ + "library/HTMLPurifier.composer.php" + ], + "psr-0": { + "HTMLPurifier": "library/" + }, + "exclude-from-classmap": [ + "/library/HTMLPurifier/Language/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ], + "support": { + "issues": "https://github.com/ezyang/htmlpurifier/issues", + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.17.0" + }, + "time": "2023-11-17T15:01:25+00:00" + }, + { + "name": "maennchen/zipstream-php", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/maennchen/ZipStream-PHP.git", + "reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/b8174494eda667f7d13876b4a7bfef0f62a7c0d1", + "reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-zlib": "*", + "php-64bit": "^8.1" + }, + "require-dev": { + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.16", + "guzzlehttp/guzzle": "^7.5", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^2.5", + "phpunit/phpunit": "^10.0", + "vimeo/psalm": "^5.0" + }, + "suggest": { + "guzzlehttp/psr7": "^2.4", + "psr/http-message": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "ZipStream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paul Duncan", + "email": "pabs@pablotron.org" + }, + { + "name": "Jonatan Männchen", + "email": "jonatan@maennchen.ch" + }, + { + "name": "Jesse Donat", + "email": "donatj@gmail.com" + }, + { + "name": "András Kolesár", + "email": "kolesar@kolesar.hu" + } + ], + "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.", + "keywords": [ + "stream", + "zip" + ], + "support": { + "issues": "https://github.com/maennchen/ZipStream-PHP/issues", + "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.0" + }, + "funding": [ + { + "url": "https://github.com/maennchen", + "type": "github" + }, + { + "url": "https://opencollective.com/zipstream", + "type": "open_collective" + } + ], + "time": "2023-06-21T14:59:35+00:00" + }, + { + "name": "markbaker/complex", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9", + "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "^9.3", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Complex\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with complex numbers", + "homepage": "https://github.com/MarkBaker/PHPComplex", + "keywords": [ + "complex", + "mathematics" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPComplex/issues", + "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2" + }, + "time": "2022-12-06T16:21:08+00:00" + }, + { + "name": "markbaker/matrix", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPMatrix.git", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c", + "reference": "728434227fe21be27ff6d86621a1b13107a2562c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "phpcompatibility/php-compatibility": "^9.3", + "phpdocumentor/phpdocumentor": "2.*", + "phploc/phploc": "^4.0", + "phpmd/phpmd": "2.*", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "sebastian/phpcpd": "^4.0", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Matrix\\": "classes/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@demon-angel.eu" + } + ], + "description": "PHP Class for working with matrices", + "homepage": "https://github.com/MarkBaker/PHPMatrix", + "keywords": [ + "mathematics", + "matrix", + "vector" + ], + "support": { + "issues": "https://github.com/MarkBaker/PHPMatrix/issues", + "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1" + }, + "time": "2022-12-02T22:17:43+00:00" + }, + { + "name": "phpoffice/phpspreadsheet", + "version": "1.29.0", + "source": { + "type": "git", + "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", + "reference": "fde2ccf55eaef7e86021ff1acce26479160a0fa0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/fde2ccf55eaef7e86021ff1acce26479160a0fa0", + "reference": "fde2ccf55eaef7e86021ff1acce26479160a0fa0", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "ext-fileinfo": "*", + "ext-gd": "*", + "ext-iconv": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "ext-xmlreader": "*", + "ext-xmlwriter": "*", + "ext-zip": "*", + "ext-zlib": "*", + "ezyang/htmlpurifier": "^4.15", + "maennchen/zipstream-php": "^2.1 || ^3.0", + "markbaker/complex": "^3.0", + "markbaker/matrix": "^3.0", + "php": "^7.4 || ^8.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-main", + "dompdf/dompdf": "^1.0 || ^2.0", + "friendsofphp/php-cs-fixer": "^3.2", + "mitoteam/jpgraph": "^10.3", + "mpdf/mpdf": "^8.1.1", + "phpcompatibility/php-compatibility": "^9.3", + "phpstan/phpstan": "^1.1", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^8.5 || ^9.0 || ^10.0", + "squizlabs/php_codesniffer": "^3.7", + "tecnickcom/tcpdf": "^6.5" + }, + "suggest": { + "dompdf/dompdf": "Option for rendering PDF with PDF Writer", + "ext-intl": "PHP Internationalization Functions", + "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers", + "mpdf/mpdf": "Option for rendering PDF with PDF Writer", + "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maarten Balliauw", + "homepage": "https://blog.maartenballiauw.be" + }, + { + "name": "Mark Baker", + "homepage": "https://markbakeruk.net" + }, + { + "name": "Franck Lefevre", + "homepage": "https://rootslabs.net" + }, + { + "name": "Erik Tilt" + }, + { + "name": "Adrien Crivelli" + } + ], + "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", + "homepage": "https://github.com/PHPOffice/PhpSpreadsheet", + "keywords": [ + "OpenXML", + "excel", + "gnumeric", + "ods", + "php", + "spreadsheet", + "xls", + "xlsx" + ], + "support": { + "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.29.0" + }, + "time": "2023-06-14T22:48:31+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "e616d01114759c4c489f93b099585439f795fe35" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + }, + "time": "2023-04-10T20:10:41+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, { "name": "tecnickcom/tcpdf", "version": "6.6.5", diff --git a/wms/contract/insertData.php b/wms/contract/insertData.php new file mode 100644 index 00000000..c0ced913 --- /dev/null +++ b/wms/contract/insertData.php @@ -0,0 +1,165 @@ +getMessage()); +} + +// 獲取活動工作表 +$sheet = $spreadsheet->getActiveSheet(); + + +$create_at = date('Y-m-d H:i:s'); +$sql_str = "INSERT INTO option_price (kind, subkind, group_name, spec, memo, optional, unit, price, status, create_at) VALUES (:kind, :subkind, :group_name, :spec, :memo, :optional, :unit, :price, :status, :create_at)"; +$sql_str_mi = "INSERT INTO option_mi (option_price_id, min_weight, max_weight, open_kind, base_floor, base_floor_plus, price, quotation_no, create_at) VALUES (:option_price_id, :min_weight, :max_weight, :open_kind, :base_floor, :base_floor_plus, :price, :quotation_no, :create_at)"; +$open_kind_arr = ['CO', '2S']; +// 遍歷工作表中的每一行 +foreach ($sheet->getRowIterator() as $key=>$row) { + // 獲得單元格迭代器 + $cellIterator = $row->getCellIterator(); + $cellIterator->setIterateOnlyExistingCells(false); // This loops through all cells, + // even if a cell value is not set. + // By default, only cells that have a value set will be iterated. + foreach ($cellIterator as $idx=>$cell) { + if ($cell !== null) { + // 打印單元格數據 + // echo $cell->getValue() . '///'; + } + if($idx == 'B'){ + $group_name = $cell->getValue(); + echo $group_name; + }elseif($idx == 'C'){ + $spec = $cell->getValue(); + echo $spec; + }elseif($idx == 'D'){ + $memo = $cell->getValue(); + echo $memo; + }elseif($idx == 'E'){ + if($cell->getValue() == "標配"){ + $optional = 1; + }else{ + $optional = 2; + } + echo $optional; + }elseif($idx == 'F'){ + $cost = $cell->getValue(); + } + elseif($idx == 'G'){ + $price = $cell->getValue(); + echo $price; + }elseif($idx == 'H'){ + $unit = $cell->getValue(); + echo $unit; + } + } + echo "
"; // 換行,以分隔不同的行 + + $status = "Y"; + $kindArr = ['A', 'B','C', 'D']; + if($id == 1){ + $kind = 'A'; + $subkind = 'A1'; + }elseif($id == 2){ + $kind = 'B'; + $subkind = 'B1'; + }elseif($id == 3){ + $kind = 'B'; + $subkind = 'B2'; + }elseif($id == 4){ + $kind ='B'; + $subkind = 'B3'; + }elseif($id == 5){ + $kind ='B'; + $subkind = 'B4'; + }elseif($id == 6){ + $kind ='B'; + $subkind = 'B5'; + }elseif($id == 7){ + $kind ='B'; + $subkind = 'B6'; + }elseif($id == 8){ + $kind ='B'; + $subkind = 'B7'; + }elseif($id == 9){ + $kind ='C'; + $subkind = 'C1'; + }elseif($id == 10){ + $kind ='C'; + $subkind = 'C2'; + }elseif($id == 11){ + $kind ='C'; + $subkind = 'C3'; + }elseif($id == 12){ + $kind ='C'; + $subkind = 'C4'; + }elseif($id == 13){ + $kind ='D'; + $subkind = 'D1'; + }elseif($id == 14){ + $kind ='D'; + $subkind = 'D2'; + } + + if(isset($_GET['id'])){ + try{ + $stmt = $conn -> prepare($sql_str); + $stmt ->bindParam(':kind', $kind); + $stmt ->bindParam(':subkind', $subkind); + $stmt ->bindParam(':group_name', $group_name); + $stmt ->bindParam(':spec', $spec); + $stmt ->bindParam(':memo', $memo); + $stmt ->bindParam(':optional', $optional); + $stmt ->bindParam(':unit', $unit); + $stmt ->bindParam(':price', $price); + $stmt ->bindParam(':status', $status); + $stmt ->bindParam(':create_at', $create_at); + // 遍歷當前行的每一個單元格 + $stmt ->execute(); + + $last_id = $conn->lastInsertId(); + + + $option_price_id = $last_id; + $option_price = $cost; + $quotation_no = 'Q2311001'; + foreach($open_kind_arr as $kind){ + $min_weight = 1; + $max_weight = 1600; + $open_kind = $kind; + $base_floor = 0; + $base_floor_plus = 0; + $sale_price = $option_price; + $stmt = $conn -> prepare($sql_str_mi); + $stmt ->bindParam(':option_price_id', $option_price_id); + $stmt ->bindParam(':min_weight', $min_weight); + $stmt ->bindParam(':max_weight', $max_weight); + $stmt ->bindParam(':open_kind', $open_kind); + $stmt ->bindParam(':base_floor', $base_floor); + $stmt ->bindParam(':base_floor_plus', $base_floor_plus); + $stmt ->bindParam(':price', $sale_price); + $stmt ->bindParam(':quotation_no', $quotation_no); + $stmt ->bindParam(':create_at', $create_at); + $stmt ->execute(); + } + + + }catch(PDOException $e){ + echo $e->getMessage(); + die('Error!:'.$e->getMessage()); + } + } + + + +} +?> diff --git a/wms/contract/js/alpine.js b/wms/contract/js/alpine.js index e754b039..a92a5396 100644 --- a/wms/contract/js/alpine.js +++ b/wms/contract/js/alpine.js @@ -1169,7 +1169,6 @@ const contractInput =()=> { this.data.files = e.target.files }, } - }; const contractNewApply = ()=>{ diff --git a/wms/mkt/assets/img/1.jpg b/wms/mkt/assets/img/1.jpg new file mode 100644 index 00000000..dc550abe Binary files /dev/null and b/wms/mkt/assets/img/1.jpg differ diff --git a/wms/mkt/assets/img/2.jpg b/wms/mkt/assets/img/2.jpg new file mode 100644 index 00000000..a7f79c89 Binary files /dev/null and b/wms/mkt/assets/img/2.jpg differ diff --git a/wms/mkt/assets/img/3.jpg b/wms/mkt/assets/img/3.jpg new file mode 100644 index 00000000..d1092101 Binary files /dev/null and b/wms/mkt/assets/img/3.jpg differ diff --git a/wms/mkt/assets/img/4.jpg b/wms/mkt/assets/img/4.jpg new file mode 100644 index 00000000..2928110e Binary files /dev/null and b/wms/mkt/assets/img/4.jpg differ diff --git a/wms/mkt/assets/img/5.jpg b/wms/mkt/assets/img/5.jpg new file mode 100644 index 00000000..14d393df Binary files /dev/null and b/wms/mkt/assets/img/5.jpg differ diff --git a/wms/mkt/assets/img/S__14541066.jpg b/wms/mkt/assets/img/S__14541066.jpg new file mode 100644 index 00000000..2e2c5e2a Binary files /dev/null and b/wms/mkt/assets/img/S__14541066.jpg differ diff --git a/wms/mkt/assets/img/curry.jpg b/wms/mkt/assets/img/curry.jpg new file mode 100644 index 00000000..b3f7bc2a Binary files /dev/null and b/wms/mkt/assets/img/curry.jpg differ diff --git a/wms/mkt/assets/js/alpine.js b/wms/mkt/assets/js/alpine.js new file mode 100644 index 00000000..f2f3962a --- /dev/null +++ b/wms/mkt/assets/js/alpine.js @@ -0,0 +1,72 @@ +const priceOptionIndex = ()=>{ + return { + init(){ + console.log(this.kind); + this.initButtons(this.kind); + }, + kind: kind, + pageLength: 999999, + search: '', + orioptions: options, + options: options, + options_arr: { + 1:'標', + 2:'選', + }, + btntype:'', + buttons:[], + initButtons(kind){ + if(kind == 'A'){ + this.buttons = [ + {name: '車廂意匠', type: 'A1'} + ] + }else if(kind == 'B'){ + this.buttons = [ + {name: '天井', type: 'B1'}, + {name: '地板', type: 'B2'}, + {name: '操縱盤', type: 'B3'}, + {name: '扶手', type: 'B4'}, + {name: '車廂門與層門(轎門/層門)', type: 'B5'}, + {name: '轎壁(車廂側板)', type: 'B6'}, + {name: '其他車廂內裝配件', type: 'B7'}, + ] + }else if(kind == 'C'){ + this.buttons = [ + {name: '框', type: 'C1'}, + {name: '乘場指示器', type: 'C2'}, + {name: '燈', type: 'C3'}, + {name: '方式與門', type: 'C4'}, + ] + }else if(kind == 'D'){ + this.buttons = [ + {name: '功能與配置', type: 'D1'}, + {name: 'OH與樓高', type: 'D2'}, + ] + } + this.buttons.unshift({ + name:'顯示全部',type:'1', + }) + this.btntype = this.buttons[0].type; + }, + changeType(type = this.btntype){ + this.btntype = type + this.options = this.orioptions; + this.options = this.getOptions(); + this.inputSearch() + }, + getOptions(){ + if(this.btntype != 1){ + return this.options.filter(item=>(item.subkind == this.btntype)).slice(0, this.pageLength) + } + return this.options.slice(0, this.pageLength); + }, + inputSearch(e=null){ + let text = e!=null ? e.target.value : this.search; + this.search = text + this.options = this.orioptions + this.options = this.getOptions().filter(item=>{ + return (item.group_name.includes(text)) + }) + } + } +} \ No newline at end of file diff --git a/wms/mkt/conn.php b/wms/mkt/conn.php new file mode 100644 index 00000000..930ef827 --- /dev/null +++ b/wms/mkt/conn.php @@ -0,0 +1,43 @@ +errorInfo()的形式獲取錯誤資訊 + //PDO::ERRMODE_WARNING: 引發 E_WARNING 錯誤,主動報錯 + //PDO::ERRMODE_EXCEPTION: 主動抛出 exceptions 異常,需要以try{}cath(){}輸出錯誤資訊。 + //設定主動以警告的形式報錯 + $conn->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); + //如果連接錯誤,將抛出一個PDOException異常對象 +} +catch ( PDOException $e ){ + //如果連結資料庫失敗則顯示錯誤訊並停止本頁的工作 + die("ERROR!!!: ". $e->getMessage()); +} + +//$conn = null; //關閉資料庫的連線 \ No newline at end of file diff --git a/wms/mkt/css/style.css b/wms/mkt/css/style.css new file mode 100644 index 00000000..57f0d949 --- /dev/null +++ b/wms/mkt/css/style.css @@ -0,0 +1,75 @@ +.price_option-select { + width: 100%; + max-width: 1200px; + margin: 0 auto; + display: flex; +} +.price_option-select > .sidebar { + width: 10%; + min-width: 180px; + height: 100%; + min-height: 80vh; + display: flex; + flex-direction: column; + border-right: 1px #ccc solid; +} +.price_option-select > .sidebar > a { + margin: 6px 0; + transition: 0.3s; +} +.price_option-select > .sidebar > a:hover { + color: #00b; +} +.price_option-select > .content { + display: grid; + grid-template-columns: repeat(3, 33.3%); + grid-row-gap: 12px; + grid-column-gap: 12px; +} +.price_option-select > .content > a { + width: 100%; + display: block; + height: 300px; + position: relative; +} +.price_option-select > .content > a:hover > div { + opacity: 1; +} +.price_option-select > .content > a > img { + width: 100%; + height: 100%; + -o-object-fit: cover; + object-fit: cover; +} +.price_option-select > .content > a > div { + opacity: 0; + transition: 0.3s; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + position: absolute; + top: 0; + right: 0; + background-color: rgba(0, 0, 0, 0.7); +} +.price_option-select > .content > a > div p { + color: #fff; + font-size: 17px; + font-weight: 600; +} + +.price_option-index { + width: 100%; + max-width: 1200px; + margin: 0 auto; +} + +.btn-secondary { + background-color: #6C757D; +} + +.text-light { + color: #fff; +}/*# sourceMappingURL=style.css.map */ \ No newline at end of file diff --git a/wms/mkt/css/style.css.map b/wms/mkt/css/style.css.map new file mode 100644 index 00000000..d1fdc7e2 --- /dev/null +++ b/wms/mkt/css/style.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["style.scss","style.css"],"names":[],"mappings":"AAAA;EACI,WAAA;EACA,iBAAA;EACA,cAAA;EACA,aAAA;ACCJ;ADAI;EACI,UAAA;EACA,gBAAA;EACA,YAAA;EACA,gBAAA;EACA,aAAA;EACA,sBAAA;EACA,4BAAA;ACER;ADDQ;EACI,aAAA;EACA,gBAAA;ACGZ;ADFY;EACI,WAAA;ACIhB;ADAI;EACI,aAAA;EACA,uCAAA;EACA,kBAAA;EACA,qBAAA;ACER;ADDQ;EACI,WAAA;EACA,cAAA;EACA,aAAA;EACA,kBAAA;ACGZ;ADFY;EACI,UAAA;ACIhB;ADFY;EACI,WAAA;EACA,YAAA;EACA,oBAAA;KAAA,iBAAA;ACIhB;ADFY;EACI,UAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,uBAAA;EACA,mBAAA;EACA,kBAAA;EACA,MAAA;EACA,QAAA;EACA,oCAAA;ACIhB;ADHgB;EACI,WAAA;EACA,eAAA;EACA,gBAAA;ACKpB;;ADCA;EACI,WAAA;EACA,iBAAA;EACA,cAAA;ACEJ;;ADAA;EACI,yBAAA;ACGJ;;ADDA;EACI,WAAA;ACIJ","file":"style.css"} \ No newline at end of file diff --git a/wms/mkt/css/style.scss b/wms/mkt/css/style.scss new file mode 100644 index 00000000..4fa886c2 --- /dev/null +++ b/wms/mkt/css/style.scss @@ -0,0 +1,71 @@ +.price_option-select{ + width: 100%; + max-width: 1200px; + margin: 0 auto; + display: flex; + >.sidebar{ + width: 10%; + min-width: 180px; + height: 100%; + min-height: 80vh; + display: flex; + flex-direction: column; + border-right:1px #ccc solid; + >a{ + margin:6px 0; + transition: .3s; + &:hover{ + color:#00b; + } + } + } + >.content{ + display: grid; + grid-template-columns: repeat(3,33.3%); + grid-row-gap: 12px; + grid-column-gap: 12px; + >a{ + width: 100%; + display: block; + height: 300px; + position: relative; + &:hover > div{ + opacity: 1; + } + >img{ + width: 100%; + height: 100%; + object-fit: cover; + } + >div{ + opacity: 0; + transition: .3s; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + position: absolute; + top: 0; + right:0; + background-color: rgba($color: #000, $alpha: .7); + p{ + color:#fff; + font-size: 17px; + font-weight: 600; + } + } + } + } +} +.price_option-index{ + width: 100%; + max-width: 1200px; + margin: 0 auto; +} +.btn-secondary{ + background-color: #6C757D; +} +.text-light{ + color:#fff; +} \ No newline at end of file diff --git a/wms/mkt/price_option-index.php b/wms/mkt/price_option-index.php index e4c81bb9..2e7bae5d 100644 --- a/wms/mkt/price_option-index.php +++ b/wms/mkt/price_option-index.php @@ -1,87 +1,76 @@ - - - -
- -

OPTION價格查詢

-
- - - - - - - - - - - - - $v) { - foreach ($v as $k2 => $v2) { - foreach ($v2 as $k3 => $v3) { - if ($v3["optional"] == "1") $optional = "標"; - elseif ($v3["optional"] == "2") $optional = "選"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - } - } -} +prepare($sql_str); +$stmt->bindParam(':kind', $kind); +$stmt->execute(); +$options = $stmt->fetchAll(PDO::FETCH_ASSOC); +$optional_arr = [1=>'標', 2=>'選']; ?> - -
名稱規格備註配置單位定價
".$k2."".$v3["spec"]."".$v3["memo"]."".$optional."".$v3["unit"]."".number_format($v3["price"])."
+ + + + + +
+

OPTION價格查詢

+
+
+ + + +
+ + + + + + + + + + + + + + +
名稱規格備註配置單位定價
+
-
- \ No newline at end of file + + + \ No newline at end of file diff --git a/wms/mkt/price_option-index2.php b/wms/mkt/price_option-index2.php new file mode 100644 index 00000000..e4c81bb9 --- /dev/null +++ b/wms/mkt/price_option-index2.php @@ -0,0 +1,87 @@ + + + +
+ +

OPTION價格查詢

+
+ + + + + + + + + + + + + $v) { + foreach ($v as $k2 => $v2) { + foreach ($v2 as $k3 => $v3) { + if ($v3["optional"] == "1") $optional = "標"; + elseif ($v3["optional"] == "2") $optional = "選"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + } +} +?> + +
名稱規格備註配置單位定價
".$k2."".$v3["spec"]."".$v3["memo"]."".$optional."".$v3["unit"]."".number_format($v3["price"])."
+
+
+ \ No newline at end of file diff --git a/wms/mkt/price_option-select.php b/wms/mkt/price_option-select.php new file mode 100644 index 00000000..9b18daa3 --- /dev/null +++ b/wms/mkt/price_option-select.php @@ -0,0 +1,47 @@ + + + + +
+ + +