progress and add new options to commodity

This commit is contained in:
Hesabix 2023-10-14 19:44:22 +03:30
parent 0b137a7f93
commit 7a799be9aa
33 changed files with 2442 additions and 33 deletions

View file

@ -354,16 +354,16 @@
},
{
"name": "doctrine/dbal",
"version": "3.7.0",
"version": "3.7.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "00d03067f07482f025d41ab55e4ba0db5eca2cdf"
"reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/00d03067f07482f025d41ab55e4ba0db5eca2cdf",
"reference": "00d03067f07482f025d41ab55e4ba0db5eca2cdf",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/5b7bd66c9ff58c04c5474ab85edce442f8081cb2",
"reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2",
"shasum": ""
},
"require": {
@ -447,7 +447,7 @@
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
"source": "https://github.com/doctrine/dbal/tree/3.7.0"
"source": "https://github.com/doctrine/dbal/tree/3.7.1"
},
"funding": [
{
@ -463,7 +463,7 @@
"type": "tidelift"
}
],
"time": "2023-09-26T20:56:55+00:00"
"time": "2023-10-06T05:06:20+00:00"
},
{
"name": "doctrine/deprecations",

View file

@ -71,6 +71,7 @@ class BusinessController extends AbstractController
$response['arzmain'] = $bus->getMoney()->getName();
$response['type'] = $bus->getType();
$response['zarinpalCode'] = $bus->getZarinpalCode();
$response['smsCharge'] = $bus->getSmsCharge();
return $this->json($response);
}
@ -184,6 +185,7 @@ class BusinessController extends AbstractController
$perms->setReport(true);
$perms->setAccounting(true);
$perms->setLog(true);
$perms->setStore(true);
$perms->setSalary(true);
$perms->setPermission(true);
$perms->setSalary(true);
@ -335,6 +337,7 @@ class BusinessController extends AbstractController
'persons'=>true,
'commodity'=>true,
'getpay'=>true,
'store'=>true,
'bank'=>true,
'bankTransfer'=>true,
'cost'=>true,
@ -372,6 +375,7 @@ class BusinessController extends AbstractController
'accounting'=>$perm->isAccounting(),
'report'=>$perm->isReport(),
'log'=>$perm->isLog(),
'store'=>$perm->isStore(),
'permission'=>$perm->isPermission(),
'salary'=>$perm->isSalary(),
'cashdesk'=>$perm->isCashdesk(),
@ -424,6 +428,7 @@ class BusinessController extends AbstractController
$perm->setBankTransfer($params['bankTransfer']);
$perm->setbuy($params['buy']);
$perm->setSell($params['sell']);
$perm->setStore($params['store']);
$perm->setCost($params['cost']);
$perm->setIncome($params['income']);
$perm->setAccounting($params['accounting']);
@ -487,7 +492,6 @@ class BusinessController extends AbstractController
'bid'=>$buss
]))
];
return $this->json($response);
}
}

View file

