/** * Deletes the selected resource row. */ function wpdev_delete_resource() { $resourceId = $_POST['resource_id']; error_log("wpdev_delete_resource {$resourceId}"); try { ResourceDBO::deleteResource($resourceId); } catch (DatabaseException $de) { $msg = $de->getMessage(); } $resources = new Resources(); if (isset($msg)) { $resources->errorMessage = $msg; } ?> <script type="text/javascript"> document.getElementById('wpdev-bookingresources-content').innerHTML = <?php echo json_encode($resources->toHtml()); ?> ; </script> <?php }