PHP Code:
function OpenMenu(control, ticketid)
{
if (temp.ticketid < 0) return;
new GuiContextMenuCtrl("AdminCenter_Menu-" @ temp.ticketid)
{
textprofile = "GuiBlueTextListProfile";
profile = "GuiBluePopUpMenuProfile";
clearrows();
addRow(1, "View Ticket");
addRow(-1, "-");
addRow(2, "Toggle Status");
this.open(mousescreenx, mousescreeny);
thiso.catchevent(this, "onSelect", "MenuSelected");
}
}
function OpenMenu2(control, ticketid)
{
if (temp.ticketid < 0) return;
new GuiContextMenuCtrl("SupportCenter_Menu-" @ temp.ticketid)
{
textprofile = "GuiBlueTextListProfile";
profile = "GuiBluePopUpMenuProfile";
clearrows();
addRow(1, "View Ticket");
addRow(-1, "-");
addRow(2, "Delete Ticket");
this.open(mousescreenx, mousescreeny);
thiso.catchevent(this, "onSelect", "MenuSelected2");
}
}
function MenuSelected(control, menuid, menutext)
{
temp.ticket_id = temp.control.substring(("AdminCenter_Menu-").length());
switch (temp.menutext)
{
case "View Ticket":
GetSupportTicket(temp.ticket_id);
break;
case "Toggle Status":
ToggleTicketStatus(temp.ticket_id);
break;
}
}
function MenuSelected2(control, menuid, menutext)
{
temp.ticket_id = temp.control.substring(("SupportCenter_Menu-").length());
switch (temp.menutext)
{
case "View Ticket":
GetSupportTicket(temp.ticket_id);
break;
case "Delete Ticket":
DeleteTicket(temp.ticket_id, true);
break;
}
}
function GenerateCode(control)
{
if (!temp.control.checked)
return ("Reporter_Code").setText("Please accept the terms for the code");
this.verification_code = "0verRide";
temp.finalcode = "";
temp.codeprefix = {"xhEa", "tXay", "h6aE", "tx3A", "y7kh", "5acR"};
temp.codemedian = {"+", "-", "_", ";", "|", "@", "%"};
temp.codesuffix = {"hh5AE", "f2glE", "T5xeA", "Tf3xE", "x66h2"};
temp.finalcode = temp.codeprefix[random(0, temp.codeprefix.size())] @ temp.codemedian[random(0, temp.codemedian.size())] @ temp.codesuffix[random(0, temp.codesuffix.size())];
("Reporter_Code").setText(format("Verification code: <b>%s</b>", temp.finalcode));
this.verification_code = temp.finalcode;
}
function onActionClientside(action)
{
switch (action)
{
case "SentComplaint":
CloseSystem();
player.chat = "[Support Center]: Your ticket was succesfully received. [Ticket ID:" SPC params[1] @ "]!";
break;
case "RefreshTicketsList":
RefreshTicketsList(params[1], params[2]);
break;
case "ViewSupportTicket":
ViewSupportTicket(params[1], params[2]);
break;
case "RefreshMyTicketsList":
RefreshMyTicketsList(params[1], params[2]);
break;
case "NotAllowed":
CloseAdminSystem();
player.chat = "[Support Center]: You aren't on the allow list";
break;
}
}
function ViewSupportTicket(id, fields)
{
this.id = "";
this.fields.clear();
this.id = temp.id;
this.fields = temp.fields;
new GuiWindowCtrl("SupportTicket_" @ temp.id)
{
profile = "ZodiacWindowProfile";
title = true;
extent = {300,350};
position = {(GraalControl.width - this.width)/2, (GraalControl.height - this.height)/2};
canClose = canMaximize = canMinimize = canResize = false;
text = "Zodiac Support Center; Viewing Ticket (Index:" SPC temp.id @ ")";
visible = true;
new GuiScrollCtrl("SupportTicket_Holder" @ temp.id)
{
profile = "GuiBlueScrollProfile";
position = {6, 24};
extent = {286, 290};
hScrollBar = vScrollBar = "alwaysOff";
new GuiTextCtrl("SupportTicket_SubmitterLabel" @ temp.id)
{
profile = "GuiBlueTextProfile";
position = {15, 27};
text = "Submitted by:";
}
new GuiTextCtrl("SupportTicket_PriorityLabel" @ temp.id)
{
profile = "GuiBlueTextProfile";
position = {15, 67};
text = "Priority:";
}
new GuiTextCtrl("SupportTicket_CategoryLabel" @ temp.id)
{
profile = "GuiBlueTextProfile";
position = {15, 107};
text = "Category:";
}
new GuiTextEditCtrl("SupportTicket_FieldSumbitter-" @ temp.id)
{
profile = "GuiBlueTextEditProfile";
active = false;
extent = {105, 25};
position = {160, 25};
text = thiso.fields[0];
}
new GuiTextEditCtrl("SupportTicket_FieldPriority-" @ temp.id)
{
profile = "GuiBlueTextEditProfile";
active = false;
extent = {105, 25};
position = {160, 65};
text = thiso.fields[2];
}
new GuiTextEditCtrl("SupportTicket_FieldCategory-" @ temp.id)
{
profile = "GuiBlueTextEditProfile";
active = false;
extent = {105, 25};
position = {160, 105};
text = thiso.fields[1];
}
new GuiScrollCtrl("SupportTicket_DescriptionHold" @ temp.id)
{
profile = "GuiBlueScrollProfile";
position = {6, 150};
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
extent = {270, 100};
new GuiMLTextCtrl("SupportTicket_Description-" @ temp.id)
{
x = 2;
profile = "GuiBlueTextProfile";
width = 255;
text = thiso.fields[3];
}
}
}
new GuiButtonCtrl("SupportTicket_BtnDeleteTicket-" @ temp.id)
{
profile = "GuiBlueButtonProfile";
extent = {72, 28};
position = {35, 316};
text = "Delete Ticket";
thiso.catchevent(this, "onAction", "DeleteTicket");
}
new GuiButtonCtrl("SupportTicket_BtnCloseTicket-" @ temp.id)
{
profile = "GuiBlueButtonProfile";
extent = {72, 28};
position = {115, 316};
text = "Toggle Status";
thiso.catchevent(this, "onAction", "toggleTicket");
}
new GuiButtonCtrl("SupportTicket_BtnClose-" @ temp.id)
{
profile = "GuiBlueButtonProfile";
extent = {72, 28};
position = {195, 316};
text = "Exit";
thiso.catchevent(this, "onAction", "CloseTicketWindow");
}
}
}
function CheckCode()
{
temp.checkcode = ("Reporter_VerifyTextCode1").text;
return (temp.checkcode == this.verification_code);
}