Skip to content

Commit

Permalink
award points prikaz broja
Browse files Browse the repository at this point in the history
  • Loading branch information
djordjeds committed Jun 2, 2022
1 parent 86e24f8 commit 0fba672
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
Binary file added faza5/Korisceni_alati.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion faza5/app/Controllers/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public function awardUser($idUser) {
$user = $this->getUser();
$awardee = (new UserM())->find($idUser);

$this->show('awardPoints', ['currentUser' => $user, 'awardee' => $awardee]);
$this->show('awardPoints', ['currentUser' => $user, 'awardee' => $awardee, 'title' => 'Award User']);
}

public function awardUserSubmit($idUser) {
Expand Down
29 changes: 17 additions & 12 deletions faza5/app/Views/pages/awardPoints.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
<form name='awardUser' action="<?= site_url("User/awardUserSubmit/{$awardee->id}") ?>" method="POST">
<br><br>
<div id="short-main">
<!-- <h2>Award Points</h2> -->
<form name='awardUser' action="<?= site_url("User/awardUserSubmit/{$awardee->id}") ?>" method="POST">
<span style="font-size: 25px; vertical-align: middle;">Award points to <br> <img style="width: 30px; vertical-align: middle;" src="<?php user_avatar($awardee->id) ?>" /> <?php echo $awardee->nickname ?>.</span>

<div>Awarder: </div>
<div><?php print_r($currentUser) ?></div>
<input type="range" id='coa' min="1" max="<?php echo $currentUser->points; ?>" value='0' step="1" name="points" onchange='document.getElementById("mybar").value = "" + document.getElementById("coa").value;'/>
<input type="text" name="mybar" id="mybar" value="" disabled style="color:rgb(255, 196, 0); background-color:rgb(0,0,0,0); border:0" />
<input type="submit" class="btn" name="action" value="Award User">
</form>

<br>

<div>Awardee: </div>
<div><?php print_r($awardee) ?></div>
<?php
if (isset($_POST["points"])) {
echo "" . $_POST["points"];
// Your Slider value is here, do what you want with it. Mail/Print anything..
} else {
echo "Please slide the bar and press award user.";
}
?>

<input type="range" min="0" max="<?php echo $currentUser->points; ?>" value='0' step="1" name="points" />

<input type="submit" class="btn" name="action" value="Award user">

</form>
</div>
2 changes: 1 addition & 1 deletion faza5/app/Views/pages/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<form name='friend_button' action="<?= site_url("user/profile/" . $user_profile->id); ?>" method="POST" style="margin: 0">
<input type="submit" name="frnd_btn" class="btn" value="<?= $buttonName ?>" style="margin:0px;border-radius: 0 5px 0 0; height: 50%;">
</form>
<a href="http://localhost:8080/user/reward/<?php echo $user_profile->id ?>"><input type="button" class="btn" value="Reward User" style="margin:0px;border-radius: 0 0 5px 0; height: 50%;"></a>
<a href="http://localhost:8080/user/awardUser/<?php echo $user_profile->id ?>"><input type="button" class="btn" value="Reward User" style="margin:0px;border-radius: 0 0 5px 0; height: 50%;"></a>
<?php } ?>
</div>
</div>
Expand Down

0 comments on commit 0fba672

Please sign in to comment.