Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Projet ISIS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MARQUE Pierre
Projet ISIS
Commits
68ba83ed
Commit
68ba83ed
authored
Mar 28, 2022
by
Okthane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
m
parent
61812c2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
40 deletions
+50
-40
index.php
index.php
+0
-1
script.js
script.js
+50
-39
No files found.
index.php
View file @
68ba83ed
...
...
@@ -20,7 +20,6 @@
<!-- API TenserFlow -->
</head>
<body>
<button
id=
"photovalidé"
>
Web_serverAPI
</button>
<div
class=
"site-header-main"
>
<div
id=
"logo-header"
></div>
<div
class=
"site-branding"
>
Titre de la page
</div>
...
...
script.js
View file @
68ba83ed
...
...
@@ -6,6 +6,8 @@ const URL_WEB_API = 'web_server.php';
const
URL_CHOOSE_MAIL
=
'io.php'
;
const
URL_END
=
'byebye.html'
;
const
timeout
=
5000
;
const
ID
=
"img-ID"
;
const
canva
=
"canvas"
;
console
.
log
(
$
(
"#"
+
ID
).
attr
(
'src'
));
...
...
@@ -18,7 +20,7 @@ const idBtnSubmit = 'btnSubmit';var btnSubmit;
const
idStatut
=
"span-status"
;
var
error
Upload
=
true
;
var
error
Format
=
true
;
var
errorRemoveBackGround
=
true
;
var
unSeulVisage
=
false
;
...
...
@@ -34,7 +36,9 @@ $(document).ready(function(){
btnCustomFileUpload
=
$
(
"#"
+
idCustomFileUpload
);
btnSubmit
=
$
(
"#"
+
idBtnSubmit
);
Console
=
$
(
"#"
+
idConsole
);
//empêcher de valider si la photo n'est pas valide
inputFileUpload
.
change
(
function
(){
unSeulVisage
=
false
;
format_correct
=
false
});
//requête pour les vérifications de sécurité
$
(
"#form"
).
on
(
"submit"
,
function
(
event
)
{
event
.
preventDefault
();
var
formData
=
new
FormData
(
this
);
...
...
@@ -55,10 +59,10 @@ $(document).ready(function(){
console
.
log
(
data
);
src
=
data
[
'src'
];
console
.
log
(
'src'
);
error
Upload
=
data
[
'error'
];
error
Format
=
data
[
'error'
];
Console
.
empty
();
Console
.
append
(
data
[
'message'
]);
format_correct
=
true
;
//Affichage de la photo
// findFaces();
})
...
...
@@ -67,31 +71,31 @@ $(document).ready(function(){
alert
(
"La requête s'est terminée en échec. Infos : "
+
JSON
.
stringify
(
error
));
})
$
.
ajax
({
//url de la requête
url
:
URL_DETOURAGE
,
method
:
'POST'
,
enctype
:
'multipart/form-data'
,
data
:
formData
,
cache
:
false
,
dataType
:
"json"
,
contentType
:
false
,
processData
:
false
})
.
done
(
function
(
data
){
console
.
log
(
data
);
//Affichage de la photo
$
(
"#img-ID2"
).
attr
(
'src'
,
data
[
'src'
]);
})
if
(
!
errorFormat
){
$
.
ajax
({
//url de la requête
url
:
URL_DETOURAGE
,
method
:
'POST'
,
enctype
:
'multipart/form-data'
,
data
:
formData
,
cache
:
false
,
dataType
:
"json"
,
contentType
:
false
,
processData
:
false
})
.
done
(
function
(
data
){
console
.
log
(
data
);
//Affichage de la photo
$
(
"#img-ID2"
).
attr
(
'src'
,
data
[
'src'
]);
})
}
});
//Etape du choix de l'addresse mail.
$
(
"#photovalidé"
).
on
(
'click'
,
function
(){
studentId
=
getParameter
(
window
.
location
.
href
);
$
.
ajax
({
url
:
URL_WEB_API
,
...
...
@@ -112,9 +116,10 @@ $(document).ready(function(){
if
(
mailsPossibles
.
length
!=
0
){
$
(
"body"
).
append
(
`<h3>Bonjour <strong>
${
prenom
}
</strong>, veuillez choisir votre prochaine adresse électronique</h3>
`
<h2>Choix de l'adresse électronique</h2>
<div class = "form-container div-form" id="email-container" >
<div class="title-container">
<h2>Choix de l'adresse électronique</h2
></div>
<div class="title-container">
<h3>Veuillez choisir votre prochaine adresse électronique</h3
></div>
<form id ="choix-email" name="mail" class="div-form form-emails" action="" method="" onsubmit="event.preventDefault();sendMail()">
</form>
</div>`
...
...
@@ -131,8 +136,11 @@ $(document).ready(function(){
`<input type="submit" id="valide-mail" value="Ok c'est bon !">`
);
}
else
{
$
(
"body"
).
append
(
`<h3>Votre adresse électronique sera
${
mail
}
, vous recevrez votre mot de passe dans les 24 heures.</h3>`
);
}
})
});
});
...
...
@@ -141,16 +149,18 @@ $(document).ready(function(){
function
sendMail
(){
console
.
log
(
$
(
"input[name=
\"
mail
\"
]:checked"
).
val
());
var
mail
=
$
(
"input[name=
\"
mail
\"
]:checked"
).
val
();
$
.
ajax
({
url
:
URL_CHOOSE_MAIL
,
method
:
'POST'
,
data
:
'mail='
+
mail
,
dataType
:
"json"
});
setTimeout
(
function
()
{
window
.
open
(
URL_END
,
'_self'
);
},
000
);;
if
(
unSeulVisage
&&
format_correct
){
$
.
ajax
({
url
:
URL_CHOOSE_MAIL
,
method
:
'POST'
,
data
:
'mail='
+
mail
,
dataType
:
"json"
});
setTimeout
(
function
()
{
window
.
open
(
URL_END
,
'_self'
);},
timeout
);
}
else
{
alert
(
"Oups...
\n
Il y a un problème avec votre photo :'("
);
}
// window.close();
}
...
...
@@ -172,6 +182,7 @@ async function findFaces(idImage) {
$
(
"#"
+
idStatut
).
append
(
predictions
.
length
+
" face(s) found!"
);
if
(
predictions
.
length
==
1
){
$
(
"#li-oneface"
).
css
(
'color'
,
'green'
);
unSeulVisage
=
true
;
}
else
{
$
(
"#li-oneface"
).
css
(
'color'
,
'red'
);}
...
...
@@ -204,7 +215,7 @@ async function findFaces(idImage) {
$
(
"#"
+
idStatut
).
append
(
"No Face(s) Found"
);
$
(
"#li-oneface"
).
css
(
'color'
,
'red'
);
}
//
btnSubmit.prop('disabled',false);
btnSubmit
.
prop
(
'disabled'
,
false
);
btnCustomFileUpload
.
prop
(
'disabled'
,
false
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment