Compare commits
2 Commits
master
...
interestin
Author | SHA1 | Date |
---|---|---|
![]() |
b51f5a9b48 | 2 years ago |
![]() |
7e795d02ee | 2 years ago |
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace API\script\Gateway;
|
||||||
|
|
||||||
|
use Config\Connection;
|
||||||
|
use PDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'accéder, d'écrire ou de modifier les données contenues dans la table Admin afin de gérer l'espace administrateur.
|
||||||
|
*/
|
||||||
|
class GatewayAdmin
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var Connection
|
||||||
|
*/
|
||||||
|
private Connection $connection;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->connection = connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer le mot de passe de l'administrateur en fonction de son login.
|
||||||
|
* @param String $login Le login de l'administrateur.
|
||||||
|
* @return String|null Le mot de passe de l'administrateur ou null si l'administrateur n'existe pas.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function getPasswordWithLogin(String $login)
|
||||||
|
{
|
||||||
|
$query = "SELECT password FROM ADMIN WHERE login = :login";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':login' => array($login, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
$result = $this->connection->getResults();
|
||||||
|
if(empty($result))
|
||||||
|
return null;
|
||||||
|
return $result[0]['password'];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,191 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace API\script\Gateway;
|
||||||
|
|
||||||
|
use Config\Connection;
|
||||||
|
use PDO;
|
||||||
|
|
||||||
|
class GatewayForm
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var Connection
|
||||||
|
*/
|
||||||
|
private Connection $connection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->connection = connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'instancier un formulaire s'il n'y a pas déjà un de présent dans la base de donnée
|
||||||
|
* afin de rendre le formulaire modulable.
|
||||||
|
*
|
||||||
|
* @param string $title Titre du formulaire que l'on veut sauvegarder
|
||||||
|
* @param string $desc Description du formulaire que l'on veut sauvegarder
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function insertForm(string $title, string $desc): void
|
||||||
|
{
|
||||||
|
if (empty($this->getForm())) {
|
||||||
|
$query = "INSERT INTO Form(title, description) VALUES(:title, :desc)";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':title' => array($title, PDO::PARAM_STR),
|
||||||
|
':desc' => array($desc, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer le formulaire sauvegarder dans la base de donnée.
|
||||||
|
*
|
||||||
|
* @return array Retourne un array contenant l'ensemble des données du formulaire
|
||||||
|
*/
|
||||||
|
public function getForm(): array
|
||||||
|
{
|
||||||
|
$query = "SELECT * FROM Form";
|
||||||
|
$this->connection->executeQuery($query);
|
||||||
|
|
||||||
|
return $this->connection->getResults();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de supprimer le formulaire dont l'id est le même que le formulaire passé en paramètre.
|
||||||
|
*
|
||||||
|
* @param int $form Id du formulaire que l'on veut supprimer de la base de donnée
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function deleteForm(int $form): void
|
||||||
|
{
|
||||||
|
$query = "DELETE FROM Form WHERE id = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($form, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de faire le lien entre une catégorie et la réponse possible passées en paramètre
|
||||||
|
* à la question dont l'id est aussi passé en paramètre.
|
||||||
|
*
|
||||||
|
* @param string $keyword Keyword que l'on veut associer
|
||||||
|
* @param string $response Réponse que l'on veut associer
|
||||||
|
* @param int $idQuestion Id de la question qui contient la réponse
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function assignKeywordToQuestion(string $keyword, string $response, int $idQuestion): void
|
||||||
|
{
|
||||||
|
$query = "SELECT pr.id
|
||||||
|
FROM Propose p, PossibleResponse pr
|
||||||
|
WHERE p.question = :id AND p.possibleResponse = pr.id
|
||||||
|
AND pr.content = :response";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($idQuestion, PDO::PARAM_INT),
|
||||||
|
':response' => array($response, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
|
||||||
|
$idPossibleResponse = $this->connection->getResults()[0][0];
|
||||||
|
|
||||||
|
$query = "INSERT INTO Reference(possibleResponse, keyword) VALUES(:possibleResponse, :keyword)";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':possibleResponse' => array($idPossibleResponse, PDO::PARAM_INT),
|
||||||
|
':keyword' => array($keyword, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de supprimer le lien entre une catégorie et la réponse possible passées en paramètre
|
||||||
|
* à la question dont l'id est aussi passé en paramètre.
|
||||||
|
*
|
||||||
|
* @param string $keyword Keyword que l'on veut associer
|
||||||
|
* @param string $response Réponse que l'on veut associer
|
||||||
|
* @param int $question Id de la question qui contient la réponse
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function deleteKeywordFromQuestion(string $keyword, string $response, int $question): void
|
||||||
|
{
|
||||||
|
$query = "SELECT pr.id FROM Propose p, PossibleResponse r
|
||||||
|
WHERE p.question = :id AND p.possibleResponse = pr.id
|
||||||
|
AND pr.content = :response";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($question, PDO::PARAM_INT),
|
||||||
|
':response' => array($response, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
|
||||||
|
$idPossibleResponse = $this->connection->getResults()[0][0];
|
||||||
|
|
||||||
|
$query = "DELETE FROM Reference WHERE response = :idResponse AND keyword = :idKeword";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':idResponse' => array($idPossibleResponse, PDO::PARAM_INT),
|
||||||
|
':idKeword' => array($keyword, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de modifier le titre du formulaire sauvé dans la base de donnée.
|
||||||
|
*
|
||||||
|
* @param string $title Nouveau titre
|
||||||
|
* @param int $form Id du formulaire que l'on veut modifier
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function updateTitleToForm(string $title, int $form): void
|
||||||
|
{
|
||||||
|
$query = "UPDATE Form SET title = :title WHERE id = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':title' => array($title, PDO::PARAM_STR),
|
||||||
|
':id' => array($form, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de modifier la description du formulaire sauvé dans la base de donnée.
|
||||||
|
*
|
||||||
|
* @param string $description Nouvelle description
|
||||||
|
* @param int $form Id du formulaire que l'on veut modifier
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function updateDescriptionToForm(string $description, int $form): void
|
||||||
|
{
|
||||||
|
$query = "UPDATE Form SET title = :title WHERE description = :description";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':description' => array($description, PDO::PARAM_STR),
|
||||||
|
':id' => array($form, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de supprimer la description du formulaire dans la base de donnée en le remplaçant par une chaine vide.
|
||||||
|
*
|
||||||
|
* @param int $form Id du formulaire que l'on veut modifier
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function deleteDescriptionToForm(int $form): void
|
||||||
|
{
|
||||||
|
$query = "UPDATE Form SET title = :title WHERE description = :description";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':description' => array('', PDO::PARAM_STR),
|
||||||
|
':id' => array($form, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de vérifier si un formulaire est présent dans la base de donnée
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function existsForm(): bool
|
||||||
|
{
|
||||||
|
$query = "SELECT * FROM Form";
|
||||||
|
$this->connection->executeQuery($query);
|
||||||
|
return !empty($this->connection->getResults());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,124 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace API\script\Gateway;
|
||||||
|
|
||||||
|
use Config\Connection;
|
||||||
|
use PDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'accéder, d'écrire ou de modifier les données contenues dans la table Keyword
|
||||||
|
* afin de gérer les catégories disponibles et associer aux différentes réponses des questions.
|
||||||
|
*/
|
||||||
|
class GatewayKeyword
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var Connection
|
||||||
|
*/
|
||||||
|
private Connection $connection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->connection = connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'ajouter un Keyword dans la base de donnée.
|
||||||
|
*
|
||||||
|
* @param string $keyword Keyword à ajouter
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function insertKeyword(string $keyword)
|
||||||
|
{
|
||||||
|
$query = "INSERT INTO Keyword(word) VALUES(:word)";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':word' => array($keyword, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de supprimer un keyword de la base de donnée.
|
||||||
|
*
|
||||||
|
* @param string $keyword Keyword à supprimer
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function deleteKeyword(string $keyword)
|
||||||
|
{
|
||||||
|
$query = "DELETE FROM Keyword WHERE word = :word";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':word' => array($keyword, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer l'ensemble des Keyword disponible.
|
||||||
|
*
|
||||||
|
* @return array Retourne la liste de l'ensemble des keyword sauvé dans la base de donnée
|
||||||
|
*/
|
||||||
|
public function getAllKeyword(): array
|
||||||
|
{
|
||||||
|
$query = "SELECT * FROM Keyword";
|
||||||
|
$this->connection->executeQuery($query);
|
||||||
|
|
||||||
|
return $this->connection->getResults();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer tous les Keyword qui font référence à l'id de la réponse possible à une question passée en paramètre.
|
||||||
|
*
|
||||||
|
* @param int $id Id de la possible réponse que l'on veut connaitre ses catégories
|
||||||
|
*
|
||||||
|
* @return array Retourne l'ensemble de tous les Keyword associer à la réponse
|
||||||
|
*/
|
||||||
|
public function getKeywordsContentByReference(int $id): array
|
||||||
|
{
|
||||||
|
$query = "SELECT k.* FROM Keyword k, Reference r
|
||||||
|
WHERE k.word = r.keyword AND r.possibleResponse = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($id, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
|
||||||
|
return $this->getKeywordByAssotiation($id , $query);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer tous les Keyword qui font référence à l'id de la réponse d'un candidat passée en paramètre.
|
||||||
|
*
|
||||||
|
* @param int $id Id de la réponse que l'on veut connaitre ses catégories
|
||||||
|
*
|
||||||
|
* @return array Retourne l'ensemble de tous les Keyword associer à la réponse
|
||||||
|
*/
|
||||||
|
public function getKeywordsContentByCategorieze(int $id): array
|
||||||
|
{
|
||||||
|
$query = "SELECT k.* FROM Keyword k, Categorize c
|
||||||
|
WHERE k.word = c.keyword AND c.response = :id";
|
||||||
|
|
||||||
|
return $this->getKeywordByAssotiation($id , $query);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer une liste de Keyword selon une requête donnée et un id associé.
|
||||||
|
*
|
||||||
|
* @param int $id Id de l'objet dont on veut ses Keyword associé
|
||||||
|
* @param string $query Requête que l'on veut exécuter
|
||||||
|
*
|
||||||
|
* @return array Retourne la liste des différents Keyword associé à l'objet voulu
|
||||||
|
*/
|
||||||
|
private function getKeywordByAssotiation(int $id, string $query): array
|
||||||
|
{
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($id, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
|
||||||
|
$tab = [];
|
||||||
|
foreach ($this->connection->getResults() as $result) {
|
||||||
|
$tab[] = $result["word"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $tab;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,127 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace API\script\Gateway;
|
||||||
|
|
||||||
|
use Config\Connection;
|
||||||
|
use PDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'accéder, d'écrire ou de modifier les données contenues dans la table PossibleResponse
|
||||||
|
* afin de gérer la liste des réponses et les catégories associer d'un candidat.
|
||||||
|
*/
|
||||||
|
class GatewayListResponseOfCandidate
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var Connection
|
||||||
|
*/
|
||||||
|
private Connection $connection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->connection = connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer la liste détaillée des réponses avec leurs catégories associer
|
||||||
|
* aux différentes questions qu'un candidat cible a répondu
|
||||||
|
*
|
||||||
|
* @param int $idListResponse Id du candidat pour lequel on veut récupérer ses réponses
|
||||||
|
*
|
||||||
|
* @return array Retourne une liste qui pour
|
||||||
|
* l'indice 0 a la liste des infos du candidat
|
||||||
|
* l'indice 1 la liste des réponses
|
||||||
|
* l'indice 2 une liste de liste de catégories, qui pour chaque même indice correspont à la liste des catégories de la réponse
|
||||||
|
*/
|
||||||
|
public function getDetailsListResponsesOfCandidate(int $idListResponse)
|
||||||
|
{
|
||||||
|
$gatewayResponse = new GatewayResponse();
|
||||||
|
$gatewayKeyword = new GatewayKeyword();
|
||||||
|
$tabKeywords = [];
|
||||||
|
|
||||||
|
$query = "SELECT * FROM ListResponsesOfCandidate WHERE id = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($idListResponse, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
|
||||||
|
$questionList = $this->connection->getResults()[0];
|
||||||
|
|
||||||
|
$responses = $gatewayResponse->getResponsesByIdListCandidate($questionList['id']);
|
||||||
|
|
||||||
|
foreach ($responses as $row) {
|
||||||
|
$tabKeywords[] = $gatewayKeyword->getKeywordsContentByCategorieze($row['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return array($questionList, $responses, $tabKeywords);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer la liste des personnes ayant répondu aux formulaire
|
||||||
|
*
|
||||||
|
* @return array Retourne la liste brute des informations de tous les candidats ayant répondu au formulaire
|
||||||
|
*/
|
||||||
|
public function getAllListResponsesOfCandidate(): array
|
||||||
|
{
|
||||||
|
$query = "SELECT * FROM ListResponsesOfCandidate";
|
||||||
|
$this->connection->executeQuery($query);
|
||||||
|
|
||||||
|
return $this->connection->getResults();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de supprimer la liste des réponses d'un candidat de la base de donnée
|
||||||
|
*
|
||||||
|
* @param int $id Id du candidat à supprimer
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function deleteListResponseOfCandidate(int $id): void
|
||||||
|
{
|
||||||
|
$gatewayResponse = new GatewayResponse();
|
||||||
|
foreach ($gatewayResponse->getResponsesIdByIdListCandidate($id) as $response) {
|
||||||
|
$gatewayResponse->deleteResponseById($response['id']);
|
||||||
|
}
|
||||||
|
$query = "DELETE FROM ListResponsesOfCandidate WHERE id = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
'id' => array($id, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'insérer dans la base de données les réponses aux questions d'un candidat
|
||||||
|
* ainsi que les catégories associées à chaque réponse
|
||||||
|
*
|
||||||
|
* @param array $id Liste des id des questions répondue
|
||||||
|
* @param array $answer Liste des réponses à chaque question
|
||||||
|
* @param array $category Liste des catégories attribuées à chaque réponse
|
||||||
|
* @param string $titleForm Titre du formulaire
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function insertListResponsesOfCandidate(array $id, array $answer, array $category, string $titleForm): void
|
||||||
|
{
|
||||||
|
$gatewayResponse = new GatewayResponse();
|
||||||
|
$gatewayQuestion = new GatewayQuestion();
|
||||||
|
|
||||||
|
$query = "INSERT INTO ListResponsesOfCandidate(date, titleForm) VALUES(:date, :titleForm)";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':date' => array(date('Y-m-d H:i:s'), PDO::PARAM_STR),
|
||||||
|
':titleForm' => array($titleForm, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
|
||||||
|
$idListQuestion = $this->connection->lastInsertId();
|
||||||
|
|
||||||
|
for ($i = 0; $i < count($answer); $i++) {
|
||||||
|
$question = $gatewayQuestion->getQuestionContentById($id[$i]);
|
||||||
|
$idResponse = $gatewayResponse->insertResponse($question, $answer[$i], $category[$i]);
|
||||||
|
|
||||||
|
$query = "INSERT INTO Submit (responsesCandidate, response) VALUES(:responsesCandidate, :response)";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':responsesCandidate' => array($idListQuestion, PDO::PARAM_STR),
|
||||||
|
':response' => array($idResponse, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,79 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace API\script\Gateway;
|
||||||
|
|
||||||
|
use Config\Connection;
|
||||||
|
use PDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'accéder, d'écrire ou de modifier les données contenues dans la table PossibleResponse.
|
||||||
|
*/
|
||||||
|
class GatewayPossibleResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var Connection
|
||||||
|
*/
|
||||||
|
private Connection $connection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->connection = connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer les différentes réponses possibles à une question donnée.
|
||||||
|
*
|
||||||
|
* @param string $idQuestion Id de la question pour laquelle on veut récupérer les réponses possibles
|
||||||
|
*
|
||||||
|
* @return array Retourne la liste de possibles réponses
|
||||||
|
*/
|
||||||
|
public function getPossibleResponseByQuestion(string $idQuestion): array
|
||||||
|
{
|
||||||
|
$query = "SELECT pr.* FROM Propose p, PossibleResponse pr
|
||||||
|
WHERE p.question = :questionId AND p.possibleResponse = pr.id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':questionId' => array($idQuestion, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
|
||||||
|
return $this->connection->getResults();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'insérer une possible réponse dans la base de donnée.
|
||||||
|
*
|
||||||
|
* @param string $contentPossibleResponse Contenu de la possible réponse
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function insertPossibleResponse(string $contentPossibleResponse): int
|
||||||
|
{
|
||||||
|
$query = "INSERT INTO PossibleResponse(content) VALUES(:content)";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':content' => array($contentPossibleResponse, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
|
||||||
|
return $this->connection->lastInsertId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de supprimer une possible réponse de la base de donnée par son id.
|
||||||
|
*
|
||||||
|
* @param int $id Id de la possible réponse à supprimer
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function deletePossibleResponse(int $id): void
|
||||||
|
{
|
||||||
|
$query = "DELETE FROM Reference WHERE response = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($id, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
|
||||||
|
$query = "DELETE FROM PossibleResponse WHERE id = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($id, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,189 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace API\script\Gateway;
|
||||||
|
|
||||||
|
use Config\Connection;
|
||||||
|
use PDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'accéder, d'écrire ou de modifier les données contenues dans la table Question
|
||||||
|
* afin de rendre le formulaire modulable.
|
||||||
|
*/
|
||||||
|
class GatewayQuestion
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var Connection
|
||||||
|
*/
|
||||||
|
private Connection $connection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->connection = connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'ajouter une question dans la base de donnée.
|
||||||
|
*
|
||||||
|
* @param array $question Information sur la question ajouter [type, content]
|
||||||
|
* @param int $idForm Id du formulaire associer
|
||||||
|
*
|
||||||
|
* @return int Id de la question ajouté en base
|
||||||
|
*/
|
||||||
|
public function addQuestion(array $question, int $idForm): int
|
||||||
|
{
|
||||||
|
$query = "INSERT INTO Question(content, type, form) VALUES(:content, :type, :form)";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':content' => array($question[1], PDO::PARAM_STR),
|
||||||
|
':type' => array($question[0], PDO::PARAM_STR),
|
||||||
|
':form' => array($idForm, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
|
||||||
|
return $this->connection->lastInsertId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ajoute une possible réponse à une question cible et associe à la possible réponse des catégories.
|
||||||
|
*
|
||||||
|
* @param string $response Contenu de la réponse possible
|
||||||
|
* @param array $categories Liste des catégories attribuées à la possible réponse
|
||||||
|
* @param int $idQuestion Id de la question associée à cette possible réponse
|
||||||
|
*
|
||||||
|
* @return int Retourne l'id de la possible réponse insérée en base
|
||||||
|
*/
|
||||||
|
public function insertResponseInQuestion(string $response, array $categories, int $idQuestion): int
|
||||||
|
{
|
||||||
|
$gatewayPossibleResponse = new GatewayPossibleResponse();
|
||||||
|
$idPossibleResponse = $gatewayPossibleResponse->insertPossibleResponse($response);
|
||||||
|
|
||||||
|
$query = "INSERT INTO Propose(question, possibleResponse) VALUES(:question, :possibleResponse)";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':question' => array($idQuestion, PDO::PARAM_INT),
|
||||||
|
':possibleResponse' => array($idPossibleResponse, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($categories as $keyword) {
|
||||||
|
$gatewayForm = new GatewayForm();
|
||||||
|
$gatewayForm->assignKeywordToQuestion($keyword, $response, $idQuestion);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $idQuestion;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de supprimer une question dans la base ainsi que ses dépendances
|
||||||
|
*
|
||||||
|
* @param int $idQuestion Id de la question à supprimer
|
||||||
|
* @param string $type Type de la question à supprimer
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function deleteQuestion(int $idQuestion, string $type): void
|
||||||
|
{
|
||||||
|
if ($type != "BusinessClass\TextQuestion") {
|
||||||
|
$query = "DELETE FROM Propose WHERE question = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($idQuestion, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
$gatewayPossibleResponse = new GatewayPossibleResponse();
|
||||||
|
$listPossibleResponse = $gatewayPossibleResponse->getPossibleResponseByQuestion($idQuestion);
|
||||||
|
foreach ($listPossibleResponse as $row) {
|
||||||
|
$gatewayPossibleResponse->deletePossibleResponse($row["id"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = "DELETE FROM Question WHERE id = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($idQuestion, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de modifier dans la base de données les informations de la question.
|
||||||
|
*
|
||||||
|
* @param array $question Question modifier à changer en base [id, type, contente]
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function updateQuestion(array $question): void
|
||||||
|
{
|
||||||
|
$query = "UPDATE Question SET content = :content, type = :type WHERE id = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':content' => array($question[2], PDO::PARAM_STR),
|
||||||
|
':type' => array($question[1], PDO::PARAM_STR),
|
||||||
|
':id' => array($question[0], PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer toutes les questions, possibles réponses et catégories associées d'un formualire cible.
|
||||||
|
*
|
||||||
|
* @param string $idForm Id du formulaire
|
||||||
|
*
|
||||||
|
* @return array Retourne une liste qui pour
|
||||||
|
* l'indice 0 la liste des questions
|
||||||
|
* l'indice 1 une liste de liste de réponses, qui pour chaque même indice correspond à la liste des réponses possibles de la question
|
||||||
|
* l'indice 2 une liste de liste de liste de catégories qui pour chaque indice de questions,
|
||||||
|
* on a une liste de liste de catégories qui pour chaque indice de réponses est associer une liste de catégories
|
||||||
|
* Ou vide s'il n'y a pas de question dans la base
|
||||||
|
*/
|
||||||
|
public function getAllQuestions(string $idForm): array
|
||||||
|
{
|
||||||
|
$query = "SELECT * FROM Question WHERE form = :fom";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':fom' => array($idForm, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
|
||||||
|
$listQuestions = $this->connection->getResults();
|
||||||
|
$possibleResponsesContent = [];
|
||||||
|
$keywordsResponses = [];
|
||||||
|
$gatewayKeyword = new GatewayKeyword();
|
||||||
|
$gatewayPossibleResponse = new GatewayPossibleResponse();
|
||||||
|
|
||||||
|
if (!empty($listQuestions)) {
|
||||||
|
|
||||||
|
for ($i = 0; $i < count($listQuestions); $i++) {
|
||||||
|
|
||||||
|
if ($listQuestions[$i]["type"] != "BusinessClass/TextQuestion") {
|
||||||
|
$idQuestion = $listQuestions[$i]["id"];
|
||||||
|
$possibleResponses = $gatewayPossibleResponse->getPossibleResponseByQuestion($idQuestion);
|
||||||
|
$tmpTabKeyword = [];
|
||||||
|
$tmpTabPossibleResponse = [];
|
||||||
|
|
||||||
|
foreach ($possibleResponses as $row) {
|
||||||
|
$tmpTabKeyword[] = $gatewayKeyword->getKeywordsContentByReference($row["id"]);
|
||||||
|
$tmpTabPossibleResponse[] = $row["content"];
|
||||||
|
}
|
||||||
|
|
||||||
|
$possibleResponsesContent[] = $tmpTabPossibleResponse;
|
||||||
|
$keywordsResponses[] = $tmpTabKeyword;
|
||||||
|
} else {
|
||||||
|
$possibleResponsesContent[] = null;
|
||||||
|
$keywordsResponses[] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return array($listQuestions, $possibleResponsesContent, $keywordsResponses);
|
||||||
|
}
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer le contenu d'une réponse à une question par son id.
|
||||||
|
*
|
||||||
|
* @param string $id Id de la question cible
|
||||||
|
*
|
||||||
|
* @return string Retourne le contenu de la question ciblé
|
||||||
|
*/
|
||||||
|
public function getQuestionContentById(string $id): string
|
||||||
|
{
|
||||||
|
$query = "SELECT content FROM Question WHERE id = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($id, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
|
||||||
|
return $this->connection->getResults()[0][0];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,131 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace API\script\Gateway;
|
||||||
|
|
||||||
|
use Config\Connection;
|
||||||
|
use PDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'accéder, d'écrire ou de modifier les données contenues dans la table Response
|
||||||
|
* afin de récupérer les réponses d'un utilisateur.
|
||||||
|
*/
|
||||||
|
class GatewayResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var Connection
|
||||||
|
*/
|
||||||
|
private Connection $connection;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->connection = connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer la liste des réponses d'un candidat ainsi que les Keyword couvert pour chaque réponse.
|
||||||
|
*
|
||||||
|
* @param int $listResponsesOfCandidateId Id du candidat
|
||||||
|
*
|
||||||
|
* @return array Retourne une liste contenant à l'indice 0 la liste de réponse
|
||||||
|
* et à l'indice 1 une liste de liste de Keword,
|
||||||
|
* où chaque indice d'une liste de question est associé au même indice une réponse
|
||||||
|
*/
|
||||||
|
public function getCatgoriezeOfResponsesIdByIdListCandidate(int $listResponsesOfCandidateId): array
|
||||||
|
{
|
||||||
|
$result = $this->getResponsesByIdListCandidate($listResponsesOfCandidateId);
|
||||||
|
$tab = [];
|
||||||
|
foreach ($result as $row) {
|
||||||
|
$tab[] = (new GatewayKeyword())->getKeywordsContentByCategorieze($row['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return array($result, $tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer la liste des réponses d'un candidat par son id.
|
||||||
|
*
|
||||||
|
* @param int $listResponsesOfCandidateId Id du candidat
|
||||||
|
*
|
||||||
|
* @return array Retourne la list des réponses du candidat
|
||||||
|
*/
|
||||||
|
public function getResponsesByIdListCandidate(int $listResponsesOfCandidateId): array
|
||||||
|
{
|
||||||
|
$query = "SELECT r.* FROM Response r, Submit s WHERE s.responsesCandidate = :id AND r.id = s.response";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($listResponsesOfCandidateId, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
return $this->connection->getResults();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de récupérer la liste des id des réponses d'un candidat par son id.
|
||||||
|
*
|
||||||
|
* @param int $listResponsesOfCandidateId Id du candidat
|
||||||
|
*
|
||||||
|
* @return array Retourne la list des id des réponses du candidat
|
||||||
|
*/
|
||||||
|
public function getResponsesIdByIdListCandidate(int $listResponsesOfCandidateId): array
|
||||||
|
{
|
||||||
|
$query = "SELECT r.id FROM Response r, Submit s WHERE s.responsesCandidate = :id AND r.id = s.response";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($listResponsesOfCandidateId, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
return $this->connection->getResults();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet de supprimer la réponse et ses liens avec les différents Keyword
|
||||||
|
* selon l'id de la réponse passée en paramêtre
|
||||||
|
*
|
||||||
|
* @param int $responseId Id de la réponse à supprimer
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function deleteResponseById(int $responseId): void
|
||||||
|
{
|
||||||
|
$query = "DELETE FROM Categorize WHERE response = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($responseId, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
|
||||||
|
$query = "DELETE FROM Submit WHERE response = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($responseId, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
|
||||||
|
$query = "DELETE FROM Response WHERE id = :id";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':id' => array($responseId, PDO::PARAM_INT)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'insérer une réponse ainsi que de la lier avec les Keywords passés en paramètre.
|
||||||
|
*
|
||||||
|
* @param string $content Contenu de la réponse
|
||||||
|
* @param string $questionContent Contenu de la question, dans le cas où la question viendra à changer dans le futur
|
||||||
|
* @param array $category Liste des Keyword associé à la réponse
|
||||||
|
*
|
||||||
|
* @return int Retourne l'Id de la réponse insérée
|
||||||
|
*/
|
||||||
|
public function insertResponse(string $content, string $questionContent, array $category): int
|
||||||
|
{
|
||||||
|
$query = "INSERT INTO Response(content, questionContent) VALUES (:content, :questionContent)";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':content' => array($content, PDO::PARAM_STR),
|
||||||
|
':questionContent' => array($questionContent, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
|
||||||
|
$idResponse = $this->connection->lastInsertId();
|
||||||
|
|
||||||
|
foreach ($category as $keyword) {
|
||||||
|
$query = "INSERT INTO Categorize (response, keyword) VALUES(:response, :keyword)";
|
||||||
|
$this->connection->executeQuery($query, array(
|
||||||
|
':response' => array($idResponse, PDO::PARAM_STR),
|
||||||
|
':keyword' => array($keyword, PDO::PARAM_STR)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $idResponse;
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "dorian/config",
|
|
||||||
"description": "composer for guzzle client",
|
|
||||||
"require": {
|
|
||||||
"guzzlehttp/psr7": "^2.4",
|
|
||||||
"guzzlehttp/guzzle": "^7.5"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,621 +0,0 @@
|
|||||||
{
|
|
||||||
"_readme": [
|
|
||||||
"This file locks the dependencies of your project to a known state",
|
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
|
||||||
"This file is @generated automatically"
|
|
||||||
],
|
|
||||||
"content-hash": "3dca324180ba7c8b11cc23a565f02dff",
|
|
||||||
"packages": [
|
|
||||||
{
|
|
||||||
"name": "guzzlehttp/guzzle",
|
|
||||||
"version": "7.5.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/guzzle/guzzle.git",
|
|
||||||
"reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba",
|
|
||||||
"reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"ext-json": "*",
|
|
||||||
"guzzlehttp/promises": "^1.5",
|
|
||||||
"guzzlehttp/psr7": "^1.9 || ^2.4",
|
|
||||||
"php": "^7.2.5 || ^8.0",
|
|
||||||
"psr/http-client": "^1.0",
|
|
||||||
"symfony/deprecation-contracts": "^2.2 || ^3.0"
|
|
||||||
},
|
|
||||||
"provide": {
|
|
||||||
"psr/http-client-implementation": "1.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"bamarni/composer-bin-plugin": "^1.8.1",
|
|
||||||
"ext-curl": "*",
|
|
||||||
"php-http/client-integration-tests": "^3.0",
|
|
||||||
"phpunit/phpunit": "^8.5.29 || ^9.5.23",
|
|
||||||
"psr/log": "^1.1 || ^2.0 || ^3.0"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"ext-curl": "Required for CURL handler support",
|
|
||||||
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
|
|
||||||
"psr/log": "Required for using the Log middleware"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"bamarni-bin": {
|
|
||||||
"bin-links": true,
|
|
||||||
"forward-command": false
|
|
||||||
},
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "7.5-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"files": [
|
|
||||||
"src/functions_include.php"
|
|
||||||
],
|
|
||||||
"psr-4": {
|
|
||||||
"GuzzleHttp\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Graham Campbell",
|
|
||||||
"email": "hello@gjcampbell.co.uk",
|
|
||||||
"homepage": "https://github.com/GrahamCampbell"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Michael Dowling",
|
|
||||||
"email": "mtdowling@gmail.com",
|
|
||||||
"homepage": "https://github.com/mtdowling"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Jeremy Lindblom",
|
|
||||||
"email": "jeremeamia@gmail.com",
|
|
||||||
"homepage": "https://github.com/jeremeamia"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "George Mponos",
|
|
||||||
"email": "gmponos@gmail.com",
|
|
||||||
"homepage": "https://github.com/gmponos"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Tobias Nyholm",
|
|
||||||
"email": "tobias.nyholm@gmail.com",
|
|
||||||
"homepage": "https://github.com/Nyholm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Márk Sági-Kazár",
|
|
||||||
"email": "mark.sagikazar@gmail.com",
|
|
||||||
"homepage": "https://github.com/sagikazarmark"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Tobias Schultze",
|
|
||||||
"email": "webmaster@tubo-world.de",
|
|
||||||
"homepage": "https://github.com/Tobion"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Guzzle is a PHP HTTP client library",
|
|
||||||
"keywords": [
|
|
||||||
"client",
|
|
||||||
"curl",
|
|
||||||
"framework",
|
|
||||||
"http",
|
|
||||||
"http client",
|
|
||||||
"psr-18",
|
|
||||||
"psr-7",
|
|
||||||
"rest",
|
|
||||||
"web service"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/guzzle/guzzle/issues",
|
|
||||||
"source": "https://github.com/guzzle/guzzle/tree/7.5.0"
|
|
||||||
},
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://github.com/GrahamCampbell",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/Nyholm",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle",
|
|
||||||
"type": "tidelift"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2022-08-28T15:39:27+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "guzzlehttp/promises",
|
|
||||||
"version": "1.5.2",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/guzzle/promises.git",
|
|
||||||
"reference": "b94b2807d85443f9719887892882d0329d1e2598"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598",
|
|
||||||
"reference": "b94b2807d85443f9719887892882d0329d1e2598",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.5"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"symfony/phpunit-bridge": "^4.4 || ^5.1"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.5-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"files": [
|
|
||||||
"src/functions_include.php"
|
|
||||||
],
|
|
||||||
"psr-4": {
|
|
||||||
"GuzzleHttp\\Promise\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Graham Campbell",
|
|
||||||
"email": "hello@gjcampbell.co.uk",
|
|
||||||
"homepage": "https://github.com/GrahamCampbell"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Michael Dowling",
|
|
||||||
"email": "mtdowling@gmail.com",
|
|
||||||
"homepage": "https://github.com/mtdowling"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Tobias Nyholm",
|
|
||||||
"email": "tobias.nyholm@gmail.com",
|
|
||||||
"homepage": "https://github.com/Nyholm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Tobias Schultze",
|
|
||||||
"email": "webmaster@tubo-world.de",
|
|
||||||
"homepage": "https://github.com/Tobion"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Guzzle promises library",
|
|
||||||
"keywords": [
|
|
||||||
"promise"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/guzzle/promises/issues",
|
|
||||||
"source": "https://github.com/guzzle/promises/tree/1.5.2"
|
|
||||||
},
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://github.com/GrahamCampbell",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/Nyholm",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
|
|
||||||
"type": "tidelift"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2022-08-28T14:55:35+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "guzzlehttp/psr7",
|
|
||||||
"version": "2.4.4",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/guzzle/psr7.git",
|
|
||||||
"reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf",
|
|
||||||
"reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "^7.2.5 || ^8.0",
|
|
||||||
"psr/http-factory": "^1.0",
|
|
||||||
"psr/http-message": "^1.0",
|
|
||||||
"ralouphie/getallheaders": "^3.0"
|
|
||||||
},
|
|
||||||
"provide": {
|
|
||||||
"psr/http-factory-implementation": "1.0",
|
|
||||||
"psr/http-message-implementation": "1.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"bamarni/composer-bin-plugin": "^1.8.1",
|
|
||||||
"http-interop/http-factory-tests": "^0.9",
|
|
||||||
"phpunit/phpunit": "^8.5.29 || ^9.5.23"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"bamarni-bin": {
|
|
||||||
"bin-links": true,
|
|
||||||
"forward-command": false
|
|
||||||
},
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "2.4-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"GuzzleHttp\\Psr7\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Graham Campbell",
|
|
||||||
"email": "hello@gjcampbell.co.uk",
|
|
||||||
"homepage": "https://github.com/GrahamCampbell"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Michael Dowling",
|
|
||||||
"email": "mtdowling@gmail.com",
|
|
||||||
"homepage": "https://github.com/mtdowling"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "George Mponos",
|
|
||||||
"email": "gmponos@gmail.com",
|
|
||||||
"homepage": "https://github.com/gmponos"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Tobias Nyholm",
|
|
||||||
"email": "tobias.nyholm@gmail.com",
|
|
||||||
"homepage": "https://github.com/Nyholm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Márk Sági-Kazár",
|
|
||||||
"email": "mark.sagikazar@gmail.com",
|
|
||||||
"homepage": "https://github.com/sagikazarmark"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Tobias Schultze",
|
|
||||||
"email": "webmaster@tubo-world.de",
|
|
||||||
"homepage": "https://github.com/Tobion"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Márk Sági-Kazár",
|
|
||||||
"email": "mark.sagikazar@gmail.com",
|
|
||||||
"homepage": "https://sagikazarmark.hu"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "PSR-7 message implementation that also provides common utility methods",
|
|
||||||
"keywords": [
|
|
||||||
"http",
|
|
||||||
"message",
|
|
||||||
"psr-7",
|
|
||||||
"request",
|
|
||||||
"response",
|
|
||||||
"stream",
|
|
||||||
"uri",
|
|
||||||
"url"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/guzzle/psr7/issues",
|
|
||||||
"source": "https://github.com/guzzle/psr7/tree/2.4.4"
|
|
||||||
},
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://github.com/GrahamCampbell",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/Nyholm",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
|
|
||||||
"type": "tidelift"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2023-03-09T13:19:02+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "psr/http-client",
|
|
||||||
"version": "1.0.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/php-fig/http-client.git",
|
|
||||||
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
|
|
||||||
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "^7.0 || ^8.0",
|
|
||||||
"psr/http-message": "^1.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.0.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Psr\\Http\\Client\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "PHP-FIG",
|
|
||||||
"homepage": "http://www.php-fig.org/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Common interface for HTTP clients",
|
|
||||||
"homepage": "https://github.com/php-fig/http-client",
|
|
||||||
"keywords": [
|
|
||||||
"http",
|
|
||||||
"http-client",
|
|
||||||
"psr",
|
|
||||||
"psr-18"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"source": "https://github.com/php-fig/http-client/tree/master"
|
|
||||||
},
|
|
||||||
"time": "2020-06-29T06:28:15+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "psr/http-factory",
|
|
||||||
"version": "1.0.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/php-fig/http-factory.git",
|
|
||||||
"reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
|
|
||||||
"reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=7.0.0",
|
|
||||||
"psr/http-message": "^1.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.0.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Psr\\Http\\Message\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "PHP-FIG",
|
|
||||||
"homepage": "http://www.php-fig.org/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Common interfaces for PSR-7 HTTP message factories",
|
|
||||||
"keywords": [
|
|
||||||
"factory",
|
|
||||||
"http",
|
|
||||||
"message",
|
|
||||||
"psr",
|
|
||||||
"psr-17",
|
|
||||||
"psr-7",
|
|
||||||
"request",
|
|
||||||
"response"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"source": "https://github.com/php-fig/http-factory/tree/master"
|
|
||||||
},
|
|
||||||
"time": "2019-04-30T12:38:16+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "psr/http-message",
|
|
||||||
"version": "1.0.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/php-fig/http-message.git",
|
|
||||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
|
|
||||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.0.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Psr\\Http\\Message\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "PHP-FIG",
|
|
||||||
"homepage": "http://www.php-fig.org/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Common interface for HTTP messages",
|
|
||||||
"homepage": "https://github.com/php-fig/http-message",
|
|
||||||
"keywords": [
|
|
||||||
"http",
|
|
||||||
"http-message",
|
|
||||||
"psr",
|
|
||||||
"psr-7",
|
|
||||||
"request",
|
|
||||||
"response"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"source": "https://github.com/php-fig/http-message/tree/master"
|
|
||||||
},
|
|
||||||
"time": "2016-08-06T14:39:51+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ralouphie/getallheaders",
|
|
||||||
"version": "3.0.3",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/ralouphie/getallheaders.git",
|
|
||||||
"reference": "120b605dfeb996808c31b6477290a714d356e822"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
|
|
||||||
"reference": "120b605dfeb996808c31b6477290a714d356e822",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.6"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"php-coveralls/php-coveralls": "^2.1",
|
|
||||||
"phpunit/phpunit": "^5 || ^6.5"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"files": [
|
|
||||||
"src/getallheaders.php"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Ralph Khattar",
|
|
||||||
"email": "ralph.khattar@gmail.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "A polyfill for getallheaders.",
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/ralouphie/getallheaders/issues",
|
|
||||||
"source": "https://github.com/ralouphie/getallheaders/tree/develop"
|
|
||||||
},
|
|
||||||
"time": "2019-03-08T08:55:37+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "symfony/deprecation-contracts",
|
|
||||||
"version": "v2.5.2",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
|
||||||
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
|
|
||||||
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=7.1"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-main": "2.5-dev"
|
|
||||||
},
|
|
||||||
"thanks": {
|
|
||||||
"name": "symfony/contracts",
|
|
||||||
"url": "https://github.com/symfony/contracts"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"files": [
|
|
||||||
"function.php"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Nicolas Grekas",
|
|
||||||
"email": "p@tchwork.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Symfony Community",
|
|
||||||
"homepage": "https://symfony.com/contributors"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "A generic function and convention to trigger deprecation notices",
|
|
||||||
"homepage": "https://symfony.com",
|
|
||||||
"support": {
|
|
||||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
|
|
||||||
},
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://symfony.com/sponsor",
|
|
||||||
"type": "custom"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/fabpot",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
|
||||||
"type": "tidelift"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2022-01-02T09:53:40+00:00"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"packages-dev": [],
|
|
||||||
"aliases": [],
|
|
||||||
"minimum-stability": "stable",
|
|
||||||
"stability-flags": [],
|
|
||||||
"prefer-stable": false,
|
|
||||||
"prefer-lowest": false,
|
|
||||||
"platform": [],
|
|
||||||
"platform-dev": [],
|
|
||||||
"plugin-api-version": "2.3.0"
|
|
||||||
}
|
|
@ -0,0 +1,37 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<?php
|
||||||
|
global $googleApis, $googleStatic, $poppins, $icon, $logoUCA;
|
||||||
|
?>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<link rel="stylesheet" href="Views/CSS/base.css" />
|
||||||
|
<link rel="preconnect" href="<?php echo $googleApis; ?>">
|
||||||
|
<link rel="preconnect" href="<?php echo $googleStatic; ?>" crossorigin>
|
||||||
|
<link href="<?php echo $poppins; ?>" rel="stylesheet">
|
||||||
|
<title>Formulaire de témoignage</title>
|
||||||
|
<link rel="shortcut icon" href="<?php echo $icon; ?>" type="image/x-icon">
|
||||||
|
<link rel="icon" href="<?php echo $icon; ?>" type="image/x-icon">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<img id="logoUCA" src="<?php echo $logoUCA; ?>" height="35px" width="auto" alt="logo UCA">
|
||||||
|
<h1>Administration</h1>
|
||||||
|
|
||||||
|
<div class="form-center">
|
||||||
|
<a href="goToCategories">Les catégories</a>
|
||||||
|
<a href="goToQuestions">Les questions</a>
|
||||||
|
<a href="goToResponses">Les réponses</a>
|
||||||
|
<a href="goToProfiles">Les profils intéressants</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<div class="form-center">
|
||||||
|
<!-- Add profiles -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
Loading…
Reference in new issue