Location: PHPKode > projects > ProjectPress > projectpress/projects/dp.php
<?php
/**
 * ProjectPress delete project
 *
 * @package ProjectPress
 * @since 2.0
 */

// Starts the session.
session_start();

include(dirname(dirname(__FILE__)) . '/config.inc.php');
require_once(PM_DIR . 'pm-includes/global.inc.php');

// Checks if user is logged in; if not redirect to login page.
if($current_user->hasPermission('access_site') != true) { pm_redirect(PM_URI . '/index.php'); }

// Enable for error checking and troubleshooting.
# display_errors();
	
pmdb::connect()->query("delete from ".DB."projects where p_id ='".$_REQUEST['p_id']."' AND creator = '" . $_SESSION['username'] . "'");
pmdb::connect()->query("delete from ".DB."project_members where pp_id ='".$_REQUEST['p_id']."'");
pmdb::connect()->query("delete from ".DB."project_leaders where p_id ='".$_REQUEST['p_id']."'");
pmdb::connect()->query("delete from ".DB."project_forum_posts where pp_id ='".$_REQUEST['p_id']."'");
pmdb::connect()->query("delete from ".DB."project_forum_topics where pt_id ='".$_REQUEST['p_id']."'");
Return current item: ProjectPress