Convert string value into array in index.php

master
dorian.hodin 2 years ago
parent dd4d624d15
commit f2bdef0972

@ -17,32 +17,7 @@ class ScriptDatabase {
public function executeScript(): void public function executeScript(): void
{ {
$queryScript = "-- phpMyAdmin SQL Dump $queryScript = '
-- version 5.1.2
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost:3306
-- Généré le : lun. 06 mars 2023 à 14:52
-- Version du serveur : 5.7.24
-- Version de PHP : 8.0.1
START TRANSACTION;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `formulaire`
--
-- --------------------------------------------------------
--
-- Structure de la table `admin`
--
CREATE TABLE `admin` ( CREATE TABLE `admin` (
`username` varchar(50) NOT NULL, `username` varchar(50) NOT NULL,
@ -317,7 +292,7 @@ COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
"; ';
$this->connection->executeQuery($queryScript); $this->connection->executeQuery($queryScript);
$queryScript = "INSERT INTO `form` (`id`, `title`, `description`) VALUES (1, 'Votre avis nous intéresse !', 'Ce formulaire vous permet de candidater à une potentielle interview si votre profil nous intéresse.')"; $queryScript = "INSERT INTO `form` (`id`, `title`, `description`) VALUES (1, 'Votre avis nous intéresse !', 'Ce formulaire vous permet de candidater à une potentielle interview si votre profil nous intéresse.')";
$this->connection->executeQuery($queryScript); $this->connection->executeQuery($queryScript);

@ -359,7 +359,7 @@ $app->delete('/deleteQuestion', function(Request $request, Response $response){
throw new TypeErrorParameters($request); throw new TypeErrorParameters($request);
} }
try{ try{
(new GatewayQuestion)->deleteQuestion($parameters['classQuestion'],$parameters['id'], $parameters['listPossibleResponse']); (new GatewayQuestion)->deleteQuestion($parameters['classQuestion'],$parameters['id'], json_decode($parameters['listPossibleResponse']));
}catch (PDOException $e){ }catch (PDOException $e){
throw new PDOError($request,$e->getMessage(),$e); throw new PDOError($request,$e->getMessage(),$e);
} }
@ -453,7 +453,7 @@ $app->post('/insertResponseInQuestion', function(Request $request, Response $res
throw new TypeErrorParameters($request); throw new TypeErrorParameters($request);
} }
try{ try{
(new GatewayQuestion)->insertResponseInQuestion($parameters['response'],$parameters['categories'],$parameters['idQuestion']); (new GatewayQuestion)->insertResponseInQuestion($parameters['response'],json_decode($parameters['categories']),$parameters['idQuestion']);
}catch (PDOException $e){ }catch (PDOException $e){
throw new PDOError($request,$e->getMessage(),$e); throw new PDOError($request,$e->getMessage(),$e);
} }

Loading…
Cancel
Save