HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/teamdemo.sports-crowd.com/public/js/symbolicTicketsPrice.js
function createSymbolicTicketPrice() {
    $("#createSymbolicTicket")
        .validator("update")
        .on("submit", function (e) {
            e.preventDefault();
            $("#btn-create-symbolic-ticket").prop("disabled", true);

            var price = $("#createSymbolicTicket input[name='price']").val();

            var comment = $(
                "#createSymbolicTicket input[name='comment']"
            ).val();
            var symbolic_ticket_id = $(
                "#createSymbolicTicket input[name='symbolic_ticket_id']"
            ).val();

            var info = {
                price,
                comment,
                symbolic_ticket_id,
            };

            swal(Lang.get("messagesClient.symbolic_tickets.to_create"), {
                buttons: {
                    cancel: "No",
                    Ok: true,
                },
            }).then((val) => {
                if (val == "Ok") {
                    $.ajax({
                        url: "/symbolic_tickets_price/add",
                        type: "POST",
                        contentType: "application/json",
                        headers: {
                            "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr(
                                "content"
                            ),
                            "Content-Type": "application/json",
                        },
                        data: JSON.stringify(info),
                        success: function (r) {
                            if (r.r) {
                                swal(r.m, {
                                    icon: "success",
                                    buttons: {
                                        Ok: true,
                                    },
                                }).then((val) => {
                                    if (val == "Ok") {
                                        $(location).attr(
                                            "href",
                                            "/symbolic_tickets"
                                        );
                                    }
                                });
                            } else {
                                swal("Error", r.m, "warning");
                                $("#btn-create-symbolic-ticket").prop(
                                    "disabled",
                                    false
                                );
                            }
                        },
                        error: function (e) {
                            swal(
                                "Error",
                                Lang.get("messagesClient.sucursal_tag4"),
                                "error"
                            );
                            $("#btn-create-symbolic-ticket").prop(
                                "disabled",
                                false
                            );
                        },
                    });
                }
            });
        });
}

function clickEditSymbolicTicket(value) {
    _table = $("#example2").DataTable();
    index = _table.page();
    localStorage.setItem("symbolicTicketsTableIndex", index);
    $(location).attr("href", "/symbolic_tickets_price/" + value + "/edit");
}

function editSymbolicTicketPrice() {
    $("#editSymbolicTicket")
        .validator("update")
        .on("submit", function (e) {
            e.preventDefault();

            var id = $("#editSymbolicTicket input[name='id']").val();
            var price = $("#editSymbolicTicket input[name='price']").val();
            var comment = $("#editSymbolicTicket input[name='comment']").val();

            var info = {
                id,
                price,
                comment,
            };

            swal(Lang.get("messagesClient.symbolic_tickets.to_update"), {
                buttons: {
                    cancel: "No",
                    Ok: true,
                },
            }).then((val) => {
                if (val == "Ok") {
                    $.ajax({
                        url: "/symbolic_tickets_price/" + id,
                        type: "PUT",
                        contentType: "application/json",
                        headers: {
                            "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr(
                                "content"
                            ),
                            "Content-Type": "application/json",
                        },
                        data: JSON.stringify(info),
                        success: function (r) {
                            if (r.r) {
                                swal(r.m, {
                                    icon: "success",
                                    buttons: {
                                        Ok: true,
                                    },
                                }).then((val) => {
                                    if (val == "Ok") {
                                        localStorage.setItem(
                                            "setPageTable",
                                            true
                                        );
                                        $(location).attr(
                                            "href",
                                            "/symbolic_tickets"
                                        );
                                    }
                                });
                            }
                        },
                        error: function (e) {
                            swal(
                                "Error",
                                Lang.get("messagesClient.sucursal_tag6"),
                                "error"
                            );
                            $("#btn-edit-sucursal").prop("disabled", false);
                        },
                    });
                }
            });
        });
}

function chkSymbolicTicket(id) {
    var state = 0;

    if ($("#Checkactive" + id).is(":checked")) {
        state = 1;
    }

    var info = {
        id,
        state,
    };

    $.ajax({
        url: "/symbolic_tickets_price/active",
        type: "POST",
        contentType: "application/json",
        headers: {
            "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
            "Content-Type": "application/json",
        },
        data: JSON.stringify(info),
        success: function (r) {
            if (r.r) {
                swal("Ok", r.m);
            } else {
                swal(
                    "Error",
                    Lang.get("messagesClient.symbolic_tickets.update_state"),
                    "error"
                );
            }
        },
        error: function (e) {
            swal(
                "Error",
                Lang.get("messagesClient.symbolic_tickets.update_error"),
                "error"
            );
        },
    });
}