var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
$("#form-add").submit(function (e) {
    $(".loading").addClass("active");
    var formData = new FormData($(this)[0]);
    var form = $(this);
    $.ajax({
        url: form.attr('action'),
        type: "POST",
        data: formData,
        cache: false,
        contentType: false,
        async: false,
        processData: false,
        success: function (data) {
            console.log(data);
            $(".loading").removeClass("active");
            if (data.status == 1) {
                form.trigger('reset');
                toastr.success(data.message); // show response from the php script.
            }
            else {
                toastr.error(data.message); // show response from the php script.
            }
        }
    });
    e.preventDefault(); // avoid to execute the actual submit of the form.
});
}