Skip to content

Commit

Permalink
Mail-Upgrade -> Issue #192
Browse files Browse the repository at this point in the history
  • Loading branch information
erleiuat committed Nov 13, 2018
1 parent 7fb7e0e commit 3e70a24
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
12 changes: 11 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,17 @@

<footer class="footer" id="slideMeFoot" style="display: none;">
<div class="container">
<a class="foot-link" href="modul/settings/settings.php"><?php echo $translate[16] ?></a> <b class="text-muted">|</b> <a class="foot-link" href="modul/kontakt/kontakt.php"><?php echo $translate[263] ?></a><i class="text-muted"> | <?php echo $_SESSION["user"]['username']; ?></i><span class="text-muted">©<a href="https://www.baloise.com/de/home.html"> Baloise Group</a> | 2018 | <?php echo $appinfo["title"];?> <a href="https://github.com/baloise/eva">v.1.0</a> by <a href="https://eliareutlinger.ch">Elia Reutlinger</a></span>
<a class="foot-link" href="modul/settings/settings.php"><?php echo $translate[16] ?></a> <b class="text-muted">|</b>
<a class="foot-link" href="modul/kontakt/kontakt.php"><?php echo $translate[263] ?></a>
<i class="text-muted"> |
<?php echo $_SESSION["user"]['username']; ?>
</i>
<span class="text-muted">©
<a href="https://www.baloise.com/de/home.html"> Baloise Group</a> | 2018 |
<?php echo $appinfo["title"];?>
<a href="https://github.com/baloise/eva">v.1.1</a> by
<a href="https://eliareutlinger.ch">Elia Reutlinger</a>
</span>
</div>
</footer>
</div>
Expand Down
34 changes: 31 additions & 3 deletions modul/noten/call/modify.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,37 @@
$sql = "SELECT firstname, lastname, bKey FROM `tb_user` WHERE ID = $session_userid";
$result = $mysqli->query($sql);

$sql2 = "SELECT subjectName FROM `tb_user_subject` WHERE ID = $subject";
$result2 = $mysqli->query($sql2);

if (isset($result) && $result->num_rows == 1) {
$userData = $result->fetch_assoc();

//SENDMAIL
include("../../../includes/generateMail.php");
$msgcontent = array('{firstname}' => $userData['firstname'], '{lastname}' => $userData['lastname'], '{bkey}' => $userData['bKey'], '{gradeTitle}' => $title, '{grade}' => $grade, '{gradeWeight}' => $weight, '{gradeReason}' => $reason);
if (isset($result2) && $result2->num_rows == 1) {
$subjectName = ($result2->fetch_assoc())['subjectName'];
$msgcontent = array(
'{firstname}' => $userData['firstname'],
'{lastname}' => $userData['lastname'],
'{bkey}' => $userData['bKey'],
'{gradeTitle}' => $title.' ('.$subjectName.')',
'{grade}' => $grade,
'{gradeWeight}' => $weight,
'{gradeReason}' => $reason
);
} else {
$msgcontent = array(
'{firstname}' => $userData['firstname'],
'{lastname}' => $userData['lastname'],
'{bkey}' => $userData['bKey'],
'{gradeTitle}' => $title,
'{grade}' => $grade,
'{gradeWeight}' => $weight,
'{gradeReason}' => $reason
);
}

$subject = strtr($translate[202], $msgcontent);
$message = strtr($translate[203], $msgcontent);
sendMail($subject, $message, $session_userid, "hr", $session_appinfo, $mysqli, $translate);
Expand Down Expand Up @@ -266,9 +291,12 @@
if($error){
echo $error;
} else {

$stmt = $mysqli->prepare("INSERT INTO `tb_user_subject` (`subjectName`, `tb_user_ID`, `tb_semester_ID`, `school`, `weight`) VALUES (?, ?, ?, ?, ?);");
$stmt->bind_param("siiid", $subName, $session_userid, $subSem, $subType, $subWeight);
$stmt->execute();
$rc = $stmt->bind_param("siiid", $subName, $session_userid, $subSem, $subType, $subWeight);
$rc = $stmt->execute();
$stmt->close();

}

} else if($_POST['todo'] == "deleteSubject"){
Expand Down

0 comments on commit 3e70a24

Please sign in to comment.