progress on pdf and excel

This commit is contained in:
Hesabix 2023-09-30 21:01:00 +03:30
parent 0f4c26f5da
commit 5c4ad11fc2
33 changed files with 1705 additions and 171 deletions

33
.env
View file

@ -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
View file

@ -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 ###

View file

@ -5,6 +5,8 @@
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<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$/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$/vendor/symfony/maker-bundle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" />

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SwUserDefinedSpecifications">
<option name="specTypeByUrl">
<map />
</option>
</component>
</project>

View file

@ -1,5 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<include_path>
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" />
@ -75,9 +85,15 @@
<component name="PhpProjectSharedConfiguration" php_language_level="8.1">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" />
</phpunit_settings>
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project>

View file

@ -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 ###

View file

@ -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.*",

File diff suppressed because it is too large Load diff

View file

@ -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
{

View file

@ -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]]);
}
}

View file

@ -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();
$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));
}
}

View file

@ -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){
$user = $entityManager->getRepository(User::class)->findOneBy(['mobile'=>$params['email']]);
if(!$user)
throw $this->createNotFoundException('email not exist');
$user->setVerifyCode(1234);
}
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

View file

@ -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)]

View file

@ -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;
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -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

View file

@ -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) {

View file

@ -9,11 +9,11 @@
<title>حسابیکس - {% block title %}{% endblock %}</title>
{# 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 %}
<!-- Icons -->
<link rel="icon" href="{{ asset('/favicon.ico') }}">

View file

@ -1,19 +1,12 @@
<html>
<html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>چاپ</title>
</head>
<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>
<div style="width: 100%">
{% block body %}{% endblock %}
</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>

View 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>&nbsp;</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 %}

View file

@ -1,23 +1,45 @@
{% extends "pdf/base.html.twig" %}
{% block body %}
<table style="border-color: black; float: right;" border="1"><caption>&nbsp;</caption>
<table class="table mt-0 pt-0" style="border:2px solid black"><caption>&nbsp;</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>
<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>
<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>
{% for person in persons %}
<tr style="text-align: center">
<td>{{ loop.index }}</td>
<td>{{ person.name }}</td>
<td>{{ person.nikeName }}</td>
<td>{{ person.address }}</td>
<td>{{ person.tel }}</td>
<td>{{ person.mobile }}</td>
<tr style="border:1px solid black" {% if loop.index is even%}class="bg-dark text-light"{% endif%}>
<td style="border:1px solid black">{{ loop.index }}</td>
<td style="border:1px solid black">{{ person.name }}</td>
<td style="border:1px solid black">{{ person.nikeName }}</td>
<td style="border:1px solid black">{{ person.company }}</td>
<td style="border:1px solid black">{{ person.shenasemeli }}</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>
{% endfor %}
</tbody>

View 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>

View file

@ -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>

View 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>