Location: PHPKode > projects > ERPSOD > erpsod/soddep1.php
<?PHP
include_once("config.php");

session_start();
$task=$_SESSION ["stask"];


$form1=$_GET["form"];
$action=$_POST["command"];
$id=$_POST["tasklist"] ;


$sql="select * from erptask where taskid=$task";

$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);
if ($num_rows <>0){
	$row = mysql_fetch_row($result);
	$taskname= $row[1];
	$taskdesc = $row[2];
}

if ($form1=="soddep1"){
	if ($action == "Cancel") {
		header('Location: soddep.php');
	} else{
		$sql="SELECT * FROM tasksod where taskid=$id and sodid=$task";

		$result = mysql_query($sql);
		$sodtel = mysql_num_rows($result);
		if ($sodtel==0){
			$sql="INSERT INTO tasksod VALUE ('',$id,$task,'N','','')";
			$result = mysql_query($sql);
			$sql="INSERT INTO tasksod VALUE ('',$task,$id,'N','','')";
			$result = mysql_query($sql);
		}
		header('Location: soddep.php');
	}
} else {

	if ($action=='Add'){
		$taskid=0;
	}
	if ($action=='Delete'){
		$sql="DELETE FROM tasksod WHERE taskid=$id and sodid=$task";
		$result = mysql_query($sql);
		$sql="DELETE FROM tasksod WHERE taskid=$task and sodid=$id";
		$result = mysql_query($sql);
		header('Location: soddep.php');
	}
	if ($action=='Done'){
		header('Location: task_edit.php');
	}
	if ($action=='Mitigate'){
		$_SESSION ["sod"] = $id;
		$_SESSION ["sform"] = "soddep1";
		header('Location: sodmitigate.php');
	}
}
?>
<HTML>
<HEAD>
<link rel="stylesheet" type="text/css" href="<?PHP echo $style ?>">
<script language="JavaScript1.2" src="js/coolmenus4.js">
</script>
</HEAD>
<body bgcolor="#ffffff">
<script language="JavaScript1.2" src="js/erpsod.js">
</script><br><br>
<center>
<h3>Select Conflicting tasks for : </h3>
<?php echo $taskname ?>
<FORM ACTION="soddep1.php?form=soddep1" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="FormName" VALUE="soddep1">
<INPUT TYPE="HIDDEN" NAME="task" VALUE="<?php echo $task ?>">
<INPUT TYPE="HIDDEN" NAME="ID" VALUE="<?PHP echo $ID ?>">
<table border=1 cellpadding=4 cellspacing=0 bgcolor="AQUA"><tr><td>
<table border=0 cellpadding=4 cellspacing=0>
<tr>
<td>Available Tasks</td>
<td><?PHP echo html_drop_down (10,"tasklist","erptask","taskid","taskname","taskid"); ?></td>
</tr>
<tr>
	<td colspan=2 align="right">
	<?php if (role_check("Updater")) { ?>
		<INPUT TYPE="SUBMIT" NAME="command" VALUE="Submit">
	<?PHP } ?>
	<INPUT TYPE="SUBMIT" NAME="command" VALUE="Cancel">
	</td>
</tr>
</table>
</td></tr></table>
</center>
</FORM>
</BODY>
<?php
include_once("footer.php");
?>
</HTML>
Return current item: ERPSOD