<tr>
          <td width="25%"><div align="center">
            <table width="25%" border="0" cellspacing="0" cellpadding="0" >
              <tr>
                <td width="100%" id="box_mid"><table width="98%" height="31" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                       <td width="38%"><div align="center">New Queries</div></td>
                    </tr>
                </table></td>
                </tr>
              <tr>
                <td id="box_border" width="283px" valign="top" align="center"><div align="center">
                    <table border="0" width="283px" align="center" style="margin:5px;">
                      <? ini_set('error_reporting', E_ALL ^ ~E_NOTICE ^ ~E_WARNING);
			include("./config.php");
			$result=mysql_query("select * from query where staffid='".get_staffname($_SESSION['cuser'])."' and querystatus='Unanswered' order by querydate desc limit 0,5");
			if(mysql_num_rows($result)>0)
			{
				while($row=mysql_fetch_array($result))
				{
					echo"<tr><td align=left width=25%>&nbsp;&nbsp;&bull;&nbsp;<a href=./queries_detail.php?id=".$row['queryid'].">".substr($row['querysubject'],0,22)."...</a></td></tr>";
				}
			}
			else
			{
				echo"<tr><td align=center width=25%>No Any Query</td></tr>";
			}
		?>
              	<tr><td align="center"><strong><a href="./queries.php">More..</a></strong></td></tr>
                </table>
                </div></td>
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function ValidateForm(){
	var dt=document.form1.txtDate
	if (isDate(dt.value)==false){
		dt.focus()
		return false
	}
    return true
 }
</script>
<?
	echo"<script>form1.faculty.value='".get_staffname($row['staffid'])."';</script>";
?>
</html>
<?
	include("./config.php");
	include("./function.php");
	$title=$_POST['title'];
	$text=$_POST['assign_text'];
	$login=$_POST['login'];
	$login=get_staffname($login);
	$sem=$_POST['sem'];
	$dt=$_POST['txtDate'];
	mysql_query("insert into assignment (assigntitle,assigndate,assigntext,staffloginid,studsemester) values('$title','$dt','$text','$login','$sem')");

	header("location: ./assignment.php?msg=Assignment Added");
?>