Location: PHPKode > projects > ERPSOD > erpsod/transdep1.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=="transdep1"){
	if ($action == "Cancel") {
		header('Location: transdep.php');
	} else{
		$sql="SELECT * FROM tasktrans where taskid=$task and transid=$id";

		$result = mysql_query($sql);
		$transtel = mysql_num_rows($result);
		if ($transtel==0){
			$sql="INSERT INTO tasktrans VALUE ($task,$id)";
			$result = mysql_query($sql);
		}
		header('Location: transdep.php');
	}
} else {

	if ($action=='Add'){
		$id=0;
	}
	if ($action=='Delete'){
		$sql="DELETE FROM tasktrans WHERE taskid=$task and transid=$id";
		$result = mysql_query($sql);
		header('Location: transdep.php');
	}
	if ($action=='Done'){
		header('Location: task_edit.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 Transactions for : </h3>
<?php echo $taskname ?>
<FORM ACTION="transdep1.php?form=transdep1" 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 Ttransactions</td>
<td><?PHP echo html_drop_down (10,"tasklist","erptrans","transid","transname","transid"); ?></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