gestion entreprise completement fonctionnel

This commit is contained in:
Louis DUMONT 2022-03-31 23:41:25 +02:00
parent 59de7487eb
commit f63aa81961
2 changed files with 44 additions and 3 deletions

View File

@ -1,8 +1,6 @@
var ID_company=0;
$(document).ready(function(){
$("#modal_stat").show();
$("#li_gestion_entreprises").delay(2000).addClass("hover");

View File

@ -20,9 +20,17 @@ if (isset($_COOKIE['username']) && isset($_COOKIE['pass'])) {
$query_localisations->execute();
$results_localisations = $query_localisations->fetchALL(PDO::FETCH_OBJ);
$query_companies_top_internship = $bdd->prepare('SELECT companies.ID_company, name_company, COUNT(internships.ID_company) AS "number_of_internships" FROM companies NATURAL JOIN companies_located NATURAL JOIN localisations LEFT JOIN internships ON companies.ID_company=internships.ID_company INNER JOIN evaluate ON companies.ID_company=evaluate.ID_company INNER JOIN users ON evaluate.ID_user=users.ID_user NATURAL JOIN roles WHERE name_role="Pilote" GROUP BY internships.ID_company ORDER BY number_of_internships DESC;');
$query_companies_top_internship = $bdd->prepare('SELECT companies.ID_company, name_company, COUNT(internships.ID_company) AS "number_of_internships" FROM companies LEFT JOIN internships ON companies.ID_company=internships.ID_company GROUP BY internships.ID_company ORDER BY number_of_internships DESC;');
$query_companies_top_internship->execute();
$results_companies_top_internship = $query_companies_top_internship->fetchALL(PDO::FETCH_OBJ);
$query_companies_top_cesi_intern = $bdd->prepare('SELECT companies.ID_company, name_company, nb_intern_cesi_company FROM companies ORDER BY nb_intern_cesi_company DESC;');
$query_companies_top_cesi_intern->execute();
$results_companies_top_cesi_intern = $query_companies_top_cesi_intern->fetchALL(PDO::FETCH_OBJ);
$query_companies_top_note = $bdd->prepare('SELECT companies.ID_company, name_company, note FROM companies INNER JOIN evaluate ON companies.ID_company=evaluate.ID_company INNER JOIN users ON evaluate.ID_user=users.ID_user NATURAL JOIN roles WHERE name_role="Pilote" ORDER BY note ASC;');
$query_companies_top_note->execute();
$results_companies_top_note = $query_companies_top_note->fetchALL(PDO::FETCH_OBJ);
?>
<html lang="fr">
<head>
@ -115,6 +123,41 @@ if (isset($_COOKIE['username']) && isset($_COOKIE['pass'])) {
<?php } ?>
</table>
</div>
<div class="title_modal">Top des entreprises ayant le plus d'étudiants CESI</div>
<div class="modal_stat_table">
<table class="table">
<tr>
<td>ID</td>
<td>Nom</td>
<td>Nb étudiants CESI</td>
</tr>
<?php foreach ($results_companies_top_cesi_intern as $result) { ?>
<tr>
<td><?= $result->ID_company ?></td>
<td><?= $result->name_company ?></td>
<td><?= $result->nb_intern_cesi_company ?></td>
</tr>
<?php } ?>
</table>
</div>
<div class="title_modal">Top des entreprises ayant les meilleures notes</div>
<div class="modal_stat_table">
<table class="table">
<tr>
<td>ID</td>
<td>Nom</td>
<td>Note</td>
</tr>
<?php foreach ($results_companies_top_note as $result) { ?>
<tr>
<td><?= $result->ID_company ?></td>
<td><?= $result->name_company ?></td>
<td><?= $result->note ?></td>
</tr>
<?php } ?>
</table>
</div>