Location: PHPKode > projects > ERPSOD > erpsod/usertask12.php

$userid=$_SESSION ["suser"];

$id=$_POST["tasklist"] ;

$sql="select logonid,name from erpuser where erpuserid=$userid";
$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);
if ($num_rows <>0){
	$row = mysql_fetch_row($result);
	$logonid= $row[0];
	$name = $row[1];

if ($form1=="usertask12"){
	if ($action == "Cancel") {
		header('Location: user_edit2.php');
	} else{
		$sql="SELECT * FROM usertask where taskid=$id and erpuserid=$userid";

		$result = mysql_query($sql);
		$sodtel = mysql_num_rows($result);
		if ($sodtel==0){
			$sql="INSERT INTO usertask VALUE ($userid,$id)";
			$result = mysql_query($sql);
		header('Location: usertask2.php');
} else {

	if ($action=='Add'){
	if ($action=='Delete'){
		$sql="DELETE FROM usertask WHERE taskid=$id and erpuserid=$userid";
		$result = mysql_query($sql);
		header('Location: usertask2.php');
	if ($action=='Done'){
		header('Location: user_edit2.php');
<link rel="stylesheet" type="text/css" href="<?PHP echo $style ?>">
<script language="JavaScript1.2" src="js/coolmenus4.js">
<body bgcolor="#ffffff">
<script language="JavaScript1.2" src="js/erpsod.js">
<h3>Select tasks for : </h3>
echo $logonid;
echo "-->";
echo $name ;?>
<FORM ACTION="usertask12.php?form=usertask12" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="FormName" VALUE="soddep1">
<INPUT TYPE="HIDDEN" NAME="id" VALUE="<?php echo $id ?>">
<INPUT TYPE="HIDDEN" NAME="userid" VALUE="<?PHP echo $userid ?>">
<table border=1 cellpadding=4 cellspacing=0 bgcolor="AQUA"><tr><td>
<table border=0 cellpadding=4 cellspacing=0>
<td>Available Tasks</td>
<td><?PHP echo html_drop_down (10,"tasklist","erptask","taskid","taskname","taskid"); ?></td>
	<td colspan=2 align="right">
		<INPUT TYPE="SUBMIT" NAME="command" VALUE="Submit">
		<INPUT TYPE="SUBMIT" NAME="command" VALUE="Cancel">
Return current item: ERPSOD