This commit is contained in:
Znote 2019-03-22 19:35:12 +01:00
parent 6fee46767b
commit 9f95fa4bb8

View File

@ -376,41 +376,43 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
FROM player_storage FROM player_storage
WHERE `player_id` = {$user_id} WHERE `player_id` = {$user_id}
"); ");
foreach ($config['quests'] as $cquest) { if (isset($config['quests']) && !empty($config['quests'])) {
$totalquests = $totalquests + 1; foreach ($config['quests'] as $cquest) {
foreach ($sqlquests as $dbquest) { $totalquests = $totalquests + 1;
if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) { foreach ($sqlquests as $dbquest) {
$completedquests = $completedquests + 1; if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) {
$completedquests = $completedquests + 1;
}
} }
} if ($cquest[3] == 1) {
if ($cquest[3] == 1) { if ($completedquests != 0) {
if ($completedquests != 0) { if ($firstrun == 1): ?>
if ($firstrun == 1): ?> <b> Quest progression </b>
<b> Quest progression </b> <table id="characterprofileQuest" class="table table-striped table-hover">
<table id="characterprofileQuest" class="table table-striped table-hover"> <thead>
<thead> <tr class="yellow">
<tr class="yellow"> <th>Quest:</th>
<th>Quest:</th> <th>progression:</th>
<th>progression:</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> <?php
$firstrun = 0;
endif;
$completed = $completedquests / $totalquests * 100;
?>
<tr>
<td><?php echo $cquest[2]; ?></td>
<td id="progress">
<span id="percent"><?php echo round($completed); ?>%</span>
<div id="bar" style="width: '.$completed.'%"></div>
</td>
</tr>
<?php <?php
$firstrun = 0; }
endif; $completedquests = 0;
$completed = $completedquests / $totalquests * 100; $totalquests = 0;
?>
<tr>
<td><?php echo $cquest[2]; ?></td>
<td id="progress">
<span id="percent"><?php echo round($completed); ?>%</span>
<div id="bar" style="width: '.$completed.'%"></div>
</td>
</tr>
<?php
} }
$completedquests = 0;
$totalquests = 0;
} }
} }
} }