Skip to content
Snippets Groups Projects
Commit 55b3db0b authored by nicrausaz's avatar nicrausaz
Browse files

Close if no positions, mails

parent 22f0c228
No related branches found
No related tags found
No related merge requests found
......@@ -35,8 +35,8 @@
insertFiles($pdo, $candidateData->fichiers, $candidateId, $candidateData->rootpath);
if ($SENDEMAILS) {
mailToResp($candidateData->prenomApprenti, $candidateData->nomApprenti, $candidateData->formation);
mailToApprenti($candidateData->mailApprenti, $candidateData->formation);
mailToResp($candidateData->prenomApprenti, $candidateData->nomApprenti);
mailToApprenti($candidateData->mailApprenti);
}
// kill session
$_SESSION['formError'] = false;
......
......@@ -7,8 +7,7 @@
// Mettre a false pour pas spammer pendant le dev
$SENDEMAILS = false;
// TODO: If 0 postitions => closed
$POSTULATION_OPEN = true; // close/open postulation
$POSTULATION_OPEN = count($DBController->getOpenPositions()) > 0; // close/open postulation
if (!$POSTULATION_OPEN && $_SERVER['PHP_SELF'] != '/denied.php') { header("Location: ./denied.php"); }
?>
\ No newline at end of file
<?php
#region [Mail Sendings]
function mailToResp($surname, $name, $job){
function mailToResp($surname, $name){
require_once("templates/mails/mailToResp.php");
mail($to, $subject, $message, $headers);
}
function mailToApprenti($to, $job){
function mailToApprenti($to){
require_once("templates/mails/mailToApp.php");
mail($to, $subject, $message, $headers);
}
......
......@@ -21,13 +21,13 @@
gtag('config', 'UA-130041798-1', { 'anonymize_ip': true });
</script>
<?php
// ini_set("display_errors", 0);
// error_reporting(0);
ini_set("display_errors", 0);
error_reporting(0);
// ini_set("display_errors", 1);
// error_reporting(E_ALL);
require_once('configs/config.php');
require('configs/db.php');
include('models/DBController.php');
$DBController = new DBController($pdo);
require_once('configs/config.php');
if (!isset($_SESSION)) { session_start(); }
?>
\ No newline at end of file
......@@ -219,7 +219,7 @@
<table border="0" cellspacing="0" cellpadding="0" class="responsive-table">
<tr>
<td align="center">
<a href="http://canap-dev.epfl.ch/viewpostulation.php" target="_blank"
<a href="https://canap.epfl.ch/viewpostulation.php" target="_blank"
style="font-size: 16px; font-family: Helvetica, Arial, sans-serif; font-weight: normal; color: #ffffff; text-decoration: none; background-color: #e30713; border-top: 15px solid #e30713; border-bottom: 15px solid #e30713; border-left: 25px solid #e30713; border-right: 25px solid #e30713; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; display: inline-block;"
class="mobile-button">Consulter votre postulation</a>
</td>
......
......@@ -3,8 +3,7 @@ $to = 'formation.apprentis@epfl.ch';
$subject = 'Nouvelle Candidature';
$message = "Candidat: ".$surname." ".$name."\n\n".
"Apprentissage: ".$job."\n\n".
"Consulter la candidature sur: "."\\\\scxdata\\apprentis$\\candidatures\\nouvelles";
"Consulter la candidature sur: https://canap-gest.epfl.ch/";
$headers = 'From: noreply+formulaireApprentis@epfl.ch' . "\r\n" .
'Reply-To: formation.apprentis@epfl.ch' . "\r\n" .
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment