Commit 6bbd568d authored by Robin Borgogno's avatar Robin Borgogno

création de l'id parti privée

parent 360cdd5f
...@@ -10,7 +10,7 @@ Game::addSqlQuery('GAME_CREATE', ...@@ -10,7 +10,7 @@ Game::addSqlQuery('GAME_CREATE',
"INSERT INTO GAME (GAME_ID, GAME_DESC) VALUES (NULL, :GAME_DESC)"); "INSERT INTO GAME (GAME_ID, GAME_DESC) VALUES (NULL, :GAME_DESC)");
Game::addSqlQuery('GAME_ID_MAX', Game::addSqlQuery('GAME_ID_MAX',
"SELECT MAX(GAME_ID) FROM GAME"); "SELECT MAX(GAME_ID) AS id FROM GAME");
Game::addSqlQuery('GAME_UPDATE', Game::addSqlQuery('GAME_UPDATE',
"UPDATE GAME SET GAME_DESC=:GAME_DESC WHERE GAME_ID=:GAME_ID"); "UPDATE GAME SET GAME_DESC=:GAME_DESC WHERE GAME_ID=:GAME_ID");
......
...@@ -1733,6 +1733,16 @@ ...@@ -1733,6 +1733,16 @@
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"dev": true "dev": true
}, },
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"cacache": { "cacache": {
"version": "13.0.1", "version": "13.0.1",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz", "resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz",
...@@ -1759,6 +1769,34 @@ ...@@ -1759,6 +1769,34 @@
"unique-filename": "^1.1.1" "unique-filename": "^1.1.1"
} }
}, },
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"find-cache-dir": { "find-cache-dir": {
"version": "3.3.1", "version": "3.3.1",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz",
...@@ -1780,6 +1818,25 @@ ...@@ -1780,6 +1818,25 @@
"path-exists": "^4.0.0" "path-exists": "^4.0.0"
} }
}, },
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"locate-path": { "locate-path": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
...@@ -1844,6 +1901,16 @@ ...@@ -1844,6 +1901,16 @@
"minipass": "^3.1.1" "minipass": "^3.1.1"
} }
}, },
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"terser-webpack-plugin": { "terser-webpack-plugin": {
"version": "2.3.8", "version": "2.3.8",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz", "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz",
...@@ -1860,6 +1927,18 @@ ...@@ -1860,6 +1927,18 @@
"terser": "^4.6.12", "terser": "^4.6.12",
"webpack-sources": "^1.4.3" "webpack-sources": "^1.4.3"
} }
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.1.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.0.tgz",
"integrity": "sha512-fTtCdI7VeyNK0HP4q4y9Z9ts8TUeaF+2/FjKx8CJ/7/Oem1rCX7zIJe+d+jLrVnVNQjENd3gqmANraLcdRWwnQ==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
} }
} }
}, },
...@@ -10906,87 +10985,6 @@ ...@@ -10906,87 +10985,6 @@
} }
} }
}, },
"vue-loader-v16": {
"version": "npm:vue-loader@16.1.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.1.0.tgz",
"integrity": "sha512-fTtCdI7VeyNK0HP4q4y9Z9ts8TUeaF+2/FjKx8CJ/7/Oem1rCX7zIJe+d+jLrVnVNQjENd3gqmANraLcdRWwnQ==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": { "vue-router": {
"version": "3.4.9", "version": "3.4.9",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.4.9.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.4.9.tgz",
......
export default class user {
token = "";
id = 0;
putId(id)
{
this.id = id
}
getId()
{
return this.id
}
putToken(token)
{
this.token = token
}
getToken()
{
return this.token
}
}
\ No newline at end of file
...@@ -34,6 +34,11 @@ const routes = [ ...@@ -34,6 +34,11 @@ const routes = [
path: '/choixPartie', path: '/choixPartie',
name: 'ChoixPartie', name: 'ChoixPartie',
component: () => import(/* webpackChunkName: "login" */ '../views/ChoixPartie.vue') component: () => import(/* webpackChunkName: "login" */ '../views/ChoixPartie.vue')
},
{
path: "/adminPrivate",
name: "AdminPrivate",
component: () => import(/* webpackChunkName: "login" */ '../views/AdminPrivate.vue')
} }
] ]
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<script> <script>
export default { export default {
name: 'Accueil', name: 'Accueil',
components: { components: {
LoginNavbar LoginNavbar
......
...@@ -2,15 +2,13 @@ ...@@ -2,15 +2,13 @@
<div class="inscription"> <div class="inscription">
<div class="row _centered"> <div class="row _centered">
<div class="column _600"> <div class="column _600">
<form method="post" class="startGame">
<div class="codeGame"> <div class="codeGame">
<label class="titre"> Code de la partie : </label> <h1 class="titre"> Code de la partie : </h1>
<!-- Choper le code de la partie privée --> <h1 class="titre" id="codeGame">{{idGame()}}</h1>
</div> </div>
<div class="joueurs"> <div class="joueurs">
<!-- ajoute les joueurs présent --> <!-- ajoute les joueurs présent -->
</div> </div>
</form>
</div> </div>
</div> </div>
</div> </div>
...@@ -27,3 +25,28 @@ ...@@ -27,3 +25,28 @@
height: 90%; height: 90%;
} }
</style> </style>
<script>
export default {
name: 'AdminPrivate',
methods: {
idGame: function(){
const url = "http://localhost/felten/projet-cdaw/backend/MVC/api.php/game"
let data = {
"GAME_DESC": "testHTML"
}
var params = {
method: 'POST',
body : JSON.stringify(data) };
fetch(url, params)
.then(response=>response.json())
.then(data=>{
document.getElementById("codeGame").innerHTML = data[0].id
})
},
},
}
</script>
\ No newline at end of file
...@@ -74,3 +74,9 @@ ...@@ -74,3 +74,9 @@
} }
</style> </style>
<script>
export default {
name: 'ChoixPartie',
}
</script>
\ No newline at end of file
...@@ -73,6 +73,8 @@ ...@@ -73,6 +73,8 @@
</style> </style>
<script> <script>
export default { export default {
name: 'Login', name: 'Login',
methods: { methods: {
...@@ -86,7 +88,7 @@ export default { ...@@ -86,7 +88,7 @@ export default {
}, },
call: function(login, password){ call: function(login, password){
const url = "http://localhost/projet-cdaw/backend/MVC/api.php/login" const url = "http://localhost/felten/projet-cdaw/backend/MVC/api.php/login"
let data = { let data = {
login: login, login: login,
...@@ -102,7 +104,11 @@ export default { ...@@ -102,7 +104,11 @@ export default {
fetch(url, params) fetch(url, params)
.then(response=>response.json()) .then(response=>response.json())
.then(data=>console.log(data)) .then(data=>{
sessionStorage.setItem("JWT_TOKEN", data.jwt_token)
console.log(sessionStorage.getItem("JWT_TOKEN"))
console.log(data)
})
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment