Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Achievements #117

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Website/achievements.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php include 'zz1.php'; ?>
<title>Manager-Achievements | Ballmanager.de</title>
<?php include 'zz2.php'; ?>
<?php if ($loggedin == 1) { ?>
<?php
$nDone = 0;
function showErfolg($erfolg = 0) {
global $nDone;
if ($erfolg > 0) {
$nDone++;
return '<img src="/images/erfolg.png" width="16" alt="J" title="Erfolgreich bestanden" />';
}
else {
return '<img src="/images/fehler.png" width="16" alt="N" title="Noch nicht abgeschlossen" />';
}
}
echo '<h1>Manager-Achievements</h1>';
echo '<p>Der Vorstand Deines Klubs hat viel Vertrauen in Dich. Aber bevor Du Transfers aushandeln darfst, sollst Du erst alle Aufgaben dieser Manager-Prüfung erfolgreich abschließen.</p>';
$html = '<table><thead><tr class="odd"><th scope="col">&nbsp;</th><th scope="col">Prüfung</th></tr></thead><tbody>';
$sql1 = "SELECT a.task, b.id AS done FROM ".$prefix."licenseTasks AS a LEFT JOIN ".$prefix."licenseTasks_Completed AS b ON a.shortName = b.task AND b.user = '".$cookie_id."' LIMIT 30, 40";
$sql2 = mysql_query($sql1);
$rowCounter = 2;
while ($sql3 = mysql_fetch_assoc($sql2)) {
$html .= '<tr';
if ($rowCounter % 2 != 0) { $html .= ' class="odd"'; }
$html .= '>';
$html .= '<td>'.showErfolg($sql3['done']).'</td>';
$html .= '<td>['.sprintf('%1$02d', $rowCounter+1).'] '.$sql3['task'].'</td></tr>';
$rowCounter++;
}
$html .= '</tbody></table>';
$pDone = floor($nDone/$rowCounter*100);
echo '<div style="width:400px; height:40px; margin:10px auto; border:1px solid #000; background-color:#fff; color:#fff"><div style="width:'.floor(400*$pDone/100).'px; height:40px; margin:0; background-color:#3b69b6;"></div></div>';
echo '<p style="text-align:center; font-size:14px">'.$pDone.'% ABGESCHLOSSEN</p>';
echo $html;
?>
<?php } else { ?>
<p>Du musst angemeldet sein, um diese Seite aufrufen zu können!</p>
<?php } ?>
<?php include 'zz3.php'; ?>
15 changes: 15 additions & 0 deletions Website/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,21 @@ function updateTextLength(element) {
</tbody>
</table>
<?php
$id = 30;
function showAchiev($erfolg = 0, $title, $id) {
if ($erfolg > 0) {
return '<img width="35" style="vertical-align: middle;" title="'.$title.'" src="images/'.$id.'.png">';
}
}
$sql1 = "SELECT a.task, b.id AS done FROM ".$prefix."licenseTasks AS a LEFT JOIN ".$prefix."licenseTasks_Completed AS b ON a.shortName = b.task AND b.user = '".$clearedID."' LIMIT 30, 40"; // change this depending on the max amount of achiev you have
$sql2 = mysql_query($sql1);
$html = ' ';
while ($sql3 = mysql_fetch_assoc($sql2)) {
$id++;
$html .= showAchiev($sql3['done'], $sql3['task'], $id);
}
echo '<div style="margin-left:5px">'.$html.'<div style="border-top: 1px solid #eff0f1;"><a href="/achievements.php">Display my achievements</a></div></div>';?>
<?php
if ($sql3['team'] != '__'.$cookie_id && $clearedID != '__'.$cookie_id) {
if ($wantTests == 1) {
// MEHERE TESTSPIELE AM GLEICHEN TAG VERHINDERN ANFANG
Expand Down
4 changes: 2 additions & 2 deletions Website/managerPruefung.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function showErfolg($erfolg = 0) {
$html = '<table><thead><tr class="odd"><th scope="col">&nbsp;</th><th scope="col">Prüfung</th></tr></thead><tbody>';
$html .= '<tr><td>'.showErfolg(1).'</td><td>[01] Registriere Dich beim Ballmanager und aktiviere Deinen Account.</td></tr>';
$html .= '<tr class="odd"><td>'.showErfolg(1).'</td><td>[02] Wähle nach dem ersten Login Dein Team und Deine Liga.</td></tr>';
$sql1 = "SELECT a.task, b.id AS done FROM ".$prefix."licenseTasks AS a LEFT JOIN ".$prefix."licenseTasks_Completed AS b ON a.shortName = b.task AND b.user = '".$cookie_id."'";
$sql1 = "SELECT a.task, b.id AS done FROM ".$prefix."licenseTasks AS a LEFT JOIN ".$prefix."licenseTasks_Completed AS b ON a.shortName = b.task AND b.user = '".$cookie_id."' LIMIT 0, 30";
$sql2 = mysql_query($sql1);
$rowCounter = 2;
while ($sql3 = mysql_fetch_assoc($sql2)) {
Expand Down Expand Up @@ -77,4 +77,4 @@ function showErfolg($erfolg = 0) {
<?php } else { ?>
<p>Du musst angemeldet sein, um diese Seite aufrufen zu können!</p>
<?php } ?>
<?php include 'zz3.php'; ?>
<?php include 'zz3.php'; ?>