+++ /dev/null
-<?php\r
-/****************************************************************************/\r
-/* ATutor */\r
-/****************************************************************************/\r
-/* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton */\r
-/* Adaptive Technology Resource Centre / University of Toronto */\r
-/* http://atutor.ca */\r
-/* */\r
-/* This program is free software. You can redistribute it and/or */\r
-/* modify it under the terms of the GNU General Public License */\r
-/* as published by the Free Software Foundation. */\r
-/****************************************************************************/\r
-// $Id: certificate_delete.php 7208 2008-02-20 16:07:24Z cindy $\r
-\r
-define('AT_INCLUDE_PATH', '../../include/');\r
-require(AT_INCLUDE_PATH.'vitals.inc.php');\r
-authenticate(AT_PRIV_CERTIFICATE);\r
-\r
-if (isset($_POST['submit_no'])) {\r
- $msg->addFeedback('CANCELLED');\r
- header('Location: index_instructor.php');\r
- exit;\r
-} else if (isset($_POST['submit_yes'])) {\r
- /* delete has been confirmed, delete this category */\r
- $certificate_id = intval($_POST['certificate_id']);\r
-\r
- $sql = "DELETE FROM ".TABLE_PREFIX."certificate WHERE certificate_id=$certificate_id";\r
- $result = mysql_query($sql, $db) or die(mysql_error());\r
-\r
- write_to_log(AT_ADMIN_LOG_DELETE, 'certificate', mysql_affected_rows($db), $sql);\r
-\r
- $sql = "DELETE FROM ".TABLE_PREFIX."certificate_text WHERE certificate_id=$certificate_id";\r
- $result = mysql_query($sql, $db) or die(mysql_error());\r
-\r
- write_to_log(AT_ADMIN_LOG_DELETE, 'certificate_text', mysql_affected_rows($db), $sql);\r
-\r
- $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');\r
- header('Location: index_instructor.php');\r
- exit;\r
-}\r
-\r
-//require('../../include/header.inc.php');\r
-require(AT_INCLUDE_PATH.'header.inc.php');\r
-\r
-$_GET['certificate_id'] = intval($_GET['certificate_id']); \r
-\r
-$sql = "SELECT certificate_id, title FROM ".TABLE_PREFIX."certificate c, ".TABLE_PREFIX."tests t WHERE c.certificate_id=$_GET[certificate_id] and c.test_id=t.test_id";\r
-$result = mysql_query($sql,$db) or die(mysql_error());\r
-\r
-if (mysql_num_rows($result) == 0) {\r
- $msg->printErrors('ITEM_NOT_FOUND');\r
-} else {\r
- $row = mysql_fetch_assoc($result);\r
- \r
- $hidden_vars['title']= $row['title'];\r
- $hidden_vars['certificate_id'] = $row['certificate_id'];\r
-\r
- $confirm = array('DELETE_CERTIFICATE', $row['title']);\r
- $msg->addConfirm($confirm, $hidden_vars);\r
- \r
- $msg->printConfirm();\r
-}\r
-\r
-require(AT_INCLUDE_PATH.'footer.inc.php');\r
-\r
-?>
\ No newline at end of file