Merge pull request #186 from ninjalulz/master

Minor fixes
This commit is contained in:
Stefan A. Brannfjell 2015-01-17 16:07:35 +01:00
commit 3ded14bee9
4 changed files with 74 additions and 25 deletions

View File

@ -50,7 +50,7 @@ if (empty($_POST) === false) {
$acc_id = user_character_account_id($_POST['reset_pass']); $acc_id = user_character_account_id($_POST['reset_pass']);
if ($acc_id != $session_user_id) { if ($acc_id != $session_user_id) {
if ($config['TFSVersion'] == 'TFS_02') { if ($config['TFSVersion'] == 'TFS_02' || $config['TFSVersion'] == 'TFS_10') {
user_change_password($acc_id, $_POST['new_pass']); user_change_password($acc_id, $_POST['new_pass']);
} else if ($config['TFSVersion'] == 'TFS_03') { } else if ($config['TFSVersion'] == 'TFS_03') {
user_change_password03($acc_id, $_POST['new_pass']); user_change_password03($acc_id, $_POST['new_pass']);

View File

@ -1,4 +1,4 @@
<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; <?php require_once 'engine/init.php'; include 'layout/overall/header.php';
protect_page(); protect_page();
admin_only($user_data); admin_only($user_data);
@ -20,6 +20,19 @@ if ($view !== false){
mysql_insert("INSERT INTO `znote_tickets_replies` ($fields) VALUES ($data)"); mysql_insert("INSERT INTO `znote_tickets_replies` ($fields) VALUES ($data)");
mysql_update("UPDATE `znote_tickets` SET `status`='Staff-Reply' WHERE `id`='$view' LIMIT 1;"); mysql_update("UPDATE `znote_tickets` SET `status`='Staff-Reply' WHERE `id`='$view' LIMIT 1;");
} else if (!empty($_POST['admin_ticket_close'])) {
$ticketId = (int) $_POST['admin_ticket_id'];
mysql_update("UPDATE `znote_tickets` SET `status` = 'CLOSED' WHERE `id` ='$ticketId' LIMIT 1;");
} else if (!empty($_POST['admin_ticket_open'])) {
$ticketId = (int) $_POST['admin_ticket_id'];
mysql_update("UPDATE `znote_tickets` SET `status` = 'Open' WHERE `id` ='$ticketId' LIMIT 1;");
} else if (!empty($_POST['admin_ticket_delete'])) {
$ticketId = (int) $_POST['admin_ticket_id'];
mysql_delete("DELETE FROM `znote_tickets` WHERE `id`='$ticketId' LIMIT 1;");
header("Location: admin_helpdesk.php");
} }
$ticketData = mysql_select_single("SELECT * FROM znote_tickets WHERE id='$view' LIMIT 1;"); $ticketData = mysql_select_single("SELECT * FROM znote_tickets WHERE id='$view' LIMIT 1;");
@ -28,11 +41,11 @@ if ($view !== false){
<table class="znoteTable ThreadTable table table-striped"> <table class="znoteTable ThreadTable table table-striped">
<tr class="yellow"> <tr class="yellow">
<th> <th>
<?php <?php
echo getClock($ticketData['creation'], true); echo getClock($ticketData['creation'], true);
?> ?>
- Created by: - Created by:
<?php <?php
echo $ticketData['username']; echo $ticketData['username'];
?> ?>
</th> </th>
@ -51,11 +64,11 @@ if ($view !== false){
<table class="znoteTable ThreadTable table table-striped"> <table class="znoteTable ThreadTable table table-striped">
<tr class="yellow"> <tr class="yellow">
<th> <th>
<?php <?php
echo getClock($reply['created'], true); echo getClock($reply['created'], true);
?> ?>
- Posted by: - Posted by:
<?php <?php
echo $reply['username']; echo $reply['username'];
?> ?>
</th> </th>
@ -66,19 +79,44 @@ if ($view !== false){
</td> </td>
</tr> </tr>
</table> </table>
<hr class="bighr">
<?php <?php
} }
} }
?> ?>
<form action="" method="post">
<input type="hidden" name="username" value="ADMIN"><br> <!-- Open/Close Ticket -->
<textarea class="forumReply" name="reply_text" style="width: 610px; height: 150px"></textarea><br> <table class="znoteTable ThreadTable table table-striped">
<input name="" type="submit" value="Post Reply" class="btn btn-primary"> <tr>
</form> <td>
<form action="" method="post" align="center">
<input type="hidden" name="admin_ticket_id" value="<?php echo $ticketData['id']; ?>">
<?php if ($ticketData['status'] !== 'CLOSED') { ?>
<input type="submit" name="admin_ticket_close" value="Close Ticket" class="btn btn-warning">
<?php } else { ?>
<input type="submit" name="admin_ticket_open" value="Open Ticket" class="btn btn-success">
<?php } ?>
</form>
</td>
<td>
<form action="" method="post" align="center" onClick="return confirm('Are you sure you want to delete this ticket?');">
<input type="hidden" name="admin_ticket_id" value="<?php echo $ticketData['id']; ?>">
<input type="submit" name="admin_ticket_delete" value="Delete Ticket" class="btn btn-danger">
</form>
</td>
</tr>
</table>
<?php if ($ticketData['status'] !== 'CLOSED') { ?>
<hr class="bighr">
<form action="" method="post">
<input type="hidden" name="username" value="ADMIN"><br>
<textarea class="forumReply" name="reply_text" style="width: 610px; height: 150px"></textarea><br>
<input name="" type="submit" value="Post Reply" class="btn btn-primary">
</form>
<?php } ?>
<?php <?php
} else { } else {
?> ?>
<h1>Latest Tickets</h1> <h1>Latest Tickets</h1>
<?php <?php
$tickets = mysql_select_multi("SELECT id,subject,creation,status FROM znote_tickets ORDER BY creation DESC"); $tickets = mysql_select_multi("SELECT id,subject,creation,status FROM znote_tickets ORDER BY creation DESC");
@ -105,5 +143,5 @@ if ($view !== false){
<?php <?php
} else echo 'No helpdesk tickets has been submitted.'; } else echo 'No helpdesk tickets has been submitted.';
} }
include 'layout/overall/footer.php'; include 'layout/overall/footer.php';
?> ?>

