Skip to content

Commit

Permalink
first
Browse files Browse the repository at this point in the history
  • Loading branch information
azizgm1234 committed Dec 21, 2023
1 parent 84b75a1 commit 6d2da5b
Show file tree
Hide file tree
Showing 23 changed files with 88 additions and 20 deletions.
Binary file added public/uploads/images/65777ffdb6fe2.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/657780d684d64.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/657781a2b8fe3.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/65782be37f470.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/65782e58315f3.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/65782eef85d82.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/65782f0a35c97.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/65782f6779eb0.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/657831692f90f.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/6578369b0f37e.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/65783a865b358.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/657843a2b5c58.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/6578446a026e6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions src/Controller/ChannelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ public function index( PaginatorInterface $paginator, Request $request, ChannelR
]);
}



/*
#[Route('/new', name: 'app_channel_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
Expand All @@ -62,7 +61,7 @@ public function new(Request $request, EntityManagerInterface $entityManager): Re
'form' => $form,
]);
}

*/


#[Route('/{idCh}', name: 'app_channel_show', methods: ['GET'])]
Expand Down
6 changes: 3 additions & 3 deletions src/Controller/TicketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ public function new(Request $request, EntityManagerInterface $entityManager, Eve
// $session->set('key', 'value');
$entityManager->persist($ticket);
$entityManager->flush();
// $to = '+21692103963'; // Static phone number
// $message = 'Hello We are excited to inform you that your ticket for the event has been successfully added.Thank you for choosing our platform! If you have any questions or concerns, feel free to reach out see you there'; // Modify the message as needed
// $twilioService->sendSMS($to, $message);
$to = '+21692103963'; // Static phone number
$message = 'Hello We are excited to inform you that your ticket for the event has been successfully added.Thank you for choosing our platform! If you have any questions or concerns, feel free to reach out see you there'; // Modify the message as needed
$twilioService->sendSMS($to, $message);
$idTicket = $ticket->getIdTicket();
// Récupérer des données depuis la session
// $valueFromSession = $session->get('key');
Expand Down
64 changes: 62 additions & 2 deletions src/Controller/UtilisateurController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace App\Controller;
use App\Entity\Activites;
use App\Entity\Channel;
use App\Form\ActivitesType;
use App\Form\ChannelType;
use App\Entity\Utilisateur;
use App\Entity\Userr;
use App\Form\UtilisateurType;
Expand Down Expand Up @@ -30,6 +32,7 @@
use Endroid\QrCode\Writer\PngWriter;
use Endroid\QrCode\QrCode;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\Security\Core\User\UserInterface;


#[Route('/utilisateur')]
Expand All @@ -56,6 +59,40 @@ public function index(
]);
}

#[Route('/statistique', name: 'app_statistique')]
public function statistique(UserrRepository $userRepository): Response
{
$totalUtilisateurs = $userRepository->count([]);
$hommes = $userRepository->countByGenre('Male');
$femmes = $userRepository->countByGenre('Female');
$Age20 = $userRepository->countByAgeRange([0,20]);
$Age40 = $userRepository->countByAgeRange([20,40]);
$Age60 = $userRepository->countByAgeRange([40,120]);

$pourcentageAge20 = ($Age20 / $totalUtilisateurs) * 100;
$pourcentageAge40 = ($Age40 / $totalUtilisateurs) * 100;
$pourcentageAge60 = ($Age60 / $totalUtilisateurs) * 100;


$pourcentageHommes = ($hommes / $totalUtilisateurs) * 100;
$pourcentageFemmes = ($femmes / $totalUtilisateurs) * 100;

return $this->render('statistique/sexe.html.twig', [
'Age20' => $Age20,
'Age40' => $Age40,
'Age60' => $Age60,
'pourcentageAge60' => $pourcentageAge60,
'pourcentageAge40' => $pourcentageAge40,
'pourcentageAge20' => $pourcentageAge20,
'totalUtilisateurs' => $totalUtilisateurs,
'hommes' => $hommes,
'femmes' => $femmes,
'pourcentageHommes' => $pourcentageHommes,
'pourcentageFemmes' => $pourcentageFemmes,
]);

}

/***************************************activite start********************************************************** */
#[Route('/backAct', name: 'activitesback_index', methods: ['GET'])]
public function backofficeact(ActivitesRepository $activitesRepository, InscriptionRepository $inscriptionRepository): Response
Expand All @@ -67,13 +104,16 @@ public function backofficeact(ActivitesRepository $activitesRepository, Inscript
]);
}
#[Route('/newact', name: 'app_activites_new', methods: ['GET', 'POST'])]
public function newact(Request $request, EntityManagerInterface $entityManager): Response
public function newact(Request $request, EntityManagerInterface $entityManager,UserInterface $user): Response
{
$activite = new Activites();
$form = $this->createForm(ActivitesType::class, $activite);
$form->handleRequest($request);
$imagedirectory = $this->getParameter('kernel.project_dir').'/public/uploads/images';
if ($form->isSubmitted() && $form->isValid()) {

$activite->setUser($user);

$imageFile = $form->get('images')->getData();
if($imageFile){
$newFilename = uniqid().'.'.$imageFile->guessExtension();
Expand Down Expand Up @@ -131,7 +171,27 @@ public function indexBack( PaginatorInterface $paginator, Request $request, Chan

]);
}

#[Route('/newcha', name: 'app_channel_new', methods: ['GET', 'POST'])]
public function newch(Request $request, EntityManagerInterface $entityManager): Response
{
$channel = new Channel();
$form = $this->createForm(ChannelType::class, $channel);
$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid()) {
$entityManager->persist($channel);
$entityManager->flush();

return $this->render('channel/showback.html.twig', [
'channel' => $channel,
]);
}

return $this->renderForm('channel/new.html.twig', [
'channel' => $channel,
'form' => $form,
]);
}

#[Route('/backProduit', name: 'produitback_index', methods: ['GET'])]
public function backofficeprod(Request $request,ProduitRepository $produitRepository,PaginatorInterface $paginator): Response
Expand Down
16 changes: 14 additions & 2 deletions src/Entity/Activites.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Doctrine\ORM\Mapping as ORM;
use Doctrine\DBAL\Types\Types;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Security\Core\User\UserInterface;

#[ORM\Entity(repositoryClass: ActivitesRepository::class)]
class Activites
Expand Down Expand Up @@ -158,12 +159,12 @@ public function setImages(string $images): static
return $this;
}

public function getPlaceDiso(): ?int
public function getPlaceDispo(): ?int
{
return $this->placeDispo;
}

public function setPlaceDiso(int $placeDispo): static
public function setPlaceDispo(int $placeDispo): static
{
$this->placeDispo = $placeDispo;

Expand Down Expand Up @@ -219,4 +220,15 @@ public function setUser(?Userr $user): static
return $this;
}

public function getUserr(): ?UserInterface
{
return $this->user;
}

public function setUserr(?UserInterface $user): static
{
$this->user = $user;

return $this;
}
}
4 changes: 2 additions & 2 deletions src/Form/ActivitesType.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
->add('prixAct')
->add('duree')
->add('periode')
->add('user',null,['choice_label'=>'id_user',
//->add('user',null,['choice_label'=>'id_user',
//'expanded' => True,
// 'multiple' => True,
])
// ])
;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Service/TwilioService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class TwilioService
{
private $accountSid = 'AC43011fd5642c2860d02bc20c118f8a0c';
private $authToken = '158999d8ea986e539d9a724fe80f5267';
private $authToken = '008a9a9dd77859fb9b1a19fc3caacc41';
private $twilioPhoneNumber = '+12672974905';

public function sendSMS($to, $body)
Expand Down
6 changes: 2 additions & 4 deletions templates/activites/_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{{ form_row(form.adresse, {'attr': {'class': 'form-control'}}) }}
</div>
<div class="form-group">
{{ form_row(form.placeDiso, {'attr': {'class': 'form-control'}}) }}
{{ form_row(form.placeDispo, {'attr': {'class': 'form-control'}}) }}
</div>

<div class="form-group">
Expand All @@ -46,9 +46,7 @@
{{ form_row(form.periode, {'attr': {'class': 'form-control'}}) }}
</div>

<div class="form-group">
{{ form_row(form.user, {'attr': {'class': 'form-control'}}) }}
</div>

<br>
<div class="form-group">
<h4 style="font-size: 18px;">Choose an image</h4>
Expand Down
2 changes: 1 addition & 1 deletion templates/activites/backoffice.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</td>


<td>{{ activite.placeDiso }}
<td>{{ activite.placeDispo }}
</td>
<td>{{ activite.prixAct }}</td>
<td>{{ activite.duree }}</td>
Expand Down
2 changes: 1 addition & 1 deletion templates/activites/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</div>
<div class="part">
<h4>Min participant :</h4>
<span>{{ activite.placeDiso }}</span>
<span>{{ activite.placeDispo }}</span>
</div>

<div class="price">
Expand Down
1 change: 0 additions & 1 deletion templates/channel/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_channel_new') }}">Create new channel</a>


<script src="https://cdn.tiny.cloud/1/adgqpc201sqv1tsnpixlr4xanu0tqz8v33s3og9t6is60tgk/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
Expand Down

0 comments on commit 6d2da5b

Please sign in to comment.