Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
canap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SI-FSD
canap
Commits
83bcdcfd
Commit
83bcdcfd
authored
Feb 25, 2019
by
nicrausaz
Browse files
Options
Downloads
Patches
Plain Diff
fix, delete working
parent
52c78749
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
canapEPFL/helpers.php
+3
-35
3 additions, 35 deletions
canapEPFL/helpers.php
canapEPFL/script.js
+24
-5
24 additions, 5 deletions
canapEPFL/script.js
canapEPFL/viewpostulation.php
+31
-17
31 additions, 17 deletions
canapEPFL/viewpostulation.php
with
58 additions
and
57 deletions
canapEPFL/helpers.php
+
3
−
35
View file @
83bcdcfd
...
...
@@ -296,46 +296,14 @@ function deletePostulation ($pdo, $id, $sciper, $rep1, $rep2) {
$query
->
bindParam
(
':id'
,
$id
,
PDO
::
PARAM_STR
);
$query
->
execute
();
$sqlreq
=
"UPDATE applicant
SET
applicant_formation=null,
applicant_it_section=null,
applicant_formation_location=null,
applicant_maturity=null,
applicant_gender=null,
applicant_name=null,
applicant_fsname=null,
applicant_address_street=null,
applicant_address_npa=null,
applicant_home_phone=null,
applicant_personal_phone=null,
applicant_mail=null,
applicant_birthdate=null,
applicant_origin=null,
applicant_nationality=null,
applicant_foreign_authorization=null,
applicant_avs=null,
applicant_main_language=null,
applicant_speaks_french=null,
applicant_speaks_german=null,
applicant_speaks_english=null,
applicant_speaks_other=null,
applicant_has_majority=null,
applicant_scolarity_end=null,
applicant_already_applicant=null,
applicant_already_applicant_year=null,
applicant_application_date=null,
applicant_application_status='deleted',
applicant_delete_date=NOW(),
fk_applicant_main_responsible=null,
fk_applicant_sec_responsible=null
WHERE applicant_id = :id AND applicant_guest_sciper = :sciper"
;
echo
"delete :
$id
"
;
$sqlreq
=
"DELETE FROM applicant WHERE applicant_id=:id"
;
$query
=
$pdo
->
prepare
(
$sqlreq
);
$query
->
bindParam
(
':id'
,
$id
,
PDO
::
PARAM_STR
);
$query
->
bindParam
(
':sciper'
,
$sciper
,
PDO
::
PARAM_STR
);
$query
->
execute
();
// delete responsibles
// TODO: check ça
$sqlreq
=
"DELETE FROM responsible WHERE responsible_id=:id1 OR responsible_id=:id2"
;
$query
=
$pdo
->
prepare
(
$sqlreq
);
$query
->
bindParam
(
':id1'
,
$rep1
,
PDO
::
PARAM_STR
);
...
...
This diff is collapsed.
Click to expand it.
canapEPFL/script.js
+
24
−
5
View file @
83bcdcfd
...
...
@@ -97,11 +97,6 @@ function initButtonsAction() {
$
(
'
#viewPostB
'
).
click
(
function
()
{
document
.
location
.
href
=
"
viewpostulation.php
"
;
});
$
(
'
#delPostB
'
).
click
(
function
()
{
if
(
confirm
(
"
Voulez-vous vraiment supprimer cette postulation ?
\r
Cette action est irréversible !
"
))
{
document
.
location
.
href
=
"
viewpostulation.php?delete
"
;
}
});
$
(
'
#infoFilieres
'
).
click
(
function
()
{
window
.
open
(
"
https://www.ict-berufsbildung.ch/fr/formation-professionnelle/formation-initiale-ict/
"
,
'
_blank
'
);
});
...
...
@@ -260,7 +255,31 @@ function initPostulationChange() {
}
function
initEdits
()
{
// init buttons
$
(
'
#delPostB
'
).
click
(
function
()
{
if
(
confirm
(
"
Voulez-vous vraiment supprimer cette postulation ?
\r
Cette action est irréversible !
"
))
{
document
.
location
.
href
=
"
viewpostulation.php?delete
"
;
}
});
$
(
'
#editPost
'
).
click
(
function
()
{
$
(
'
#editPost
'
).
prop
(
'
disabled
'
,
true
);
$
(
'
#confirmEditPost
'
).
show
();
$
(
'
#cancelEditPost
'
).
show
();
// set inputs
});
// $('#confirmEditPost').click(function () {
// });
$
(
'
#cancelEditPost
'
).
click
(
function
()
{
$
(
'
#editPost
'
).
prop
(
'
disabled
'
,
false
);
$
(
'
#confirmEditPost
'
).
hide
();
$
(
'
#cancelEditPost
'
).
hide
();
});
// hide default
$
(
'
#confirmEditPost
'
).
hide
();
$
(
'
#cancelEditPost
'
).
hide
();
}
function
checkRequired
()
{
...
...
This diff is collapsed.
Click to expand it.
canapEPFL/viewpostulation.php
+
31
−
17
View file @
83bcdcfd
...
...
@@ -30,7 +30,7 @@
<div
class=
"form-group"
>
<label>
Vous avez effectué plusieurs postulations, merci de choisir
</label>
<form
action=
"
<?=
$_SERVER
[
'PHP_SELF'
]
?>
"
method=
"post"
name=
"postSelector"
>
<select
id=
"selectPost"
name=
"selected_post"
class=
"custom-select mb-3"
onselect=
"postSelector.submit()"
>
<select
id=
"selectPost"
name=
"selected_post"
class=
"custom-select mb-3"
>
<?php
foreach
(
$postulations
as
$key
=>
$postulation
)
{
?>
<option
<?=
$key
==
$_POST
[
'selected_post'
]
?
'selected'
:
''
?>
value=
"
<?=
$key
?>
"
>
<?=
$LISTJOB
[
$postulation
[
'applicant_formation_location'
]][
$postulation
[
'applicant_formation'
]]
.
", "
.
date
(
'd/m/Y'
,
strtotime
(
$postulation
[
'applicant_application_date'
]))
?>
</option>
<?php
}
?>
...
...
@@ -40,18 +40,24 @@
<?php
}
?>
<article>
<?php
if
(
isset
(
$_GET
[
'delete'
]))
{
deletePostulation
(
$pdo
,
$_SESSION
[
'current_post'
][
'applicant_id'
],
$_SESSION
[
'current_post'
][
'applicant_guest_sciper'
],
$_SESSION
[
'current_post'
][
'fk_applicant_main_responsible'
],
$_SESSION
[
'current_post'
][
'fk_applicant_sec_responsible'
]);
}
else
if
(
isset
(
$_GET
[
'update'
]))
{
}
else
{
if
(
$_POST
[
'selected_post'
])
{
$postulation
=
$postulations
[
$_POST
[
'selected_post'
]];
}
else
{
$postulation
=
$postulations
[
0
];
}
if
(
isset
(
$_GET
[
'delete'
]))
{
deletePostulation
(
$pdo
,
$postulation
[
'applicant_id'
],
$postulation
[
'applicant_guest_sciper'
],
$postulation
[
'fk_applicant_main_responsible'
],
$postulation
[
'fk_applicant_sec_responsible'
]);
}
$_SESSION
[
'current_post'
]
=
$postulation
;
echo
"<h4>Postulation du "
.
date
(
'd/m/Y'
,
strtotime
(
$postulation
[
'applicant_application_date'
]))
.
"</h4>"
;
?>
<form
action=
"?update"
method=
"post"
>
<?php
include
(
'templates/viewPostulationTables/personnalInfosTable.php'
);
include
(
'templates/viewPostulationTables/responsiblesInfosTable.php'
);
include
(
'templates/viewPostulationTables/scolaritiesInfosTable.php'
);
...
...
@@ -59,7 +65,15 @@
include
(
'templates/viewPostulationTables/practicesInfosTable.php'
);
include
(
'templates/viewPostulationTables/filesTables.php'
);
?>
<button
type=
"button"
class=
"btn btn-primary btn-block btn-sm mt-3 mb-2"
id=
"editPost"
>
Modifier
</button>
<div
id=
"editingPost"
>
<button
type=
"submit"
class=
"btn btn-secondary btn-block btn-sm mt-3 mb-2"
id=
"confirmEditPost"
>
Confirmer
</button>
<button
type=
"button"
class=
"btn btn-secondary btn-block btn-sm mt-3 mb-2"
id=
"cancelEditPost"
>
Annuler
</button>
</div>
</form>
<br>
<button
type=
"button"
class=
"btn btn-primary btn-block btn-sm mt-3 mb-2"
id=
"delPostB"
>
Retirer ma postulation
</button>
<br>
<button
type=
"button"
class=
"btn btn-primary btn-block btn-sm mt-3 mb-2"
id=
"retourAccueil"
>
Retour
</button>
<?php
}
else
{
?>
<p>
Aucune postulation effectuée.
</p>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment