function delete_record(type, id){

  swal({
    
    title: "Are you sure?",
    text: "You want to delete this record",
    icon: "warning",
    buttons: true,
    dangerMode: true,
  })
  .then((willDelete) => {

    if (willDelete) {
      
      $.ajax({

        url  : SITEURL + 'admin/delete-record',
        method: 'POST',
        data : { "type": type, "id": id },
        dataType : "JSON",
        headers: headers,
        success: function(res) {            

          $('#table').DataTable().ajax.reload(null, false);
                
          swal(res.message, { icon: "success", timer: 2000});

        },          
        error: function(error){

          ajax_error(error);              

        } 
      
      });
    
    }

  });

}
// This function is used to delete record
This function is used to delete record
This function is used to delete record
function delete_record(type, id){
  swal({
    title: "Are you sure?",
    text: "You want to delete this record",
    icon: "warning",
    buttons: true,
    dangerMode: true,
  })
  .then((willDelete) => {
    if (willDelete) {
      $.ajax({
        url  : SITEURL + 'admin/delete-record',
        method: 'POST',
        data : { "type": type, "id": id },
        dataType : "JSON",
        headers: headers,
        success: function(res) {            
          $('#table').DataTable().ajax.reload(null, false);
          swal(res.message, { icon: "success", timer: 2000});
        },          
        error: function(error){
          ajax_error(error);              
        } 
      });
    }
  });
}
function delete_record ( type , id ) { swal ( { title : "Are you sure?" , text : "You want to delete this record" , icon : "warning" , buttons : true , dangerMode : true , } ) . then ( ( willDelete ) => { if ( willDelete ) { $ . ajax ( { url : SITEURL + 'admin/delete-record' , method : 'POST' , data : { "type" : type , "id" : id } , dataType : "JSON" , headers : headers , success : function ( res ) { $ ( '#table' ) . DataTable ( ) . ajax . reload ( null , false ) ; swal ( res . message , { icon : "success" , timer : 2000 } ) ; } , error : function ( error ) { ajax_error ( error ) ; } } ) ; } } ) ; }
This function is used to delete record
This function is used to delete record