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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SI-FSD
canap
Commits
6bb72e4d
You need to sign in or sign up before continuing.
Commit
6bb72e4d
authored
5 years ago
by
Nicolas Dubois
Browse files
Options
Downloads
Patches
Plain Diff
Add job name in email to managers
parent
f03cf229
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
canapEPFL/cible.php
+11
-1
11 additions, 1 deletion
canapEPFL/cible.php
canapEPFL/helpers.php
+23
-4
23 additions, 4 deletions
canapEPFL/helpers.php
canapEPFL/models/DBController.php
+11
-0
11 additions, 0 deletions
canapEPFL/models/DBController.php
with
45 additions
and
5 deletions
canapEPFL/cible.php
+
11
−
1
View file @
6bb72e4d
...
...
@@ -22,6 +22,14 @@
if
(
isset
(
$_GET
[
'edit'
]))
{
// update data
updatePostulation
(
$pdo
,
$candidateData
,
$_FILES
);
// get job name
$job
=
$DBController
->
getPositionName
(
$candidateData
->
formation
);
if
(
$SENDEMAILS
)
{
mailToResp
(
$candidateData
->
prenomApprenti
,
$candidateData
->
nomApprenti
,
$job
);
mailToApprenti
(
$candidateData
->
mailApprenti
);
}
include
(
"templates/confirmationText.php"
);
}
else
{
// write infos in DB
...
...
@@ -34,8 +42,10 @@
// insert files in DB
insertFiles
(
$pdo
,
$candidateData
->
fichiers
,
$candidateId
,
$candidateData
->
rootpath
);
// get job name
$job
=
$DBController
->
getPositionName
(
$candidateData
->
formation
);
if
(
$SENDEMAILS
)
{
mailToResp
(
$candidateData
->
prenomApprenti
,
$candidateData
->
nomApprenti
,
$
candidateData
->
formation
);
mailToResp
(
$candidateData
->
prenomApprenti
,
$candidateData
->
nomApprenti
,
$
job
);
mailToApprenti
(
$candidateData
->
mailApprenti
);
}
// kill session
...
...
This diff is collapsed.
Click to expand it.
canapEPFL/helpers.php
+
23
−
4
View file @
6bb72e4d
<?php
#region [Mail Sendings]
function
mailToResp
(
$surname
,
$name
,
$job
){
require_once
(
"templates/mails/mailToResp.php"
);
mail
(
$to
,
$subject
,
$message
,
$headers
);
global
$EMAIL_FORMATION
,
$EMAIL_FROM
,
$EMAIL_REPLY_TO
;
$subject
=
'Nouvelle Candidature'
;
$message
=
"Candidat:
$surname
$name
\r\n
"
.
"Profession:
$job
\r\n
"
.
"Consulter la candidature sur: https://canap-gest.epfl.ch/"
;
$headers
=
"From:
$EMAIL_FROM
\r\n
"
.
"Reply-To:
$EMAIL_REPLY_TO
\r\n
"
.
"X-Mailer: PHP/"
.
phpversion
();
mail
(
$EMAIL_FORMATION
,
$subject
,
$message
,
$headers
);
}
function
mailToApprenti
(
$to
){
require_once
(
"templates/mails/mailToApp.php"
);
mail
(
$to
,
$subject
,
$message
,
$headers
);
global
$EMAIL_FROM
,
$EMAIL_REPLY_TO
;
$subject
=
'Votre candidature pour une place d\'apprentissage'
;
$message
=
file_get_contents
(
'./templates/mails/apprenticeMailTemplate.html'
);
$headers
=
"From:
$EMAIL_FROM
\r\n
"
.
"Content-type: text/html; charset=utf8
\r\n
"
.
"Reply-To:
$EMAIL_REPLY_TO
\r\n
"
.
"X-Mailer: PHP/"
.
phpversion
();
mail
(
$to
,
$subject
,
$message
,
$headers
);
}
#endregion
...
...
This diff is collapsed.
Click to expand it.
canapEPFL/models/DBController.php
+
11
−
0
View file @
6bb72e4d
...
...
@@ -15,4 +15,15 @@ class DBController {
$query
->
execute
();
return
$query
->
fetchAll
();
}
public
function
getPositionName
(
int
$positionId
)
{
$sqlreq
=
"SELECT * FROM position JOIN job ON job_id = fk_job JOIN location ON fk_location = location_id WHERE position_id = :position"
;
$query
=
$this
->
pdo
->
prepare
(
$sqlreq
);
$query
->
bindParam
(
':position'
,
$positionId
,
PDO
::
PARAM_INT
);
$query
->
execute
();
$job
=
$query
->
fetch
();
return
"
{
$job
[
"job_full_value"
]
}
(
{
$job
[
"location_site"
]
}
)"
;
}
}
\ No newline at end of file
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
register
or
sign in
to comment