<?php
if (isset($_REQUEST['selectedProject'])) {
$selectedProject = intval($_REQUEST['selectedProject']);
$newProject = intval($_REQUEST['newProject']);
$projDesc = htmlentities($bugDatabase->lists['project'][$selectedProject]['proj_desc']);
$projName = htmlentities($bugDatabase->lists['project'][$selectedProject]['name']);
if (isset($_REQUEST['confirm'])) {
$update[0]['action'] = "delete";
$update[0]['tableName'] = "projects";
$update[0]['uniqueRow'] = "id";
$update[0]['rowid'] = $bugDatabase->lists['project'][$selectedProject]['id'];
$update[1]['action'] = "change";
$update[1]['tableName'] = "tickets";
$update[1]['uniqueRow'] = "project";
$update[1]['rowid'] = $selectedProject;
$update[1]['modify'][0]['fieldName'] = "project";
$update[1]['modify'][0]['fieldValue'] = $newProject;
$bugDatabase->alterDb($update);
header("Location: {$options['baseURL']}?area=admin&action=pedit");
}
}
?>