progress on pdf and excel
This commit is contained in:
parent
0f4c26f5da
commit
5c4ad11fc2
33
.env
33
.env
|
@ -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 ###
|
|
10
.gitignore
vendored
10
.gitignore
vendored
|
@ -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 ###
|
|
|
@ -5,6 +5,8 @@
|
||||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="App\" />
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="App\" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="App\Tests\" />
|
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="App\Tests\" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/hesabixCore/src" isTestSource="false" packagePrefix="App" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/hesabixCore/var/cache/dev" isTestSource="false" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/var" />
|
<excludeFolder url="file://$MODULE_DIR$/var" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/maker-bundle" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/maker-bundle" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" />
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="SwUserDefinedSpecifications">
|
|
||||||
<option name="specTypeByUrl">
|
|
||||||
<map />
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,5 +1,15 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="MessDetectorOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PHPCSFixerOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PHPCodeSnifferOptionsConfiguration">
|
||||||
|
<option name="highlightLevel" value="WARNING" />
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
<component name="PhpIncludePathManager">
|
<component name="PhpIncludePathManager">
|
||||||
<include_path>
|
<include_path>
|
||||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
|
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
|
||||||
|
@ -75,9 +85,15 @@
|
||||||
<component name="PhpProjectSharedConfiguration" php_language_level="8.1">
|
<component name="PhpProjectSharedConfiguration" php_language_level="8.1">
|
||||||
<option name="suggestChangeDefaultLanguageLevel" value="false" />
|
<option name="suggestChangeDefaultLanguageLevel" value="false" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="PhpStanOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
<component name="PhpUnit">
|
<component name="PhpUnit">
|
||||||
<phpunit_settings>
|
<phpunit_settings>
|
||||||
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" />
|
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" />
|
||||||
</phpunit_settings>
|
</phpunit_settings>
|
||||||
</component>
|
</component>
|
||||||
|
<component name="PsalmOptionsConfiguration">
|
||||||
|
<option name="transferred" value="true" />
|
||||||
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -8,9 +8,9 @@ APP_SECRET=f56179673fa562596e7fc565778a60f1
|
||||||
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
# 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="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="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 ###
|
###< doctrine/doctrine-bundle ###
|
||||||
|
|
||||||
###> nelmio/cors-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=redis://localhost:6379/messages
|
||||||
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
|
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
|
||||||
###< symfony/messenger ###
|
###< symfony/messenger ###
|
||||||
###> MELI PAYAMAK ###
|
|
||||||
MP_USERNAME = 09180000000
|
|
||||||
MP_PASSWORD = PASSWORD
|
|
||||||
###< MELI PAYAMAK ###
|
|
||||||
###> symfony/mailer ###
|
###> symfony/mailer ###
|
||||||
# MAILER_DSN=null://null
|
# MAILER_DSN=null://null
|
||||||
###< symfony/mailer ###
|
###< symfony/mailer ###
|
||||||
|
|
|
@ -17,8 +17,10 @@
|
||||||
"friendsofsymfony/ckeditor-bundle": "*",
|
"friendsofsymfony/ckeditor-bundle": "*",
|
||||||
"gregwar/captcha-bundle": "^2.2",
|
"gregwar/captcha-bundle": "^2.2",
|
||||||
"melipayamak/php": "1.0.0",
|
"melipayamak/php": "1.0.0",
|
||||||
|
"mpdf/mpdf": "^8.2",
|
||||||
"nelmio/cors-bundle": "^2.2",
|
"nelmio/cors-bundle": "^2.2",
|
||||||
"phpdocumentor/reflection-docblock": "^5.3",
|
"phpdocumentor/reflection-docblock": "^5.3",
|
||||||
|
"phpoffice/phpspreadsheet": "^1.29",
|
||||||
"phpstan/phpdoc-parser": "^1.16",
|
"phpstan/phpdoc-parser": "^1.16",
|
||||||
"symfony/apache-pack": "^1.0",
|
"symfony/apache-pack": "^1.0",
|
||||||
"symfony/asset": "6.2.*",
|
"symfony/asset": "6.2.*",
|
||||||
|
|
980
hesabixCore/composer.lock
generated
980
hesabixCore/composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -29,7 +29,25 @@ class CommodityController extends AbstractController
|
||||||
}
|
}
|
||||||
return $this->json($items);
|
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')]
|
#[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
|
public function app_commodity_info($code,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,7 @@ use App\Entity\HesabdariDoc;
|
||||||
use App\Entity\PrinterQueue;
|
use App\Entity\PrinterQueue;
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use App\Service\pdfMGR;
|
use App\Service\pdfMGR;
|
||||||
|
use App\Service\Provider;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
@ -98,12 +99,9 @@ class UiGeneralController extends AbstractController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
#[Route('/test', name: 'general_test')]
|
#[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([
|
$provider->createExcell([[1,2],[3.4]]);
|
||||||
'pid'=>'SKDUTJAEZXV37D6HBMQARZAZ9MGW6P79FWVXHTUC4J2FU48K2P4RNWYX3UY2Z5KMSJG746CLLXSRDLQNCG6BBS5TKRW8HDQMF3ENGHY5EQL2BP8VJ78A9CE9VNTY35F'
|
|
||||||
]);
|
|
||||||
return $pdfMGR->streamTwig2PDF($user);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,10 @@ use App\Service\Log;
|
||||||
use App\Service\Provider;
|
use App\Service\Provider;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Serializer\SerializerInterface;
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
|
|
||||||
|
@ -73,6 +75,28 @@ class PersonsController extends AbstractController
|
||||||
$person->setDes($params['des']);
|
$person->setDes($params['des']);
|
||||||
if(array_key_exists('mobile',$params))
|
if(array_key_exists('mobile',$params))
|
||||||
$person->setMobile($params['mobile']);
|
$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->persist($person);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
$log->insert('اشخاص','شخص با نام مستعار ' . $params['nikename'] . ' افزوده/ویرایش شد.',$this->getUser(),$request->headers->get('activeBid'));
|
$log->insert('اشخاص','شخص با نام مستعار ' . $params['nikename'] . ' افزوده/ویرایش شد.',$this->getUser(),$request->headers->get('activeBid'));
|
||||||
|
@ -96,10 +120,29 @@ class PersonsController extends AbstractController
|
||||||
$acc = $access->hasRole('person');
|
$acc = $access->hasRole('person');
|
||||||
if(!$acc)
|
if(!$acc)
|
||||||
throw $this->createAccessDeniedException();
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$persons = $entityManager->getRepository(Person::class)->findBy([
|
|
||||||
'bid'=>$acc['bid']
|
|
||||||
]);
|
|
||||||
$pid = $provider->createPrint(
|
$pid = $provider->createPrint(
|
||||||
$acc['bid'],
|
$acc['bid'],
|
||||||
$this->getUser(),
|
$this->getUser(),
|
||||||
|
@ -110,4 +153,33 @@ class PersonsController extends AbstractController
|
||||||
]));
|
]));
|
||||||
return $this->json(['id'=>$pid]);
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,6 +307,52 @@ class UserController extends AbstractController
|
||||||
return $this->json($res);
|
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')]
|
#[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
|
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]);
|
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')]
|
#[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 = [];
|
$params = [];
|
||||||
if ($content = $request->getContent()) {
|
if ($content = $request->getContent()) {
|
||||||
|
@ -341,11 +387,31 @@ class UserController extends AbstractController
|
||||||
if(! array_key_exists('email',$params))
|
if(! array_key_exists('email',$params))
|
||||||
throw $this->createAccessDeniedException('email not send');
|
throw $this->createAccessDeniedException('email not send');
|
||||||
$user = $entityManager->getRepository(User::class)->findOneBy(['email'=>$params['email']]);
|
$user = $entityManager->getRepository(User::class)->findOneBy(['email'=>$params['email']]);
|
||||||
if(!$user)
|
if(!$user){
|
||||||
throw $this->createNotFoundException('email not exist');
|
$user = $entityManager->getRepository(User::class)->findOneBy(['mobile'=>$params['email']]);
|
||||||
$user->setVerifyCode(1234);
|
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')]
|
#[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
|
public function api_user_save_mobile_number(MailerInterface $mailer,SMS $SMS,#[CurrentUser] ?User $user,UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager,Request $request): Response
|
||||||
|
|
|
@ -35,10 +35,10 @@ class Commodity
|
||||||
#[ORM\Column(type: 'bigint')]
|
#[ORM\Column(type: 'bigint')]
|
||||||
private $code;
|
private $code;
|
||||||
|
|
||||||
#[ORM\Column(type: 'integer', nullable: true)]
|
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||||
private $priceBuy;
|
private $priceBuy;
|
||||||
|
|
||||||
#[ORM\Column(type: 'integer', nullable: true)]
|
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||||
private $priceSell;
|
private $priceSell;
|
||||||
|
|
||||||
#[ORM\OneToMany(mappedBy: 'commodity', targetEntity: HesabdariRow::class)]
|
#[ORM\OneToMany(mappedBy: 'commodity', targetEntity: HesabdariRow::class)]
|
||||||
|
|
|
@ -70,6 +70,39 @@ class Person
|
||||||
#[ORM\OneToMany(mappedBy: 'customer', targetEntity: PlugNoghreOrder::class)]
|
#[ORM\OneToMany(mappedBy: 'customer', targetEntity: PlugNoghreOrder::class)]
|
||||||
private Collection $ordersFromCustomer;
|
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()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->hesabdariRows = new ArrayCollection();
|
$this->hesabdariRows = new ArrayCollection();
|
||||||
|
@ -327,4 +360,136 @@ class Person
|
||||||
|
|
||||||
return $this;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
hesabixCore/src/Fonts/Vazirmatn-Black.ttf
Normal file
BIN
hesabixCore/src/Fonts/Vazirmatn-Black.ttf
Normal file
Binary file not shown.
BIN
hesabixCore/src/Fonts/Vazirmatn-Bold.ttf
Normal file
BIN
hesabixCore/src/Fonts/Vazirmatn-Bold.ttf
Normal file
Binary file not shown.
BIN
hesabixCore/src/Fonts/Vazirmatn-ExtraBold.ttf
Normal file
BIN
hesabixCore/src/Fonts/Vazirmatn-ExtraBold.ttf
Normal file
Binary file not shown.
BIN
hesabixCore/src/Fonts/Vazirmatn-ExtraLight.ttf
Normal file
BIN
hesabixCore/src/Fonts/Vazirmatn-ExtraLight.ttf
Normal file
Binary file not shown.
BIN
hesabixCore/src/Fonts/Vazirmatn-Light.ttf
Normal file
BIN
hesabixCore/src/Fonts/Vazirmatn-Light.ttf
Normal file
Binary file not shown.
BIN
hesabixCore/src/Fonts/Vazirmatn-Medium.ttf
Normal file
BIN
hesabixCore/src/Fonts/Vazirmatn-Medium.ttf
Normal file
Binary file not shown.
BIN
hesabixCore/src/Fonts/Vazirmatn-Regular.ttf
Normal file
BIN
hesabixCore/src/Fonts/Vazirmatn-Regular.ttf
Normal file
Binary file not shown.
BIN
hesabixCore/src/Fonts/Vazirmatn-SemiBold.ttf
Normal file
BIN
hesabixCore/src/Fonts/Vazirmatn-SemiBold.ttf
Normal file
Binary file not shown.
BIN
hesabixCore/src/Fonts/Vazirmatn-Thin.ttf
Normal file
BIN
hesabixCore/src/Fonts/Vazirmatn-Thin.ttf
Normal file
Binary file not shown.
|
@ -7,8 +7,12 @@ use App\Entity\PlugNoghreOrder;
|
||||||
use App\Entity\PrinterQueue;
|
use App\Entity\PrinterQueue;
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Writer\Exception;
|
||||||
use ReflectionFunction;
|
use ReflectionFunction;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||||
|
|
||||||
class Provider
|
class Provider
|
||||||
{
|
{
|
||||||
|
@ -148,6 +152,22 @@ class Provider
|
||||||
return $print->getPid();
|
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
|
* function to generate random strings
|
||||||
* @param int $length number of characters in the generated string
|
* @param int $length number of characters in the generated string
|
||||||
|
|
|
@ -17,22 +17,33 @@ class pdfMGR
|
||||||
}
|
}
|
||||||
|
|
||||||
public function streamTwig2PDF(PrinterQueue $printQueue,$configs = []){
|
public function streamTwig2PDF(PrinterQueue $printQueue,$configs = []){
|
||||||
$data = [
|
|
||||||
|
|
||||||
];
|
$defaultConfig = (new \Mpdf\Config\ConfigVariables())->getDefaults();
|
||||||
|
$fontDirs = $defaultConfig['fontDir'];
|
||||||
|
|
||||||
$dompdf = new Dompdf();
|
$defaultFontConfig = (new \Mpdf\Config\FontVariables())->getDefaults();
|
||||||
$options = $dompdf->getOptions();
|
$fontData = $defaultFontConfig['fontdata'];
|
||||||
$options->setDefaultFont('DejaVuSans');
|
$mpdf = new \Mpdf\Mpdf([
|
||||||
$dompdf->setOptions($options);
|
'mode' => 'utf-8', 'format' => 'A4-L',
|
||||||
$dompdf->loadHtml($printQueue->getView());
|
'fontDir' => array_merge($fontDirs, [
|
||||||
$dompdf->render();
|
__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 (
|
$mpdf->WriteHTML($stylesheet,\Mpdf\HTMLParserMode::HEADER_CSS);
|
||||||
$dompdf->stream('resume', ["Attachment" => false]),
|
$mpdf->WriteHTML($printQueue->getView());
|
||||||
Response::HTTP_OK,
|
$mpdf->Output();
|
||||||
['Content-Type' => 'application/pdf']
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function imageToBase64($path) {
|
private function imageToBase64($path) {
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
<title>حسابیکس - {% block title %}{% endblock %}</title>
|
<title>حسابیکس - {% block title %}{% endblock %}</title>
|
||||||
{# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #}
|
{# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #}
|
||||||
{% block stylesheets %}
|
{% block stylesheets %}
|
||||||
{{ encore_entry_link_tags('app') }}
|
{#{{ encore_entry_link_tags('app') }}#}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block javascripts %}
|
{% block javascripts %}
|
||||||
{{ encore_entry_script_tags('app') }}
|
{#{{ encore_entry_script_tags('app') }}#}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
<!-- Icons -->
|
<!-- Icons -->
|
||||||
<link rel="icon" href="{{ asset('/favicon.ico') }}">
|
<link rel="icon" href="{{ asset('/favicon.ico') }}">
|
||||||
|
|
|
@ -1,19 +1,12 @@
|
||||||
<html>
|
<html dir="rtl">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
<title>چاپ</title>
|
<title>چاپ</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 style="text-align: center; margin-top: 0px; padding-top: 0px;">{{bid.name}}</h1>
|
<h3 style="text-align: center; margin-top: 0px; padding-top: 0px;">{{bid.name}}</h3>
|
||||||
<p style="text-align: center;">{{ page_title }}</p>
|
<p style="text-align: center;">{{ page_title }}</p>
|
||||||
<div style="width: 100%">
|
<div style="width: 100%">
|
||||||
{% block body %}{% endblock %}
|
{% block body %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
<br>
|
|
||||||
<p style="text-align: center">امضا:</p>
|
|
||||||
<p>
|
|
||||||
<span>نشانی: {{ bid.address }}</span>
|
|
||||||
<span>تلفن: {{ bid.tel }}</span>
|
|
||||||
<span style="float: left">ایمیل: <span style="direction: ltr">{{ bid.email }}</span> </span>
|
|
||||||
</p>
|
|
||||||
</body>
|
</body>
|
23
hesabixCore/templates/pdf/commodity.html.twig
Normal file
23
hesabixCore/templates/pdf/commodity.html.twig
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{% extends "pdf/base.html.twig" %}
|
||||||
|
{% block body %}
|
||||||
|
<table class="table mt-0 pt-0" style="border-color: black; float: right;" border="1"><caption> </caption>
|
||||||
|
<tbody>
|
||||||
|
<tr style="text-align: center; background-color: grey; color: white">
|
||||||
|
<td style="width: 35px;">ردیف</td>
|
||||||
|
<td>نام</td>
|
||||||
|
<td>واحد شمارش</td>
|
||||||
|
<td>قیمت فروش</td>
|
||||||
|
<td>قیمت خرید</td>
|
||||||
|
</tr>
|
||||||
|
{% for person in persons %}
|
||||||
|
<tr style="text-align: center">
|
||||||
|
<td>{{ loop.index }}</td>
|
||||||
|
<td>{{ person.name }}</td>
|
||||||
|
<td>{{ person.unit.name }}</td>
|
||||||
|
<td>{{ person.priceSell }}</td>
|
||||||
|
<td>{{ person.priceBuy }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{% endblock %}
|
0
hesabixCore/templates/pdf/header.html.twig
Normal file
0
hesabixCore/templates/pdf/header.html.twig
Normal file
|
@ -1,23 +1,45 @@
|
||||||
{% extends "pdf/base.html.twig" %}
|
{% extends "pdf/base.html.twig" %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<table style="border-color: black; float: right;" border="1"><caption> </caption>
|
<table class="table mt-0 pt-0" style="border:2px solid black"><caption> </caption>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr style="text-align: center; background-color: grey; color: white">
|
<tr style="text-align: center; background-color: grey; color: white">
|
||||||
<td style="width: 35px;">ردیف</td>
|
<td style="width: 35px;">ردیف</td>
|
||||||
<td>نام و نام خانوادگی</td>
|
<td style="border:1px solid black">نام و نام خانوادگی</td>
|
||||||
<td>نام مستعار</td>
|
<td style="border:1px solid black">نام مستعار</td>
|
||||||
<td>آدرس</td>
|
<td style="border:1px solid black">شرکت</td>
|
||||||
<td>تلفن</td>
|
<td style="border:1px solid black">شناسه ملی</td>
|
||||||
<td>موبایل</td>
|
<td style="border:1px solid black">شماره ثبت</td>
|
||||||
|
<td style="border:1px solid black">کد اقتصادی</td>
|
||||||
|
<td style="border:1px solid black">کشور</td>
|
||||||
|
<td style="border:1px solid black">استان</td>
|
||||||
|
<td style="border:1px solid black">شهر</td>
|
||||||
|
<td style="border:1px solid black">آدرس</td>
|
||||||
|
<td style="border:1px solid black">کد پستی</td>
|
||||||
|
<td style="border:1px solid black">تلفن</td>
|
||||||
|
<td style="border:1px solid black">موبایل</td>
|
||||||
|
<td style="border:1px solid black">فکس</td>
|
||||||
|
<td style="border:1px solid black">وب سایت</td>
|
||||||
|
<td style="border:1px solid black">پست الکترونیکی</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% for person in persons %}
|
{% for person in persons %}
|
||||||
<tr style="text-align: center">
|
<tr style="border:1px solid black" {% if loop.index is even%}class="bg-dark text-light"{% endif%}>
|
||||||
<td>{{ loop.index }}</td>
|
<td style="border:1px solid black">{{ loop.index }}</td>
|
||||||
<td>{{ person.name }}</td>
|
<td style="border:1px solid black">{{ person.name }}</td>
|
||||||
<td>{{ person.nikeName }}</td>
|
<td style="border:1px solid black">{{ person.nikeName }}</td>
|
||||||
<td>{{ person.address }}</td>
|
<td style="border:1px solid black">{{ person.company }}</td>
|
||||||
<td>{{ person.tel }}</td>
|
<td style="border:1px solid black">{{ person.shenasemeli }}</td>
|
||||||
<td>{{ person.mobile }}</td>
|
<td style="border:1px solid black">{{ person.sabt }}</td>
|
||||||
|
<td style="border:1px solid black">{{ person.codeeghtesadi }}</td>
|
||||||
|
<td style="border:1px solid black">{{ person.keshvar }}</td>
|
||||||
|
<td style="border:1px solid black">{{ person.ostan }}</td>
|
||||||
|
<td style="border:1px solid black">{{ person.shahr }}</td>
|
||||||
|
<td style="border:1px solid black">{{ person.address }}</td>
|
||||||
|
<td style="border:1px solid black">{{ person.postalcode }}</td>
|
||||||
|
<td style="border:1px solid black">{{ person.tel }}</td>
|
||||||
|
<td style="border:1px solid black">{{ person.mobile }}</td>
|
||||||
|
<td style="border:1px solid black">{{ person.fax }}</td>
|
||||||
|
<td style="border:1px solid black">{{ person.website }}</td>
|
||||||
|
<td style="border:1px solid black">{{ person.email }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
29
hesabixCore/templates/test-pdf.html.twig
Normal file
29
hesabixCore/templates/test-pdf.html.twig
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html dir="rtl">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta lang="fa">
|
||||||
|
<meta content="width=device-width,initial-scale=1.0" name="viewport"/>
|
||||||
|
<meta content="حسابیکس برترین نرم افزار حسابداری ابری و رایگان" name="description"/>
|
||||||
|
<meta content="Babak Alizadeh" name="author"/>
|
||||||
|
<style>
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Vazirmatn';
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
font-variant: normal;
|
||||||
|
src: url('fonts/Vazirmatn-Regular.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: 'Vazirmatn', sans-serif;
|
||||||
|
}
|
||||||
|
</style></head>
|
||||||
|
<body>
|
||||||
|
<div id="page-container">
|
||||||
|
fdsfds
|
||||||
|
<div style="font-family: 'Vazirmatn">صادق</div>
|
||||||
|
</div>
|
||||||
|
<script src=""></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,147 @@
|
||||||
|
<!DOCTYPE html PUBLIC " -//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width">
|
||||||
|
<style type="text/css">body, html {
|
||||||
|
direction: rtl;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
text-size-adjust: none;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
table td, table {
|
||||||
|
}
|
||||||
|
#outlook a {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
|
||||||
|
line-height: 100%;
|
||||||
|
}
|
||||||
|
.ExternalClass {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 480px) {
|
||||||
|
table, table tr td, table td {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
width: inherit;
|
||||||
|
}
|
||||||
|
.layer_2 {
|
||||||
|
max-width: 100% !important;
|
||||||
|
}
|
||||||
|
.edsocialfollowcontainer table {
|
||||||
|
max-width: 25% !important;
|
||||||
|
}
|
||||||
|
.edsocialfollowcontainer table td {
|
||||||
|
padding: 10px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
|
||||||
|
</head>
|
||||||
|
<body style="padding:0; margin: 0;">
|
||||||
|
<table align="center" style="width: 100%; height: 100%; background-color: #efefef;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td valign="top" id="dbody" data-version="2.31" style="padding-top: 50px; padding-bottom: 50px; background-color: #efefef; width: 100%;">
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table align="center" style="max-width:600px" width="600" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table align="center" style="max-width:600px" width="600" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<table class="layer_1" align="center" border="0" cellpadding="0" cellspacing="0" style="max-width: 600px; width: 100%; box-sizing: border-box; margin: 0px auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;">
|
||||||
|
<table class="edcontent" style="border-collapse: collapse;width:100%" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="edimg" valign="top" style="padding: 0px; box-sizing: border-box; text-align: center;">
|
||||||
|
<img style="border-width: 0px; border-style: none; max-width: 600px; width: 100%;" alt="Image" src="https://api.elasticemail.com/userfile/a18de9fc-4724-42f2-b203-4992ceddc1de/violetinvitation_top.jpg" width="600">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;">
|
||||||
|
<table class="edcontent" style="border-collapse: collapse;width:100%" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="edtext" valign="top" style="padding: 20px; color: #5f5f5f; font-size: 12px; font-family: Tahoma, Geneva, sans-serif; text-align: right; direction: rtl; box-sizing: border-box;">
|
||||||
|
<div class="style1" style="text-align: center; color: #000000; font-size: 28px; font-family: Helvetica, Arial, sans-serif;">
|
||||||
|
<strong>
|
||||||
|
<span style="color: #5f497a;">حسابیکس
|
||||||
|
</span>
|
||||||
|
<br>
|
||||||
|
</strong>
|
||||||
|
</div>
|
||||||
|
<span style="line-height: 2.25em;">
|
||||||
|
<span style="font-size: 18px;">
|
||||||
|
<p style="margin: 0px; padding: 0px;">
|
||||||
|
<br>
|
||||||
|
</p>
|
||||||
|
<div style="text-align: center;">
|
||||||
|
کد بازیابی کلمه عبور شما به شرح زیر می باشد.
|
||||||
|
<br>
|
||||||
|
در صورتی که شما درخواست بازیابی گذرواژه خود را نداشته اید این پیام را نادیده بگیرید.
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;">
|
||||||
|
<table border="0" cellspacing="0" cellpadding="0" class="edcontent" style="border-collapse: collapse;width:100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td valign="top" class="edbutton" style="padding: 20px;">
|
||||||
|
<table cellspacing="0" cellpadding="0" style="text-align: center; margin: 0px auto;" align="center">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td align="center" style="background: #ff0334; border-radius: 4px; padding: 12px;">
|
||||||
|
<a href="#" target="_blank" style="font-weight: bold; color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; width: 100%; display: inline-block;"><span style="color: #ffffff;">{{ code }}</span></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
145
hesabixCore/templates/user/email/reset-password.html.twig
Normal file
145
hesabixCore/templates/user/email/reset-password.html.twig
Normal file
|
@ -0,0 +1,145 @@
|
||||||
|
<!DOCTYPE html PUBLIC " -//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width">
|
||||||
|
<style type="text/css">body, html {
|
||||||
|
direction: rtl;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
text-size-adjust: none;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
table td, table {
|
||||||
|
}
|
||||||
|
#outlook a {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
|
||||||
|
line-height: 100%;
|
||||||
|
}
|
||||||
|
.ExternalClass {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 480px) {
|
||||||
|
table, table tr td, table td {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
width: inherit;
|
||||||
|
}
|
||||||
|
.layer_2 {
|
||||||
|
max-width: 100% !important;
|
||||||
|
}
|
||||||
|
.edsocialfollowcontainer table {
|
||||||
|
max-width: 25% !important;
|
||||||
|
}
|
||||||
|
.edsocialfollowcontainer table td {
|
||||||
|
padding: 10px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
|
||||||
|
</head>
|
||||||
|
<body style="padding:0; margin: 0;">
|
||||||
|
<table align="center" style="width: 100%; height: 100%; background-color: #efefef;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td valign="top" id="dbody" data-version="2.31" style="padding-top: 50px; padding-bottom: 50px; background-color: #efefef; width: 100%;">
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table align="center" style="max-width:600px" width="600" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table align="center" style="max-width:600px" width="600" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<table class="layer_1" align="center" border="0" cellpadding="0" cellspacing="0" style="max-width: 600px; width: 100%; box-sizing: border-box; margin: 0px auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;">
|
||||||
|
<table class="edcontent" style="border-collapse: collapse;width:100%" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="edimg" valign="top" style="padding: 0px; box-sizing: border-box; text-align: center;">
|
||||||
|
<img style="border-width: 0px; border-style: none; max-width: 600px; width: 100%;" alt="Image" src="https://api.elasticemail.com/userfile/a18de9fc-4724-42f2-b203-4992ceddc1de/violetinvitation_top.jpg" width="600">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;">
|
||||||
|
<table class="edcontent" style="border-collapse: collapse;width:100%" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="edtext" valign="top" style="padding: 20px; color: #5f5f5f; font-size: 12px; font-family: Tahoma, Geneva, sans-serif; text-align: right; direction: rtl; box-sizing: border-box;">
|
||||||
|
<div class="style1" style="text-align: center; color: #000000; font-size: 28px; font-family: Helvetica, Arial, sans-serif;">
|
||||||
|
<strong>
|
||||||
|
<span style="color: #5f497a;">حسابیکس
|
||||||
|
</span>
|
||||||
|
<br>
|
||||||
|
</strong>
|
||||||
|
</div>
|
||||||
|
<span style="line-height: 2.25em;">
|
||||||
|
<span style="font-size: 18px;">
|
||||||
|
<p style="margin: 0px; padding: 0px;">
|
||||||
|
<br>
|
||||||
|
</p>
|
||||||
|
<div style="text-align: center;">
|
||||||
|
کلمه عبور ورود به حسابیکس به درخواست شما تغییر یافت . جهت ورود از کلمه عبور زیر استفاده نمایید.
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="drow" valign="top" align="center" style="background-color: #ffffff; box-sizing: border-box; font-size: 0px;">
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]><table width="100%" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><![endif]-->
|
||||||
|
<div class="layer_2" style="max-width: 600px; width: 100%; display: inline-block; vertical-align: top; margin: 0px auto;">
|
||||||
|
<table border="0" cellspacing="0" cellpadding="0" class="edcontent" style="border-collapse: collapse;width:100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td valign="top" class="edbutton" style="padding: 20px;">
|
||||||
|
<table cellspacing="0" cellpadding="0" style="text-align: center; margin: 0px auto;" align="center">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td align="center" style="background: #ff0334; border-radius: 4px; padding: 12px;">
|
||||||
|
<a href="#" target="_blank" style="font-weight: bold; color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; width: 100%; display: inline-block;"><span style="color: #ffffff;">{{ code }}</span></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
<!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in a new issue