View Single Post
  #4  
Old 05-01-2007, 01:26 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Append to weapon (-Complaint Reporter):
Part 3
PHP Code:
function OpenMenu(controlticketid)
{
  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(mousescreenxmousescreeny);
      
thiso.catchevent(this"onSelect""MenuSelected");
  }
}

function 
OpenMenu2(controlticketid)
{
  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(mousescreenxmousescreeny);
      
thiso.catchevent(this"onSelect""MenuSelected2");
  }
}

function 
MenuSelected(controlmenuidmenutext)
{
  
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(controlmenuidmenutext)
{
  
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_idtrue);
    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(0temp.codeprefix.size())] @ temp.codemedian[random(0temp.codemedian.size())] @ temp.codesuffix[random(0temp.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(idfields)
{
  
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 = {624};
      
extent = {286290};
      
hScrollBar vScrollBar "alwaysOff";
      
      new 
GuiTextCtrl("SupportTicket_SubmitterLabel" temp.id)
      {
        
profile "GuiBlueTextProfile";
        
position = {1527};
        
text "Submitted by:";
      }
      
      new 
GuiTextCtrl("SupportTicket_PriorityLabel" temp.id)
      {
        
profile "GuiBlueTextProfile";
        
position = {1567};
        
text "Priority:";
      }
      
      new 
GuiTextCtrl("SupportTicket_CategoryLabel" temp.id)
      {
        
profile "GuiBlueTextProfile";
        
position = {15107};
        
text "Category:";
      }
      
      new 
GuiTextEditCtrl("SupportTicket_FieldSumbitter-" temp.id)
      {
        
profile "GuiBlueTextEditProfile";
        
active false;
        
extent = {10525};
        
position = {16025};
        
text thiso.fields[0];
      }
      
      new 
GuiTextEditCtrl("SupportTicket_FieldPriority-" temp.id)
      {
        
profile "GuiBlueTextEditProfile";
        
active false;
        
extent = {10525};
        
position = {16065};
        
text thiso.fields[2];
      }
      
      new 
GuiTextEditCtrl("SupportTicket_FieldCategory-" temp.id)
      {
        
profile "GuiBlueTextEditProfile";
        
active false;
        
extent = {10525};
        
position = {160105};
        
text thiso.fields[1];
      }
      
      new 
GuiScrollCtrl("SupportTicket_DescriptionHold" temp.id)
      {
        
profile "GuiBlueScrollProfile";
        
position = {6150};
        
hScrollBar "alwaysOff";
        
vScrollBar "dynamic";
        
extent = {270100};
        
        new 
GuiMLTextCtrl("SupportTicket_Description-" temp.id)
        {
          
2;
          
profile "GuiBlueTextProfile";
          
width 255;
          
text thiso.fields[3];
        }
      }
    }
    
   new 
GuiButtonCtrl("SupportTicket_BtnDeleteTicket-" temp.id)
    {
      
profile "GuiBlueButtonProfile";
      
extent = {7228};
      
position = {35316};
      
text "Delete Ticket";
      
thiso.catchevent(this"onAction""DeleteTicket");
    }
    
   new 
GuiButtonCtrl("SupportTicket_BtnCloseTicket-" temp.id)
    {
      
profile "GuiBlueButtonProfile";
      
extent = {7228};
      
position = {115316};
      
text "Toggle Status";
      
thiso.catchevent(this"onAction""toggleTicket");
    }
    
    new 
GuiButtonCtrl("SupportTicket_BtnClose-" temp.id)
    {
      
profile "GuiBlueButtonProfile";
      
extent = {7228};
      
position = {195316};
      
text "Exit";
      
thiso.catchevent(this"onAction""CloseTicketWindow");
    }
  }
}

function 
CheckCode()
{
  
temp.checkcode = ("Reporter_VerifyTextCode1").text;
  return (
temp.checkcode == this.verification_code);

Reply With Quote