// for each field that appears in a story record foreach ($orow as $key => $value) { // that is passed in (Blocked wants some special handling) if ($_REQUEST[$key] || $key == 'Blocked' && $orow['Blocked'] == 1) { // and somethng has changed then log it if ($_REQUEST[$key] !== $orow[$key]) { echo '# n' . $key . ' ' . $_REQUEST[$key] . ' - o' . $orow[$key] . '</br>'; auditit($_REQUEST['PID'], $_REQUEST['AID'], $_SESSION['Email'], $aaction . $key, $orow[$key], $_REQUEST[$key]); } } } } else { auditit($_REQUEST['PID'], 0, $_SESSION['Email'], $aaction, '', $_REQUEST['Summary']); } $showForm = false; Update_Parent_Points($_REQUEST['AID']); Update_Iteration_Points($_REQUEST['Iteration_ID']); Update_Project_Tags($_REQUEST['PID'], $_REQUEST['Tags']); if (!empty($_REQUEST['gobackto'])) { header('Location:' . $_REQUEST['gobackto']); } else { header('Location:story_List.php?PID=' . $_REQUEST['PID'] . '&IID=' . $_REQUEST['IID']); } } else { $error = 'The form failed to process correctly.' . mysqli_error($DBConn); } } if (!empty($error)) { echo '<div class="error">' . $sql . '<p>' . $error . '</div>'; } if ($showForm) {
<?php require_once 'include/dbconfig.inc.php'; require_once 'include/common.php'; $user_details = check_user($_SESSION['user_identifier']); if (!$user_details) { exit; } $sql = 'UPDATE story SET story.Parent_Story_ID="' . $_GET['NPAR'] . '" WHERE story.AID=' . $_GET['SID']; mysqli_query($DBConn, $sql); Update_Parent_Points($_GET['SID']); Update_oldParent_Points($_GET['OPAR']); auditit($_GET['PID'], $_GET['SID'], $_SESSION['Email'], 'Update parent', fetchusingID('Summary', $_GET['OPAR'], 'story'), fetchusingID('Summary', $_GET['NPAR'], 'story'));