132 lines
5.3 KiB
PHP
Executable File
132 lines
5.3 KiB
PHP
Executable File
<?PHP
|
|
|
|
function mail_zusage($stellen, $uid1){
|
|
|
|
|
|
$array = unserialize($stellen);
|
|
|
|
for($i=0;$i<count($array);$i++){ // welche Stellen wurden angeklickt?
|
|
$stelle .= "$array[$i],";
|
|
|
|
}
|
|
|
|
$stelle=substr($stelle, 0, -1);
|
|
|
|
$db = dbconnect();
|
|
$result = $db->query("SELECT mail, mail2, vorname, nachname
|
|
FROM stud
|
|
WHERE uid = '$uid1'");
|
|
$row = $result->fetch_array();
|
|
|
|
|
|
#######################
|
|
## MAIL bei ZUSAGE
|
|
#######################
|
|
|
|
|
|
|
|
$empfaenger = $row[mail];
|
|
$betreff = "Zusage im Stellenantragssystem";
|
|
$text = "<html>
|
|
<head>
|
|
<title>Zuweisung</title>
|
|
</head>
|
|
<body>
|
|
<font face='Arial' size='2'>
|
|
Guten Tag $row[vorname] $row[nachname]!<br><br>
|
|
Im Stellenantragssystem wurden Sie folgender Praxisstelle zugewiesen:<br><br>
|
|
</font>
|
|
<table>";
|
|
$db = dbconnect();
|
|
$query = "SELECT saaid, bezeichnung, ort, date_format(beginn, '%d%.%m.%Y') beginn, date_format(ende, '%d%.%m.%Y') ende, date_format(beginn, '%Y%m%d') beginnform
|
|
FROM stan_antrag
|
|
WHERE saaid IN ($stelle)
|
|
AND zuweisung = 'Z'
|
|
ORDER BY beginnform
|
|
";
|
|
|
|
|
|
$result = $db->query ($query)
|
|
or die ("Cannot execute query");
|
|
|
|
|
|
|
|
while ($row15 = $result->fetch_array()){
|
|
$text .= "
|
|
<tr>
|
|
<td width='60%'>
|
|
<font face='Arial' size='2'><b>Bezeichnung:</b></font>
|
|
</td>
|
|
<td width='40%' align='left'>
|
|
<font face='Arial' size='2'>$row15[bezeichnung] </font>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width='60%'>
|
|
<b><font face='Arial' size='2'>Ort</font></b><font face='Arial' size='2'><b>:</b></font>
|
|
</td>
|
|
<td width='40%' align='left'>
|
|
<font face='Arial' size='2'>$row15[ort] </font>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width='60%'>
|
|
<font face='Arial' size='2'><b>Zeitraum:</b></font></td>
|
|
<td width='40%' align='left'>
|
|
<font face='Arial' size='2'>$row15[beginn] - $row15[ende]</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td width='60%'>
|
|
|
|
</td>
|
|
<td width='40%' align='left'>
|
|
|
|
</td>
|
|
</tr>
|
|
";
|
|
|
|
}
|
|
$text .= "
|
|
</table>
|
|
<font face='Arial' size='2'>
|
|
Diese Mail wurde automatisch generiert!<br>
|
|
Antworten Sie daher nicht auf diese Mail<br>
|
|
<br>
|
|
Vielen Dank
|
|
</font>
|
|
</body>
|
|
</html>";
|
|
|
|
$result20 = $db->query("SELECT wert2
|
|
FROM parameter
|
|
WHERE pid = '4'");
|
|
$row20 = $result20->fetch_array();
|
|
|
|
$sender = "Stellenantragssystem";
|
|
$sendermail = "$row20[wert2]";
|
|
|
|
$headers = "From: $sender <$sendermail>\r\n";
|
|
$headers .= "MIME-Version: 1.0\r\n";
|
|
$headers .= "Content-type: text/html; charset=utf-8\r\n";
|
|
|
|
|
|
// Emailversand:
|
|
if ($row[mail2] != '')
|
|
{
|
|
$empfaenger .= ", $row[mail2]";
|
|
}
|
|
|
|
$ret = @mail($empfaenger, $betreff, $text, $headers);
|
|
|
|
if($ret){
|
|
return TRUE;
|
|
}else{
|
|
return FALSE;
|
|
}
|
|
|
|
#######################
|
|
## MAIL BEI ZUSAGE ENDE
|
|
#######################
|
|
|
|
}
|
|
?>
|