First you will need to add a colum to your characters/character_ticket db make the new colum < admin >
or run this it's your choice...
Code:
ALTER TABLE character_ticket ADD admin VARCHAR(60) AFTER ticket_lastchange;
them change templates\offlike\admin\admin.index.php to this:
Code:
<ul style="font-weight:bold;"><h2>Server Managment</h2>
<li><a href="index.php?n=admin&sub=tickets">GM Ticket Manager</a></li>
them change templates\offlike\admin\admin.tickets.php to this:
Code:
<br>
<?php builddiv_start(1, $lang['tickets']) ?>
<style type="text/css">
a.server { border-style: solid; border-width: 0px 1px 1px 0px; border-color: #D8BF95; font-weight: bold; }
td.serverStatus1 { font-size: 1.8em; border-style: solid; border-width: 0px 1px 1px 0px; border-color: #D8BF95; }
td.serverStatus2 { font-size: 1.8em; border-style: solid; border-width: 0px 1px 1px 0px; border-color: #D8BF95; background-color: #C3AD89; }
td.rankingHeader { color: #C7C7C7; font-size: 10pt; font-family: arial,helvetica,sans-serif; font-weight: bold; background-color: #2E2D2B; border-style: solid; border-width: 1px; border-color: #5D5D5D #5D5D5D #1E1D1C #1E1D1C; padding: 3px;}
</style>
<br><center><img src= "http://YOUR_SERVER/YOUR_BANNER.jpg"></br><br><br>
<?php write_metalborder_header(); ?>
<?php builddiv_end() ?>
<?php
$db="characters";
$link = mysql_connect('localhost:3308', 'ROOT_USER', 'ROOT_PASS');
if (! $link) die(mysql_error());
mysql_select_db($db , $link) or die ("Couldn't open $db:".mysql_error());
$result = mysql_query("SELECT * FROM character_ticket") or die ("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
echo "<table width=600 border=2>";
echo "<tr><th>ID</th><th>Guid</th><th>Player's Ticket</th><th>Response</th><th>Date</th><th>Admin</th></tr>";
while ($get_info = mysql_fetch_row($result)){
echo "<tr>";
foreach ($get_info as $field)
echo "<td>$field</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($link);
?>
<?php write_metalborder_footer(); ?>
<br><br>
<?php echo $lang['tickets_desc']; ?><br /><br />
<?php
foreach($alltopics as $topic) {
$topic_choose .= "<option value='".$topic['ticket_id']."'>".$topic['ticket_id']."</option>";
}
// We we start with our form posts
if(isset($_POST['add'])){
if(isset($_POST['add_admin'])) {
if(isset($_POST['add_response_text'])) {
$ques = $_POST['add_admin'];
$answ = $_POST['add_response_text'];
$CHDB->query("INSERT INTO `character_ticket` (`admin`,`response_text`) VALUES ('". $ques ."','". $answ ."')");
echo "<font color=\"blue\"><center>Added Response...</center></font>";
}else{ echo "<font color=\"darkred\"><center>You Must Provide An Admin Name.</center></font>"; }
}else{ echo "<font color=\"darkred\"><center>You Must Provide A Response.</center></font>"; }
}elseif(isset($_POST['delete'])){
$gid = $_POST['delete'];
$CHDB->query("DELETE FROM `character_ticket` WHERE `ticket_id`=?d",$gid);
echo "<font color=\"blue\"><center>Deleted Ticket #" . $gid . ".</center></font>";
}elseif(isset($_POST['finishedit'])){
if(isset($_POST['edit_admin'])) {
if(isset($_POST['edit_response_text'])) {
$ques = $_POST['edit_admin'];
$answ = $_POST['edit_response_text'];
$gid = $_POST['edit_ticket_id'];
$CHDB->query("UPDATE `character_ticket` SET `admin`='". $ques ."', `response_text`='". $answ ."' WHERE `ticket_id`=?d",$gid);
echo "<font color=\"blue\"><center>Successfully Edited Ticket #" . $gid . ".</center></font>";
}
}
}
?>
<center>
<!-- If user posted to edit -->
<?php
if(isset($_POST['edit'])){
$numb = $_POST['edit'];
$q = $CHDB->select("SELECT `admin`,`response_text` FROM `character_ticket` WHERE `ticket_id`=?d",$numb);
foreach($q as $qs) {
}
?>
<form action="index.php?n=admin&sub=tickets" method="POST">
<table width="600px">
<tr><center>Editting Ticket # <?php echo $numb ?></center></tr>
<tr><center><b>Name of Administrator / GM: </b><input type="text" name="edit_admin" size="50" value="<?php echo $qs['admin'] ?>"></center></tr>
<tr><center><b>Response to Ticket: </b><input type="text" name="edit_response_text" size="50" value="<?php echo $qs['response_text'] ?>"></center></tr>
<tr><center><input type="hidden" name="edit_ticket_id" value="<?php echo $numb ?>"><input type="submit" value="Finish" name="finishedit"></center></tr>
</table>
</form>
</center>
<?php }else{ ?>
<!-- Add -->
<form action="index.php?n=admin&sub=tickets" method="POST">
<table width="600px">
<tr><H3><center>RESPOND TO A TICKET</center></h3></tr><br />
<tr><center><b>Name of Administrator / GM: </b><input type="text" name="add_admin" size="50"></center></tr>
<tr><center><b>Response to Ticket: </b><input type="text" name="add_response_text" size="50"></center></tr>
<tr><center><input type="submit" value="Send Answer" name="add"></center></tr>
</table>
</form>
</center>
<br /><br />
<!-- Edit -->
<center>
<form action="index.php?n=admin&sub=tickets" method="POST">
<table width="600px" >
<tr><center>Select A Ticket To Edit</center></tr>
<tr><center><select name='edit'><?php echo $topic_choose ?></select></center></tr>
<tr><center><input type="submit" value="EDIT"></center></tr>
</table>
</form>
</center>
<br /><br />
<!-- Delete -->
<center>
<form action="index.php?n=admin&sub=tickets" method="POST">
<table width="600px">
<tr><center>Delete A Ticket</center></tr>
<tr><center><select name='delete'><?php echo $topic_choose ?></select></center></tr>
<tr><center><input type="submit" value="Delete"></center></tr>
</table>
</form>
</center>
<?php
}
them change components\offlike\admin\admin.tickets.php to this:
Code:
<?php
if(INCLUDED!==true)exit;
// ==================== //
$pathway_info[] = array('title'=>'tickets','link'=>'');
// ==================== //
$alltopics = $CHDB->select("SELECT * FROM `character_ticket` ORDER BY `ticket_id`");
?>
themadd this to your lang\en.english.lang file:
Code:
|=|tickets :=: Tickets
|=|tickets_desc :=: If you have a Ticket that has not been answerd, try searching or asking in the forums or simply send in another Ticket.
That's it Enjoy.