View File

@ -239,12 +239,14 @@ if (user_logged_in() === true) {
} }
} }
//data_dump($players, false, "Data"); //data_dump($players, false, "Data");
$rankName = '';
foreach ($players as $player) { foreach ($players as $player) {
if ($config['TFSVersion'] !== 'TFS_10') { if ($config['TFSVersion'] !== 'TFS_10') {
$chardata['online'] = $player['online']; $chardata['online'] = $player['online'];
} else $chardata['online'] = (in_array($player['id'], $onlinelist)) ? 1 : 0; } else $chardata['online'] = (in_array($player['id'], $onlinelist)) ? 1 : 0;
echo '<tr>'; echo '<tr>';
echo '<td>'. $player['rank_name'] .'</td>'; echo '<td>' . ($rankName !== $player['rank_name'] ? $player['rank_name'] : '') . '</td>';
$rankName = $player['rank_name'];
echo '<td><a href="characterprofile.php?name='. $player['name'] .'">'. $player['name'] .'</a>'; echo '<td><a href="characterprofile.php?name='. $player['name'] .'">'. $player['name'] .'</a>';
if (!empty($player['guildnick'])) { if (!empty($player['guildnick'])) {
echo ' ('. $player['guildnick'] .')'; echo ' ('. $player['guildnick'] .')';

View File

@ -29,7 +29,13 @@ if ($view !== false) {
die; die;
} }
?> ?>
<h1>View Ticket #<?php echo $ticketData['id']; ?></h1> <h1>View Ticket #
<?php
echo $ticketData['id'];
if ($ticketData['status'] === 'CLOSED') {
echo '<span style="color:red">[CLOSED]</SPAN>';
}
?></h1>
<table class="znoteTable ThreadTable table table-striped"> <table class="znoteTable ThreadTable table table-striped">
<tr class="yellow"> <tr class="yellow">
<th> <th>
@ -76,11 +82,14 @@ if ($view !== false) {
} }
} }
?> ?>
<form action="" method="post">
<input type="hidden" name="username" value="<?php echo $ticketData['username']; ?>"><br> <?php if ($ticketData['status'] !== 'CLOSED') { ?>
<textarea class="forumReply" name="reply_text" style="width: 610px; height: 150px"></textarea><br> <form action="" method="post">
<input name="" type="submit" value="Post Reply" class="btn btn-primary"> <input type="hidden" name="username" value="<?php echo $ticketData['username']; ?>"><br>
</form> <textarea class="forumReply" name="reply_text" style="width: 610px; height: 150px"></textarea><br>
<input name="" type="submit" value="Post Reply" class="btn btn-primary">
</form>
<?php } ?>
<?php <?php
} else { } else {