diff --git a/.env b/.env deleted file mode 100644 index dbe739b..0000000 --- a/.env +++ /dev/null @@ -1,33 +0,0 @@ -# In all environments, the following files are loaded if they exist, -# the latter taking precedence over the former: -# -# * .env contains default values for the environment variables needed by the app -# * .env.local uncommitted file with local overrides -# * .env.$APP_ENV committed environment-specific defaults -# * .env.$APP_ENV.local uncommitted environment-specific overrides -# -# Real environment variables win over .env files. -# -# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. -# https://symfony.com/doc/current/configuration/secrets.html -# -# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). -# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration - -###> symfony/framework-bundle ### -APP_ENV=dev -APP_SECRET=17902f251c557579ee832f20ed66776b -###< symfony/framework-bundle ### - -###> doctrine/doctrine-bundle ### -# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url -# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml -# -# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" -DATABASE_URL="mysql://root:136431@127.0.0.1:3306/hsx?serverVersion=8&charset=utf8mb4" -# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=15&charset=utf8" -###< doctrine/doctrine-bundle ### - -###> nelmio/cors-bundle ### -CORS_ALLOW_ORIGIN='*' -###< nelmio/cors-bundle ### diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a67f91e..0000000 --- a/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ - -###> symfony/framework-bundle ### -/.env.local -/.env.local.php -/.env.*.local -/config/secrets/prod/prod.decrypt.private.php -/public/bundles/ -/var/ -/vendor/ -###< symfony/framework-bundle ### diff --git a/.idea/hesabixCore.iml b/.idea/hesabixCore.iml index b3edbfd..b8cf450 100644 --- a/.idea/hesabixCore.iml +++ b/.idea/hesabixCore.iml @@ -5,6 +5,8 @@ + + diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 283b9b4..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml index 24bd864..341c4a2 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -1,5 +1,15 @@ + + + + + + @@ -75,9 +85,15 @@ + + + + \ No newline at end of file diff --git a/hesabixCore/.env b/hesabixCore/.env index ead879f..b230675 100644 --- a/hesabixCore/.env +++ b/hesabixCore/.env @@ -8,9 +8,9 @@ APP_SECRET=f56179673fa562596e7fc565778a60f1 # IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml # # DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" -# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" +DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" -DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=15&charset=utf8" +# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=15&charset=utf8" ###< doctrine/doctrine-bundle ### ###> nelmio/cors-bundle ### @@ -23,10 +23,6 @@ CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$' # MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 ###< symfony/messenger ### -###> MELI PAYAMAK ### -MP_USERNAME = 09180000000 -MP_PASSWORD = PASSWORD -###< MELI PAYAMAK ### ###> symfony/mailer ### # MAILER_DSN=null://null ###< symfony/mailer ### diff --git a/hesabixCore/composer.json b/hesabixCore/composer.json index 060243c..b43fda5 100644 --- a/hesabixCore/composer.json +++ b/hesabixCore/composer.json @@ -17,8 +17,10 @@ "friendsofsymfony/ckeditor-bundle": "*", "gregwar/captcha-bundle": "^2.2", "melipayamak/php": "1.0.0", + "mpdf/mpdf": "^8.2", "nelmio/cors-bundle": "^2.2", "phpdocumentor/reflection-docblock": "^5.3", + "phpoffice/phpspreadsheet": "^1.29", "phpstan/phpdoc-parser": "^1.16", "symfony/apache-pack": "^1.0", "symfony/asset": "6.2.*", diff --git a/hesabixCore/composer.lock b/hesabixCore/composer.lock index 8c9adda..cdcace6 100644 --- a/hesabixCore/composer.lock +++ b/hesabixCore/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "011e94334036ef386813eb2771d6a629", + "content-hash": "4283b361d2fc6c23d255821e9bea4da6", "packages": [ { "name": "doctrine/annotations", @@ -1525,6 +1525,67 @@ ], "time": "2023-01-14T14:17:03+00:00" }, + { + "name": "ezyang/htmlpurifier", + "version": "v4.16.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/523407fb06eb9e5f3d59889b3978d5bfe94299c8", + "reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8", + "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" + }, + "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.16.0" + }, + "time": "2022-09-18T07:06:19+00:00" + }, { "name": "friendsofsymfony/ckeditor-bundle", "version": "2.4.0", @@ -1729,6 +1790,194 @@ }, "time": "2022-01-11T08:28:06+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": "masterminds/html5", "version": "2.8.1", @@ -1951,6 +2200,238 @@ ], "time": "2023-06-21T08:46:11+00:00" }, + { + "name": "mpdf/mpdf", + "version": "v8.2.0", + "source": { + "type": "git", + "url": "https://github.com/mpdf/mpdf.git", + "reference": "170a236a588d177c2aa7447ce490a030ca68e6f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpdf/mpdf/zipball/170a236a588d177c2aa7447ce490a030ca68e6f4", + "reference": "170a236a588d177c2aa7447ce490a030ca68e6f4", + "shasum": "" + }, + "require": { + "ext-gd": "*", + "ext-mbstring": "*", + "mpdf/psr-http-message-shim": "^1.0 || ^2.0", + "mpdf/psr-log-aware-trait": "^2.0 || ^3.0", + "myclabs/deep-copy": "^1.7", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": "^5.6 || ^7.0 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "psr/http-message": "^1.0 || ^2.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "setasign/fpdi": "^2.1" + }, + "require-dev": { + "mockery/mockery": "^1.3.0", + "mpdf/qrcode": "^1.1.0", + "squizlabs/php_codesniffer": "^3.5.0", + "tracy/tracy": "~2.5", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "ext-bcmath": "Needed for generation of some types of barcodes", + "ext-xml": "Needed mainly for SVG manipulation", + "ext-zlib": "Needed for compression of embedded resources, such as fonts" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Mpdf\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-only" + ], + "authors": [ + { + "name": "Matěj Humpál", + "role": "Developer, maintainer" + }, + { + "name": "Ian Back", + "role": "Developer (retired)" + } + ], + "description": "PHP library generating PDF files from UTF-8 encoded HTML", + "homepage": "https://mpdf.github.io", + "keywords": [ + "pdf", + "php", + "utf-8" + ], + "support": { + "docs": "http://mpdf.github.io", + "issues": "https://github.com/mpdf/mpdf/issues", + "source": "https://github.com/mpdf/mpdf" + }, + "funding": [ + { + "url": "https://www.paypal.me/mpdf", + "type": "custom" + } + ], + "time": "2023-09-01T11:44:52+00:00" + }, + { + "name": "mpdf/psr-http-message-shim", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/mpdf/psr-http-message-shim.git", + "reference": "1cf4c0b68b8461cea27411ff961482ce7687e34f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpdf/psr-http-message-shim/zipball/1cf4c0b68b8461cea27411ff961482ce7687e34f", + "reference": "1cf4c0b68b8461cea27411ff961482ce7687e34f", + "shasum": "" + }, + "require": { + "psr/http-message": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mpdf\\PsrHttpMessageShim\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Dorison", + "email": "mark@chromatichq.com" + }, + { + "name": "Kristofer Widholm", + "email": "kristofer@chromatichq.com" + }, + { + "name": "Nigel Cunningham", + "email": "nigel.cunningham@technocrat.com.au" + } + ], + "description": "Shim to allow support of different psr/message versions.", + "support": { + "issues": "https://github.com/mpdf/psr-http-message-shim/issues", + "source": "https://github.com/mpdf/psr-http-message-shim/tree/2.0.0" + }, + "time": "2023-09-01T06:08:18+00:00" + }, + { + "name": "mpdf/psr-log-aware-trait", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/mpdf/psr-log-aware-trait.git", + "reference": "a633da6065e946cc491e1c962850344bb0bf3e78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpdf/psr-log-aware-trait/zipball/a633da6065e946cc491e1c962850344bb0bf3e78", + "reference": "a633da6065e946cc491e1c962850344bb0bf3e78", + "shasum": "" + }, + "require": { + "psr/log": "^3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mpdf\\PsrLogAwareTrait\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Dorison", + "email": "mark@chromatichq.com" + }, + { + "name": "Kristofer Widholm", + "email": "kristofer@chromatichq.com" + } + ], + "description": "Trait to allow support of different psr/log versions.", + "support": { + "issues": "https://github.com/mpdf/psr-log-aware-trait/issues", + "source": "https://github.com/mpdf/psr-log-aware-trait/tree/v3.0.0" + }, + "time": "2023-05-03T06:19:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, { "name": "nelmio/cors-bundle", "version": "2.3.1", @@ -2013,6 +2494,56 @@ }, "time": "2023-02-16T08:49:29+00:00" }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2020-10-15T08:29:30+00:00" + }, { "name": "phenx/php-font-lib", "version": "0.5.4", @@ -2271,6 +2802,111 @@ }, "time": "2023-08-12T11:01:26+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": "phpstan/phpdoc-parser", "version": "1.23.1", @@ -2470,6 +3106,166 @@ }, "time": "2019-01-08T18:20:26+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/link", "version": "2.0.1", @@ -2576,6 +3372,57 @@ }, "time": "2021-07-14T16:46:02+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": "sabberworm/php-css-parser", "version": "8.4.0", @@ -2629,6 +3476,78 @@ }, "time": "2021-12-11T13:40:54+00:00" }, + { + "name": "setasign/fpdi", + "version": "v2.4.1", + "source": { + "type": "git", + "url": "https://github.com/Setasign/FPDI.git", + "reference": "f4ba73e5bc053ccc90b81717c5df1cb2ea7bae7b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Setasign/FPDI/zipball/f4ba73e5bc053ccc90b81717c5df1cb2ea7bae7b", + "reference": "f4ba73e5bc053ccc90b81717c5df1cb2ea7bae7b", + "shasum": "" + }, + "require": { + "ext-zlib": "*", + "php": "^5.6 || ^7.0 || ^8.0" + }, + "conflict": { + "setasign/tfpdf": "<1.31" + }, + "require-dev": { + "phpunit/phpunit": "~5.7", + "setasign/fpdf": "~1.8", + "setasign/tfpdf": "~1.31", + "squizlabs/php_codesniffer": "^3.5", + "tecnickcom/tcpdf": "~6.2" + }, + "suggest": { + "setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured." + }, + "type": "library", + "autoload": { + "psr-4": { + "setasign\\Fpdi\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Slabon", + "email": "jan.slabon@setasign.com", + "homepage": "https://www.setasign.com" + }, + { + "name": "Maximilian Kresse", + "email": "maximilian.kresse@setasign.com", + "homepage": "https://www.setasign.com" + } + ], + "description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.", + "homepage": "https://www.setasign.com/fpdi", + "keywords": [ + "fpdf", + "fpdi", + "pdf" + ], + "support": { + "issues": "https://github.com/Setasign/FPDI/issues", + "source": "https://github.com/Setasign/FPDI/tree/v2.4.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/setasign/fpdi", + "type": "tidelift" + } + ], + "time": "2023-07-27T08:12:09+00:00" + }, { "name": "symfony/apache-pack", "version": "v1.0.1", @@ -8063,65 +8982,6 @@ } ], "packages-dev": [ - { - "name": "myclabs/deep-copy", - "version": "1.11.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2023-03-08T13:26:56+00:00" - }, { "name": "nikic/php-parser", "version": "v4.17.1", diff --git a/hesabixCore/src/Controller/CommodityController.php b/hesabixCore/src/Controller/CommodityController.php index 8dd52c4..127542e 100644 --- a/hesabixCore/src/Controller/CommodityController.php +++ b/hesabixCore/src/Controller/CommodityController.php @@ -29,7 +29,25 @@ class CommodityController extends AbstractController } return $this->json($items); } - + #[Route('/api/commodity/list/print', name: 'app_commodity_list_print')] + public function app_commodity_list_print(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse + { + $acc = $access->hasRole('commodity'); + if(!$acc) + throw $this->createAccessDeniedException(); + $items = $entityManager->getRepository(Commodity::class)->findBy([ + 'bid'=>$request->headers->get('activeBid') + ]); + $pid = $provider->createPrint( + $acc['bid'], + $this->getUser(), + $this->renderView('pdf/commodity.html.twig',[ + 'page_title'=>'فهرست کالا و خدمات', + 'bid'=>$acc['bid'], + 'persons'=>$items + ])); + return $this->json(['id'=>$pid]); + } #[Route('/api/commodity/info/{code}', name: 'app_commodity_info')] public function app_commodity_info($code,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse { diff --git a/hesabixCore/src/Controller/Front/UiGeneralController.php b/hesabixCore/src/Controller/Front/UiGeneralController.php index f693984..3cbd437 100644 --- a/hesabixCore/src/Controller/Front/UiGeneralController.php +++ b/hesabixCore/src/Controller/Front/UiGeneralController.php @@ -10,6 +10,7 @@ use App\Entity\HesabdariDoc; use App\Entity\PrinterQueue; use App\Entity\User; use App\Service\pdfMGR; +use App\Service\Provider; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; @@ -98,12 +99,9 @@ class UiGeneralController extends AbstractController ]); } #[Route('/test', name: 'general_test')] - public function general_test(pdfMGR $pdfMGR,EntityManagerInterface $entityManager): Response + public function general_test(Provider $provider,pdfMGR $pdfMGR,EntityManagerInterface $entityManager): Response { - $user = $entityManager->getRepository(PrinterQueue::class)->findOneBy([ - 'pid'=>'SKDUTJAEZXV37D6HBMQARZAZ9MGW6P79FWVXHTUC4J2FU48K2P4RNWYX3UY2Z5KMSJG746CLLXSRDLQNCG6BBS5TKRW8HDQMF3ENGHY5EQL2BP8VJ78A9CE9VNTY35F' - ]); - return $pdfMGR->streamTwig2PDF($user); + $provider->createExcell([[1,2],[3.4]]); } } diff --git a/hesabixCore/src/Controller/PersonsController.php b/hesabixCore/src/Controller/PersonsController.php index 882f4aa..1125212 100644 --- a/hesabixCore/src/Controller/PersonsController.php +++ b/hesabixCore/src/Controller/PersonsController.php @@ -9,8 +9,10 @@ use App\Service\Log; use App\Service\Provider; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Serializer\SerializerInterface; @@ -73,6 +75,28 @@ class PersonsController extends AbstractController $person->setDes($params['des']); if(array_key_exists('mobile',$params)) $person->setMobile($params['mobile']); + if(array_key_exists('fax',$params)) + $person->setFax($params['fax']); + if(array_key_exists('website',$params)) + $person->setWebsite($params['website']); + if(array_key_exists('email',$params)) + $person->setEmail($params['email']); + if(array_key_exists('postalcode',$params)) + $person->setPostalcode($params['postalcode']); + if(array_key_exists('shahr',$params)) + $person->setShahr($params['shahr']); + if(array_key_exists('ostan',$params)) + $person->setOstan($params['ostan']); + if(array_key_exists('keshvar',$params)) + $person->setKeshvar($params['keshvar']); + if(array_key_exists('sabt',$params)) + $person->setSabt($params['sabt']); + if(array_key_exists('codeeghtesadi',$params)) + $person->setCodeeghtesadi($params['codeeghtesadi']); + if(array_key_exists('shenasemeli',$params)) + $person->setShenasemeli($params['shenasemeli']); + if(array_key_exists('company',$params)) + $person->setCompany($params['company']); $entityManager->persist($person); $entityManager->flush(); $log->insert('اشخاص','شخص با نام مستعار ' . $params['nikename'] . ' افزوده/ویرایش شد.',$this->getUser(),$request->headers->get('activeBid')); @@ -96,10 +120,29 @@ class PersonsController extends AbstractController $acc = $access->hasRole('person'); if(!$acc) throw $this->createAccessDeniedException(); - - $persons = $entityManager->getRepository(Person::class)->findBy([ - 'bid'=>$acc['bid'] - ]); + $params = []; + if ($content = $request->getContent()) { + $params = json_decode($content, true); + } + if(!array_key_exists('items',$params)){ + $persons = $entityManager->getRepository(Person::class)->findBy([ + 'bid'=>$acc['bid'] + ]); + } + else{ + $persons = []; + foreach ($params['items'] as $param){ + $prs = $entityManager->getRepository(Person::class)->findOneBy([ + 'id'=>$param['id'], + 'bid'=>$acc['bid'] + ]); + if($prs) + $persons[] = $prs; + } + } + + + $pid = $provider->createPrint( $acc['bid'], $this->getUser(), @@ -110,4 +153,33 @@ class PersonsController extends AbstractController ])); return $this->json(['id'=>$pid]); } + + #[Route('/api/person/list/excel', name: 'app_persons_list_excel')] + public function app_persons_list_excel(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): BinaryFileResponse | JsonResponse | StreamedResponse + { + $acc = $access->hasRole('person'); + if(!$acc) + throw $this->createAccessDeniedException(); + $params = []; + if ($content = $request->getContent()) { + $params = json_decode($content, true); + } + if(!array_key_exists('items',$params)){ + $persons = $entityManager->getRepository(Person::class)->findBy([ + 'bid'=>$acc['bid'] + ]); + } + else{ + $persons = []; + foreach ($params['items'] as $param){ + $prs = $entityManager->getRepository(Person::class)->findOneBy([ + 'id'=>$param['id'], + 'bid'=>$acc['bid'] + ]); + if($prs) + $persons[] = $prs; + } + } + return new BinaryFileResponse($provider->createExcell($persons)); + } } diff --git a/hesabixCore/src/Controller/UserController.php b/hesabixCore/src/Controller/UserController.php index ae3caf4..dbce23e 100644 --- a/hesabixCore/src/Controller/UserController.php +++ b/hesabixCore/src/Controller/UserController.php @@ -307,6 +307,52 @@ class UserController extends AbstractController return $this->json($res); } + #[Route('/api/user/reset/password/send-to-sms/{id}', name: 'api_user_forget_reset_password')] + public function api_user_forget_reset_password(MailerInterface $mailer,SMS $SMS,String $id,UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager,Request $request): Response + { + $params = []; + if ($content = $request->getContent()) { + $params = json_decode($content, true); + } + if(array_key_exists('code',$params)){ + $obj = $entityManager->getRepository(User::class)->find($id); + if($obj){ + if($obj->getVerifyCodeTime() > time()){ + $obj = $entityManager->getRepository(User::class)->findOneBy(['id'=>$id,'verifyCode'=>$params['code']]); + if($obj){ + //reset password + $password = $this->RandomString(12,true); + $obj->setPassword( + $userPasswordHasher->hashPassword( + $obj, + $password + ) + ); + $entityManager->persist($obj); + $entityManager->flush(); + $SMS->send([$password],163543,$obj->getMobile()); + $email = (new Email()) + ->to($obj->getEmail()) + ->priority(Email::PRIORITY_HIGH) + ->subject('تغییر کلمه عبور') + ->html( + $this->renderView('user/email/reset-password.html.twig',[ + 'code'=>$password + ]) + ); + $mailer->send($email); + return $this->json(['result'=>'ok']); + } + //code is incorrect + return $this->json(['result'=>'false']); + } + else + return $this->json(['result'=>'expired']); + } + } + throw $this->createAccessDeniedException(); + } + #[Route('/api/user/active/account/{id}', name: 'api_user_active_account')] public function api_user_active_account(MailerInterface $mailer,SMS $SMS,String $id,#[CurrentUser] ?User $user,UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager,Request $request): Response { @@ -332,7 +378,7 @@ class UserController extends AbstractController return $this->json(['result'=>'not correct','id'=>$user->getId(),'active'=>false]); } #[Route('/api/user/forget/password/send-code', name: 'api_user_forget_password_send_code')] - public function api_user_forget_password_send_code(#[CurrentUser] ?User $user,UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager,Request $request): Response + public function api_user_forget_password_send_code(#[CurrentUser] ?User $user,SMS $SMS,MailerInterface $mailer,UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager,Request $request): Response { $params = []; if ($content = $request->getContent()) { @@ -341,11 +387,31 @@ class UserController extends AbstractController if(! array_key_exists('email',$params)) throw $this->createAccessDeniedException('email not send'); $user = $entityManager->getRepository(User::class)->findOneBy(['email'=>$params['email']]); - if(!$user) - throw $this->createNotFoundException('email not exist'); - $user->setVerifyCode(1234); + if(!$user){ + $user = $entityManager->getRepository(User::class)->findOneBy(['mobile'=>$params['email']]); + if(!$user) + throw $this->createNotFoundException('email not exist'); + } + if($user->getVerifyCodeTime() > time()) + return $this->json(['result'=>'send before']); + $user->setVerifyCode($this->RandomString(6,true)); + $user->setVerifyCodeTime(time() + 300); + $entityManager->persist($user); + $entityManager->flush(); + //send sms and email + $SMS->send([$user->getVerifyCode()],'160887',$user->getMobile()); + $email = (new Email()) + ->to($user->getEmail()) + ->priority(Email::PRIORITY_HIGH) + ->subject('حسابیکس - فراموشی کلمه عبور') + ->html( + $this->renderView('user/email/confrim-forget-password.html.twig',[ + 'code'=>$user->getVerifyCode() + ]) + ); - return $this->json(['result'=>false]); + $mailer->send($email); + return $this->json(['result'=>true,'id'=>$user->getId()]); } #[Route('/api/user/save/mobile-number', name: 'api_user_save_mobile_number')] public function api_user_save_mobile_number(MailerInterface $mailer,SMS $SMS,#[CurrentUser] ?User $user,UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager,Request $request): Response diff --git a/hesabixCore/src/Entity/Commodity.php b/hesabixCore/src/Entity/Commodity.php index 6a1b2cc..79b6180 100644 --- a/hesabixCore/src/Entity/Commodity.php +++ b/hesabixCore/src/Entity/Commodity.php @@ -35,10 +35,10 @@ class Commodity #[ORM\Column(type: 'bigint')] private $code; - #[ORM\Column(type: 'integer', nullable: true)] + #[ORM\Column(type: 'string', length: 255, nullable: true)] private $priceBuy; - #[ORM\Column(type: 'integer', nullable: true)] + #[ORM\Column(type: 'string', length: 255, nullable: true)] private $priceSell; #[ORM\OneToMany(mappedBy: 'commodity', targetEntity: HesabdariRow::class)] diff --git a/hesabixCore/src/Entity/Person.php b/hesabixCore/src/Entity/Person.php index b86d896..dce64f5 100644 --- a/hesabixCore/src/Entity/Person.php +++ b/hesabixCore/src/Entity/Person.php @@ -70,6 +70,39 @@ class Person #[ORM\OneToMany(mappedBy: 'customer', targetEntity: PlugNoghreOrder::class)] private Collection $ordersFromCustomer; + #[ORM\Column(length: 255, nullable: true)] + private ?string $company = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $shenasemeli = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $codeeghtesadi = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $sabt = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $keshvar = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $ostan = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $shahr = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $postalcode = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $email = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $website = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $fax = null; + public function __construct() { $this->hesabdariRows = new ArrayCollection(); @@ -327,4 +360,136 @@ class Person return $this; } + + public function getCompany(): ?string + { + return $this->company; + } + + public function setCompany(?string $company): static + { + $this->company = $company; + + return $this; + } + + public function getShenasemeli(): ?string + { + return $this->shenasemeli; + } + + public function setShenasemeli(?string $shenasemeli): static + { + $this->shenasemeli = $shenasemeli; + + return $this; + } + + public function getCodeeghtesadi(): ?string + { + return $this->codeeghtesadi; + } + + public function setCodeeghtesadi(?string $codeeghtesadi): static + { + $this->codeeghtesadi = $codeeghtesadi; + + return $this; + } + + public function getSabt(): ?string + { + return $this->sabt; + } + + public function setSabt(?string $sabt): static + { + $this->sabt = $sabt; + + return $this; + } + + public function getKeshvar(): ?string + { + return $this->keshvar; + } + + public function setKeshvar(?string $keshvar): static + { + $this->keshvar = $keshvar; + + return $this; + } + + public function getOstan(): ?string + { + return $this->ostan; + } + + public function setOstan(?string $ostan): static + { + $this->ostan = $ostan; + + return $this; + } + + public function getShahr(): ?string + { + return $this->shahr; + } + + public function setShahr(?string $shahr): static + { + $this->shahr = $shahr; + + return $this; + } + + public function getPostalcode(): ?string + { + return $this->postalcode; + } + + public function setPostalcode(?string $postalcode): static + { + $this->postalcode = $postalcode; + + return $this; + } + + public function getEmail(): ?string + { + return $this->email; + } + + public function setEmail(?string $email): static + { + $this->email = $email; + + return $this; + } + + public function getWebsite(): ?string + { + return $this->website; + } + + public function setWebsite(?string $website): static + { + $this->website = $website; + + return $this; + } + + public function getFax(): ?string + { + return $this->fax; + } + + public function setFax(?string $fax): static + { + $this->fax = $fax; + + return $this; + } } diff --git a/hesabixCore/src/Fonts/Vazirmatn-Black.ttf b/hesabixCore/src/Fonts/Vazirmatn-Black.ttf new file mode 100644 index 0000000..4b9bd66 Binary files /dev/null and b/hesabixCore/src/Fonts/Vazirmatn-Black.ttf differ diff --git a/hesabixCore/src/Fonts/Vazirmatn-Bold.ttf b/hesabixCore/src/Fonts/Vazirmatn-Bold.ttf new file mode 100644 index 0000000..efa9b09 Binary files /dev/null and b/hesabixCore/src/Fonts/Vazirmatn-Bold.ttf differ diff --git a/hesabixCore/src/Fonts/Vazirmatn-ExtraBold.ttf b/hesabixCore/src/Fonts/Vazirmatn-ExtraBold.ttf new file mode 100644 index 0000000..380bd15 Binary files /dev/null and b/hesabixCore/src/Fonts/Vazirmatn-ExtraBold.ttf differ diff --git a/hesabixCore/src/Fonts/Vazirmatn-ExtraLight.ttf b/hesabixCore/src/Fonts/Vazirmatn-ExtraLight.ttf new file mode 100644 index 0000000..b7b947e Binary files /dev/null and b/hesabixCore/src/Fonts/Vazirmatn-ExtraLight.ttf differ diff --git a/hesabixCore/src/Fonts/Vazirmatn-Light.ttf b/hesabixCore/src/Fonts/Vazirmatn-Light.ttf new file mode 100644 index 0000000..2dfd5c3 Binary files /dev/null and b/hesabixCore/src/Fonts/Vazirmatn-Light.ttf differ diff --git a/hesabixCore/src/Fonts/Vazirmatn-Medium.ttf b/hesabixCore/src/Fonts/Vazirmatn-Medium.ttf new file mode 100644 index 0000000..1e08dd5 Binary files /dev/null and b/hesabixCore/src/Fonts/Vazirmatn-Medium.ttf differ diff --git a/hesabixCore/src/Fonts/Vazirmatn-Regular.ttf b/hesabixCore/src/Fonts/Vazirmatn-Regular.ttf new file mode 100644 index 0000000..64e4a81 Binary files /dev/null and b/hesabixCore/src/Fonts/Vazirmatn-Regular.ttf differ diff --git a/hesabixCore/src/Fonts/Vazirmatn-SemiBold.ttf b/hesabixCore/src/Fonts/Vazirmatn-SemiBold.ttf new file mode 100644 index 0000000..6b3842a Binary files /dev/null and b/hesabixCore/src/Fonts/Vazirmatn-SemiBold.ttf differ diff --git a/hesabixCore/src/Fonts/Vazirmatn-Thin.ttf b/hesabixCore/src/Fonts/Vazirmatn-Thin.ttf new file mode 100644 index 0000000..b7a7d23 Binary files /dev/null and b/hesabixCore/src/Fonts/Vazirmatn-Thin.ttf differ diff --git a/hesabixCore/src/Service/Provider.php b/hesabixCore/src/Service/Provider.php index 2362983..d2aaf2e 100644 --- a/hesabixCore/src/Service/Provider.php +++ b/hesabixCore/src/Service/Provider.php @@ -7,8 +7,12 @@ use App\Entity\PlugNoghreOrder; use App\Entity\PrinterQueue; use App\Entity\User; use Doctrine\ORM\EntityManagerInterface; +use PhpOffice\PhpSpreadsheet\Writer\Exception; use ReflectionFunction; use Symfony\Component\HttpFoundation\Request; +use PhpOffice\PhpSpreadsheet\Spreadsheet; +use PhpOffice\PhpSpreadsheet\Writer\Xlsx; +use Symfony\Component\HttpFoundation\StreamedResponse; class Provider { @@ -148,6 +152,22 @@ class Provider return $print->getPid(); } + /** + * @throws Exception + */ + public function createExcell(array $entities, array $headers = null){ + + $spreadsheet = new Spreadsheet(); + $activeWorksheet = $spreadsheet->getActiveSheet(); + $arrayEntity = $this->ArrayEntity2Array($entities,0); + $activeWorksheet->fromArray($arrayEntity,null,'A1'); + $activeWorksheet->setRightToLeft(true); + $activeWorksheet->getHeaderFooter()->setOddHeader('&CHeader of the Document'); + $writer = new Xlsx($spreadsheet); + $filePath = __DIR__ . '/../../var/'.$this->RandomString(12).'.xlsx'; + $writer->save($filePath); + return $filePath; + } /** * function to generate random strings * @param int $length number of characters in the generated string diff --git a/hesabixCore/src/Service/pdfMGR.php b/hesabixCore/src/Service/pdfMGR.php index 7567026..57f32c6 100644 --- a/hesabixCore/src/Service/pdfMGR.php +++ b/hesabixCore/src/Service/pdfMGR.php @@ -17,22 +17,33 @@ class pdfMGR } public function streamTwig2PDF(PrinterQueue $printQueue,$configs = []){ - $data = [ - ]; + $defaultConfig = (new \Mpdf\Config\ConfigVariables())->getDefaults(); + $fontDirs = $defaultConfig['fontDir']; - $dompdf = new Dompdf(); - $options = $dompdf->getOptions(); - $options->setDefaultFont('DejaVuSans'); - $dompdf->setOptions($options); - $dompdf->loadHtml($printQueue->getView()); - $dompdf->render(); + $defaultFontConfig = (new \Mpdf\Config\FontVariables())->getDefaults(); + $fontData = $defaultFontConfig['fontdata']; + $mpdf = new \Mpdf\Mpdf([ + 'mode' => 'utf-8', 'format' => 'A4-L', + 'fontDir' => array_merge($fontDirs, [ + __DIR__ . '../Fonts', + ]), + 'fontdata' => $fontData + [ // lowercase letters only in font key + 'Vazirmatn-Regular' => [ + 'R' => 'Vazirmatn-Regular.ttf', + 'I' => 'Vazirmatn-Regular.ttf', + ] + ], + 'default_font' => 'Vazirmatn-Regular', + 'tempDir' => sys_get_temp_dir().DIRECTORY_SEPARATOR.'mpdf' + ]); + $mpdf->AddFontDirectory(__DIR__ . '../Fonts'); + $mpdf->setFooter('{PAGENO}'); + $stylesheet = file_get_contents(__DIR__ . '/../../../public_html/assets/css/dashmix.min.css'); - return new Response ( - $dompdf->stream('resume', ["Attachment" => false]), - Response::HTTP_OK, - ['Content-Type' => 'application/pdf'] - ); + $mpdf->WriteHTML($stylesheet,\Mpdf\HTMLParserMode::HEADER_CSS); + $mpdf->WriteHTML($printQueue->getView()); + $mpdf->Output(); } private function imageToBase64($path) { diff --git a/hesabixCore/templates/blank.html.twig b/hesabixCore/templates/blank.html.twig index 70ebab1..2590519 100644 --- a/hesabixCore/templates/blank.html.twig +++ b/hesabixCore/templates/blank.html.twig @@ -9,11 +9,11 @@ حسابیکس - {% block title %}{% endblock %} {# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #} {% block stylesheets %} - {{ encore_entry_link_tags('app') }} + {#{{ encore_entry_link_tags('app') }}#} {% endblock %} {% block javascripts %} - {{ encore_entry_script_tags('app') }} + {#{{ encore_entry_script_tags('app') }}#} {% endblock %} diff --git a/hesabixCore/templates/pdf/base.html.twig b/hesabixCore/templates/pdf/base.html.twig index 7b24afe..0e2a6c3 100644 --- a/hesabixCore/templates/pdf/base.html.twig +++ b/hesabixCore/templates/pdf/base.html.twig @@ -1,19 +1,12 @@ - + چاپ -

