function delete_object($objid) { $conn = db_connect(); $result_array = get_multiple_locations($objid); foreach ($result_array as $row) { unlink($row['location']); } $query_delobj = "delete from object\n where objid='" . $objid . "'"; $result_obj = $conn->query($query_delobj); $query_delrights = "delete from obj_rights\n where objid='" . $objid . "'"; $result_rights = $conn->query($query_delrights); $query_dellc = "delete from obj_lifecycle\n where objid='" . $objid . "'"; $result_lc = $conn->query($query_dellc); $query_deltech = "delete from obj_tech\n where objid='" . $objid . "'"; $result_tech = $conn->query($query_deltech); if (!$result_obj || !$result_rights || !$result_lc || !$result_tech) { return false; } else { return true; } }
<?php /* This page displays the metadata and related files of a learning object. */ require_once 'repository_fns.php'; session_start(); $objid = $_GET['objid']; $object_general = get_obj_general($objid); $object_rights = get_obj_rights($objid); $object_lifecycle = get_obj_lifecycle($objid); $object_tech = get_obj_tech($objid); $result_array = get_multiple_locations($objid); do_html_header_browse(); do_page_content_show_object($object_general, $object_rights, $object_lifecycle, $object_tech, $result_array); do_html_footer();