@ -2,9 +2,13 @@
namespace App\Controller;
use App\Entity\Business;
use App\Entity\Commodity;
use App\Entity\CommodityCat;
use App\Entity\CommodityDrop;
use App\Entity\CommodityUnit;
use App\Service\Access;
use App\Service\Jdate;
use App\Service\Log;
use App\Service\Provider;
use Doctrine\ORM\EntityManagerInterface;
@ -17,17 +21,29 @@ use Symfony\Component\Routing\Annotation\Route;
class CommodityController extends AbstractController
{
#[Route('/api/commodity/list', name: 'app_commodity_list')]
public function app_commodity_list(Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
public function app_commodity_list(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
if(!$access->hasRole('commodity'))
throw $this->createAccessDeniedException();
$items = $entityManager->getRepository(Commodity::class)->findBy([
'bid'=>$request->headers->get('activeBid')
]);
$res = [];
foreach ($items as $item){
$item->setUnit($item->getUnit()->getName());
$temp = [];
$temp['id'] = $item->getId();
$temp['name'] = $item->getName();
$temp['unit'] = $item->getUnit()->getName();
$temp['des'] = $item->getDes();
$temp['priceBuy'] = $item->getPriceBuy();
$temp['priceSell'] = $item->getPriceSell();
$temp['code'] = $item->getCode();
$temp['cat'] = null;
if($item->getCat())
$temp['cat'] = $item->getCat()->getName();
$res[] = $temp;
}
return $this->json($items);
return $this->json($res);
}
#[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
@ -59,7 +75,7 @@ class CommodityController extends AbstractController
'code'=>$code
]);
$data->setUnit($data->getUnit()->getName());
return $this->json($data);
return $this->json($provider->Entity2Array($data,0));
}
#[Route('/api/commodity/mod/{code}', name: 'app_commodity_mod')]
@ -105,6 +121,17 @@ class CommodityController extends AbstractController
$data->setDes($params['des']);
$data->setPriceSell($params['priceSell']);
$data->setPriceBuy($params['priceBuy']);
//set cat
if(array_key_exists('cat',$params)){
if($params['cat'] != null){
$cat = $entityManager->getRepository(CommodityCat::class)->find($params['cat']);
if($cat){
if($cat->getBid() == $acc['bid']){
$data->setCat($cat);
}
}
}
}
$entityManager->persist($data);
$entityManager->flush();
$log->insert('کالا و خدمات','کالا / خدمات با نام ' . $params['name'] . ' افزوده/ویرایش شد.',$this->getUser(),$request->headers->get('activeBid'));
@ -112,12 +139,242 @@ class CommodityController extends AbstractController
}
#[Route('/api/commodity/units', name: 'app_commodity_units')]
public function app_commodity_units(Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
public function app_commodity_units(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
if(!$access->hasRole('commodity'))
throw $this->createAccessDeniedException();
$items = $entityManager->getRepository(CommodityUnit::class)->findAll();
return $this->json($items);
}
#[Route('/api/commodity/drop/list', name: 'app_commodity_drop_list')]
public function app_commodity_drop_list(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
if(!$access->hasRole('commodity'))
throw $this->createAccessDeniedException();
$items = $entityManager->getRepository(CommodityDrop::class)->findBy([
'bid'=>$request->headers->get('activeBid')
]);
$generalItems = $entityManager->getRepository(CommodityDrop::class)->findBy([
'bid'=>null
]);
return $this->json($provider->ArrayEntity2Array(array_merge($items,$generalItems),0));
}
#[Route('/api/commodity/drop/mod/{code}', name: 'app_commodity_drop_mod')]
public function app_commodity_drop_mod(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,$code = 0): JsonResponse
{
$acc = $access->hasRole('commodity');
if(!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
if(!array_key_exists('name',$params))
return $this->json(['result'=>-1]);
if(count_chars(trim($params['name'])) == 0)
return $this->json(['result'=>3]);
if($code == 0){
$data = $entityManager->getRepository(CommodityDrop::class)->findOneBy([
'name'=>$params['name'],
'bid'=>$acc['bid']
]);
//check exist before
if($data)
return $this->json(['result'=>2]);
$data = new CommodityDrop();
}
else{
$data = $entityManager->getRepository(CommodityDrop::class)->findOneBy([
'bid'=>$acc['bid'],
'id'=>$code
]);
if(!$data)
throw $this->createNotFoundException();
}
$data->setName($params['name']);
$data->setBid($acc['bid']);
$data->setCanEdit(true);
$entityManager->persist($data);
$entityManager->flush();
$log->insert('کالا و خدمات','ویژگی کالا / خدمات با نام ' . $params['name'] . ' افزوده/ویرایش شد.',$this->getUser(),$request->headers->get('activeBid'));
return $this->json(['result' => 1]);
}
/**
* @throws \ReflectionException
*/
#[Route('/api/commodity/drop/info/{code}', name: 'app_commodity_drop_info')]
public function app_commodity_drop_info($code,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('commodity');
if(!$acc)
throw $this->createAccessDeniedException();
$data = $entityManager->getRepository(CommodityDrop::class)->findOneBy([
'bid'=>$acc['bid'],
'id'=>$code
]);
return $this->json($provider->Entity2Array($data,0));
}
#[Route('/api/commodity/cat/get', name: 'app_commodity_cat_get')]
public function app_commodity_cat_get(Jdate $jdate,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('commodity');
if(!$acc)
throw $this->createAccessDeniedException();
$temp =[];
$nodes = $entityManager->getRepository(CommodityCat::class)->findBy([
'bid'=>$acc['bid']
]);
if(count($nodes) == 0)
$nodes = $this->createDefaultCat($acc['bid'],$entityManager);
foreach ($nodes as $node){
if($this->hasChild($entityManager,$node)){
$temp[$node->getId()]=[
'text'=>$node->getName(),
'children'=>$this->getChildsLabel($entityManager,$node)
];
}
else{
$temp[$node->getId()]=[
'text'=>$node->getName(),
];
}
}
$root = $entityManager->getRepository(CommodityCat::class)->findOneBy([
'bid'=>$acc['bid'],
'root'=>true
]);
return $this->json(['items'=>$temp,'root'=>$root->getId()]);
}
#[Route('/api/commodity/cat/childs', name: 'app_commodity_cat_childs')]
public function app_commodity_cat_childs(Jdate $jdate,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('commodity');
if(!$acc)
throw $this->createAccessDeniedException();
$items= $entityManager->getRepository(CommodityCat::class)->findOneBy([
'bid'=>$acc['bid'],
'root'=>true
]);
return $this->json($this->getChilds($entityManager,$items));
}
#[Route('/api/commodity/cat/insert', name: 'app_commodity_cat_insert')]
public function app_commodity_cat_insert(Jdate $jdate,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('commodity');
if(!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
if(!array_key_exists('upper',$params) || !array_key_exists('text',$params))
return $this->json(['result'=>-1]);
$upper = $entityManager->getRepository(CommodityCat::class)->find($params['upper']);
if($upper){
if($upper->getBid() == $acc['bid']){
$cat = new CommodityCat();
$cat->setBid($acc['bid']);
$cat->setRoot(false);
$cat->setName($params['text']);
$cat->setUpper($upper->getId());
$entityManager->persist($cat);
$entityManager->flush();
return $this->json(['result'=>1,'id'=>$cat->getId()]);
}
}
return $this->json(['result'=>1]);
}
#[Route('/api/commodity/cat/edit', name: 'app_commodity_cat_edit')]
public function app_commodity_cat_edit(Jdate $jdate,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('commodity');
if(!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
if(!array_key_exists('id',$params) || !array_key_exists('text',$params))
return $this->json(['result'=>-1]);
$node = $entityManager->getRepository(CommodityCat::class)->find($params['id']);
if($node){
if($node->getBid() == $acc['bid']){
$node->setName($params['text']);
$entityManager->persist($node);
$entityManager->flush();
return $this->json(['result'=>1,'id'=>$node->getId()]);
}
}
return $this->json(['result'=>1]);
}
private function getChildsLabel(EntityManagerInterface $entityManager, mixed $node){
$childs = $entityManager->getRepository(CommodityCat::class)->findBy([
'upper'=>$node
]);
$temp = [];
foreach ($childs as $child){
$temp[] = $child->getId();
}
return $temp;
}
private function hasChild(EntityManagerInterface $entityManager, mixed $node)
{
if(count($entityManager->getRepository(CommodityCat::class)->findBy([
'upper'=>$node
]))!= 0)
return true;
return false;
}
private function getChilds(EntityManagerInterface $entityManager, mixed $node){
$childs = $entityManager->getRepository(CommodityCat::class)->findBy([
'upper'=>$node
]);
$temp = [];
foreach ($childs as $child){
if($this->hasChild($entityManager,$child)){
$temp[]=[
'id'=>$child->getId(),
'label'=>$child->getName(),
'children'=>$this->getChilds($entityManager,$child)
];
}
else{
$temp[]=[
'id'=>$child->getId(),
'label'=>$child->getName(),
];
}
}
return $temp;
}
public function createDefaultCat(Business $bid,EntityManagerInterface $en): array
{
$item = new CommodityCat();
$item->setName('دسته بندی ها');
$item->setUpper(null);
$item->setBid($bid);
$item->setRoot(true);
$en->persist($item);
$en->flush();
$child = new CommodityCat();
$child->setUpper($item->getId());
$child->setBid($bid);
$child->setName('بدون دسته‌بندی');
$en->persist($child);
$en->flush();
return [$item,$child];
}
}

View file

@ -0,0 +1,36 @@
<?php
namespace App\Controller\Front\Store;
use App\Entity\Business;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class StoreController extends AbstractController
{
protected $em;
public function __construct(EntityManagerInterface $entityManager)
{
$this->em = $entityManager;
}
private function CheckBID($id):bool|Business{
$bid = $this->em->getRepository(Business::class)->findOneBy(['storeUsername'=>$id]);
if(!$bid)
return false;
return $bid;
}
#[Route('/s/{id}', name: 'app_store')]
public function app_store(String $id,EntityManagerInterface $entityManager): Response
{
$bid = $this->CheckBID($id);
if(!$bid)
throw $this->createNotFoundException();
return $this->render('store/index.html.twig', [
'bid' => $bid,
]);
}
}

View file

@ -424,6 +424,34 @@ class HesabdariController extends AbstractController
'id'=>'DESC'
]);
}
elseif($params['type'] == 'cashdesk'){
$cashdesk = $entityManager->getRepository(Cashdesk::class)->findOneBy([
'bid'=>$acc['bid'],
'code'=>$params['id'],
]);
if(!$cashdesk)
throw $this->createNotFoundException();
$data = $entityManager->getRepository(HesabdariRow::class)->findBy([
'cashdesk'=> $cashdesk,
],[
'id'=>'DESC'
]);
}
elseif($params['type'] == 'salary'){
$salary = $entityManager->getRepository(Salary::class)->findOneBy([
'bid'=>$acc['bid'],
'code'=>$params['id'],
]);
if(!$salary)
throw $this->createNotFoundException();
$data = $entityManager->getRepository(HesabdariRow::class)->findBy([
'salary'=> $salary,
],[
'id'=>'DESC'
]);
}
$dataTemp =[];
foreach ($data as $item){
$temp = [

View file

@ -9,23 +9,39 @@ 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\Routing\Annotation\Route;
class LogController extends AbstractController
{
#[Route('/api/business/logs/{bid}', name: 'api_business_logs')]
public function api_business_logs(Access $access,String $bid, Jdate $jdate, EntityManagerInterface $entityManager,Log $log): JsonResponse
public function api_business_logs(Request $request,Access $access,String $bid, Jdate $jdate, EntityManagerInterface $entityManager,Log $log): JsonResponse
{
if(!$access->hasRole('log'))
throw $this->createAccessDeniedException();
$business = $entityManager->getRepository(Business::class)->find($bid);
if(!$business)
throw $this->createNotFoundException();
$logs = $entityManager->getRepository(\App\Entity\Log::class)->findBy(['bid'=>$business]);
$params = [];
$logs = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
if(array_key_exists('type',$params)){
if($params['type'] == 'sms')
$logs = $entityManager->getRepository(\App\Entity\Log::class)->findBy(['bid'=>$business,'part'=>'پیامک']);
}
else{
$logs = $entityManager->getRepository(\App\Entity\Log::class)->findBy(['bid'=>$business]);
}
$temps = [];
foreach ($logs as $log){
$temp = [];
$temp['user'] = $log->getUser()->getFullName();
if($log->getUser())
$temp['user'] = $log->getUser()->getFullName();
else
$temp['user'] = '';
$temp['des'] = $log->getDes();
$temp['part'] = $log->getPart();
$temp['date'] = $jdate->jdate('Y/n/d H:i',$log->getDateSubmit());

View file

@ -0,0 +1,213 @@
<?php
namespace App\Controller;
use App\Entity\Business;
use App\Entity\SMSPays;
use App\Entity\SMSSettings;
use App\Service\Access;
use App\Service\Jdate;
use App\Service\Log;
use App\Service\Notification;
use App\Service\Provider;
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 SMSController extends AbstractController
{
#[Route('/api/sms/save/settings', name: 'api_sms_save_settings')]
public function api_sms_save_settings(Access $access,Log $log,Request $request,EntityManagerInterface $entityManager): Response
{
$acc = $access->hasRole('owner');
if(!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
if(array_key_exists('settings',$params))
$params = $params['settings'];
$settings = $entityManager->getRepository(SMSSettings::class)->findOneBy([
'bid'=>$acc['bid']
]);
if(!$settings)
$settings = new SMSSettings();
$settings->setBid($acc['bid']);
if(array_key_exists('sendAfterSell',$params))
$settings->setSendAfterSell($params['sendAfterSell']);
if(array_key_exists('sendAfterSellPayOnline',$params))
$settings->setSendAfterSellPayOnline($params['sendAfterSellPayOnline']);
if(array_key_exists('sendAfterBuy',$params))
$settings->setSendAfterBuy($params['sendAfterBuy']);
if(array_key_exists('sendAfterBuyToUser',$params))
$settings->setSendAfterBuyToUser($params['sendAfterBuyToUser']);
$entityManager->persist($settings);
$entityManager->flush();
$log->insert('سرویس پیامک','به روز رسانی تنظیمات' ,$this->getUser(),$acc['bid']);
return $this->json(['result'=>1]);
}
/**
* @throws \ReflectionException
*/
#[Route('/api/sms/load/pays', name: 'api_sms_load_pays')]
public function api_sms_load_pays(Jdate $jdate,Provider $provider,Access $access,Log $log,Request $request,EntityManagerInterface $entityManager): Response
{
$acc = $access->hasRole('owner');
if(!$acc)
throw $this->createAccessDeniedException();
$items = $entityManager->getRepository(SMSPays::class)->findBy([
'bid'=>$acc['bid']
],['id'=>'DESC']);
$res = [];
foreach ($items as $item){
$temp = [];
$temp['des']=$item->getDes();
$temp['submitter']=$item->getSubmitter()->getFullName();
$temp['dateSubmit']=$jdate->jdate('Y/n/d H:i',$item->getDateSubmit());
$temp['status'] = $item->getStatus();
$temp['price'] = number_format($item->getPrice());
$res[] = $temp;
}
return $this->json($res);
}
/**
* @throws \ReflectionException
*/
#[Route('/api/sms/load/settings', name: 'api_sms_load_settings')]
public function api_sms_load_settings(Provider $provider,Access $access,Log $log,Request $request,EntityManagerInterface $entityManager): Response
{
$acc = $access->hasRole('owner');
if(!$acc)
throw $this->createAccessDeniedException();
$settings = $entityManager->getRepository(SMSSettings::class)->findOneBy([
'bid'=>$acc['bid']
]);
if(!$settings)
$settings = new SMSSettings();
return $this->json($provider->Entity2Array($settings,0));
}
#[Route('/api/sms/charge', name: 'api_sms_charge')]
public function api_sms_charge(Log $log,Notification $notification,Request $request,Access $access,EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('owner');
if(!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
if(!array_key_exists('price',$params))
throw $this->createAccessDeniedException('price not set');
$data = array("merchant_id" => "a7804652-1fb9-4b43-911c-0a1046e61be1",
"amount" => $params['price'],
"callback_url" => "http://hesabix.local/api/sms/buy/verify",
"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) {
$smsPay = new SMSPays();
$smsPay->setBid($acc['bid']);
$smsPay->setDateSubmit(time());
$smsPay->setSubmitter($this->getUser());
$smsPay->setDes('افزایش اعتبار سرویس پیامک');
$smsPay->setPrice($params['price']);
$smsPay->setStatus(0);
$smsPay->setVerifyCode($result['data']['authority']);
$smsPay->setGatePay('zarinpal');
$entityManager->persist($smsPay);
$entityManager->flush();
$log->insert('سرویس پیامک','صدور فاکتور شارژ سرویس پیامک' ,$this->getUser(),$acc['bid']);
return $this->json([
'authority' => $result['data']["authority"]
]);
}
}
}
throw $this->createAccessDeniedException();
}
#[Route('/api/sms/buy/verify', name: 'api_sms_buy_verify')]
public function api_sms_buy_verify(Notification $notification,Request $request,EntityManagerInterface $entityManager,Log $log): Response
{
$Authority = $request->get('Authority');
$status = $request->get('Status');
$req = $entityManager->getRepository(SMSPays::class)->findOneBy(['verifyCode'=>$Authority]);
$data = array("merchant_id" => "a7804652-1fb9-4b43-911c-0a1046e61be1", "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(100);
$req->setRefID($result['data']['ref_id']);
$req->setCardPan($result['data']['card_pan']);
$req->getBid()->setSmsCharge($req->getBid()->getSmsCharge() + ($req->getPrice()/1.09));
$entityManager->persist($req);
$entityManager->flush();
$log->insert(
'سرویس پیامک',
'افزایش اعتبار سرویس پیامک به مبلغ: ' . $req->getPrice() . ' ریال ',
$req->getSubmitter(),
$req->getBid()
);
$log->insert('سرویس پیامک','پرداخت ناموفق شارژ سرویس پیامک' ,$this->getUser(),$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]);
}
}
}

View file

@ -0,0 +1,94 @@
<?php
namespace App\Controller;
use App\Entity\Storeroom;
use App\Service\Access;
use App\Service\Log;
use App\Service\Provider;
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 StoreroomController extends AbstractController
{
#[Route('/api/storeroom/list', name: 'app_storeroom_list')]
public function app_storeroom_list(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('store');
if(!$acc)
throw $this->createAccessDeniedException();
$items = $entityManager->getRepository(Storeroom::class)->findBy([
'bid'=>$acc['bid']
]);
return $this->json($provider->ArrayEntity2Array($items,0));
}
#[Route('/api/storeroom/mod/{code}', name: 'app_storeroom_mod')]
public function app_storeroom_mod(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,$code = 0): JsonResponse
{
$acc = $access->hasRole('store');
if(!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
if(!array_key_exists('name',$params))
return $this->json(['result'=>-1]);
if(count_chars(trim($params['name'])) == 0)
return $this->json(['result'=>3]);
if($code == 0){
$data = $entityManager->getRepository(Storeroom::class)->findOneBy([
'name'=>$params['name'],
'bid'=>$acc['bid']
]);
//check exist before
if($data)
return $this->json(['result'=>2]);
$data = new Storeroom();
$data->setBid($acc['bid']);
}
else{
$data = $entityManager->getRepository(Storeroom::class)->findOneBy([
'bid'=>$acc['bid'],
'id'=>$code
]);
if(!$data)
throw $this->createNotFoundException();
}
$data->setName($params['name']);
$data->setAdr($params['adr']);
$data->setManager($params['manager']);
$data->setTel($params['tel']);
if($params['active'] == 'true')
$data->setActive(true);
else
$data->setActive(false);
$entityManager->persist($data);
$entityManager->flush();
$log->insert('انبارداری','انبار ' . $params['name'] . ' افزوده/ویرایش شد.',$this->getUser(),$acc['bid']);
return $this->json(['result' => 1]);
}
/**
* @throws \ReflectionException
*/
#[Route('/api/storeroom/info/{code}', name: 'app_storeroom_info')]
public function app_storeroom_info($code,Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('store');
if(!$acc)
throw $this->createAccessDeniedException();
$data = $entityManager->getRepository(Storeroom::class)->findOneBy([
'bid'=>$acc['bid'],
'id'=>$code
]);
return $this->json($provider->Entity2Array($data,0));
}
}

View file

@ -39,7 +39,7 @@ class SupportController extends AbstractController
$params = json_decode($content, true);
}
if($id == ''){
if(array_key_exists('title',$params) && array_key_exists('body',$params) && array_key_exists('bid',$params)){
if(array_key_exists('title',$params) && array_key_exists('body',$params)){
$item = new Support();
$item->setBody($params['body']);
$item->setTitle($params['title']);

View file

@ -0,0 +1,84 @@
<?php
namespace App\Controller;
use App\Entity\HesabdariDoc;
use App\Entity\HesabdariRow;
use App\Service\Access;
use App\Service\Log;
use App\Service\Provider;
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 TransferController extends AbstractController
{
#[Route('/api/transfer/search', name: 'app_transfer_search')]
public function app_transfer_search(Provider $provider,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('transfer');
if(!$acc)
throw $this->createAccessDeniedException();
$items = $entityManager->getRepository(HesabdariDoc::class)->findBy([
'bid'=>$acc['bid'],
'type'=>'transfer',
'year'=>$acc['year']
]);
$resp = [];
foreach ($items as $item){
$temp = [];
$temp['submitter']= $item->getSubmitter()->getFullName();
$temp['code']= $item->getCode();
$temp['date']= $item->getDate();
$temp['des']= $item->getDes();
$temp['amount']= $item->getAmount();
$rows = $entityManager->getRepository(HesabdariRow::class)->findBy([
'doc'=>$item
]);
$fromType = '';
$fromObject = '';
$toType = '';
$toObject = '';
foreach ($rows as $row){
if($row->getBs()!=0){
//it is from
if($row->getBank()){
$fromType = 'bank';
$fromObject = $row->getBank()->getName();
}
elseif($row->getSalary()){
$fromType = 'salary';
$fromObject = $row->getSalary()->getName();
}
elseif($row->getCashdesk()){
$fromType = 'cashDesk';
$fromObject = $row->getCashdesk()->getName();
}
}
else{
if($row->getBank()){
$toType = 'bank';
$toObject = $row->getBank()->getName();
}
elseif($row->getSalary()){
$toType = 'salary';
$toObject = $row->getSalary()->getName();
}
elseif($row->getCashdesk()){
$toType = 'cashDesk';
$toObject = $row->getCashdesk()->getName();
}
}
}
$temp['fromType']= $fromType;
$temp['fromObject']= $fromObject;
$temp['toType']= $toType;
$temp['toObject']= $toObject;
$resp[] = $temp;
}
return $this->json($resp);
}
}

View file

@ -231,6 +231,7 @@ class UserController extends AbstractController
$user->setFullName($params['name']);
$user->setMobile($params['mobile']);
$user->setVerifyCodeTime(time() + 300);
$user->setVerifyCode($this->RandomString(6,true));
$user->setDateRegister(time());
$user->setPassword(
$userPasswordHasher->hashPassword(
@ -241,6 +242,22 @@ class UserController extends AbstractController
$user->setActive(false);
$entityManager->persist($user);
$entityManager->flush();
$SMS->send([$user->getVerifyCode()],'162246',$user->getMobile());
try {
$email = (new Email())
->to($user->getEmail())
->priority(Email::PRIORITY_HIGH)
->subject('تایید ایمیل در حسابیکس')
->html(
$this->renderView('user/email/confrim-register.html.twig',[
'code'=>$user->getVerifyCode()
])
);
$mailer->send($email);
}catch (Exception $exception){
}
return $this->json([
'error'=> 0,
'id'=>$user->getId(),

View file

@ -138,6 +138,27 @@ class Business
#[ORM\JoinColumn(nullable: false)]
private ?User $owner = null;
#[ORM\Column(nullable: true)]
private ?bool $storeOnline = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $storeUsername = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $smsCharge = null;
#[ORM\OneToMany(mappedBy: 'bid', targetEntity: SMSPays::class, orphanRemoval: true)]
private Collection $sMSPays;
#[ORM\OneToMany(mappedBy: 'bid', targetEntity: SMSSettings::class, orphanRemoval: true)]
private Collection $sMSSettings;
#[ORM\OneToMany(mappedBy: 'bid', targetEntity: CommodityDrop::class)]
private Collection $commodityDrops;
#[ORM\OneToMany(mappedBy: 'bid', targetEntity: Storeroom::class, orphanRemoval: true)]
private Collection $storerooms;
public function __construct()
{
$this->logs = new ArrayCollection();
@ -152,6 +173,10 @@ class Business
$this->notifications = new ArrayCollection();
$this->plugins = new ArrayCollection();
$this->plugNoghreOrders = new ArrayCollection();
$this->sMSPays = new ArrayCollection();
$this->sMSSettings = new ArrayCollection();
$this->commodityDrops = new ArrayCollection();
$this->storerooms = new ArrayCollection();
}
public function getId(): ?int
@ -852,4 +877,161 @@ class Business
return $this;
}
public function isStoreOnline(): ?bool
{
return $this->storeOnline;
}
public function setStoreOnline(?bool $storeOnline): static
{
$this->storeOnline = $storeOnline;
return $this;
}
public function getStoreUsername(): ?string
{
return $this->storeUsername;
}
public function setStoreUsername(?string $storeUsername): static
{
$this->storeUsername = $storeUsername;
return $this;
}
public function getSmsCharge(): ?string
{
if(!$this->smsCharge) return 0;
return $this->smsCharge;
}
public function setSmsCharge(?string $smsCharge): static
{
$this->smsCharge = $smsCharge;
return $this;
}
/**
* @return Collection<int, SMSPays>
*/
public function getSMSPays(): Collection
{
return $this->sMSPays;
}
public function addSMSPay(SMSPays $sMSPay): static
{
if (!$this->sMSPays->contains($sMSPay)) {
$this->sMSPays->add($sMSPay);
$sMSPay->setBid($this);
}
return $this;
}
public function removeSMSPay(SMSPays $sMSPay): static
{
if ($this->sMSPays->removeElement($sMSPay)) {
// set the owning side to null (unless already changed)
if ($sMSPay->getBid() === $this) {
$sMSPay->setBid(null);
}
}
return $this;
}
/**
* @return Collection<int, SMSSettings>
*/
public function getSMSSettings(): Collection
{
return $this->sMSSettings;
}
public function addSMSSetting(SMSSettings $sMSSetting): static
{
if (!$this->sMSSettings->contains($sMSSetting)) {
$this->sMSSettings->add($sMSSetting);
$sMSSetting->setBid($this);
}
return $this;
}
public function removeSMSSetting(SMSSettings $sMSSetting): static
{
if ($this->sMSSettings->removeElement($sMSSetting)) {
// set the owning side to null (unless already changed)
if ($sMSSetting->getBid() === $this) {
$sMSSetting->setBid(null);
}
}
return $this;
}
/**
* @return Collection<int, CommodityDrop>
*/
public function getCommodityDrops(): Collection
{
return $this->commodityDrops;
}
public function addCommodityDrop(CommodityDrop $commodityDrop): static
{
if (!$this->commodityDrops->contains($commodityDrop)) {
$this->commodityDrops->add($commodityDrop);
$commodityDrop->setBid($this);
}
return $this;
}
public function removeCommodityDrop(CommodityDrop $commodityDrop): static
{
if ($this->commodityDrops->removeElement($commodityDrop)) {
// set the owning side to null (unless already changed)
if ($commodityDrop->getBid() === $this) {
$commodityDrop->setBid(null);
}
}
return $this;
}
/**
* @return Collection<int, Storeroom>
*/
public function getStorerooms(): Collection
{
return $this->storerooms;
}
public function addStoreroom(Storeroom $storeroom): static
{
if (!$this->storerooms->contains($storeroom)) {
$this->storerooms->add($storeroom);
$storeroom->setBid($this);
}
return $this;
}
public function removeStoreroom(Storeroom $storeroom): static
{
if ($this->storerooms->removeElement($storeroom)) {
// set the owning side to null (unless already changed)
if ($storeroom->getBid() === $this) {
$storeroom->setBid(null);
}
}
return $this;
}
}

View file

@ -48,11 +48,18 @@ class Commodity
#[ORM\Column(nullable: true)]
private ?bool $khadamat = null;
#[ORM\OneToMany(mappedBy: 'commodity', targetEntity: CommodityDropLink::class, orphanRemoval: true)]
private Collection $commodityDropLinks;
#[ORM\ManyToOne(inversedBy: 'commodities')]
private ?CommodityCat $cat = null;
public function __construct()
{
$this->setPriceBuy(0);
$this->setPriceSell(0);
$this->hesabdariRows = new ArrayCollection();
$this->commodityDropLinks = new ArrayCollection();
}
public function getId(): ?int
@ -185,4 +192,46 @@ class Commodity
return $this;
}
/**
* @return Collection<int, CommodityDropLink>
*/
public function getCommodityDropLinks(): Collection
{
return $this->commodityDropLinks;
}
public function addCommodityDropLink(CommodityDropLink $commodityDropLink): static
{
if (!$this->commodityDropLinks->contains($commodityDropLink)) {
$this->commodityDropLinks->add($commodityDropLink);
$commodityDropLink->setCommodity($this);
}
return $this;
}
public function removeCommodityDropLink(CommodityDropLink $commodityDropLink): static
{
if ($this->commodityDropLinks->removeElement($commodityDropLink)) {
// set the owning side to null (unless already changed)
if ($commodityDropLink->getCommodity() === $this) {
$commodityDropLink->setCommodity(null);
}
}
return $this;
}
public function getCat(): ?CommodityCat
{
return $this->cat;
}
public function setCat(?CommodityCat $cat): static
{
$this->cat = $cat;
return $this;
}
}

View file

@ -0,0 +1,121 @@
<?php
namespace App\Entity;
use App\Repository\CommodityCatRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CommodityCatRepository::class)]
class CommodityCat
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?Business $bid = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $upper = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(nullable: true)]
private ?bool $root = null;
#[ORM\OneToMany(mappedBy: 'cat', targetEntity: Commodity::class)]
private Collection $commodities;
public function __construct()
{
$this->commodities = new ArrayCollection();
}
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 getUpper(): ?string
{
return $this->upper;
}
public function setUpper(?string $upper): static
{
$this->upper = $upper;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function isRoot(): ?bool
{
return $this->root;
}
public function setRoot(?bool $root): static
{
$this->root = $root;
return $this;
}
/**
* @return Collection<int, Commodity>
*/
public function getCommodities(): Collection
{
return $this->commodities;
}
public function addCommodity(Commodity $commodity): static
{
if (!$this->commodities->contains($commodity)) {
$this->commodities->add($commodity);
$commodity->setCat($this);
}
return $this;
}
public function removeCommodity(Commodity $commodity): static
{
if ($this->commodities->removeElement($commodity)) {
// set the owning side to null (unless already changed)
if ($commodity->getCat() === $this) {
$commodity->setCat(null);
}
}
return $this;
}
}

View file

@ -0,0 +1,135 @@
<?php
namespace App\Entity;
use App\Repository\CommodityDropRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CommodityDropRepository::class)]
class CommodityDrop
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'commodityDrops')]
private ?Business $bid = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $UDPrice = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $UDPricePercent = null;
#[ORM\OneToMany(mappedBy: 'commoditydrop', targetEntity: CommodityDropLink::class, orphanRemoval: true)]
private Collection $commodityDropLinks;
#[ORM\Column(nullable: true)]
private ?bool $canEdit = null;
public function __construct()
{
$this->commodityDropLinks = new ArrayCollection();
}
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 getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getUDPrice(): ?string
{
return $this->UDPrice;
}
public function setUDPrice(?string $UDPrice): static
{
$this->UDPrice = $UDPrice;
return $this;
}
public function getUDPricePercent(): ?string
{
return $this->UDPricePercent;
}
public function setUDPricePercent(?string $UDPricePercent): static
{
$this->UDPricePercent = $UDPricePercent;
return $this;
}
/**
* @return Collection<int, CommodityDropLink>
*/
public function getCommodityDropLinks(): Collection
{
return $this->commodityDropLinks;
}
public function addCommodityDropLink(CommodityDropLink $commodityDropLink): static
{
if (!$this->commodityDropLinks->contains($commodityDropLink)) {
$this->commodityDropLinks->add($commodityDropLink);
$commodityDropLink->setCommoditydrop($this);
}
return $this;
}
public function removeCommodityDropLink(CommodityDropLink $commodityDropLink): static
{
if ($this->commodityDropLinks->removeElement($commodityDropLink)) {
// set the owning side to null (unless already changed)
if ($commodityDropLink->getCommoditydrop() === $this) {
$commodityDropLink->setCommoditydrop(null);
}
}
return $this;
}
public function isCanEdit(): ?bool
{
return $this->canEdit;
}
public function setCanEdit(?bool $canEdit): static
{
$this->canEdit = $canEdit;
return $this;
}
}

View file

@ -0,0 +1,67 @@
<?php
namespace App\Entity;
use App\Repository\CommodityDropLinkRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CommodityDropLinkRepository::class)]
class CommodityDropLink
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'commodityDropLinks')]
#[ORM\JoinColumn(nullable: false)]
private ?CommodityDrop $commoditydrop = null;
#[ORM\ManyToOne(inversedBy: 'commodityDropLinks')]
#[ORM\JoinColumn(nullable: false)]
private ?Commodity $commodity = null;
#[ORM\Column(length: 255)]
private ?string $value = null;
public function getId(): ?int
{
return $this->id;
}
public function getCommoditydrop(): ?CommodityDrop
{
return $this->commoditydrop;
}
public function setCommoditydrop(?CommodityDrop $commoditydrop): static
{
$this->commoditydrop = $commoditydrop;
return $this;
}
public function getCommodity(): ?Commodity
{
return $this->commodity;
}
public function setCommodity(?Commodity $commodity): static
{
$this->commodity = $commodity;
return $this;
}
public function getValue(): ?string
{
return $this->value;
}
public function setValue(string $value): static
{
$this->value = $value;
return $this;
}
}

View file

@ -81,6 +81,9 @@ class Permission
#[ORM\Column(nullable: true)]
private ?bool $plugCCAdmin = null;
#[ORM\Column(nullable: true)]
private ?bool $store = null;
public function getId(): ?int
{
return $this->id;
@ -349,4 +352,16 @@ class Permission
return $this;
}
public function isStore(): ?bool
{
return $this->store;
}
public function setStore(?bool $store): static
{
$this->store = $store;
return $this;
}
}