{{bid.name}}

+

{{bid.name}}

{{ page_title }}

{% block body %}{% endblock %}
-
-

امضا:

-

- نشانی: {{ bid.address }} - تلفن: {{ bid.tel }} - ایمیل: {{ bid.email }} -

\ No newline at end of file diff --git a/hesabixCore/templates/pdf/commodity.html.twig b/hesabixCore/templates/pdf/commodity.html.twig new file mode 100644 index 0000000..ffa1259 --- /dev/null +++ b/hesabixCore/templates/pdf/commodity.html.twig @@ -0,0 +1,23 @@ +{% extends "pdf/base.html.twig" %} +{% block body %} + + + + + + + + + + {% for person in persons %} + + + + + + + + {% endfor %} + +
 
ردیفنامواحد شمارشقیمت فروشقیمت خرید
{{ loop.index }}{{ person.name }}{{ person.unit.name }}{{ person.priceSell }}{{ person.priceBuy }}
+{% endblock %} \ No newline at end of file diff --git a/hesabixCore/templates/pdf/header.html.twig b/hesabixCore/templates/pdf/header.html.twig new file mode 100644 index 0000000..e69de29 diff --git a/hesabixCore/templates/pdf/persons.html.twig b/hesabixCore/templates/pdf/persons.html.twig index 8dec2cb..1bd3f31 100644 --- a/hesabixCore/templates/pdf/persons.html.twig +++ b/hesabixCore/templates/pdf/persons.html.twig @@ -1,23 +1,45 @@ {% extends "pdf/base.html.twig" %} {% block body %} - +
 
- - - - - + + + + + + + + + + + + + + + + {% for person in persons %} - - - - - - - + + + + + + + + + + + + + + + + + + {% endfor %} diff --git a/hesabixCore/templates/test-pdf.html.twig b/hesabixCore/templates/test-pdf.html.twig new file mode 100644 index 0000000..4564b92 --- /dev/null +++ b/hesabixCore/templates/test-pdf.html.twig @@ -0,0 +1,29 @@ + + + + + + + + + + +
+ fdsfds +
صادق
+
+ + + \ No newline at end of file diff --git a/hesabixCore/templates/user/email/confrim-forget-password.html.twig b/hesabixCore/templates/user/email/confrim-forget-password.html.twig new file mode 100644 index 0000000..3c2a73c --- /dev/null +++ b/hesabixCore/templates/user/email/confrim-forget-password.html.twig @@ -0,0 +1,147 @@ + + + + + + + + + + +
 
ردیفنام و نام خانوادگینام مستعارآدرستلفنموبایلنام و نام خانوادگینام مستعارشرکتشناسه ملیشماره ثبتکد اقتصادیکشوراستانشهرآدرسکد پستیتلفنموبایلفکسوب سایتپست الکترونیکی
{{ loop.index }}{{ person.name }}{{ person.nikeName }}{{ person.address }}{{ person.tel }}{{ person.mobile }}
{{ loop.index }}{{ person.name }}{{ person.nikeName }}{{ person.company }}{{ person.shenasemeli }}{{ person.sabt }}{{ person.codeeghtesadi }}{{ person.keshvar }}{{ person.ostan }}{{ person.shahr }}{{ person.address }}{{ person.postalcode }}{{ person.tel }}{{ person.mobile }}{{ person.fax }}{{ person.website }}{{ person.email }}
+ + + + + +
+ + + + + + + + + + + + + + +
+ + +
+ + + + + + +
+ Image +
+
+ + +
+ + +
+ + + + + + +
+
+ + حسابیکس + +
+
+
+ + +

+
+

+
+ کد بازیابی کلمه عبور شما به شرح زیر می باشد. +
+ در صورتی که شما درخواست بازیابی گذرواژه خود را نداشته اید این پیام را نادیده بگیرید. +
+
+
+
+
+ + +
+ + +
+ + + + + + +
+ + + + + + +
+ {{ code }} +
+
+
+ + +
+ + +
+ + \ No newline at end of file diff --git a/hesabixCore/templates/user/email/reset-password.html.twig b/hesabixCore/templates/user/email/reset-password.html.twig new file mode 100644 index 0000000..958136b --- /dev/null +++ b/hesabixCore/templates/user/email/reset-password.html.twig @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + +
+ + + + + + +
+ Image +
+
+ + +
+ + +
+ + + + + + +
+
+ + حسابیکس + +
+
+
+ + +

+
+

+
+ کلمه عبور ورود به حسابیکس به درخواست شما تغییر یافت . جهت ورود از کلمه عبور زیر استفاده نمایید. +
+
+
+
+
+ + +
+ + +
+ + + + + + +
+ + + + + + +
+ {{ code }} +
+
+
+ + +
+ + +
+ + \ No newline at end of file