Jump to content
  • 0

Flux Support NPC w/ Ticket Viewer


Katazui

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  167
  • Reputation:   22
  • Joined:  11/23/11
  • Last Seen:  

Hey guys! I need your guy's expertise on SQL coding.

//===== rAthena Script =======================================
//= @support
//===== By: ==================================================
//= Akkarin
//===== Current Version: =====================================
//= 1.00.01
//===== Description: ========================================= 
//= Script control over @support
//============================================================

-	script	atcmd_support	-1,{
OnInit:
	bindatcmd("Support","atcmd_support::Onsupport");
	end;

Onsupport:
	query_sql "SELECT `cat_id`, `name` FROM `cp_servicedeskcat` WHERE `display` = 1 ORDER BY `name`", @cat_id, @cat_name$;
	mes "[Mrs. Support]";
	mes "Please select one of the following categories";
	set @j,0;
	for(set @i, 0; @i < getarraysize(@cat_id); set @i, @i + 1){	set @menulist$[@j],@cat_name$[@i]; set @menureference[@j],@i; set @j,@j+1; }
	menu @menulist$[0],-,@menulist$[1],-,@menulist$[2],-,@menulist$[3],-,@menulist$[4],-,@menulist$[5],-,@menulist$[6],-,@menulist$[7],-,@menulist$[8],-,@menulist$[9],-,@menulist$[10],-,@menulist$[11],-,@menulist$[12],-,@menulist$[13],-,@menulist$[14],-,@menulist$[15],-,@menulist$[16],-,@menulist$[17],-,@menulist$[18],-,@menulist$[19],-,@menulist$[20],-,@menulist$[21],-,@menulist$[22],-,@menulist$[23],-,@menulist$[24],-,@menulist$[25],-,@menulist$[26],-,@menulist$[27],-,@menulist$[28],-,@menulist$[29],-,@menulist$[30],-;
	next;
	mes "[Mrs. Support]";
	mes "Next, please type in a subject line";
	input @subject$;
	next;
	mes "[Mrs. Support]";
	mes "Please tell us what the problem is. You must make sure that you keep this brief so all the text fits into the box!";
	input @body$;
	next;
	mes "[Mrs. Support]";
	mes "This is what we have so far.", "Click 'Next' to view each entry, then submit your ticket.";
	next;
	mes "^FF0000Category^000000", "You selected "+@cat_name$[@menureference[@menu-1]]; next;
	mes "^008000Subject^000000", @subject$; next;
	mes "^0000FFBody^000000", @body$; next;
	mes "If this is all correct, your ticket will be created.", "Continue?";
	if(select("Yes:No")==1) {
		query_sql "SELECT `email`, `last_ip` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'", @player_email$, @player_lastip$;
		query_sql("INSERT INTO `cp_servicedesk` (`account_id`, `category`, `char_id`, `timestamp`, `sslink`, `chatlink`, `videolink`, `subject`, `text`, `ip`, `curemail`) VALUES ('"+getcharid(3)+"', '"+@cat_id[@menureference[@menu-1]]+"', '"+getcharid(0)+"', NOW(), '0', '0', '0', '"+@subject$+"', '"+@body$+"', '"+@player_lastip$+"', '"+@player_email$+"')");
		mes "Ticket created.";
		close;
	} else {
		mes "Submission terminated.";
		close;
		end;
	}
	end;
}

Using this script from FluxCP's support_cmd, I was wondering if the player can view their own resolved ticket, after a ticket has been completed/resolved. I'm aware that Admins are the only ones able to see all the support tickets. Is it possible for a player to view their own support ticket once completed?

I greatly appreciate this awesome community<3

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

Yes this is possible. You can just query back from your database table "cp_servicedesk".

 

Just make sure that the script will check the player account_id before it checks the database ? or else you will retrieve all the tickets from the database

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  167
  • Reputation:   22
  • Joined:  11/23/11
  • Last Seen:  

40 minutes ago, glemor123 said:

Yes this is possible. You can just query back from your database table "cp_servicedesk".

 

Just make sure that the script will check the player account_id before it checks the database ? or else you will retrieve all the tickets from the database

Hey! I'm not to familiar with SQL coding do you mind writing one up?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...