View file

@ -0,0 +1,172 @@
<?php
namespace App\Entity;
use App\Repository\SMSPaysRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SMSPaysRepository::class)]
class SMSPays
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'sMSPays')]
#[ORM\JoinColumn(nullable: false)]
private ?Business $bid = null;
#[ORM\ManyToOne(inversedBy: 'sMSPays')]
#[ORM\JoinColumn(nullable: false)]
private ?User $submitter = null;
#[ORM\Column(length: 255)]
private ?string $dateSubmit = null;
#[ORM\Column(length: 255)]
private ?string $price = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $des = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $status = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $refID = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $cardPan = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $verifyCode = null;
#[ORM\Column(length: 255)]
private ?string $gatePay = 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 getSubmitter(): ?User
{
return $this->submitter;
}
public function setSubmitter(?User $submitter): static
{
$this->submitter = $submitter;
return $this;
}
public function getDateSubmit(): ?string
{
return $this->dateSubmit;
}
public function setDateSubmit(string $dateSubmit): static
{
$this->dateSubmit = $dateSubmit;
return $this;
}
public function getPrice(): ?string
{
return $this->price;
}
public function setPrice(string $price): static
{
$this->price = $price;
return $this;
}
public function getDes(): ?string
{
return $this->des;
}
public function setDes(?string $des): static
{
$this->des = $des;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): static
{
$this->status = $status;
return $this;
}
public function getRefID(): ?string
{
return $this->refID;
}
public function setRefID(?string $refID): static
{
$this->refID = $refID;
return $this;
}
public function getCardPan(): ?string
{
return $this->cardPan;
}
public function setCardPan(?string $cardPan): static
{
$this->cardPan = $cardPan;
return $this;
}
public function getVerifyCode(): ?string
{
return $this->verifyCode;
}
public function setVerifyCode(?string $verifyCode): static
{
$this->verifyCode = $verifyCode;
return $this;
}
public function getGatePay(): ?string
{
return $this->gatePay;
}
public function setGatePay(string $gatePay): static
{
$this->gatePay = $gatePay;
return $this;
}
}

