some progress in new face
This commit is contained in:
parent
6829d77730
commit
e0448c8d99
|
@ -3,16 +3,21 @@
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Entity\ArchiveFile;
|
use App\Entity\ArchiveFile;
|
||||||
|
use App\Entity\ArchiveOrders;
|
||||||
|
use App\Entity\Settings;
|
||||||
use App\Service\Access;
|
use App\Service\Access;
|
||||||
use App\Service\Jdate;
|
use App\Service\Jdate;
|
||||||
use App\Service\Log;
|
use App\Service\Log;
|
||||||
|
use App\Service\Notification;
|
||||||
use App\Service\Provider;
|
use App\Service\Provider;
|
||||||
|
use App\Service\twigFunctions;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
|
|
||||||
class ArchiveController extends AbstractController
|
class ArchiveController extends AbstractController
|
||||||
{
|
{
|
||||||
|
@ -22,9 +27,155 @@ class ArchiveController extends AbstractController
|
||||||
$acc = $access->hasRole('archiveInfo');
|
$acc = $access->hasRole('archiveInfo');
|
||||||
if(!$acc)
|
if(!$acc)
|
||||||
throw $this->createAccessDeniedException();
|
throw $this->createAccessDeniedException();
|
||||||
return $this->json([
|
$orders = $entityManager->getRepository(ArchiveOrders::class)->findBy([
|
||||||
'size' => $acc['bid']->getArchiveSize()
|
'bid'=>$acc['bid'],
|
||||||
|
'status'=>100
|
||||||
]);
|
]);
|
||||||
|
$totalSize = 0;
|
||||||
|
foreach ($orders as $order){
|
||||||
|
if($order->getExpireDate()>= time())
|
||||||
|
$totalSize += $order->getOrderSize();
|
||||||
|
}
|
||||||
|
$usedSize = 0;
|
||||||
|
$files = $entityManager->getRepository(ArchiveFile::class)->findBy(['bid'=>$acc['bid']]);
|
||||||
|
foreach ($files as $file)
|
||||||
|
$usedSize += $file->getFileSize();
|
||||||
|
return $this->json([
|
||||||
|
'size' => $totalSize * 1024,
|
||||||
|
'remain'=>$usedSize
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/api/archive/order/settings', name: 'app_archive_order_settings')]
|
||||||
|
public function app_archive_order_settings(twigFunctions $functions,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,$code = 0): JsonResponse
|
||||||
|
{
|
||||||
|
$acc = $access->hasRole('archiveInfo');
|
||||||
|
if(!$acc)
|
||||||
|
throw $this->createAccessDeniedException();
|
||||||
|
$settings = $functions->systemSettings();
|
||||||
|
return $this->json([
|
||||||
|
'priceBase' => $settings->getStoragePrice()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/api/archive/order/submit', name: 'app_archive_order_submit')]
|
||||||
|
public function app_archive_order_submit(twigFunctions $functions,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,$code = 0): JsonResponse
|
||||||
|
{
|
||||||
|
$acc = $access->hasRole('archiveInfo');
|
||||||
|
if(!$acc)
|
||||||
|
throw $this->createAccessDeniedException();
|
||||||
|
$params = [];
|
||||||
|
if ($content = $request->getContent()) {
|
||||||
|
$params = json_decode($content, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$order = new ArchiveOrders();
|
||||||
|
$order->setBid($acc['bid']);
|
||||||
|
$order->setSubmitter($this->getUser());
|
||||||
|
$order->setDateSubmit(time());
|
||||||
|
$order->setGatePay('zarinpal');
|
||||||
|
$order->setDes('خرید سرویس فضای ابری به مقدار ' . $params['space'] . ' گیگابایت به مدت ' . $params['month'] . ' ماه ');
|
||||||
|
|
||||||
|
$settings = $functions->systemSettings();
|
||||||
|
if(array_key_exists('space',$params) && array_key_exists('month',$params)){
|
||||||
|
$order->setPrice($params['space'] * $params['month'] * $settings->getStoragePrice());
|
||||||
|
$order->setOrderSize($params['space']);
|
||||||
|
$order->setMonth($params['month']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
throw $this->createAccessDeniedException();
|
||||||
|
$data = array("merchant_id" => $settings->getZarinpalMerchant(),
|
||||||
|
"amount" => $order->getPrice(),
|
||||||
|
"callback_url" => $this->generateUrl('api_archive_buy_verify',[],UrlGeneratorInterface::ABSOLUTE_URL),
|
||||||
|
"description" => 'خرید سرویس فضای ابری',
|
||||||
|
);
|
||||||
|
$jsonData = json_encode($data);
|
||||||
|
$ch = curl_init('https://api.zarinpal.com/pg/v4/payment/request.json');
|
||||||
|
curl_setopt($ch, CURLOPT_USERAGENT, 'ZarinPal Rest Api v1');
|
||||||
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'Content-Length: ' . strlen($jsonData)
|
||||||
|
));
|
||||||
|
|
||||||
|
$result = curl_exec($ch);
|
||||||
|
$err = curl_error($ch);
|
||||||
|
$result = json_decode($result, true, JSON_PRETTY_PRINT);
|
||||||
|
curl_close($ch);
|
||||||
|
if ($err) {
|
||||||
|
throw $this->createAccessDeniedException($err);
|
||||||
|
} else {
|
||||||
|
if (empty($result['errors'])) {
|
||||||
|
if ($result['data']['code'] == 100) {
|
||||||
|
$order->setStatus(0);
|
||||||
|
$order->setVerifyCode($result['data']['authority']);
|
||||||
|
$entityManager->persist($order);
|
||||||
|
$entityManager->flush();
|
||||||
|
$log->insert('سرویس فضای ابری','صدور فاکتور سرویس فضای ابری به مقدار ' . $params['space'] . ' گیگابایت به مدت ' . $params['month']. ' ماه ' ,$this->getUser(),$acc['bid']);
|
||||||
|
return $this->json([
|
||||||
|
'authority' => $result['data']["authority"]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw $this->createAccessDeniedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/api/archive/buy/verify', name: 'api_archive_buy_verify')]
|
||||||
|
public function api_archive_buy_verify(twigFunctions $functions,Notification $notification,Request $request,EntityManagerInterface $entityManager,Log $log): Response
|
||||||
|
{
|
||||||
|
$Authority = $request->get('Authority');
|
||||||
|
$req = $entityManager->getRepository(ArchiveOrders::class)->findOneBy(['verifyCode'=>$Authority]);
|
||||||
|
//get system settings
|
||||||
|
$settings = $functions->systemSettings();
|
||||||
|
$data = array("merchant_id" => $settings->getZarinpalMerchant(), "authority" => $Authority, "amount" => $req->getPrice());
|
||||||
|
$jsonData = json_encode($data);
|
||||||
|
$ch = curl_init('https://api.zarinpal.com/pg/v4/payment/verify.json');
|
||||||
|
curl_setopt($ch, CURLOPT_USERAGENT, 'ZarinPal Rest Api v4');
|
||||||
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'Content-Length: ' . strlen($jsonData)
|
||||||
|
));
|
||||||
|
|
||||||
|
$result = curl_exec($ch);
|
||||||
|
$err = curl_error($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
$result = json_decode($result, true);
|
||||||
|
|
||||||
|
//-----------------------------------
|
||||||
|
|
||||||
|
//-----------------------------------
|
||||||
|
if ($err) {
|
||||||
|
$log->insert('سرویس فضای ابری','پرداخت ناموفق سرویس فضای ابری' ,$this->getUser(),$req->getBid());
|
||||||
|
return $this->render('buy/fail.html.twig', ['results'=>$result]);
|
||||||
|
} else {
|
||||||
|
if(array_key_exists('code',$result['data'])){
|
||||||
|
if ($result['data']['code'] == 100) {
|
||||||
|
$req->setStatus($request->get('Status'));
|
||||||
|
$req->setRefID($result['data']['ref_id']);
|
||||||
|
$req->setCardPan($result['data']['card_pan']);
|
||||||
|
$req->setExpireDate(time() + ($req->getMonth() * 30 * 24 * 60 * 60));
|
||||||
|
$entityManager->persist($req);
|
||||||
|
$entityManager->flush();
|
||||||
|
$log->insert(
|
||||||
|
'سرویس فضای ابری',
|
||||||
|
'پرداخت موفق فاکتور سرویس فضای ابری',
|
||||||
|
$req->getSubmitter(),
|
||||||
|
$req->getBid()
|
||||||
|
);
|
||||||
|
$notification->insert(' فاکتور فضای ابری پرداخت شد.','/acc/sms/panel',$req->getBid(),$req->getSubmitter());
|
||||||
|
return $this->render('buy/success.html.twig',['req'=>$req]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$notification->insert('پرداخت فاکتور فضای ابری ناموفق بود','/',$req->getBid(),$req->getSubmitter());
|
||||||
|
$log->insert('سرویس پیامک','پرداخت ناموفق فاکتور فضای ابری' ,$this->getUser(),$req->getBid());
|
||||||
|
return $this->render('buy/fail.html.twig', ['results'=>$result]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/api/archive/list/{cat}', name: 'app_archive_list')]
|
#[Route('/api/archive/list/{cat}', name: 'app_archive_list')]
|
||||||
|
@ -56,4 +207,20 @@ class ArchiveController extends AbstractController
|
||||||
|
|
||||||
return $this->json($resp);
|
return $this->json($resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Route('/api/archive/orders/list', name: 'app_archive_orders_list')]
|
||||||
|
public function app_archive_orders_list(Jdate $jdate, Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,$code = 0): JsonResponse
|
||||||
|
{
|
||||||
|
$acc = $access->hasRole('archiveInfo');
|
||||||
|
if (!$acc)
|
||||||
|
throw $this->createAccessDeniedException();
|
||||||
|
$orders = $entityManager->getRepository(ArchiveOrders::class)->findBy([
|
||||||
|
'bid'=>$acc['bid']
|
||||||
|
],['id'=>'DESC']);
|
||||||
|
$resp = $provider->ArrayEntity2Array($orders,0);
|
||||||
|
foreach ($resp as &$item){
|
||||||
|
$item['dateSubmit'] = $jdate->jdate('Y/n/d H:i',$item['dateSubmit']);
|
||||||
|
}
|
||||||
|
return $this->json($resp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -389,7 +389,8 @@ class BusinessController extends AbstractController
|
||||||
'archiveUpload'=>true,
|
'archiveUpload'=>true,
|
||||||
'archiveMod'=>true,
|
'archiveMod'=>true,
|
||||||
'archiveDelete'=>true,
|
'archiveDelete'=>true,
|
||||||
'active'=> $perm->getUser()->isActive()
|
'active'=> $perm->getUser()->isActive(),
|
||||||
|
'shareholder'=>true,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
elseif($perm){
|
elseif($perm){
|
||||||
|
@ -422,7 +423,8 @@ class BusinessController extends AbstractController
|
||||||
'archiveUpload'=>$perm->isArchiveUpload(),
|
'archiveUpload'=>$perm->isArchiveUpload(),
|
||||||
'archiveMod'=>$perm->isArchiveMod(),
|
'archiveMod'=>$perm->isArchiveMod(),
|
||||||
'archiveDelete'=>$perm->isArchiveDelete(),
|
'archiveDelete'=>$perm->isArchiveDelete(),
|
||||||
'active'=> $perm->getUser()->isActive()
|
'active'=> $perm->getUser()->isActive(),
|
||||||
|
'shareholder'=> $perm->isShareholder(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
return $this->json($result);
|
return $this->json($result);
|
||||||
|
@ -483,6 +485,7 @@ class BusinessController extends AbstractController
|
||||||
$perm->setArchiveMod($params['archiveMod']);
|
$perm->setArchiveMod($params['archiveMod']);
|
||||||
$perm->setArchiveDelete($params['archiveDelete']);
|
$perm->setArchiveDelete($params['archiveDelete']);
|
||||||
$perm->setArchiveUpload($params['archiveUpload']);
|
$perm->setArchiveUpload($params['archiveUpload']);
|
||||||
|
$perm->setShareholder($params['shareholder']);
|
||||||
$entityManager->persist($perm);
|
$entityManager->persist($perm);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
$log->insert('تنظیمات پایه','ویرایش دسترسیهای کاربر با پست الکترونیکی ' . $user->getEmail() ,$this->getUser(),$business);
|
$log->insert('تنظیمات پایه','ویرایش دسترسیهای کاربر با پست الکترونیکی ' . $user->getEmail() ,$this->getUser(),$business);
|
||||||
|
|
30
hesabixCore/src/Controller/ShareHolderController.php
Normal file
30
hesabixCore/src/Controller/ShareHolderController.php
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use App\Entity\Shareholder;
|
||||||
|
use App\Service\Access;
|
||||||
|
use App\Service\Log;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
|
class ShareHolderController extends AbstractController
|
||||||
|
{
|
||||||
|
#[Route('/api/shareholder/list', name: 'app_shareholder_list')]
|
||||||
|
public function app_shareholder_list(Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
|
||||||
|
{
|
||||||
|
if(!$access->hasRole('shareholder'))
|
||||||
|
throw $this->createAccessDeniedException();
|
||||||
|
$datas = $entityManager->getRepository(Shareholder::class)->findBy([
|
||||||
|
'bid'=>$request->headers->get('activeBid')
|
||||||
|
]);
|
||||||
|
foreach($datas as $data){
|
||||||
|
|
||||||
|
}
|
||||||
|
return $this->json($datas);
|
||||||
|
}
|
||||||
|
}
|
|
@ -48,6 +48,12 @@ class ArchiveOrders
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
private ?string $ExpireDate = null;
|
private ?string $ExpireDate = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
|
private ?string $des = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $month = null;
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
|
@ -184,4 +190,28 @@ class ArchiveOrders
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDes(): ?string
|
||||||
|
{
|
||||||
|
return $this->des;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDes(?string $des): static
|
||||||
|
{
|
||||||
|
$this->des = $des;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMonth(): ?string
|
||||||
|
{
|
||||||
|
return $this->month;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMonth(string $month): static
|
||||||
|
{
|
||||||
|
$this->month = $month;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,6 +196,9 @@ class Business
|
||||||
#[ORM\OneToMany(mappedBy: 'bid', targetEntity: ArchiveOrders::class, orphanRemoval: true)]
|
#[ORM\OneToMany(mappedBy: 'bid', targetEntity: ArchiveOrders::class, orphanRemoval: true)]
|
||||||
private Collection $archiveOrders;
|
private Collection $archiveOrders;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(mappedBy: 'bid', targetEntity: Shareholder::class, orphanRemoval: true)]
|
||||||
|
private Collection $shareholders;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->logs = new ArrayCollection();
|
$this->logs = new ArrayCollection();
|
||||||
|
@ -219,6 +222,7 @@ class Business
|
||||||
$this->storeroomItems = new ArrayCollection();
|
$this->storeroomItems = new ArrayCollection();
|
||||||
$this->archiveFiles = new ArrayCollection();
|
$this->archiveFiles = new ArrayCollection();
|
||||||
$this->archiveOrders = new ArrayCollection();
|
$this->archiveOrders = new ArrayCollection();
|
||||||
|
$this->shareholders = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
|
@ -1287,4 +1291,34 @@ class Business
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Collection<int, Shareholder>
|
||||||
|
*/
|
||||||
|
public function getShareholders(): Collection
|
||||||
|
{
|
||||||
|
return $this->shareholders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addShareholder(Shareholder $shareholder): static
|
||||||
|
{
|
||||||
|
if (!$this->shareholders->contains($shareholder)) {
|
||||||
|
$this->shareholders->add($shareholder);
|
||||||
|
$shareholder->setBid($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeShareholder(Shareholder $shareholder): static
|
||||||
|
{
|
||||||
|
if ($this->shareholders->removeElement($shareholder)) {
|
||||||
|
// set the owning side to null (unless already changed)
|
||||||
|
if ($shareholder->getBid() === $this) {
|
||||||
|
$shareholder->setBid(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,6 +96,9 @@ class Permission
|
||||||
#[ORM\Column(nullable: true)]
|
#[ORM\Column(nullable: true)]
|
||||||
private ?bool $archiveDelete = null;
|
private ?bool $archiveDelete = null;
|
||||||
|
|
||||||
|
#[ORM\Column(nullable: true)]
|
||||||
|
private ?bool $shareholder = null;
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
|
@ -424,4 +427,16 @@ class Permission
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isShareholder(): ?bool
|
||||||
|
{
|
||||||
|
return $this->shareholder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setShareholder(?bool $shareholder): static
|
||||||
|
{
|
||||||
|
$this->shareholder = $shareholder;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,12 +110,16 @@ class Person
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
private ?string $birthday = null;
|
private ?string $birthday = null;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(mappedBy: 'person', targetEntity: Shareholder::class, orphanRemoval: true)]
|
||||||
|
private Collection $shareholders;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->hesabdariRows = new ArrayCollection();
|
$this->hesabdariRows = new ArrayCollection();
|
||||||
$this->plugNoghreOrders = new ArrayCollection();
|
$this->plugNoghreOrders = new ArrayCollection();
|
||||||
$this->ordersFromCustomer = new ArrayCollection();
|
$this->ordersFromCustomer = new ArrayCollection();
|
||||||
$this->storeroomTickets = new ArrayCollection();
|
$this->storeroomTickets = new ArrayCollection();
|
||||||
|
$this->shareholders = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
|
@ -542,4 +546,34 @@ class Person
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Collection<int, Shareholder>
|
||||||
|
*/
|
||||||
|
public function getShareholders(): Collection
|
||||||
|
{
|
||||||
|
return $this->shareholders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addShareholder(Shareholder $shareholder): static
|
||||||
|
{
|
||||||
|
if (!$this->shareholders->contains($shareholder)) {
|
||||||
|
$this->shareholders->add($shareholder);
|
||||||
|
$shareholder->setPerson($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeShareholder(Shareholder $shareholder): static
|
||||||
|
{
|
||||||
|
if ($this->shareholders->removeElement($shareholder)) {
|
||||||
|
// set the owning side to null (unless already changed)
|
||||||
|
if ($shareholder->getPerson() === $this) {
|
||||||
|
$shareholder->setPerson(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,9 @@ class Settings
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
private ?string $appSite = null;
|
private ?string $appSite = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
|
private ?string $storagePrice = null;
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
|
@ -92,4 +95,16 @@ class Settings
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getStoragePrice(): ?string
|
||||||
|
{
|
||||||
|
return $this->storagePrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setStoragePrice(?string $storagePrice): static
|
||||||
|
{
|
||||||
|
$this->storagePrice = $storagePrice;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
67
hesabixCore/src/Entity/Shareholder.php
Normal file
67
hesabixCore/src/Entity/Shareholder.php
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\ShareholderRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: ShareholderRepository::class)]
|
||||||
|
class Shareholder
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(inversedBy: 'shareholders')]
|
||||||
|
#[ORM\JoinColumn(nullable: false)]
|
||||||
|
private ?Business $bid = null;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(inversedBy: 'shareholders')]
|
||||||
|
#[ORM\JoinColumn(nullable: false)]
|
||||||
|
private ?Person $person = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $percent = null;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBid(): ?Business
|
||||||
|
{
|
||||||
|
return $this->bid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setBid(?Business $bid): static
|
||||||
|
{
|
||||||
|
$this->bid = $bid;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPerson(): ?Person
|
||||||
|
{
|
||||||
|
return $this->person;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPerson(?Person $person): static
|
||||||
|
{
|
||||||
|
$this->person = $person;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPercent(): ?int
|
||||||
|
{
|
||||||
|
return $this->percent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPercent(int $percent): static
|
||||||
|
{
|
||||||
|
$this->percent = $percent;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
48
hesabixCore/src/Repository/ShareholderRepository.php
Normal file
48
hesabixCore/src/Repository/ShareholderRepository.php
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Shareholder;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<Shareholder>
|
||||||
|
*
|
||||||
|
* @method Shareholder|null find($id, $lockMode = null, $lockVersion = null)
|
||||||
|
* @method Shareholder|null findOneBy(array $criteria, array $orderBy = null)
|
||||||
|
* @method Shareholder[] findAll()
|
||||||
|
* @method Shareholder[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||||
|
*/
|
||||||
|
class ShareholderRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Shareholder::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return Shareholder[] Returns an array of Shareholder objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('s')
|
||||||
|
// ->andWhere('s.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('s.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?Shareholder
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('s')
|
||||||
|
// ->andWhere('s.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{% extends "base.html.twig" %}
|
{% extends "base.html.twig" %}
|
||||||
{% block title %}نرم افزار حسابداری آنلاین ، متن باز و کاملا رایگان{% endblock %}
|
{% block title %}نرم افزار حسابداری آنلاین ، متن باز و کاملا رایگان{% endblock %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="px-4 py-3 text-center rounded-4 bg-light">
|
<div class="px-4 py-3 text-center rounded-4 bg-warning">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12 col-md-6">
|
<div class="col-sm-12 col-md-6">
|
||||||
<h1 class="fw-bold text-primary-darker">
|
<h1 class="fw-bold text-primary-darker">
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
<i class="fa fa-door-open"></i>
|
<i class="fa fa-door-open"></i>
|
||||||
ورود | عضویت رایگان
|
ورود | عضویت رایگان
|
||||||
</a>
|
</a>
|
||||||
<button href="http://insider.hesabix.ir" disabled="disabled" class="btn btn-outline-warning btn-lg px-4 gap-3">
|
<button href="http://insider.hesabix.ir" disabled="disabled" class="btn btn-outline-dark btn-lg px-4 gap-3">
|
||||||
<i class="fa fa-door-open"></i>
|
<i class="fa fa-door-open"></i>
|
||||||
پیشنمایش (فعلا غیرفعال است)
|
پیشنمایش (فعلا غیرفعال است)
|
||||||
</button>
|
</button>
|
||||||
|
@ -27,11 +27,9 @@
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12 col-md-6">
|
<div class="col-sm-12 col-md-6">
|
||||||
<img alt="پیش نمایش حسابیکس" class="img-fluid img-thumbnail" src="/img/cover.jpg" />
|
<img alt="پیش نمایش حسابیکس" class="img-fluid rounded-3" src="/img/cover.jpg" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue