diff --git a/.scannerwork/.sonar_lock b/.scannerwork/.sonar_lock
new file mode 100644
index 0000000..e69de29
diff --git a/.scannerwork/report-task.txt b/.scannerwork/report-task.txt
new file mode 100644
index 0000000..1953886
--- /dev/null
+++ b/.scannerwork/report-task.txt
@@ -0,0 +1,6 @@
+projectKey=jtt_crm
+serverUrl=https://codefirst.iut.uca.fr/sonar
+serverVersion=9.6.1.59531
+dashboardUrl=https://codefirst.iut.uca.fr/sonar/dashboard?id=jtt_crm
+ceTaskId=AYSvDEjizKKB0GF_0uUi
+ceTaskUrl=https://codefirst.iut.uca.fr/sonar/api/ce/task?id=AYSvDEjizKKB0GF_0uUi
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
new file mode 100644
index 0000000..980fd57
--- /dev/null
+++ b/.vscode/c_cpp_properties.json
@@ -0,0 +1,18 @@
+{
+ "configurations": [
+ {
+ "name": "macos-clang-arm64",
+ "includePath": [
+ "${workspaceFolder}/**"
+ ],
+ "compilerPath": "/usr/bin/clang",
+ "cStandard": "${default}",
+ "cppStandard": "${default}",
+ "intelliSenseMode": "macos-clang-arm64",
+ "compilerArgs": [
+ ""
+ ]
+ }
+ ],
+ "version": 4
+}
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..6053dbd
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,13 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "C/C++ Runner: Debug Session",
+ "type": "lldb",
+ "request": "launch",
+ "args": [],
+ "cwd": "/Users/malanone/JTT_Production/JTT_CrM",
+ "program": "/Users/malanone/JTT_Production/JTT_CrM/build/Debug/outDebug"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..50d1b0f
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,36 @@
+{
+ "C_Cpp_Runner.cCompilerPath": "clang",
+ "C_Cpp_Runner.cppCompilerPath": "clang++",
+ "C_Cpp_Runner.debuggerPath": "lldb",
+ "C_Cpp_Runner.cStandard": "",
+ "C_Cpp_Runner.cppStandard": "",
+ "C_Cpp_Runner.msvcBatchPath": "",
+ "C_Cpp_Runner.useMsvc": false,
+ "C_Cpp_Runner.warnings": [
+ "-Wall",
+ "-Wextra",
+ "-Wpedantic",
+ "-Wshadow",
+ "-Wformat=2",
+ "-Wconversion",
+ "-Wnull-dereference",
+ "-Wsign-conversion"
+ ],
+ "C_Cpp_Runner.enableWarnings": true,
+ "C_Cpp_Runner.warningsAsError": false,
+ "C_Cpp_Runner.compilerArgs": [],
+ "C_Cpp_Runner.linkerArgs": [],
+ "C_Cpp_Runner.includePaths": [],
+ "C_Cpp_Runner.includeSearch": [
+ "*",
+ "**/*"
+ ],
+ "C_Cpp_Runner.excludeSearch": [
+ "**/build",
+ "**/build/**",
+ "**/.*",
+ "**/.*/**",
+ "**/.vscode",
+ "**/.vscode/**"
+ ]
+}
\ No newline at end of file
diff --git a/server-api/api.js b/server-api/api.js
index f639d30..b0292a5 100644
--- a/server-api/api.js
+++ b/server-api/api.js
@@ -287,6 +287,41 @@ app.get('/Contact/AllWithCustomerName', (req, res) => {
});
});
+app.get('/Entreprise/All', (req, res) => {
+ let sql = 'SELECT idcustomer,name FROM customers ORDER BY name';
+ db.query(sql, (err, result) => {
+ if (err) throw err;
+ console.log(result);
+ res.send(result);
+ });
+});
+
+app.get('/Contact/Exist/:phone', (req, res) => {
+ const phone = req.params.phone
+ let sql = 'SELECT idcontact FROM contacts WHERE phone = ?';
+
+ db.query(sql, [phone], (err, result) => {
+ if (err) throw err;
+
+ console.log(result);
+ res.send(result);
+ });
+});
+
+app.post('/Contact/Add', (req, res) => {
+
+ let form = req.body;
+
+ console.log("on est dans le form",form);
+
+ const sql = `INSERT INTO contacts(firstname,lastname, mail, phone, iduser, idcustomer) VALUES ('${form.firstname}', '${form.lastname}', '${form.mail}', '${form.phone}', '${form.iduser}', '${form.idcustomer}' )`;
+ db.query(sql , (err, result) => {
+ if (err) throw err;
+ console.log(result);
+ res.send('Post added...' + result.insertId);
+ });
+});
+
app.get('/Contact/:iduser', (req, res) => {
const iduser = req.params.iduser;
@@ -303,7 +338,7 @@ app.post('/Event/Add', (req, res) => {
let form = req.body;
- console.log(form);
+ console.log("on est dans le form d'un event ",form);
const sql = `INSERT INTO events(date,starttime,endtime,comment,idusersend,iduserreceive,idcontact) VALUES ('${form.date}', '${form.starttime}', '${form.endtime}', '${form.comment}', '${form.idusersend}', '${form.iduserreceive}', '${form.idcontact}')`;
db.query(sql , (err, result) => {
@@ -325,4 +360,4 @@ app.get('/Event/:iduser', (req, res) => {
console.log(result);
res.send(result);
});
-});
+});
\ No newline at end of file
diff --git a/src/App.js b/src/App.js
index 0a85a37..d84a7b5 100644
--- a/src/App.js
+++ b/src/App.js
@@ -13,6 +13,7 @@ import Calendrier from './pages/Calendrier';
import Repertoire from './pages/Repertoire';
import Parametres from './pages/Parametres';
import Chargement from './pages/Chargement';
+import AddContact from './components/Contact/AddContact'
import { Component } from 'fullcalendar';
import RestartPassword from './pages/RestartPassword';
@@ -40,6 +41,7 @@ const App = () => {