/* 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 page = $(this).attr('page');
    var q = confirm("Kas soovid kirje kustutada?");

    if (q == true){

      $.post('http://localhost/oksjoniportaal/admin/internetioksjon/delete_oksjon.php', {
        object_id: id,
        page: page
      }, function(data){
        location.reload();
      }).fail(function() {
        alert('Kustutamine ebaõnnestus.s');
      });

    }   
    return false;
  });