View file

@ -0,0 +1,96 @@
<?php
namespace App\Entity;
use App\Repository\SMSSettingsRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SMSSettingsRepository::class)]
class SMSSettings
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'sMSSettings')]
#[ORM\JoinColumn(nullable: false)]
private ?Business $bid = null;
#[ORM\Column(nullable: true)]
private ?bool $sendAfterSell = false;
#[ORM\Column(nullable: true)]
private ?bool $sendAfterSellPayOnline = false;
#[ORM\Column(nullable: true)]
private ?bool $sendAfterBuy = false;
#[ORM\Column(nullable: true)]
private ?bool $sendAfterBuyToUser = false;
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 isSendAfterSell(): ?bool
{
return $this->sendAfterSell;
}
public function setSendAfterSell(?bool $sendAfterSell): static
{
$this->sendAfterSell = $sendAfterSell;
return $this;
}
public function isSendAfterSellPayOnline(): ?bool
{
return $this->sendAfterSellPayOnline;
}
public function setSendAfterSellPayOnline(?bool $sendAfterSellPayOnline): static
{
$this->sendAfterSellPayOnline = $sendAfterSellPayOnline;
return $this;
}
public function isSendAfterBuy(): ?bool
{
return $this->sendAfterBuy;
}
public function setSendAfterBuy(?bool $sendAfterBuy): static
{
$this->sendAfterBuy = $sendAfterBuy;
return $this;
}
public function isSendAfterBuyToUser(): ?bool
{
return $this->sendAfterBuyToUser;
}
public function setSendAfterBuyToUser(?bool $sendAfterBuyToUser): static
{
$this->sendAfterBuyToUser = $sendAfterBuyToUser;
return $this;
}
}

