Skip to content

Commit

Permalink
Merge branch 'main' of github.com:eliooooooo/Time-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
eliooooooo committed Mar 20, 2024
2 parents 1bdaca5 + ffaf1d9 commit b697471
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
10 changes: 10 additions & 0 deletions chart-my-time/app/controller/StatsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

class StatsController extends ControllerBase
{
public function read(){
$stats = new Stats();
$stats = $stats->read();
header('X-Json-Data: ' . trim(json_encode($stats)));
}
}
12 changes: 12 additions & 0 deletions chart-my-time/app/models/Stats.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

class Stats{
public function read()
{
$pdo = connexion();
$sqlGenerator = new SqlGenerator($pdo);

$stats = $sqlGenerator->select('Day', '*', 'user_id = ' . $_SESSION['user_id']);
return $stats;
}
}
1 change: 1 addition & 0 deletions chart-my-time/app/views/includes/menu.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
</svg>
</li>
{% endif %}
<li><a href="#">Stats</a></li>
<li><a href="legalInfos" class="text-gray-400" >Legal notices</a></li>
</ul>
<ul class="flex flex-row w-full justify-between px-8 border-t-[1px] border-gray-400 pt-4 pb-4">
Expand Down
10 changes: 10 additions & 0 deletions chart-my-time/app/views/page/stats.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends "page.html.twig" %}

{% block main %}

{% endblock %}
{% block scripts %}
<!-- Gère les infobulles -->
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
{% endblock %}

0 comments on commit b697471

Please sign in to comment.