function deleteImage(id)
  {
    var table = $('#table_name').val();
    var data_table = $('#data_table_name').val();

    swal({
        title: "Are you sure?",
        text: "You want to permanently delete this record !!",
        icon: 'warning',
        buttons: [
          "No, cancel it!",
          "Yes, I am sure!"
        ],
        dangerMode: true,
      }).then(function(isConfirm) {
        if (isConfirm) {
          $.ajax({
            url: SITEURL + "/event-provider/event/delete-event-image",
            data:{ _token: $('meta[name="csrf-token"]').attr('content'), 'id':id},
            method:'post',
            datatype: 'json',             
            success:function(res){
              if(res == 1){
                swal({
                  title: "Success!",
                  text: "record removed successfully.",
                  icon: "success",
                  button: "Ok"
                });
                $('#imgbox-'+id).remove();
              }
            }
          });
        
        } else {
          swal({
            title: "Cancelled",
            text: "Your imaginary file is safe :)",
            icon: 'error',
            button: "Ok"
          });
          // swal({
          //   lang.canceled, lang.your_imaginary_file_is_safe, "error");
        }
      });
  }
/*  -----------> For Hard Delete data from table. <----------- */
> For Hard Delete data from table.
> For Hard Delete data from table .
function deleteImage(id)
  {
    var table = $('#table_name').val();
    var data_table = $('#data_table_name').val();
    swal({
        title: "Are you sure?",
        text: "You want to permanently delete this record !!",
        icon: 'warning',
        buttons: [
          "No, cancel it!",
          "Yes, I am sure!"
        ],
        dangerMode: true,
      }).then(function(isConfirm) {
        if (isConfirm) {
          $.ajax({
            url: SITEURL + "/event-provider/event/delete-event-image",
            data:{ _token: $('meta[name="csrf-token"]').attr('content'), 'id':id},
            method:'post',
            datatype: 'json',             
            success:function(res){
              if(res == 1){
                swal({
                  title: "Success!",
                  text: "record removed successfully.",
                  icon: "success",
                  button: "Ok"
                });
                $('#imgbox-'+id).remove();
              }
            }
          });
        } else {
          swal({
            title: "Cancelled",
            text: "Your imaginary file is safe :)",
            icon: 'error',
            button: "Ok"
          });
        }
      });
  }
function deleteImage ( id ) { var table = $ ( '#table_name' ) . val ( ) ; var data_table = $ ( '#data_table_name' ) . val ( ) ; swal ( { title : "Are you sure?" , text : "You want to permanently delete this record !!" , icon : 'warning' , buttons : [ "No, cancel it!" , "Yes, I am sure!" ] , dangerMode : true , } ) . then ( function ( isConfirm ) { if ( isConfirm ) { $ . ajax ( { url : SITEURL + "/event-provider/event/delete-event-image" , data : { _token : $ ( 'meta[name="csrf-token"]' ) . attr ( 'content' ) , 'id' : id } , method : 'post' , datatype : 'json' , success : function ( res ) { if ( res == 1 ) { swal ( { title : "Success!" , text : "record removed successfully." , icon : "success" , button : "Ok" } ) ; $ ( '#imgbox-' + id ) . remove ( ) ; } } } ) ; } else { swal ( { title : "Cancelled" , text : "Your imaginary file is safe :)" , icon : 'error' , button : "Ok" } ) ; } } ) ; }
> For Hard Delete data from table.
> For Hard Delete data from table .
// swal({ //   lang.canceled, lang.your_imaginary_file_is_safe, "error");