viewing paste topic/11506- support_ticket_1.2 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495
//===== eAthena Unofficial Script ============================
//= Support Ticket System
//===== By: ================================================== 
//= [GM]Xeon
//===== Current Version: ===================================== 
//= 1.2
//===== Compatible With: ===================================== 
//= Latest versions of SQL, stable and trunk?
//===== Description: ========================================= 
//= The core engine for the Support Ticket system, please
//= ensure you first installed the MySQL script located at
//= http://svn.massemu.com/ro/branches/script/ST_1.1.sql
//===== Additional Comments: ================================= 
//= 1.0 Script created ;D [[GM]Xeon]
//= 1.1 Added missed character name display, fixed a couple
//=  other bugs [[GM]Xeon]
//= 1.2 Optimized and added delete tickets function [[GM]Xeon]
//============================================================ 
 
prontera,155,185,5  script  Support Tickets 4_BULLETIN_BOARD2,{
if (getgmlevel() >= 40) goto L_GM;
L_Main:
    mes "[Support Tickets]";
    mes "Hello, I'm the support ticket NPC, how can I help you?";
    next;
    switch(select("Post a new ticket","View Ticket(s)","Exit")) {
        case 1:
            goto L_NewTicket;
        case 2:
            goto L_ListTickets;
        case 3:
            close;
        }
 
L_NewTicket:
    mes "[Support Tickets]";
    mes "Enter the title of the new ticket (Max 24 chars.), enter one space to cancel.";
    next;
    input @msg_title$;
    set @msg_title$, escape_sql(@msg_title$);
    if (@msg_title$ == " ") goto L_Main;
    mes "[Support Tickets]";
    mes "Enter the message, enter one space to cancel.";
    next;
    input @msg_base$;
    set @msg_base$, escape_sql(@msg_base$);
    if (@msg_base$ == " ") goto L_Main;
    query_sql "insert into `support_ticket` (char_name,char_id,title,message,date) values ('"+escape_sql(strcharinfo(0))+"',"+getcharid(0)+",'"+@msg_title$+"','"+@msg_base$+"', now())";
    mes "[Support Tickets]";
    mes "Support ticket has been successfully posted.";
    next;
    goto L_Main;
 
L_ListTickets:
    set @tickets, query_sql("select ticket_id,status,title,message,date from `support_ticket` where char_id = "+getcharid(0)+" order by date desc limit 10",@ticket_id,@status,@title$,@message$,@date$);
    mes "[Support Tickets]";
    if (@tickets > 0) mes "Select a ticket to view";
    if (@tickets == 0) {
        mes "You currently have no support tickets";
        next;
        goto L_Main;
        }
    set @temp,0;
    while (@temp < @tickets) {
        if (@status[@temp] == 0) set @title2$[@temp], "^339900"+@title$[@temp]+"^000000";
        if (@status[@temp] == 1) set @title2$[@temp], "^FF0000"+@title$[@temp]+"^000000";
        if (@status[@temp] > 1) set @title2$[@temp], "^FF9900"+@title$[@temp]+"^000000";
        set @temp,@temp+1;
        }
    next;
    switch(select("Back",@title2$[0],@title2$[1],@title2$[2],@title2$[3],@title2$[4],@title2$[5],@title2$[6],@title2$[7],@title2$[8],@title2$[9])) {
        case 1:
            goto L_Main;
        case 2:
            set @view, 0;
            goto L_ViewTicket;
        case 3:
            set @view, 1;
            goto L_ViewTicket;
        case 4:
            set @view, 2;
            goto L_ViewTicket;
        case 5:
            set @view, 3;
            goto L_ViewTicket;
        case 6:
            set @view, 4;
            goto L_ViewTicket;
        case 7:
            set @view, 5;
            goto L_ViewTicket;
        case 8:
            set @view, 6;
            goto L_ViewTicket;
        case 9:
            set @view, 7;
            goto L_ViewTicket;
        case 10:
            set @view, 8;
            goto L_ViewTicket;
        case 11:
            set @view, 9;
            goto L_ViewTicket;
        }
 
L_ViewTicket:
    mes "[Support Tickets]";
    mes "^808080Title: ^9900CC"+@title$[@view]+"^000000";
    mes "^808080Message: ^9900CC"+@message$[@view]+"^000000";
    set @replies, query_sql("select reply_number,char_name,message,status_change from `support_response` where ticket_id = "+@ticket_id[@view]+" order by reply_number asc",@reply_number,@char_name$,@message_reply$,@status_change);
    set @temp, 0;
    while (@temp < @replies) {
        mes "^C9C9C9-^000000";
        if (@message$[@view] == "†" && @char_name$[@temp] == strcharinfo(0)) mes "^808080Status change from: ^339900"+@char_name$[@temp]+"^000000";
        if (@message$[@view] == "†" && @char_name$[@temp] != strcharinfo(0)) mes "^808080Status change from: ^0066FF"+@char_name$[@temp]+"^000000";
        if (@message$[@view] != "†" && @char_name$[@temp] == strcharinfo(0)) {
            mes "^808080Reply from: ^339900"+@char_name$[@temp]+"^000000";
            mes "^808080Message: ^339900"+@message_reply$[@temp]+"^000000";
            }
        if (@message$[@view] != "†" && @char_name$[@temp] != strcharinfo(0)) {
            mes "^808080Reply from: ^0066FF"+@char_name$[@temp]+"^000000";
            mes "^808080Message: ^0066FF"+@message_reply$[@temp]+"^000000";
            }
        if (@status_change[@temp] == 0) mes "^FF9900>Status changed to ^339900OPEN^000000";
        if (@status_change[@temp] == 1) mes "^FF9900>Status changed to ^FF0000CLOSED^000000";
        if (@status_change[@temp] == 2) mes "^FF9900>Status changed to WAITING^000000";
        if (@status_change[@temp] == 3) mes "^FF9900>Status changed to ON HOLD^000000";
        set @temp,@temp+1;
        }
    next;
    switch(select(((@status[@view]==1)?"^C9C9C9":"")+"Reply^000000",((@status[@view]==1)?"^C9C9C9":"")+"Close Ticket^000000","Back")) {
        case 1:
            if (@status[@view] == 1) {
                mes "[Support Tickets]";
                mes "You can't reply to closed tickets!";
                next;
                goto L_ViewTicket;
                }
            mes "[Support Tickets]";
            mes "Enter the reply, enter one space to cancel";
            input @msg$;
            set @msg$, escape_sql(@msg$);
            if (@msg$ == " ") {
                next;
                goto L_ViewTicket;
                }
            if (@status[@view] == 2) {
                query_sql "insert into `support_response` values ("+@ticket_id[@view]+","+(@replies+1)+",'"+escape_sql(strcharinfo(0))+"',"+getcharid(0)+",'"+@msg$+"',0,now())";
                query_sql "update `support_ticket` set status = 0 where ticket_id = "+@ticket_id[@view];
                } else {
                query_sql "insert into `support_response` values ("+@ticket_id[@view]+","+(@replies+1)+",'"+escape_sql(strcharinfo(0))+"',"+getcharid(0)+",'"+@msg$+"','-1',now())";
                }
            mes "[Support Tickets]";
            mes "Reply posted";
            next;
            goto L_ListTickets;
        case 2:
            if (@status[@view] == 1) {
                mes "[Support Tickets]";
                mes "This ticket is already closed!";
                next;
                goto L_ViewTicket;
                }
            query_sql "insert into `support_response` values ("+@ticket_id[@view]+","+(@replies+1)+",'"+escape_sql(strcharinfo(0))+"',"+getcharid(0)+",'†',1,now())";
            query_sql "update `support_ticket` set status = 1 where ticket_id = "+@ticket_id[@view];
            mes "[Support Tickets]";
            mes "Support ticket closed!";
            next;
            goto L_ListTickets;
        case 3:
            next;
            goto L_ListTickets;
        }
 
L_GM:
    deletearray @display$, 128;
    mes "[Support Tickets]";
    mes "Hello GM, how can I help?";
    next;
    switch(select("View Tickets","Search Tickets","Exit","Test")) {
        case 1:
            set @open, query_sql("select * from `support_ticket` where status = 0 order by date desc limit 128",@open_ticket_id,@open_status,@open_charname$,@open_charid,@open_title$,@open_message$,@open_date$);
            set @waiting, query_sql("select * from `support_ticket` where status = 2 order by date desc limit 128",@waiting_ticket_id,@waiting_status,@waiting_charname$,@waiting_charid,@waiting_title$,@waiting_message$,@waiting_date$);
            set @onhold, query_sql("select * from `support_ticket` where status = 3 order by date desc limit 128",@onhold_ticket_id,@onhold_status,@onhold_charname$,@onhold_charid,@onhold_title$,@onhold_message$,@onhold_date$);
            set @closed, query_sql("select * from `support_ticket` where status = 1 order by date desc limit 128",@closed_ticket_id,@closed_status,@closed_charname$,@closed_charid,@closed_title$,@closed_message$,@closed_date$);
            switch(select("^339900View Open ["+@open+"]","^FF9900View Waiting ["+@waiting+"]","^FF9900View On Hold ["+@onhold+"]","^FF0000View Closed ["+@closed+"]","^000000Back")) {
                case 1:
                    set @temptic, 1;
                    goto L_GMListTickets;
                case 2:
                    set @temptic, 2;
                    goto L_GMListTickets;
                case 3:
                    set @temptic, 3;
                    goto L_GMListTickets;
                case 4:
                    set @temptic, 4;
                    goto L_GMListTickets;
                case 5:
                }
        case 2:
            set @temptic, 0;
            switch(select("By Title","By Content","By Ticket ID","By Char Name","By Char ID","Back")) {
                case 1:
                    mes "[Support Tickets]";
                    mes "Enter part or the full ticket name to search";
                    input @input$;
                    next;
                    set @tickets, query_sql("select ticket_id,char_name,char_id,status,title,message,date from `support_ticket` where title regexp '"+escape_sql(@input$)+"' order by date desc limit 128",@ticket_id,@charname$,@charid,@status,@title$,@message$,@date$);
                    goto L_GMListTickets;
                case 2:
                    mes "[Support Tickets]";
                    mes "Enter part or the full message content to search";
                    input @input$;
                    next;
                    set @tickets, query_sql("select ticket_id,char_name,char_id,status,title,message,date from `support_ticket` where message regexp '"+escape_sql(@input$)+"' order by date desc limit 128",@ticket_id,@charname$,@charid,@status,@title$,@message$,@date$);
                    goto L_GMListTickets;
                case 3:
                    mes "[Support Tickets]";
                    mes "Enter the ticket ID to search for";
                    input @input;
                    next;
                    set @tickets, query_sql("select ticket_id,char_name,char_id,status,title,message,date from `support_ticket` where ticket_id = "+@input+" order by date desc limit 128",@ticket_id,@charname$,@charid,@status,@title$,@message$,@date$);
                    goto L_GMListTickets;
                case 4:
                    mes "[Support Tickets]";
                    mes "Enter part or the full character name";
                    input @input$;
                    next;
                    set @tickets, query_sql("select ticket_id,char_name,char_id,status,title,message,date from `support_ticket` where char_name regexp '"+escape_sql(@input$)+"' order by date desc limit 128",@ticket_id,@charname$,@charid,@status,@title$,@message$,@date$);
                    set @search, 1;
                    goto L_GMListTickets;
                case 5:
                    mes "[Support Tickets]";
                    mes "Enter the character ID to search for";
                    input @input;
                    next;
                    set @tickets, query_sql("select ticket_id,char_name,char_id,status,title,message,date from `support_ticket` where char_id = "+@input+" order by date desc limit 128",@ticket_id,@charname$,@charid,@status,@title$,@message$,@date$);
                    goto L_GMListTickets;
                case 6:
                }
        case 3:
            close;
        case 4:
            next;
            goto L_Main;
        }
 
L_GMListTickets:
    //cleararray ??
    if (@temptic == 1) {
        set @tickets, @open;
        copyarray @ticket_id[0],@open_ticket_id[0],128;
        copyarray @charname$[0],@open_charname$[0],128;
        copyarray @charid[0],@open_charid[0],128;
        copyarray @status[0],@open_status[0],128;
        copyarray @title$[0],@open_title$[0],128;
        copyarray @message$[0],@open_message$[0],128;
        copyarray @date$[0],@open_date$[0],128;
        }
    if (@temptic == 2) {
        set @tickets, @waiting;
        copyarray @ticket_id[0],@waiting_ticket_id[0],128;
        copyarray @charname$[0],@waiting_charname$[0],128;
        copyarray @charid[0],@waiting_charid[0],128;
        copyarray @status[0],@waiting_status[0],128;
        copyarray @title$[0],@waiting_title$[0],128;
        copyarray @message$[0],@waiting_message$[0],128;
        copyarray @date$[0],@waiting_date$[0],128;
        }
    if (@temptic == 3) {
        set @tickets, @onhold;
        copyarray @ticket_id[0],@onhold_ticket_id[0],128;
        copyarray @charname$[0],@onhold_charname$[0],128;
        copyarray @charid[0],@onhold_charid[0],128;
        copyarray @status[0],@onhold_status[0],128;
        copyarray @title$[0],@onhold_title$[0],128;
        copyarray @message$[0],@onhold_message$[0],128;
        copyarray @date$[0],@onhold_date$[0],128;
        }
    if (@temptic == 4) {
        set @tickets, @closed;
        copyarray @ticket_id[0],@closed_ticket_id[0],128;
        copyarray @charname$[0],@closed_charname$[0],128;
        copyarray @charid[0],@closed_charid[0],128;
        copyarray @status[0],@closed_status[0],128;
        copyarray @title$[0],@closed_title$[0],128;
        copyarray @message$[0],@closed_message$[0],128;
        copyarray @date$[0],@closed_date$[0],128;
        }
L_GMListTickets2:
    if (@tickets == 0) {
        mes "[Support Tickets]";
        mes "There are no tickets to display in this category!";
        next;
        goto L_GM;
        }
    mes "[Support Tickets]";
    mes "Select a ticket to view, delete, edit or reply to";
    set @temp,0;
    while (@temp < @tickets) {
        if (@status[@temp] == 0) set @title2$[@temp], "^339900"+@title$[@temp]+"^000000";
        if (@status[@temp] == 1) set @title2$[@temp], "^FF0000"+@title$[@temp]+"^000000";
        if (@status[@temp] > 1) set @title2$[@temp], "^FF9900"+@title$[@temp]+"^000000";
        set @temp,@temp+1;
        }
    next;
    set @temp, 0;
L_GMMore:
    set @temp2, @temp+11;
    if (@temp2 > @tickets) set @temp2, @tickets;
    if (@temp+1 != @temp2) {
        mes "Viewing tickets ["+(@temp+1)+"-"+@temp2+"]";
        } else {
        mes "Viewing ticket "+(@temp+1);
        }
    if (@search == 0) {
        set @display$[0], @title2$[@temp];
        set @display$[1], @title2$[@temp+1];
        set @display$[2], @title2$[@temp+2];
        set @display$[3], @title2$[@temp+3];
        set @display$[4], @title2$[@temp+4];
        set @display$[5], @title2$[@temp+5];
        set @display$[6], @title2$[@temp+6];
        set @display$[7], @title2$[@temp+7];
        set @display$[8], @title2$[@temp+8];
        set @display$[9], @title2$[@temp+9];
        }
    if (@search == 1) {
        if ( @tickets > 0 ) set @display$[0], @charname$[@temp] + ", " + @title2$[@temp];
        else if ( @tickets > 1 ) set @display$[1], @charname$[@temp+1] + ", " + @title2$[@temp+1];
        else if ( @tickets > 2 ) set @display$[2], @charname$[@temp+2] + ", " + @title2$[@temp+2];
        else if ( @tickets > 3 ) set @display$[3], @charname$[@temp+3] + ", " + @title2$[@temp+3];
        else if ( @tickets > 4 ) set @display$[4], @charname$[@temp+4] + ", " + @title2$[@temp+4];
        else if ( @tickets > 5 ) set @display$[5], @charname$[@temp+5] + ", " + @title2$[@temp+5];
        else if ( @tickets > 6 ) set @display$[6], @charname$[@temp+6] + ", " + @title2$[@temp+6];
        else if ( @tickets > 7 ) set @display$[7], @charname$[@temp+7] + ", " + @title2$[@temp+7];
        else if ( @tickets > 8 ) set @display$[8], @charname$[@temp+8] + ", " + @title2$[@temp+8];
        else set @display$[9], @charname$[@temp+9] + ", " + @title2$[@temp+9];
        }
    set @search, 0;
    switch(select("Back","More",@display$[0],@display$[1],@display$[2],@display$[3],@display$[4],@display$[5],@display$[6],@display$[7],@display$[8],@display$[9])) {
        case 1:
            goto L_GM;
        case 2:
            if (@temp2 < 120) {
                set @temp, @temp+10;
                } else {
                mes "[Support Tickets]";
                mes "You can only view up to 128 tickets per category without changing their status'!";
                next;
                goto L_GM;
                }
            if (@temp2 + 10 >= @tickets) {
                mes "[Support Tickets]";
                mes "There is no more tickets to display!";
                next;
                goto L_GM;
                }
            set @temp, @temp+10;
            goto L_GMMore;
        case 3:
            set @view, @temp;
            goto L_GMViewTicket;
        case 4:
            set @view, @temp+1;
            goto L_GMViewTicket;
        case 5:
            set @view, @temp+2;
            goto L_GMViewTicket;
        case 6:
            set @view, @temp+3;
            goto L_GMViewTicket;
        case 7:
            set @view, @temp+4;
            goto L_GMViewTicket;
        case 8:
            set @view, @temp+5;
            goto L_GMViewTicket;
        case 9:
            set @view, @temp+6;
            goto L_GMViewTicket;
        case 10:
            set @view, @temp+7;
            goto L_GMViewTicket;
        case 11:
            set @view, @temp+8;
            goto L_GMViewTicket;
        case 12:
            set @view, @temp+9;
            goto L_GMViewTicket;
        }
 
L_GMViewTicket:
    mes "[Support Tickets]";
    mes "^808080Posted by: ^9900CC"+@charname$[@view]+" ["+@charid[@view]+"]^000000";
    mes "^808080Title: ^9900CC"+@title$[@view]+"^000000";
    mes "^808080Message: ^9900CC"+@message$[@view]+"^000000";
    set @replies, query_sql("select reply_number,char_name,char_id, message,status_change from `support_response` where ticket_id = "+@ticket_id[@view]+" order by reply_number asc",@reply_number,@char_name$,@char_id,@message_reply$,@status_change);
    set @temp, 0;
    while (@temp < @replies) {
        mes "^C9C9C9-^000000";
        if (@message$[@view] == "†" && @char_name$[@temp] == strcharinfo(0)) mes "^808080Status change from: ^339900"+@char_name$[@temp]+"^000000";
        if (@message$[@view] == "†" && @char_name$[@temp] != strcharinfo(0)) mes "^808080Status change from: ^0066FF"+@char_name$[@temp]+"^000000";
        if (@message$[@view] != "†" && @char_name$[@temp] == strcharinfo(0)) {
            mes "^808080Reply from: ^0066FF"+@char_name$[@temp]+" ["+ @char_id +"]^000000";
            mes "^808080Message: ^0066FF"+@message_reply$[@temp]+"^000000";
            }
        if (@message$[@view] != "†" && @char_name$[@temp] != strcharinfo(0)) {
            mes "^808080Reply from: ^339900"+@char_name$[@temp]+" ["+ @char_id +"]^000000";
            mes "^808080Message: ^339900"+@message_reply$[@temp]+"^000000";
            }
        if (@status_change[@temp] == 0) mes "^FF9900>Status changed to ^339900OPEN^000000";
        if (@status_change[@temp] == 1) mes "^FF9900>Status changed to ^FF0000CLOSED^000000";
        if (@status_change[@temp] == 2) mes "^FF9900>Status changed to WAITING^000000";
        if (@status_change[@temp] == 3) mes "^FF9900>Status changed to ON HOLD^000000";
        set @temp,@temp+1;
        }
    next;
    switch(select("Reply","Change Status [No Reply]","Delete Ticket","Back")) {
        case 1:
            mes "[Support Tickets]";
            mes "Enter the reply, enter one space to cancel";
            input @msg$;
            set @msg$, escape_sql(@msg$);
            if (@msg$ == " ") {
                next;
                goto L_GMViewTickets2;
                }
            next;
            mes "[Support Tickets]";
            mes "Enter the new status";
            next;
            menu "^FF9900Waiting",-,"^FF0000Closed",-,"^FF9900On Hold",-,"^339900Open",-,"^000000No Change",-;
            if (@menu == 1) set @stat, 2;
            if (@menu == 2) set @stat, 1;
            if (@menu == 3) set @stat, 3;
            if (@menu == 4) set @stat, 0;
            if (@menu == 5) set @stat, -1;
            if (@stat > -1 && @stat != @status[@view]) {
                    query_sql "insert into `support_response` values ("+@ticket_id[@view]+","+(@replies+1)+",'"+escape_sql(strcharinfo(0))+"',"+getcharid(0)+",'"+@msg$+"',"+@stat+",now())";
                    query_sql "update `support_ticket` set status = "+@stat+" where ticket_id = "+@ticket_id[@view];
                } else {
                query_sql "insert into `support_response` values ("+@ticket_id[@view]+","+(@replies+1)+",'"+escape_sql(strcharinfo(0))+"',"+getcharid(0)+",'"+@msg$+"','-1',now())";
                }
            mes "[Support Tickets]";
            mes "Reply posted";
            next;
            goto L_GMListTickets;
        case 2:
            mes "[Support Tickets]";
            mes "Enter the new status";
            next;
            menu "^FF9900Waiting",-,"^FF0000Closed",-,"^FF9900On Hold",-,"^339900Open",-,"^000000No Change",-;
            if (@menu == 1) set @stat, 2;
            if (@menu == 2) set @stat, 1;
            if (@menu == 3) set @stat, 3;
            if (@menu == 4) set @stat, 0;
            if (@menu == 5) set @stat, -1;
            if (@stat > -1 && @stat != @status[@view]) {
                query_sql "insert into `support_response` values ("+@ticket_id[@view]+","+(@replies+1)+",'"+escape_sql(strcharinfo(0))+"',"+getcharid(0)+",'†',"+@stat+",now())";
                query_sql "update `support_ticket` set status = "+@stat+" where ticket_id = "+@ticket_id[@view];
                }
            mes "[Support Tickets]";
            mes "Status changed";
            next;
            goto L_GMListTickets2;
        case 3:
            mes "[Support Tickets]";
            mes "Are you POSITIVe you want to delete this ticket?!";
            next;
            switch(select("No","Yes")) {
            case 1:
                goto L_GMViewTickets2;
            case 2:
                query_sql "delete from `support_ticket` where ticket_id = "+@ticket_id[@view];
                query_sql "delete from `support_response` where ticket_id = "+@ticket_id[@view];
                deletearray @ticket_id[@view],1;
                deletearray @charname$[@view],1;
                deletearray @charid[@view],1;
                deletearray @status[@view],1;
                deletearray @title$[@view],1;
                deletearray @message$[@view],1;
                deletearray @date$[@view],1;
                goto L_GMListTickets2;
            }
        case 4:
            next;
            goto L_GMListTickets2;
        }
 
OnWhisperGlobal:
    if (getgmlevel() < 40) goto L_Main;
    goto L_GM;
}
Viewed 1401 times, submitted by AnnieRuru.