Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

After purchasing with us the download link will be delivered to your forum message box.


This forum is now closed and has moved to a new location! Click here to find out why.

AuthorTopic: [mccode v2] Support Desk  (Read 591 times)

Maniak

  • Basic Member
  • *
  • Reputation Power: 4
  • Maniak has no influence.
  • Offline Offline
  • Posts: 4
    • View Profile
    • Email
[mccode v2] Support Desk
« on: March 14, 2011, 06:21:56 PM »
I don't know if this has been done before; but I am releasing it anyway :). Feed back is appreciated (no flaming though :P).

SQL's:
Code: [Select]
--
-- Table structure for table `support`
--

CREATE TABLE IF NOT EXISTS `support` (
  `sID` int(11) NOT NULL AUTO_INCREMENT,
  `sUser` int(11) NOT NULL DEFAULT '0',
  `sTitle` varchar(40) NOT NULL,
  `sMessage` text NOT NULL,
  `sStatus` enum('Open','Closed') NOT NULL DEFAULT 'Open',
  `sSupportType` enum('Bug','General','Sales') NOT NULL,
  `sLastReply` int(11) NOT NULL DEFAULT '0',
  `sLastReplyTime` int(50) NOT NULL,
  `sSalesEmail` varchar(255) NOT NULL,
  `sSalesMethod` varchar(50) NOT NULL,
  `sSalesTransaction` varchar(255) NOT NULL,
  `sSalesPackage` varchar(50) NOT NULL,
  PRIMARY KEY (`sID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Table structure for table `supportreplies`
--

CREATE TABLE IF NOT EXISTS `supportreplies` (
  `rID` int(11) NOT NULL AUTO_INCREMENT,
  `rTopic` int(11) NOT NULL DEFAULT '0',
  `rUser` int(11) NOT NULL DEFAULT '0',
  `rMessage` text NOT NULL,
  `rTime` varchar(50) NOT NULL,
  PRIMARY KEY (`rID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

support.php
Code: [Select]
<?php
include_once('globals.php');
echo <<<EOF

<!-- This is a FREE Modification by Maniak @ www.makewebgames.com/user/15536/maniak/ -->
<!-- Do not sell, or redistribute as your own. -->
<!-- Keep these tags here. -->

EOF;
?>

<style type="text/css">
.title {
border-bottom: groove 1px;
border-top: groove 1px;
padding: 3px 0 3px 0;
text-align: center;
}
.content {
margin: 2% 3% 0 3%;
}
</style>
<?php
// BBCode Function edited from: http://www.ultramegatech.com/blog/2009/04/creating-a-bbcode-parser/
function BBCode($str) {
$search = array(
'#\[b\](.*?)\[/b\]#is',
'#\[u\](.*?)\[/u\]#is',
'#\[i\](.*?)\[/i\]#is',
'#\[color=\#?([A-F0-9]{3}|[A-F0-9]{6})\](.*?)\[/color\]#is',
'#\[url\]((?:ftp|https?)://.*?)\[/url\]#i',
'#\[img\](https?://.*?\.(?:jpg|jpeg|gif|png|bmp))\[/img\]#i'
);
$replace = array(
 '<strong>$1</strong>',
 '<span style="text-decoration: underline;">$1</span>',
 '<em>$1</em>',
 '<span style="color: #$1;">$2</span>',
 '<a href="$1">$1</a>',
 '<img src="$1" alt="" />'
 );
$str preg_replace($search$replace$str);
$str nl2br($str);
return $str;
}
switch(
$_GET['Page']) {
case 'Sales'sales_support(); break;
case 'General'general_support(); break;
case 'Bug'bug_support(); break;
case 'Ticket'view_ticket(); break;
default: support_home(); break;
}
function 
support_home() {
global $db$h$ir;
echo '<div class="content">
<div class="title"><span style="font-size: 18px;">Support Desk</span></div><br />
If you need help with any features of the game, found a Bug or have a Problem with a Donation; you are able to Submit a Support Ticket and a Member of Staff will assist you with that problem as soon as possible.<br /><br />
<table width="65%" cellpadding="2" cellspacing="2" align="center"><tr>
<td width="33%">&gt; <a href="?Page=Sales">Sales Support</a></td>
<td width="34%">&gt; <a href="?Page=General">General Support</a></td>
<td width="33%">&gt; <a href="?Page=Bug">Bug Support</a></td>
</tr></table><br />
<table width="95%" align="center" cellpadding="2" cellspacing="2"><tr>
<td width="15%"><strong>Department</strong></td>
<td width="45%"><strong>Topic</strong></td>
<td width="30%"><strong>Last Reply</strong></td>
<td width="10%"><strong>Status</strong></td>
</tr>'
;
$query $db->query('SELECT * FROM `support` WHERE (`sUser`='.abs(intval($ir['userid'])).')');
if(!$db->num_rows($query)) {
echo '<tr><td colspan="4" align="center"><strong>You currently have no outstanding Support Tickets</strong></td></tr>';
} else {
while($q $db->fetch_row($query)) {
if($q['sLastReply'] >= 1) {
$user $db->query('SELECT `userid`,`username` FROM `users` WHERE (`userid`='.abs(intval($q['sLastReply'])).')');
$u $db->fetch_row($user);
$l '<a href="viewuser.php?u='.abs(intval($u['userid'])).'">'.stripslashes($u['username']).'</a>';
} else {
$l 'Awaiting Reply.';
}
echo '<tr>
<td>'
.$q['sSupportType'].'</td>
<td><a href="?Page=Ticket&ID='
.abs(intval($q['sID'])).'">'.stripslashes($q['sTitle']).'</a></td>
<td>'
.$l.'</td>
<td>'
.$q['sStatus'].'</td>
</tr>'
;
}
}
echo '</table>
</div>'
;
}
function 
sales_support() {
global $db$h$ir;
echo '<div class="content">
<div class="title"><span style="font-size: 18px;">Support Desk - Sales Support</span></div><br />'
;
if(isset($_POST['salesButton'])) {
if(empty($_POST['salesTitle']) || empty($_POST['salesEmail']) || empty($_POST['salesTrans']) || empty($_POST['salesPackage'])) {
echo '<div align="center"><strong>You need to fill out ALL of the <span style="color: red;">*</span> fields!</strong></div><br />';
} elseif(!filter_var($_POST['salesEmail'], FILTER_VALIDATE_EMAIL)) {
echo '<div align="center"><strong>Please enter a Valid Email!</strong></div><br />';
} else {
$ID abs(intval($ir['userid']));
$title mysql_real_escape_string(htmlentities($_POST['salesTitle']));
$email filter_var($_POST['salesEmail'], FILTER_VALIDATE_EMAIL);
$trans mysql_real_escape_string(htmlentities($_POST['salesTrans']));
$pack mysql_real_escape_string(htmlentities($_POST['salesPackage']));
$info mysql_real_escape_string(htmlentities($_POST['salesInfo']));
$db->query('INSERT INTO `support` VALUES("", '.$ID.', "'.$title.'", "'.$info.'", "Open", "Sales", 0, 0, "'.$email.'", "'.$_POST['salesMethod'].'", "'.$trans.'", "'.$pack.'")');
echo '<div align="center"><strong>Support Ticket Submitted!</strong></div><br />';
}
}
echo 'If you brought more than 1 Item; then please submit the same number of Tickets, as Items brought (1 for each Item).. E.g. You brought 1 Crystals Package, and 1 Donator Package - Submit 1 Ticket for the Crystals, and 1 for the Donator Package!<br /><br />
If the Sales Support is used for anything other than Sales Support, there could be repercussions!<br /><br />
<form action="#" method="post">
<table width="70%" align="center" cellpadding="2" cellspacing="2"><tr>
<td width="30%"><strong>Department:</strong></td>
<td width="70%">Sales</td>
</tr><tr>
<td><span style="color: red;">*</span> <strong>Topic:</strong><br /><small>Max 40 chars.</small></td>
<td><input type="text" name="salesTitle" maxlength="40" size="45"/></td>
</tr><tr>
<td><strong>Method:</strong><br /><small>In which you Paid.</small></td>
<td><select type="dropdown" name="salesMethod">
<option value="Paypal">Paypal</option>
<option value="Moneybookers">Moneybookers</option>
</select></td>
</tr><tr>
<td><span style="color: red;">*</span> <strong>Email:</strong><br /><small>Used to Pay.</small></td>
<td><input type="text" name="salesEmail" size="45" /></td>
</tr><tr>
<td><span style="color: red;">*</span> <strong>Transaction ID:</stron></td>
<td><input type="text" name="salesTrans" size="45"/></td>
</tr><tr>
<td><span style="color: red;">*</span> <strong>Package Brought:</strong></td>
<td><input type="text" name="salesPackage" size="45" /></td>
</tr><tr>
<td><strong>Other Info:</strong><br /><small>BBCode may be used.</small></td>
<td><textarea name="salesInfo" rows="6" cols="56"></textarea></td>
</tr><tr>
<td></td>
<td><input type="submit" name="salesButton" value="Submit Ticket!" /></td>
</tr></table>
</form><br />
<div class="title">&gt; <a href="?">Back</a></div>
</div>'
;
}
function 
general_support() {
global $db$h$ir;
echo '<div class="content">
<div class="title"><span style="font-size: 18px;">Support Desk - General Support</span></div><br />'
;
if(isset($_POST['generalButton'])) {
if(empty($_POST['generalTitle']) || empty($_POST['generalQuery'])) {
echo '<div align="center"><strong>You need to fill out ALL of the <span style="color: red;">*</span> fields!</strong></div><br />';
} else {
$ID abs(intval($ir['userid']));
$title mysql_real_escape_string(htmlentities($_POST['generalTitle']));
$query mysql_real_escape_string(htmlentities($_POST['generalQuery']));
$db->query('INSERT INTO `support` (`sUser`,`sTitle`,`sMessage`,`sStatus`,`sSupportType`,`sLastReply`,`sLastReplyTime`) VALUES('.$ID.', "'.$title.'", "'.$query.'", "Open", "General", 0, 0)');
echo '<div align="center"><strong>Support Ticket Submitted!</strong></div><br />';
}
}
echo 'This section of the Support Desk is for anything Game Related.<br /><br />
<form action="#" method="post">
<table width="70%" align="center" cellpadding="2" cellspacing="2"><tr>
<td width="30%"><strong>Department:</strong></td>
<td width="70%">General</td>
</tr><tr>
<td><span style="color: red;">*</span> <strong>Topic:</strong><br /><small>Max 40 chars.</small></td>
<td><input type="text" name="generalTitle" maxlength="40" size="45"/></td>
</tr><tr>
<td><span style="color: red;">*</span> <strong>Query/Question:</strong><br /><small>BBCode may be used.</small></td>
<td><textarea name="generalQuery" rows="6" cols="56"></textarea></td>
</tr><tr>
<td></td>
<td><input type="submit" name="generalButton" value="Submit Ticket!" /></td>
</tr></table>
</form><br />
<div class="title">&gt; <a href="?">Back</a></div>
</div>'
;
}
function 
bug_support() {
global $db$h$ir;
echo '<div class="content">
<div class="title"><span style="font-size: 18px;">Support Desk - Bug Support</span></div><br />'
;
if(isset($_POST['bugButton'])) {
if(empty($_POST['bugTitle']) || empty($_POST['bugInfo'])) {
echo '<div align="center"><strong>You need to fill out ALL of the <span style="color: red;">*</span> fields!</strong></div><br />';
} else {
$ID abs(intval($ir['userid']));
$title mysql_real_escape_string(htmlentities($_POST['bugTitle']));
$bug mysql_real_escape_string(htmlentities($_POST['bugInfo']));
$db->query('INSERT INTO `support` (`sUser`,`sTitle`,`sMessage`,`sStatus`,`sSupportType`,`sLastReply`,`sLastReplyTime`) VALUES('.$ID.', "'.$title.'", "'.$bug.'", "Open", "Bug", 0, 0)');
echo '<div align="center"><strong>Support Ticket Submitted!</strong></div><br />';
}
}
echo 'This section of the Support Desk is for anything that you think may be a Bug. Please include the URL of the suspected Bug in the Information section.<br /><br />
Failure to provide a Link, or what the Bug does will result in this Ticket being Closed and ignored.<br /><br />
<form action="#" method="post">
<table width="70%" align="center" cellpadding="2" cellspacing="2"><tr>
<td width="30%"><strong>Department:</strong></td>
<td width="70%">Bug</td>
</tr><tr>
<td><span style="color: red;">*</span> <strong>Topic:</strong><br /><small>Max 40 chars.</small></td>
<td><input type="text" name="bugTitle" maxlength="40" size="45"/></td>
</tr><tr>
<td><span style="color: red;">*</span> <strong>Information:</strong><br /><small>BBCode may be used.</small></td>
<td><textarea name="bugInfo" rows="6" cols="56"></textarea></td>
</tr><tr>
<td></td>
<td><input type="submit" name="bugButton" value="Submit Ticket!" /></td>
</tr></table>
</form><br />
<div class="title">&gt; <a href="?">Back</a></div>
</div>'
;
}
function 
view_ticket() {
global $db$h$ir;
$_GET['ID'] = abs(intval($_GET['ID']));
echo '<div class="content">';
if(!$_GET['ID']) {
echo '<div class="title"><span style="font-size: 18px;">View Ticket - Error</span></div><br />
<div align="center"><strong>Check your Source.</strong></div><br />
<div class="title">&gt; <a href="?">Back</a></div>'
;
} else {
$query $db->query('SELECT * FROM `support` WHERE (`sID`='.$_GET['ID'].' AND `sUser`='.abs(intval($ir['userid'])).')');
if(!$db->num_rows($query)) {
echo '<div class="title"><span style="font-size: 18px;">View Ticket - Error</span></div><br />
<div align="center"><strong>We couldn\'t locate a Ticket with that ID, submitted by yourself.</strong></div><br />
<div class="title">&gt; <a href="?">Back</a></div>'
;
} else {
$q $db->fetch_row($query);
echo '<div class="title"><span style="font-size: 18px;">View Ticket</span></div><br />
<table width="95%" cellpadding="2" cellspacing="2" align="center"><tr>
<td width="20%"><strong>Department:</strong></td>
<td width="80%">'
.$q['sSupportType'].'</td>
</tr><tr>
<td><strong>Topic:</strong></td>
<td>'
.stripslashes($q['sTitle']).'</td>
</tr>'
;
if($q['sSupportType'] == 'Sales') {
echo '<tr>
<td><strong>Payment Method:</strong></td>
<td>'
.$q['sSalesMethod'].'</td>
</tr><tr>
<td><strong>Payment Email:</strong></td>
<td>'
.$q['sSalesEmail'].'</td>
</tr><tr>
<td><strong>Transaction ID:</strong></td>
<td>'
.stripslashes($q['sSalesTransaction']).'</td>
</tr><tr>
<td><strong>Package Brought:</strong></td>
<td>'
.stripslashes($q['sSalesPackage']).'</td>
</tr>'
;
}
echo '<tr>
<td valign="top"><strong>Body:</strong></td>
<td>'
.BBCode(stripslashes($q['sMessage'])).'</td>
</tr></table><br />
<div class="title"><span style="font-size: 15px;">Replies</span></div><br />'
;
if(isset($_POST['topicButton'])) {
if(empty($_POST['topicReply'])) {
echo '<div align="center"><strong>You cannot leave the Reply blank!</strong></div><br />';
} else {
$ID abs(intval($ir['userid']));
$reply mysql_real_escape_string(htmlentities($_POST['topicReply']));
$db->query('UPDATE `support` SET `sLastReply`='.$ID.', `sLastReplyTime`='.time().' WHERE (`sID`='.$_GET['ID'].')');
$db->query('INSERT INTO `supportreplies` VALUES("", "'.$_GET['ID'].'", '.$ID.', "'.$reply.'", '.time().')');
echo '<div align="center"><strong>You have left a Reply..</strong></div><br />';
}
}
$replies $db->query('SELECT * FROM `supportreplies` WHERE (`rTopic`='.$_GET['ID'].')');
if(!$db->num_rows($replies)) {
echo '';
} else {
echo '<table width="95%" cellpadding="2" cellspacing="2" align="center">';
while($r $db->fetch_row($replies)) {
$user $db->query('SELECT `userid`,`username` FROM `users` WHERE (`userid`='.abs(intval($r['rUser'])).')');
$u $db->fetch_row($user);
echo '<tr>
<td width="20%" valign="top"><a href="viewuser.php?u='
.abs(intval($u['userid'])).'">'.stripslashes($u['username']).'</a><br />
<small>'
.date('F j, Y'$r['rTime']).'</small></td>
<td width="80%">'
.BBCode(stripslashes($r['rMessage'])).'</td>
</tr>'
;
}
echo '</table>';
}
if($q['sStatus'] == 'Open') {
echo '<form action="#" method="post">
<table width="95%" cellpadding="2" cellspacing="2" align="center"><tr>
<td><strong>Reply:</strong><br /><small>BBCode may be used.</small></td>
<td><textarea name="topicReply" rows="6" cols="97"></textarea><br />
<input type="submit" name="topicButton" value="Add Reply!" /></td>
</tr></table>
</form>'
;
}
}
}
}
$h->endpage();
?>


File edit: mainmenu.php
Code: [Select]
<a href='support.php'>Support Desk</a>
staff_support.php
Code: [Select]
<?php
include_once('sglobals.php');
if(
$ir['user_level'] > 3) {
die("403");
}
?>

<style type="text/css">
.title {
border-bottom: groove 1px;
border-top: groove 1px;
padding: 3px 0 3px 0;
text-align: center;
}
.content {
margin: 2% 3% 0 3%;
}
</style>
<?php
// BBCode Function edited from: http://www.ultramegatech.com/blog/2009/04/creating-a-bbcode-parser/
function BBCode($str) {
$search = array(
'#\[b\](.*?)\[/b\]#is',
'#\[u\](.*?)\[/u\]#is',
'#\[i\](.*?)\[/i\]#is',
'#\[color=\#?([A-F0-9]{3}|[A-F0-9]{6})\](.*?)\[/color\]#is',
'#\[url\]((?:ftp|https?)://.*?)\[/url\]#i',
'#\[img\](https?://.*?\.(?:jpg|jpeg|gif|png|bmp))\[/img\]#i'
);
$replace = array(
 '<strong>$1</strong>',
 '<span style="text-decoration: underline;">$1</span>',
 '<em>$1</em>',
 '<span style="color: #$1;">$2</span>',
 '<a href="$1">$1</a>',
 '<img src="$1" alt="" />'
 );
$str preg_replace($search$replace$str);
$str nl2br($str);
return $str;
}
switch(
$_GET['Page']) {
case 'viewTicket'view_ticket(); break;
case 'changeStatus'change_status(); break;
default: staff_support_home(); break;
}
function 
staff_support_home() {
global $db$h$ir;
echo '<div class="content">
<div class="title"><span style="font-size: 18px;">Open Support Tickets</span></div><br />'
;
$_GET['p'] = abs(intval($_GET['p']));
$p = ($_GET['p']) ? $_GET['p'] : 0;
$count $db->query('SELECT `sID` FROM `support`');
$c $db->num_rows($count);
$pages abs(intval($c/10+1));
if($pages 100 == 0) {
$pages--;
}
$query $db->query('SELECT `sID`,`sUser`,`sTitle`,`sSupportType`,`sLastReplyTime` FROM `support` WHERE (`sStatus`="Open") ORDER BY `sID` LIMIT '.$p.', 10');
echo '<table width="95%" align="center" cellpadding="2" cellspacing="2"><tr>
<td width="15%"><strong>Department</strong></td>
<td width="35%"><strong>Topic</strong></td>
<td width="25%"><strong>Poster</strong></td>
<td width="25%"><strong>Last Reply</strong></td>
</tr>'
;
if(!$db->num_rows($query)) {
echo '<tr>
<td colspan="4" align="center"><strong>There are no Open Support Tickets!</strong></td>
</tr>'
;
} else {
while($q $db->fetch_row($query)) {
$user $db->query('SELECT `userid`,`username` FROM `users` WHERE (`userid`='.abs(intval($q['sUser'])).')');
$u $db->fetch_row($user);
echo '<tr>
<td>'
.$q['sSupportType'].'</td>
<td><a href="?Page=viewTicket&ID='
.abs(intval($q['sID'])).'">'.stripslashes($q['sTitle']).'</a></td>
<td><a href="viewuser.php?u='
.abs(intval($u['userid'])).'">'.stripslashes($u['username']).'</a></td>
<td>'
.date('F j, Y - g:i a'$q['sLastReplyTime']).'</td>
</tr>'
;
}
}
echo '</table><br />
Page: '
;
for($i 1$i <= $pages$i++) {
$stl = (($i-1)*10);
echo '<a href="?p='.$stl.'">'.$i.'</a> ';
}
echo '</div>';
}
function 
view_ticket() {
global $db$h$ir;
$_GET['ID'] = abs(intval($_GET['ID']));
echo '<div class="content">';
if(!$_GET['ID']) {
echo '<div class="title"><span style="font-size: 18px;">View Ticket - Error</span></div><br />
<div align="center"><strong>Check your Source.</strong></div><br />
<div class="title">&gt; <a href="?">Back</a></div>'
;
} else {
$query $db->query('SELECT * FROM `support` WHERE (`sID`='.$_GET['ID'].' AND `sStatus`="Open")');
if(!$db->num_rows($query)) {
echo '<div class="title"><span style="font-size: 18px;">View Ticket - Error</span></div><br />
<div align="center"><strong>We couldn\'t locate an Open Ticket with that ID.</strong></div><br />
<div class="title">&gt; <a href="?">Back</a></div>'
;
} else {
$q $db->fetch_row($query);
$user $db->query('SELECT `userid`,`username` FROM `users` WHERE (`userid`='.abs(intval($q['sUser'])).')');
$u $db->fetch_row($user);
echo '<div class="title"><span style="font-size: 18px;">View Ticket</span></div><br />
<span style="float: right"><input type="submit" onClick="location.href=\'?Page=changeStatus&ID='
.$_GET['ID'].'\'" value="Close Ticket" /></span>
<table width="95%" cellpadding="2" cellspacing="2" align="center"><tr>
<td width="20%"><strong>Poster:</strong></td>
<td width="80%"><a href="viewuser.php?u='
.abs(intval($u['userid'])).'">'.stripslashes($u['username']).'</a></td>
</tr><tr>
<td><strong>Department:</strong></td>
<td>'
.$q['sSupportType'].'</td>
</tr><tr>
<td><strong>Topic:</strong></td>
<td>'
.stripslashes($q['sTitle']).'</td>
</tr>'
;
if($q['sSupportType'] == 'Sales') {
echo '<tr>
<td><strong>Payment Method:</strong></td>
<td>'
.$q['sSalesMethod'].'</td>
</tr><tr>
<td><strong>Payment Email:</strong></td>
<td>'
.$q['sSalesEmail'].'</td>
</tr><tr>
<td><strong>Transaction ID:</strong></td>
<td>'
.stripslashes($q['sSalesTransaction']).'</td>
</tr><tr>
<td><strong>Package Brought:</strong></td>
<td>'
.stripslashes($q['sSalesPackage']).'</td>
</tr>'
;
}
echo '<tr>
<td valign="top"><strong>Body:</strong></td>
<td>'
.BBCode(stripslashes($q['sMessage'])).'</td>
</tr></table><br />
<div class="title"><span style="font-size: 15px;">Replies</span></div><br />'
;
if(isset($_POST['topicButton'])) {
if(empty($_POST['topicReply'])) {
echo '<div align="center"><strong>You cannot leave the Reply blank!</strong></div><br />';
} else {
$ID abs(intval($ir['userid']));
$reply mysql_real_escape_string(htmlentities($_POST['topicReply']));
$db->query('UPDATE `support` SET `sLastReply`='.$ID.', `sLastReplyTime`='.time().' WHERE (`sID`='.$_GET['ID'].')');
$db->query('INSERT INTO `supportreplies` VALUES("", "'.$_GET['ID'].'", '.$ID.', "'.$reply.'", '.time().')');
echo '<div align="center"><strong>You have left a Reply..</strong></div><br />';
}
}
$replies $db->query('SELECT * FROM `supportreplies` WHERE (`rTopic`='.$_GET['ID'].')');
if(!$db->num_rows($replies)) {
echo '';
} else {
echo '<table width="95%" cellpadding="2" cellspacing="2" align="center">';
while($r $db->fetch_row($replies)) {
$user $db->query('SELECT `userid`,`username` FROM `users` WHERE (`userid`='.abs(intval($r['rUser'])).')');
$u $db->fetch_row($user);
echo '<tr>
<td width="20%" valign="top"><a href="viewuser.php?u='
.abs(intval($u['userid'])).'">'.stripslashes($u['username']).'</a><br />
<small>'
.date('F j, Y'$r['rTime']).'</small></td>
<td width="80%">'
.BBCode(stripslashes($r['rMessage'])).'</td>
</tr>'
;
}
echo '</table>';
}
echo '<form action="#" method="post">
<table width="95%" cellpadding="2" cellspacing="2" align="center"><tr>
<td><strong>Reply:</strong><br /><small>BBCode may be used.</small></td>
<td><textarea name="topicReply" rows="6" cols="97"></textarea><br />
<input type="submit" name="topicButton" value="Add Reply!" /></td>
</tr></table>
</form>'
;
}
}
echo '</div>';
}
function 
change_status() {
global $db$h;
$_GET['ID'] = abs(intval($_GET['ID']));
echo '<div class="content">';
if(!$_GET['ID']) {
echo '<div class="title"><span style="font-size: 18px;">Close Ticket - Error</span></div><br />
<div align="center"><strong>How can you close a ticket without a ID?!</strong></div><br />
<div class="title">&gt; <a href="?">Back</a></div>'
;
} else {
$check $db->query('SELECT `sID` FROM `support` WHERE (`sID`='.$_GET['ID'].')');
if(!$db->num_rows($check)) {
echo '<div class="title"><span style="font-size: 18px;">Close Ticket - Error</span></div><br />
<div align="center"><strong>How can you close a ticket that doesn\'t exist!</strong></div><br />
<div class="title">&gt; <a href="?">Back</a></div>'
;
} else {
$db->query('UPDATE `support` SET `sStatus`="Closed" WHERE (`sID`='.$_GET['ID'].')');
stafflog_add('Closed Support ticket ID: '.$_GET['ID'].'.');
echo '<div class="title"><span style="font-size: 18px;">Close Ticket - Success</span></div><br />
<div align="center"><strong>You have closed ticket ID: '
.$_GET['ID'].'!</strong></div><br />
<div class="title">&gt; <a href="?">Back</a></div>'
;
}
}
echo '</div>';
}
$h->endpage();
?>


File edit: smenu.php
Code: [Select]
<a href='staff_support.php'>Support Tickets</a>
Logged

MonoD

  • Basic Member
  • *
  • Reputation Power: 23
  • MonoD has no influence.
  • Offline Offline
  • Posts: 34
    • MSN Messenger - Contact@Monodistrict.com
    • View Profile
    • WWW
    • Email
Re: [mccode v2] Support Desk
« Reply #1 on: July 06, 2011, 07:21:10 PM »
Love the concept of this modification, Well done!
Logged

dmkmonkey

  • Basic Member
  • *
  • Reputation Power: 23
  • dmkmonkey has no influence.
  • Offline Offline
  • Posts: 11
    • View Profile
    • Email
Re: [mccode v2] Support Desk
« Reply #2 on: September 17, 2011, 09:05:13 AM »
Love it! :) works perfect  ::)
Logged

pricey

  • Basic Member
  • *
  • Reputation Power: 0
  • pricey has no influence.
  • Offline Offline
  • Posts: 1
    • View Profile
Re: [mccode v2] Support Desk
« Reply #3 on: January 13, 2012, 08:22:33 AM »
Nice add on just shame its another feature a community member had to create
Logged

Peterisgb

  • Basic Member
  • *
  • Reputation Power: 20
  • Peterisgb has no influence.
  • Offline Offline
  • Posts: 14
    • View Profile
    • Email
Re: [mccode v2] Support Desk
« Reply #4 on: January 13, 2012, 03:39:27 PM »
good addition
Logged
 


This forum is now closed and has moved to a new location! Click here to find out why.