View file

@ -0,0 +1,111 @@
<?php
namespace App\Entity;
use App\Repository\StoreroomRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StoreroomRepository::class)]
class Storeroom
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\ManyToOne(inversedBy: 'storerooms')]
#[ORM\JoinColumn(nullable: false)]
private ?Business $bid = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $manager = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $adr = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $tel = null;
#[ORM\Column(nullable: true)]
private ?bool $active = null;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getBid(): ?Business
{
return $this->bid;
}
public function setBid(?Business $bid): static
{
$this->bid = $bid;
return $this;
}
public function getManager(): ?string
{
return $this->manager;
}
public function setManager(?string $manager): static
{
$this->manager = $manager;
return $this;
}
public function getAdr(): ?string
{
return $this->adr;
}
public function setAdr(?string $adr): static
{
$this->adr = $adr;
return $this;
}
public function getTel(): ?string
{
return $this->tel;
}
public function setTel(?string $tel): static
{
$this->tel = $tel;
return $this;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(?bool $active): static
{
$this->active = $active;
return $this;
}
}

View file

@ -83,6 +83,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\Column(length: 255, nullable: true)]
private ?string $verifyCodeTime = null;
#[ORM\OneToMany(mappedBy: 'submitter', targetEntity: SMSPays::class, orphanRemoval: true)]
private Collection $sMSPays;
public function __construct()
{
$this->userTokens = new ArrayCollection();
@ -97,6 +100,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$this->supports = new ArrayCollection();
$this->notifications = new ArrayCollection();
$this->emailHistories = new ArrayCollection();
$this->sMSPays = new ArrayCollection();
}
public function getId(): ?int
@ -600,4 +604,34 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
return $this;
}
/**
* @return Collection<int, SMSPays>
*/
public function getSMSPays(): Collection
{
return $this->sMSPays;
}
public function addSMSPay(SMSPays $sMSPay): static
{
if (!$this->sMSPays->contains($sMSPay)) {
$this->sMSPays->add($sMSPay);
$sMSPay->setSubmitter($this);
}
return $this;
}
public function removeSMSPay(SMSPays $sMSPay): static
{
if ($this->sMSPays->removeElement($sMSPay)) {
// set the owning side to null (unless already changed)
if ($sMSPay->getSubmitter() === $this) {
$sMSPay->setSubmitter(null);
}
}
return $this;
}
}

View file

@ -0,0 +1,48 @@
<?php
namespace App\Repository;
use App\Entity\CommodityCat;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<CommodityCat>
*
* @method CommodityCat|null find($id, $lockMode = null, $lockVersion = null)
* @method CommodityCat|null findOneBy(array $criteria, array $orderBy = null)
* @method CommodityCat[] findAll()
* @method CommodityCat[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class CommodityCatRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, CommodityCat::class);
}
// /**
// * @return CommodityCat[] Returns an array of CommodityCat objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('c')
// ->andWhere('c.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('c.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?CommodityCat
// {
// return $this->createQueryBuilder('c')
// ->andWhere('c.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View file

@ -0,0 +1,48 @@
<?php
namespace App\Repository;
use App\Entity\CommodityDropLink;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<CommodityDropLink>
*
* @method CommodityDropLink|null find($id, $lockMode = null, $lockVersion = null)
* @method CommodityDropLink|null findOneBy(array $criteria, array $orderBy = null)
* @method CommodityDropLink[] findAll()
* @method CommodityDropLink[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class CommodityDropLinkRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, CommodityDropLink::class);
}
// /**
// * @return CommodityDropLink[] Returns an array of CommodityDropLink objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('c')
// ->andWhere('c.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('c.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?CommodityDropLink
// {
// return $this->createQueryBuilder('c')
// ->andWhere('c.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View file

@ -0,0 +1,48 @@
<?php
namespace App\Repository;
use App\Entity\CommodityDrop;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<CommodityDrop>
*
* @method CommodityDrop|null find($id, $lockMode = null, $lockVersion = null)
* @method CommodityDrop|null findOneBy(array $criteria, array $orderBy = null)
* @method CommodityDrop[] findAll()
* @method CommodityDrop[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class CommodityDropRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, CommodityDrop::class);
}
// /**
// * @return CommodityDrop[] Returns an array of CommodityDrop objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('c')
// ->andWhere('c.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('c.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?CommodityDrop
// {
// return $this->createQueryBuilder('c')
// ->andWhere('c.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View file

@ -0,0 +1,48 @@
<?php
namespace App\Repository;
use App\Entity\SMSPays;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<SMSPays>
*
* @method SMSPays|null find($id, $lockMode = null, $lockVersion = null)
* @method SMSPays|null findOneBy(array $criteria, array $orderBy = null)
* @method SMSPays[] findAll()
* @method SMSPays[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class SMSPaysRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, SMSPays::class);
}
// /**
// * @return SMSPays[] Returns an array of SMSPays 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): ?SMSPays
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View file

@ -0,0 +1,48 @@
<?php
namespace App\Repository;
use App\Entity\SMSSettings;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<SMSSettings>
*
* @method SMSSettings|null find($id, $lockMode = null, $lockVersion = null)
* @method SMSSettings|null findOneBy(array $criteria, array $orderBy = null)
* @method SMSSettings[] findAll()
* @method SMSSettings[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class SMSSettingsRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, SMSSettings::class);
}
// /**
// * @return SMSSettings[] Returns an array of SMSSettings 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): ?SMSSettings
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View file

