/* Realisatsiooni aluseks on võetud:
PHP Object Oriented CRUD Example with Bootstrap
Kasutatud 6.04.2016
https://www.codeofaninja.com/2014/06/php-object-oriented-crud-example-oop.html
*/

$(document).on('click', '.delete-object', function(){

  var id = $(this).attr('delete-id');
  var q = confirm("Kas soovid oksjoni jälgitavatest eemaldada?");

  if (q == true){

    $.post('delete_jalgitav.php', {
      object_id: id
    }, function(data){
      location.reload();
    }).fail(function() {
      alert('Unable to delete.');
    });

  }   
  return false;
});