From 3d0d3a86106ece4ea298ab2f262b3af5ff8a7728 Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Sat, 11 Mar 2017 01:29:13 -0800 Subject: Almost there... --- dash/js/dash.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'dash/js/dash.js') diff --git a/dash/js/dash.js b/dash/js/dash.js index 7fbceac..9d44802 100644 --- a/dash/js/dash.js +++ b/dash/js/dash.js @@ -25,7 +25,6 @@ function acbtn (e) { $(this).parents().filter('.job').hide(250); $.get('headless.php?hire='+$(this).attr('data-rid'), function (data) { if (data == 'OK') { - window.alert('This application has been approved for hire. You can rate your experience with this candidate under the \'Rate\' tab.'); window.location.href = '/dash/rate.php'; } else { window.alert('We\'ve experienced an error trying to approve this application. Please try again another time.'); @@ -34,6 +33,15 @@ function acbtn (e) { }); } } +function trashbtn (e) { + e.preventDefault(); + if (window.confirm('Permanently delete this ad?')) { + $.get('headless.php?rmad='+$(this).attr('data-adid'), function (data) { + if (data == 'OK') window.location.href = '/dash/'; + else window.alert('An error was encountered while attempting to delete this ad.'); + }); + } +} function serveratings ($spaces) { $.each($spaces, function (idx, me) { var $me = $(me); @@ -55,5 +63,6 @@ $(function() { $('.jobxbtn').click(jxbtn); $('.appxbtn').click(axbtn); $('.appcbtn').click(acbtn); + $('.adtrash').click(trashbtn); serveratings($('.ratingdata')); }); -- cgit v1.2.3