Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
chaimaktari committed Nov 27, 2023
2 parents d3d8044 + 20b509f commit f298a12
Show file tree
Hide file tree
Showing 61 changed files with 2,879 additions and 751 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
###> nelmio/cors-bundle ###
CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
###< nelmio/cors-bundle ###

###> symfony/firebase-notifier ###
# FIREBASE_DSN=firebase://TOKEN@default
###< symfony/firebase-notifier ###
15 changes: 12 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,28 @@
"ext-ctype": "*",
"ext-iconv": "*",
"api-platform/core": "^2.7",
"bacon/bacon-qr-code": "^2.0",
"doctrine/annotations": "^2.0",
"doctrine/doctrine-bundle": "^2.10",
"doctrine/doctrine-migrations-bundle": "^3.2",
"doctrine/orm": "^2.16",
"eckinox/tinymce-bundle": "^0.1.5",
"endroid/qr-code": "^5.0",
"endroid/qr-code-bundle": "^5.0",
"knplabs/knp-paginator-bundle": "^5.9",
"mercuryseries/flashy-bundle": "^5.1",
"nelmio/cors-bundle": "^2.3",

"phpdocumentor/reflection-docblock": "^5.3",
"phpoffice/phpexcel": "^1.8",
"phpstan/phpdoc-parser": "^1.24",
"sensio/framework-extra-bundle": "^6.2",
"symfony/asset": "5.4.*",
"symfony/console": "5.4.*",
"symfony/doctrine-messenger": "5.4.*",
"symfony/dotenv": "5.4.*",
"symfony/expression-language": "5.4.*",

"symfony/firebase-notifier": "5.4.*",
"symfony/flex": "^1.17|^2",
"symfony/form": "5.4.*",
"symfony/framework-bundle": "5.4.*",
Expand All @@ -35,7 +42,8 @@
"symfony/process": "5.4.*",
"symfony/property-access": "5.4.*",
"symfony/property-info": "5.4.*",
"symfony/runtime": "5.4.*",

"symfony/runtime": "^5.4",
"symfony/security-bundle": "5.4.*",
"symfony/serializer": "5.4.*",
"symfony/string": "5.4.*",
Expand All @@ -56,7 +64,8 @@
"composer/package-versions-deprecated": true,
"php-http/discovery": true,
"symfony/flex": true,
"symfony/runtime": true
"symfony/runtime": true,
"endroid/installer": true
},
"optimize-autoloader": true,
"preferred-install": {
Expand Down
1,822 changes: 1,353 additions & 469 deletions composer.lock

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,17 @@
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
<<<<<<< HEAD
Eckinox\TinymceBundle\TinymceBundle::class => ['all' => true],
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
Symfony\UX\Chartjs\ChartjsBundle::class => ['all' => true],
Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true],
=======
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
MercurySeries\FlashyBundle\MercurySeriesFlashyBundle::class => ['all' => true],
Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true],
Endroid\QrCodeBundle\EndroidQrCodeBundle::class => ['all' => true],
Endroid\QrCodeBundle\EndroidQrCodeBundle::class => ['all' => true],
>>>>>>> 20b509f004855b6d998dc661712019c9fb0a60c7
];
9 changes: 9 additions & 0 deletions config/packages/endroid_qr_code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
endroid_qr_code:
default:
writer: Endroid\QrCode\Writer\PngWriter
size: 300
margin: 10
encoding: "UTF-8"
errorCorrectionLevel: "low"
roundBlockSizeMode: "margin"
validateResult: false
1 change: 1 addition & 0 deletions config/packages/notifier.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
framework:
notifier:
chatter_transports:
firebase: '%env(FIREBASE_DSN)%'
texter_transports:
channel_policy:
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
Expand Down
3 changes: 3 additions & 0 deletions config/routes/endroid_qr_code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
endroid_qr_code:
resource: "@EndroidQrCodeBundle/Resources/config/routes.yaml"
prefix: /qr-code
8 changes: 8 additions & 0 deletions public/assets/css/styleaziz.css
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ flex-direction: column;
color: rgb(182, 174, 174);
margin-left: 70px;

}
.navact a{
font-size: 15px;
color: rgb(182, 174, 174);
margin-left: 560px;
margin-top: 10px;
color: rgb(207, 74, 74);

}
.navact .first{

Expand Down
141 changes: 141 additions & 0 deletions public/assets/css/styleticket.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
.content {

background-color: whitesmoke;
height:100%;
display: flex;
flex-direction: row;
}
.tickettable{
background-color: #007bff;
height :200px;
width: 50%;
}
.inscription_list{
height:10px;
}
/* Apply basic styles to the table */
.table2 {
width: 50%;
border-collapse: collapse;
margin-top: 20px; /* Adjust as needed */
}

/* Style the table header */
.table2 th {

padding: 10px;
text-align: left;
color: #2b2525;

}

/* Style the table rows */
.table2 td {
padding: 10px;
border: 1px solid #ddd; /* Border color */
}

/* Style alternating rows for better readability */

/* Style links inside table cells */
.table2 a {
text-decoration: none;
color: #007bff; /* Blue color for links, adjust as needed */
}

/* Add hover effect to links */
.table2 a:hover {
text-decoration: underline;
}

/* Style the "you have no inscription right now" message */
.table2 tbody tr:nth-last-child(2),
.table2 tbody tr:last-child {
font-style: italic;
color: rgb(31, 28, 28); /* Gray color for the message */
}

/* Adjust styling for the "go back to the home page and make one" message */
.table2 tbody tr:last-child {
font-weight: bold;
color: rgb(31, 28, 28); /* Darker color for emphasis */
}



.qrcode #qrCodeImage{
height: 100px;
width: 100px;
margin-left: 10px;
}
.ticket{
border-radius: 4px;

width: 600px;
margin-left: 50px;
height: 200px;
display: flex;
position: relative;
flex-direction: row;
justify-content: flex-end;
gap: 280px;
background:url(../images/welcome-hero/Ticket.png)no-repeat;

background-position:center;
background-size:cover;
background-color: #8D2649;
z-index: 1;
}
.ticket img{
max-height: 100px; /* Set the maximum desired height */
max-width: 120px; /* Set the maximum desired width */
width: auto; /* Allow the width to adjust proportionally */
height: auto;
object-fit: fill;
}

