// session_start(); include 'TPGP_db.php'; // self post data $iCancel = $_POST['Cancel']; $theSTStepsId = $_POST['theSTStepsId']; $theSTStepId = $_POST['theSTStepId']; $theSubStepId = $_POST['theSubStepId']; $EntryDate = $_POST['EntryDate']; $SubValue = $_POST['SubValue']; $WorkHoursAssigned = $_POST['WorkHoursAssigned']; $submit = $_POST['Submit']; $theSTStepsId = stripslashes($theSTStepsId); $theSTStepId = stripslashes($theSTStepId); $theSubStepId = stripslashes($theSubStepId); $EntryDate = stripslashes($EntryDate); $SubValue = stripslashes($SubValue); $WorkHoursAssigned = stripslashes($WorkHoursAssigned); $submit = stripslashes($submit); // echo "$SubValue "; // echo "$WorkHoursAssigned"; $iCancel = stripslashes($iCancel); if ($submit=="Cancel"){ $ReturnURL = "TPGP_UpdateStepSubSteps.php?ID=" . $theSTStepId; header("Location:" .$ReturnURL); } if ($submit=="Delete") { $sql2 = "DELETE FROM ststeps WHERE STStepsID=" .$theSTStepsId; // echo $sql2; mysql_query($sql2); $ReturnURL = "TPGP_UpdateStepSubSteps.php?ID=" . $theSTStepId; header("Location:" .$ReturnURL); } else { // $PHP_SELF as the form action will cause the script to post to itself $STStepsID = $_GET['ID']; // ********************************************************************* // GET THE STStepID $theSQL = "SELECT STStepID FROM ststeps WHERE STStepsID ='$STStepsID'"; $sql444 = mysql_query($theSQL); // echo $theSQL; $record_found = mysql_num_rows($sql444); // echo $record_found; if($record_found > 0){ while($row = mysql_fetch_array($sql444)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } // echo $row; // echo $key; // echo $$key; $STStepId = $STStepID; // echo $STStepID; // echo $UserID; // echo $StudentId; } } // ********************************************************************* // $theSQL = "SELECT UserID FROM ststep WHERE STStepID ='$STStepId'"; $theSQL = "SELECT ststep.UserID, step.Step FROM step INNER JOIN ststep ON step.StepID = ststep.StepID WHERE STStepID ='$STStepId'"; $sql444 = mysql_query($theSQL); // echo $theSQL; $record_found = mysql_num_rows($sql444); // echo $record_found; if($record_found > 0){ while($row = mysql_fetch_array($sql444)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } // echo $row; // echo $key; // echo $$key; $StudentId = $UserID; $StepName = $Step; // echo $UserID; // echo $StudentId; } } // ************************************************************************ $theStudentID = $StudentId; $sql = mysql_query("SELECT * FROM users WHERE userid='$theStudentID'"); $record_found = mysql_num_rows($sql); if($record_found > 0){ while($row = mysql_fetch_array($sql)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } // END FOR echo "
|
|