@ -0,0 +1,48 @@
<?php
namespace App\Repository;
use App\Entity\Storeroom;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Storeroom>
*
* @method Storeroom|null find($id, $lockMode = null, $lockVersion = null)
* @method Storeroom|null findOneBy(array $criteria, array $orderBy = null)
* @method Storeroom[] findAll()
* @method Storeroom[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class StoreroomRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Storeroom::class);
}
// /**
// * @return Storeroom[] Returns an array of Storeroom 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): ?Storeroom
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View file

@ -0,0 +1,30 @@
<?php
namespace App\Service;
use App\Entity\Business;
use App\Entity\User;
use Doctrine\ORM\EntityManagerInterface;
class Notification
{
private $em;
function __construct(EntityManagerInterface $entityManager)
{
$this->em = $entityManager;
}
public function insert(string $message,string $url,Business $business,User $user): bool
{
$item = new \App\Entity\Notification();
$item->setBid($business);
$item->setDateSubmit(time());
$item->setViewed(false);
$item->setUser($user);
$item->setMessage($message);
$item->setUrl($url);
$this->em->persist($item);
$this->em->flush();
return true;
}
}

View file

@ -100,32 +100,32 @@ class Provider
if(str_starts_with($method, 'get')){
$getMethods[] = trim(trim($method));
}
elseif(str_starts_with($method, 'is')){
$getMethods[] = trim(trim($method));
}
}
//var_dump($getMethods);
foreach ($getMethods as $method){
if(!is_int(array_search(lcfirst(trim(str_replace('get', '', $method))), $ignores))){
if(method_exists($entity,$method) && $method != 'get'){
if(!is_int(array_search(lcfirst(trim(str_replace(['get','is'], '', $method))), $ignores))) {
if (method_exists($entity, $method)) {
$method = trim(trim($method));
$canProced = true;
$reflection = new \ReflectionMethod($entity, $method);
if ($reflection->isPublic() && !str_starts_with('\\0',$method)) {
$value = $entity->$method();
}
else
if ($reflection->isPublic() && !str_starts_with('\\0', $method)) {
$value = $entity->$method();
} else
$canProced = false;
if($canProced){
if(!is_object($value)){
$result[lcfirst(str_replace('get','',$method))] = $value;
}
else{
if($deep != 0){
$result[lcfirst(str_replace('get','',$method))] = $this->Entity2Array($value,$deep - 1);
if ($canProced) {
if (!is_object($value)) {
$result[lcfirst(str_replace(['get','is'], '', $method))] = $value;
} else {
if ($deep != 0) {
$result[lcfirst(str_replace(['get','is'], '', $method))] = $this->Entity2Array($value, $deep - 1);
}
}
}
}
}
}
}
}
return $result;

View file

@ -16,6 +16,10 @@
<i class="fa fa-door-open"></i>
ورود | عضویت رایگان
</a>
<a href="http://insider.hesabix.ir" class="btn btn-outline-warning btn-lg px-4 gap-3">
<i class="fa fa-door-open"></i>
دمو (نسخه در حال توسعه)
</a>
{% if is_granted('ROLE_ADMIN')%}
<a href="/app/dashboard" class="btn btn-alt-danger btn-lg px-4 gap-3">
<i class="fa fa-door-open"></i>

View file

@ -0,0 +1,327 @@
<!DOCTYPE html>
<html dir="rtl" lang="fa"><head>
<meta charset="utf-8"/>
<meta content="width=device-width,initial-scale=1.0" name="viewport"/>
<title>{% block title %}{% endblock %}</title>
<meta content="حسابیکس فروشگاه آنلاین" name="description"/>
<meta content="Hesabix.ir" name="author"/>
<!-- Open Graph Meta -->
<meta content="Dashmix - Bootstrap 5 Admin Template & UI Framework" property="og:title"/>
<meta content="Hesabix" property="og:site_name"/>
<meta content="Dashmix - Bootstrap 5 Admin Template & UI Framework created by pixelcave and published on Themeforest" property="og:description"/>
<meta content="website" property="og:type"/>
<meta content="" property="og:url"/>
<meta content="" property="og:image"/>
<!-- Icons -->
<!-- The following icons can be replaced with your own, they are used by desktop and mobile browsers -->
<link href="/assets/media/favicons/favicon.png" rel="shortcut icon"/>
<link href="/assets/media/favicons/favicon-192x192.png" rel="icon" sizes="192x192" type="image/png"/>
<link href="/assets/media/favicons/apple-touch-icon-180x180.png" rel="apple-touch-icon" sizes="180x180"/>
<!-- END Icons -->
<!-- Stylesheets -->
<!-- Dashmix framework -->
<link href="/assets/css/dashmix.min.css" id="css-main" rel="stylesheet"/>
<!-- You can include a specific file from css/themes/ folder to alter the default color theme of the template. eg: -->
<!-- <link rel="stylesheet" id="css-theme" href="assets/css/themes/xwork.min.css"> -->
<!-- END Stylesheets -->
<!--===== Custom Font css =====-->
<link href="/assets/css/custom-fonts.css" rel="stylesheet"/>
</head>
<body>
<!-- Page Container -->
<!--
Available classes for #page-container:
GENERIC
'remember-theme' Remembers active color theme and dark mode between pages using localStorage when set through
- Theme helper buttons [data-toggle="theme"],
- Layout helper buttons [data-toggle="layout" data-action="dark_mode_[on/off/toggle]"]
- ..and/or Dashmix.layout('dark_mode_[on/off/toggle]')
SIDEBAR & SIDE OVERLAY
'sidebar-r' Right Sidebar and left Side Overlay (default is left Sidebar and right Side Overlay)
'sidebar-mini' Mini hoverable Sidebar (screen width > 991px)
'sidebar-o' Visible Sidebar by default (screen width > 991px)
'sidebar-o-xs' Visible Sidebar by default (screen width < 992px)
'sidebar-dark' Dark themed sidebar
'side-overlay-hover' Hoverable Side Overlay (screen width > 991px)
'side-overlay-o' Visible Side Overlay by default
'enable-page-overlay' Enables a visible clickable Page Overlay (closes Side Overlay on click) when Side Overlay opens
'side-scroll' Enables custom scrolling on Sidebar and Side Overlay instead of native scrolling (screen width > 991px)
HEADER
'' Static Header if no class is added
'page-header-fixed' Fixed Header
FOOTER
'' Static Footer if no class is added
'page-footer-fixed' Fixed Footer (please have in mind that the footer has a specific height when is fixed)
HEADER STYLE
'' Classic Header style if no class is added
'page-header-dark' Dark themed Header
'page-header-glass' Light themed Header with transparency by default
(absolute position, perfect for light images underneath - solid light background on scroll if the Header is also set as fixed)
'page-header-glass page-header-dark' Dark themed Header with transparency by default
(absolute position, perfect for dark images underneath - solid dark background on scroll if the Header is also set as fixed)
MAIN CONTENT LAYOUT
'' Full width Main Content if no class is added
'main-content-boxed' Full width Main Content with a specific maximum width (screen width > 1200px)
'main-content-narrow' Full width Main Content with a percentage width (screen width > 1200px)
DARK MODE
'sidebar-dark page-header-dark dark-mode' Enable dark mode (light sidebar/header is not supported with dark mode)
-->
<div class="rtl-support page-header-dark main-content-boxed" id="page-container">
<!-- Header -->
<header id="page-header">
<!-- Header Content -->
<div class="content-header">
<!-- Left Section -->
<div class="d-flex align-items-center">
<!-- Logo -->
<a class="fw-semibold text-dual tracking-wide" href="/s/{{ bid.storeUsername }}">
فروشگاه
{{ bid.name }}
</a>
<!-- END Logo -->
</div>
<!-- END Left Section -->
<!-- Right Section -->
<div>
<!-- Open Search Section -->
<!-- Layout API, functionality initialized in Template._uiApiLayout() -->
<button class="btn btn-alt-secondary ms-2" data-action="header_search_on" data-toggle="layout" type="button">
<i class="fa fa-search"></i>
</button>
<!-- END Open Search Section -->
<a class="btn btn-alt-secondary ms-2" href="/s/{{ bid.storeUsername }}/basket">
<i class="fa fa-shopping-basket"></i>
</a>
<!-- Toggle Main Navigation -->
<button class="d-lg-none btn btn-alt-secondary ms-2" data-class="d-none" data-target="#main-navigation" data-toggle="class-toggle" type="button"><i class="fa fa-bars"></i></button>
<!-- END Toggle Main Navigation -->
</div>
<!-- END Right Section -->
</div>
<!-- END Header Content -->
<!-- Header Search -->
<div class="overlay-header bg-sidebar-dark" id="page-header-search">
<div class="content-header">
<form action="bd_search.html" class="w-100" method="POST">
<div class="input-group">
<input class="form-control" id="page-header-search-input" name="page-header-search-input" placeholder="محصول مورد نظر را جست و جو کنید" type="text"/>
<!-- Layout API, functionality initialized in Template._uiApiLayout() -->
<button class="btn btn-alt-danger" data-action="header_search_off" data-toggle="layout" type="button">
<i class="fa fa-fw fa-times-circle"></i>
</button>
</div>
</form>
</div>
</div>
<!-- END Header Search -->
<!-- Header Loader -->
<!-- Please check out the Loaders page under Components category to see examples of showing/hiding it -->
<div class="overlay-header bg-sidebar-dark" id="page-header-loader">
<div class="content-header">
<div class="w-100 text-center">
<i class="fa fa-fw fa-2x fa-spinner fa-spin text-primary"></i>
</div>
</div>
</div>
<!-- END Header Loader -->
</header>
<!-- END Header -->
<!-- Main Container -->
<main id="main-container">
<!-- Navigation -->
<div class="bg-sidebar-dark">
<div class="content">
<!-- Main Navigation -->
<div class="d-none d-lg-block push" id="main-navigation">
<ul class="nav-main nav-main-horizontal nav-main-hover nav-main-dark">
<li class="nav-main-item">
<a class="nav-main-link" href="/s/{{ bid.storeUsername }}">
<i class="nav-main-link-icon fa fa-compass"></i>
<span class="nav-main-link-name"> صفحه نخست </span>
</a>
</li>
</ul>
</div>
<!-- END Main Navigation -->
</div>
</div>
<!-- END Navigation -->
<!-- Page Content -->
<div class="content">
<!-- Hero -->
<div class="block block-rounded">
<div class="block-content">
<div class="py-4 text-center">
<h1 class="mb-2"> داشبورد </h1>
<h2 class="h4 fw-normal text-muted">به برنامه خود خوش آمدید، همه چیز عالی به نظر می رسد!</h2>
</div>
</div>
</div>
<!-- END Hero -->
<!-- Dummy content -->
<div class="row">
<div class="col-sm-4">
<div class="block block-rounded">
<div class="block-content">
<p class="text-center py-6">...</p>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="block block-rounded">
<div class="block-content">
<p class="text-center py-6">...</p>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="block block-rounded">
<div class="block-content">
<p class="text-center py-6">...</p>
</div>
</div>
</div>
<div class="col-12">
<div class="block block-rounded">
<div class="block-content">
<p class="text-center py-6">...</p>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="block block-rounded">
<div class="block-content">
<p class="text-center py-6">...</p>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="block block-rounded">
<div class="block-content">
<p class="text-center py-6">...</p>
</div>
</div>
</div>
<div class="col-12">
<div class="block block-rounded">
<div class="block-content">
<p class="text-center py-6">...</p>
</div>
</div>
</div>
</div>
<!-- END Dummy content -->
</div>
<!-- END Page Content -->
</main>
<!-- END Main Container -->
<!-- Footer -->
<footer class="footer-static bg-body-extra-light" id="page-footer">
<div class="content py-4">
<!-- Footer Navigation -->
<div class="row items-push fs-sm border-bottom pt-4">
<div class="col-sm-12 col-md-6">
<h3 class="fw-light">تماس با فروشگاه</h3>
<ul class="list list-simple-mini">
{% if bid.tel != null or bid.tel != '' %}
<li>
<a class="fw-semibold" href="javascript:void(0)">
<i class="fa fa-fw fa-mobile text-primary-lighter me-1"></i>
تلفن: {{ bid.tel }}
</a>
</li>
{% endif %}
{% if bid.mobile != null or bid.mobile != '' %}
<li>
<a class="fw-semibold" href="javascript:void(0)">
<i class="fa fa-fw fa-mobile-android text-primary-lighter me-1"></i>
موبایل: {{ bid.mobile }}
</a>
</li>
{% endif %}
{% if bid.email != null or bid.email != '' %}
<li>
<a class="fw-semibold" href="javascript:void(0)">
<i class="fa fa-fw fa-message text-primary-lighter me-1"></i>
پست الکترونیکی: {{ bid.email }}
</a>
</li>
{% endif %}
{% if bid.postalCode != null or bid.postalCode != '' %}
<li>
<a class="fw-semibold" href="javascript:void(0)">
<i class="fa fa-fw fa-message text-primary-lighter me-1"></i>
کد پستی : {{ bid.postalCode }}
</a>
</li>
{% endif %}
{% if bid.address != null or bid.address != '' %}
<li>
<a class="fw-semibold" href="javascript:void(0)">
<i class="fa fa-fw fa-message text-primary-lighter me-1"></i>
آدرس : استان {{ bid.ostan }} شهر {{ bid.shahrestan }} {{ bid.address }}
</a>
</li>
{% endif %}
</ul>
</div>
</div>
<!-- END Footer Navigation -->
<!-- Footer Copyright -->
<div class="row fs-sm pt-4">
<div class="col-sm-6 order-sm-2 mb-1 mb-sm-0 text-center text-sm-end"> ساخته شده با <i class="fa fa-heart text-danger"></i> در <a class="fw-semibold" href="https://hesabix.ir" target="_blank">حسابیکس</a>
</div>
<div class="col-sm-6 order-sm-1 text-center text-sm-start">
</div>
</div>
<!-- END Footer Copyright -->
</div>
</footer>
<!-- END Footer -->
</div>
<!-- END Page Container -->
<!--
Dashmix JS
Core libraries and functionality
webpack is putting everything together at assets/_js/main/app.js
-->
<script src="/assets/js/dashmix.app.min.js"></script>
</body></html>

View file

@ -0,0 +1,20 @@
{% extends 'store/base.html.twig' %}
{% block title %} فروشگاه {{ bid.name }}{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
This friendly message is coming from:
<ul>
<li>Your controller at <code><a href="{{ '/var/www/hesabix.local/hesabixCore/src/Controller/StoreController.php'|file_link(0) }}">src/Controller/StoreController.php</a></code></li>
<li>Your template at <code><a href="{{ '/var/www/hesabix.local/hesabixCore/templates/store/index.html.twig'|file_link(0) }}">templates/store/index.html.twig</a></code></li>
</ul>
</div>
{% endblock %}

View file

@ -1,8 +1,17 @@
<?php
$http_origin = $_SERVER['HTTP_ORIGIN'];
if ($http_origin == "https://app.hesabix.ir" || $http_origin == "http://insider.hesabix.ir")
{
header("Access-Control-Allow-Origin: $http_origin");
}
header("Access-Control-Allow-Headers: *");
header("Access-Control-Allow-Methods: *");
header("Allow: GET, POST, OPTIONS, PUT, DELETE");
use App\Kernel;
require_once dirname(__DIR__).'/hesabixCore/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
};