.ticket .nomactivte{


margin-top: 170px;

}
.ticket .nomactivte h4 {
color: #ddd;
font-size: 15px;
font-style: italic;
}
.content-ticket{
margin-top: 100px;
display: flex;
flex-direction: row;
gap:100px;
}
.leftside{

margin-left: 20px;
}
.leftside p {
font-size: 17px;
}
.leftside h1 {
font-size: 19px;
color: #8D2649;
}
.leftside #note{
color: #FF3131;

}
.btndownload{
margin-top: 20px;
border-radius: 7px;
color: azure;
width: 120px;
height: 40px;
background-color: #8D2649;
}
.btndownload:hover{

background-color: #5e1f34;

}
Binary file added public/assets/images/welcome-hero/Ticket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uploads/images/655b9bfc526d0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uploads/images/655b9c3d5f38d.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uploads/images/655b9c56a8fed.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uploads/images/655e133b7d39a.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uploads/images/655e4ecb8fd4c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uploads/images/655e5132bfa36.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uploads/images/655f5845951a7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uploads/images/655f6f8990cf5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uploads/images/655f8f01b1144.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/uploads/images/655f8f4a2d60f.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 49 additions & 4 deletions src/Controller/ActivitesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Endroid\QrCode\QrCode;
use Endroid\QrCode\Writer\PngWriter;
use Endroid\QrCode\Color\Color;
use Endroid\QrCode\Encoding\Encoding;
use Endroid\QrCode\ErrorCorrectionLevel;

use Endroid\QrCode\Label\Label;
use Endroid\QrCode\Logo\Logo;
use Endroid\QrCode\RoundBlockSizeMode;

use Endroid\QrCode\Writer\ValidationException;

#[Route('/activites')]
class ActivitesController extends AbstractController
Expand Down Expand Up @@ -84,19 +95,23 @@ public function new(Request $request, EntityManagerInterface $entityManager): Re
#[Route('/{idAct}', name: 'app_activites_show', methods: ['GET', 'POST'])]
public function show(Activites $activite , Request $request, EntityManagerInterface $entityManager,$idAct): Response
{
$isFormSubmitted = false;
$inscription = new Inscription();
$inscription->setNbrTickes(1);
$prix = $activite->getPrixAct();
$form = $this->createForm(InscriptionType::class, $inscription);
$form->handleRequest($request);
$userId=0;

if ($form->isSubmitted() && $form->isValid()) {
$inscription -> setActiviteId($idAct);
$inscription->setActivite($activite);
$inscription -> setUserId(0);
$inscription -> setFraitAbonnement(20.00);
dump($inscription);
$entityManager->persist($inscription);
$entityManager->flush();

$this->addFlash('success', 'Reservation made successfully');

return $this->redirectToRoute('app_activites_show', ['idAct' => $idAct], Response::HTTP_SEE_OTHER);

Expand All @@ -107,9 +122,41 @@ public function show(Activites $activite , Request $request, EntityManagerInterf
'form' => $form,
'id'=>$idAct,
'prixactivite'=>$prix,
'userid'=> $userId,

]);
}


#[Route('/ticket/{userId}', name: 'ticket', methods: ['GET', 'POST'])]
public function showTicket(InscriptionRepository $inscriptionRepository,ActivitesRepository $activitesRepository , $userId): Response
{
$inscriptions = $inscriptionRepository->findByUserId($userId);
return $this->render('inscription/ticket.html.twig', [
'inscription' => $inscriptions,

]);
}

#[Route('/load-ticket-content/{inscriptionId}', name: 'load-ticket-content', methods: ['GET'])]
public function loadTicketContent(InscriptionRepository $inscriptionRepository, $inscriptionId): Response
{ $writer = new PngWriter();

$inscription = $inscriptionRepository->find($inscriptionId);
$ticketData = $inscription->getTicketData();
$qrCode = new QrCode($ticketData);
//$qrCode = new QrCode("heelo world");


$pngResult = $writer->write($qrCode);

$qrCodeImage = base64_encode($pngResult->getString());


return $this->render('inscription/ticket_content.html.twig', [
'inscription' => $inscription,
'qrCodeImage' => $qrCodeImage,
]);
}



Expand Down Expand Up @@ -147,8 +194,6 @@ public function delete(Request $request, Activites $activite, EntityManagerInter







}
Loading

0 comments on commit f298a12

Please sign in to comment.