function remove(lang){
    let data = {};
    data["delete"] = [];
    $("#ticker_" + lang).each(function(){
        data["delete"].push($(this).val());
    });
    console.log(JSON.stringify(data));

    $.ajax({
        type: "DELETE",
        url: "/intern/ticker/remove",
        data: data,
        dataType: "json",
        success: function (d) {
            switch(d.messageStatus){
                case "success":
                    setzeFehlermeldung(d.messageStatus, i18n.ticker.delete_success);
                    location.reload();
                    break;
                case "failure":
                    setzeFehlermeldung(d.messageStatus, d.errorMessage);
                    break;
            }
        },
        error: function (d, status, error) {
            setzeFehlermeldung("failure", i18n.common.error_occurred + error);
        }
    });
}

function insert(lang){

    let data = {};
    data.insert = $("#insert_" + lang).val();
    data.lang = lang;

    $.ajax({
        type: "PUT",
        url: "/intern/ticker/add",
        data: data,
        dataType: "json",
        success: function (d) {
            switch(d.messageStatus){
                case "success":
                    setzeFehlermeldung(d.messageStatus, i18n.ticker.insert_success);
                    location.reload();
                    break;
                case "failure":
                    setzeFehlermeldung(d.messageStatus, d.errorMessage);
                    break;
            }
        },
        error: function (d, status, error) {
            setzeFehlermeldung("failure", i18n.common.error_occurred + error);
        }
    });
}
