Your IP : 10.1.73.149


Current Path : /home/bolconlineco/www/tutor/
Upload File :
Current File : /home/bolconlineco/www/tutor/studentInfo.php

<?php 
  ob_start();
  //ob_end_clean();
 

  session_start();
 clearstatcache();
 header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");
  header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
  header("Cache-Control: post-check=0, pre-check=0",false);
  session_cache_limiter("must-revalidate");
date_default_timezone_set('Europe/London');
  ?>
<?php include('header.php'); ?>
<?php

if(!isset($_SESSION['tutor']) || $_SESSION['tutorrole'] != 3)
 {
	header("location:../index.php");
	exit(); 
 }
 header("Cache-Control: no-cache, must-revalidate");
 $id=$_GET['Id'];


?>
<script>
    
$("document").ready(function(){
	$("#nte tr:odd").addClass('high');
	
	});
</script>
<script>
$("document").ready(function(){
	$("#ddd").datepicker({dateFormat:'dd/mm/yy'});
});
</script>
<script>
$("document").ready(function(){
	$("#aaa").hide(234234);
	})
</script>


<div id="content">
             	
	<div id="frm">
  
			
		
					
</div>
<?php
  if(isset($_GET['msg']))
   {
	   ?>
	  <span class="eror">Assignment Assign Successfully</span>
      <?php 
	  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-3';\",2500);</script>";
   }

?>

<?php
  if(isset($_GET['a']))
   {
	   ?>
	  <span class="eror">Assignment Re-Assign Successfully</span>
      <?php 
	  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-3';\",2500);</script>";
   }

?>

<?php
  if(isset($_GET['up']))
   {
	   ?>
	  <span class="eror">Result Re-uploaded Successfully</span>
      <?php 
	  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-3';\",2500);</script>";
   }

?>
<?php
  if(isset($_GET['e']))
   {
	   ?>
	  <span class="error">This Email address is already registerd</span>
      <?php 
	  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id';\",2500);</script>";
   }

?>

<?php
  if(isset($_GET['assign']))
   {
	?>
    <span class="error">Uploaded Successfully</span>
    
    <?php   
	echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-3';\",2500);</script>";
	   
   }

?>
<?php
  if(isset($_GET['err']))
   {
	?>
    <span class="error">Please Enter Due Date</span>
    
    <?php   
	echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-3';\",2500);</script>";
	   
   }

?>
<?php
  if(isset($_GET['er']))
   {
	?>
    <span class="error">Select a valid type of file</span>
    
    <?php   
	echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-3';\",2500);</script>";
	   
   }

?>
<?php
  if(isset($_GET['n']))
   {
	?>
   <span class="error"> No Assignments Founds</span>
    
    <?php   
	echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-3';\",2500);</script>";
	   
   }

?>
                      
          <?php
   
     
     $query="SELECT * FROM student where rollno='$id'";
     $reslt=mysql_query($query) or die(mysql_error());
	 $fetch=mysql_fetch_array($reslt);
     extract($fetch);
	 $query2="select * from course where courseId=(select courseid from assigncourse where rollno='$rollno')";
	 $rr=mysql_query($query2) or die(mysql_error());
	 $resultSEt=mysql_fetch_array($rr);
   ?>
   <?php
     if(isset($_POST['registrationdate']))
	  {
		  //$newRegist=date('Y-m-d',strtotime($_POST['registdate']));
		  //$old=sql_strip($_POST['oldregist']);
		  $day=$_POST['day'];
		  $month=$_POST['month'];
		  $year=$_POST['year'];
		  
		  $newRegist=$year.'-'.$month.'-'.$day;
		  $query="update student set registrationdate='$newRegist' where  rollno='$id'";
		  $result=mysql_query($query) or die(mysql_error());
		    $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Registeration date of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
		 // header("location:studentInfo.php?Id=$id");
		  //exit();
		  echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
	  }
	
	  elseif(isset($_POST['postcodeupdate']))
	   {
		   $postcodes=sql_strip($_POST['postcodes']);
		   $oldrepostcode=sql_strip($_POST['oldrepostcode']);
		   $query="update student set postcode='$postcodes' where postcode='$oldrepostcode' and rollno='$id'";
		   $result=mysql_query($query) or die(mysql_error());
		     $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the POSTCODE of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
		  // header("location:studentInfo.php?Id=$id");
		   //exit();
		   echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
	   }
	   elseif(isset($_POST['updatefname']))
	    {
		  	$firstname=$_POST['firstname'];
			$oldfname=$_POST['oldfname'];
			$query="update student set fname='$firstname' where fname='$oldfname' and rollno='$id'";
		    $result=mysql_query($query) or die(mysql_error());
			  $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the First Name of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
			
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}
		   elseif(isset($_POST['updatelname']))
	    {
		  	$lastname=$_POST['lastname'];
			$oldlname=$_POST['oldlname'];
			$query="update student set lname='$lastname' where lname='$oldlname' and rollno='$id'";
		    $result=mysql_query($query) or die(mysql_error());
			 $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Last Name of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}
		
		   elseif(isset($_POST['updatedob']))
	    {
		  	//$newdob=date('d/m/Y',strtotime($_POST['newdob']));
			//$olddob=date('d/m/Y',strtotime($_POST['olddob']));
			 $month=$_POST['month'];
			 $day=$_POST['day'];
			 $year=$_POST['year'];
			 $newdob=$year.'-'.$month.'-'.$day;
			$query="update student set dob='$newdob' where rollno='$id'";
		    $result=mysql_query($query) or die(mysql_error());
			 $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Date of Birth of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}
		   elseif(isset($_POST['updateaddress1']))
	    {
		  	$newaddress1=$_POST['newaddress1'];
			$oldaddress1=$_POST['oldaddress1'];
			$query="update student set address='$newaddress1' where address='$oldaddress1' and rollno='$id'";
		    $result=mysql_query($query) or die(mysql_error());
			
			 $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Address of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}
		   elseif(isset($_POST['updatecity']))
	    {
		  	$newcity=$_POST['newcity'];
			$oldcity=$_POST['oldcity'];
			$query="update student set city='$newcity' where city='$oldcity' and rollno='$id'";
		    $result=mysql_query($query) or die(mysql_error());
			 $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the City of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}
		   elseif(isset($_POST['updatecountry']))
	    {
		  	$newcountry=$_POST['newcountry'];
			//$oldlname=$_POST['oldlname'];
			$query="update student set country='$newcountry' where rollno='$id'";
		    $result=mysql_query($query) or die(mysql_error());
			 $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Country of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}
		   elseif(isset($_POST['updatephone']))
	    {
		  	$phone=$_POST['phone'];
			$query="update student set phone='$phone' where rollno='$id'";
		    $result=mysql_query($query) or die(mysql_error());
			
			 $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Phone Number of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}
		   elseif(isset($_POST['updatemobile']))
	    {
		  	$mobile=$_POST['mobile'];
			$query="update student set mobile='$mobile' where rollno='$id'";
		    $result=mysql_query($query) or die(mysql_error());
			
			
			 $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Mobile Number of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}
		   elseif(isset($_POST['updatest']))
	    {
		  	$studstatus=$_POST['studstatus'];
			
			$query="update student set studentstatus='$studstatus' where rollno='$id'";
		    $result=mysql_query($query) or die(mysql_error());
			 $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Status of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
		   // header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}
		  elseif(isset($_POST['updateemail']))
	    {
			/*
		  	$newemail=$_POST['newemail'];
			$oldemail=$_POST['oldemail'];
			$query="update student set email='$newemail' where rollno='$id'";
		    $result=mysql_query($query) or die(mysql_error());
			$qq="update admin set username='$newemail' where username='$oldemail'";
			$rr=mysql_query($qq) or die(mysql_error());
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
			*/
			
		  	$email=$_POST['newemail'];
			$oldemail=$_POST['oldemail'];
			if($email==$oldemail)
			 {
				 echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
			 }else
			 {
			$sql="select * from programe_co where email='$email'";
			$rresult=mysql_query($sql) or die(mysql_error());
			$sql1="select tutorId from tutor where email='$email'";
		    $rr=mysql_query($sql1) or die(mysql_error());
			$sql="select SId from student where email='$email'";
			$result=mysql_query($sql) or die(mysql_error());
			if(mysql_num_rows($rresult) > 0 )
			 {
				echo "<script>window.location.href='studentInfo.php?e&Id=$id'</script>"; 
			 }else if(mysql_num_rows($rr) > 0 )
			  {
				echo "<script>window.location.href='studentInfo.php?e&Id=$id'</script>";  
			  }else if(mysql_num_rows($result) > 0 )
			   {
				  echo "<script>window.location.href='studentInfo.php?e&Id=$id'</script>"; 
			   }else
				   {
					$oldemail=$_POST['oldemail'];
					$query="update student set email='$email' where rollno='$id'";
					$result=mysql_query($query) or die(mysql_error());
					$qq="update admin set username='$email' where username='$oldemail'";
					$rr=mysql_query($qq) or die(mysql_error());
					//header("location:studentInfo.php?Id=$id");
					//exit();
					echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
			   }
			 }
			
		}
		elseif(isset($_POST['updatetitle']))
		 {
			 $title=$_POST['title'];
			 $query="update student set jobtitle='$title' where rollno='$id'";
			 $result=mysql_query($query) or die(mysql_error());
			 
			  $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Job title of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
			 //header("location:studentInfo.php?Id=$id");
			 //exit();
			 echo "<script>window.location.href='studentInfo.php?Id=$id'#ui-tabs-9</script>";
		 }
		 
		 elseif(isset($_POST['updatecomp']))
		  {
			  $companyname=$_POST['companyname'];
			  $query="update student set companyname='$companyname' where rollno='$id'";
			  $result=mysql_query($query) or die(mysql_error());
			  
			    $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Company Name of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
			 // header("location:studentInfo.php?Id=$id");
			  //exit();
			  echo "<script>window.location.href='studentInfo.php?Id=$id'#ui-tabs-9</script>";
			  
		  }
		  elseif(isset($_POST['upadd1']))
		   {
			   $addline1=$_POST['addline1'];
			   $query="update student set addressline1='$addline1' where rollno='$id'";
			   $result=mysql_query($query) or die(mysql_error());
			   
			      $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Address Line 1 of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
			   //header("location:studentInfo.php?Id=$id");
			   //exit();
			   echo "<script>window.location.href='studentInfo.php?Id=$id'#ui-tabs-9</script>";
		   }
		
		  elseif(isset($_POST['updateaddressline2']))
		   {
			  $addressline2=$_POST['addressline2'];
			  $query="update student set addressline2='$addressline2' where rollno='$id'";
			  $result=mysql_query($query) or die(mysql_error());
			  
			    $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Address Line 2 of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
			  //header("location:studentInfo.php?Id=$id"); 
			  //exit();
			  echo "<script>window.location.href='studentInfo.php?Id=$id'#ui-tabs-9</script>";
		   }
		  elseif(isset($_POST['updateaddressline3']))
		  {
			  $addressline3=$_POST['addressline3'];
			  $query="update student set addressline3='$addressline3' where rollno='$id'";
			  $result=mysql_query($query) or die(mysql_error());
			  
			    $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Address Line 3 of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
			 // header("location:studentInfo.php?Id=$id");
			  //exit();
			  echo "<script>window.location.href='studentInfo.php?Id=$id'#ui-tabs-9</script>";
			  
		  }
		  elseif(isset($_POST['updatee-City']))
		  {
			  $ecity=$_POST['ecity'];
			  $query="update student set ecity='$ecity' where rollno='$id'";
			  $result=mysql_query($query) or die(mysql_error());
			  
			    $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the City (employment) of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
			  //header("location:studentInfo.php?Id=$id");
			  //exit();
			  echo "<script>window.location.href='studentInfo.php?Id=$id'#ui-tabs-9</script>";
			  
		  }
		  elseif(isset($_POST['epostcode']))
		  {
			  $ecode=$_POST['ecode'];
			  $query="update student set epostcode='$ecode' where rollno='$id'";
			  $result=mysql_query($query) or die(mysql_error());
			  
			   $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Postcode (employment) of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
			  //header("location:studentInfo.php?Id=$id");
			  //exit();
			  echo "<script>window.location.href='studentInfo.php?Id=$id'#ui-tabs-9</script>";
			  
		  }
		  elseif(isset($_POST['updatemecountry']))
		  {
			  $ecountry=$_POST['ecountry'];
			  $query="update student set ecountry='$ecountry' where rollno='$id'";
			  $result=mysql_query($query) or die(mysql_error());
			     $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated the Country (employment) of role number ".$id."','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
			 // header("location:studentInfo.php?Id=$id");
			  //exit();
			  echo "<script>window.location.href='studentInfo.php?Id=$id'#ui-tabs-9</script>";
			  
		  }
		  
		  if(isset($_POST['submitthis']))
		   {
			   
			  $topicId=$_POST['topicIdd'];
			  $courseId=$_POST['courseIdd'];
			
				   $q="SELECT tAId FROM topicassignment where topicId='$topicId' and courseId='$courseId'";
				   $r=mysql_query($q) or die(mysql_error());
				   if(mysql_num_rows($r) > 0) 
				    {
				     $fff=mysql_fetch_array($r);
				   
				     $sql1="insert into studentassignment values('',".$fff['tAId'].",current_date(),1,'$id','$courseId','$topicId')";
	                 $result=mysql_query($sql1) or die(mysql_error());
	                 if($result)
		             {
				    
				   
					header("location:studentInfo.php?Id=$id&msg#ui-tabs-3");
					exit();
					
            
      
				   
			   }
					}else
					{
						header("location:studentInfo.php?Id=$id&n#ui-tabs-3");
					    exit();
					}
			  
			 
			   
			   
		   }
		   //}
   ?>  
      <?php
	/*$selectTutor = "SELECT * FROM tutor WHERE email = '" . $_SESSION['tutor']. "'";
	$selectgTutor*/
  if(isset($_POST['addtasks']))
		    {
			  $taks=$_POST['task'];
			  
			  $date1=$_POST['date'];
			            $d1=explode('/',$date1);
					    $date=$d1[2].'-'.$d1[1].'-'.$d1[0];
			  
			  $query="insert into tasks() values ('','$taks','$date',now(),2,'$id','',0)";
			  $result=mysql_query($query) or die(mysql_error());
			  $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Added a new Task','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
			  header("location:studentInfo.php?Id=$id&task#ui-tabs-5");
			  exit();
			}
			
			if(isset($_POST['updatetask']))
			 {
				$task=$_POST['task'];
				$date1= $_POST['date'];
				$taskstatus=$_POST['taskstatus'];
				$d1=explode('/',$date1);
					    $date=$d1[2].'-'.$d1[1].'-'.$d1[0];
				$idd=$_POST['id'];
				$q="update tasks set task='$task',taskdate='$date',cdate=now(),taskstatus='$taskstatus' where id='$idd' and rollno='$id'";
				$r=mysql_query($q) or die(mysql_error());
				  $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Updated a Task','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
				header("location:studentInfo.php?Id=$id#ui-tabs-5");
				exit();
			 }
			 
			 if(isset($_GET['d']))
			  {
				  
				$tasks=$_GET['taskId'];
				$d=mysql_query("delete from tasks where id='$tasks'");
                header("location:studentInfo.php?Id=$id#ui-tabs-5");
				exit();
				  
			  }
   ?>
    <?php
  if(isset($_POST['add-upload']))
   {
	  
	  $name = $_FILES['upload']['name'];
	  
	  $temp_name = $_FILES['upload']['tmp_name'];
	  
	  $allowed=array('doc','docx','pdf');
	  
	  $type=explode('.',$name);
	  
	  $iid=$_POST['assigid'];
	  
	  
	  
	  $dir="../studentresult/";
       $rand=mt_rand();
	   $fullname=$rand.$name;

       if(in_array($type[1],$allowed))
	   
	     {
			 $q1="SELECT * from studentassignment where SAid='$iid' and rollno='$id' and AssignmentStatus=3";
	        $r=mysql_query($q1) or die(mysql_error());
	        if(mysql_num_rows($r) > 0)
	           {
				   
				   if(move_uploaded_file($temp_name,$dir.$fullname))
				    {
						$query2="SELECT * from studentassignment where SAid='$iid' and rollno='$id'";
						
						$reuslt2=mysql_query($query2) or die(mysql_error());
	   
                        $aN=mysql_fetch_array($reuslt2);
						
						$aname=$aN['AssignmentName'];
						$sql="update uploadassignment set uploadStatus=0,Reassign=0 where assignmentId='$iid' and courseId=".$aN['courseId']."  and topicId=".$aN['topicId']." and rollno='$id'";
	   
	                    $result=mysql_query($sql) or die(mysql_error());
						
						$qq2="SELECT fullname from studenresult where assignmentId='$aname' and rollno='$id'";
						$resuletSet=mysql_query($qq2) or die(mysql_error());
						$name=mysql_fetch_array($resuletSet);
						if(file_exists('../studentresult/'.$name['fullname']))
						 {
							unlink('../studentresult/'.$name['fullname']); 
						 }
						
					   $q="update studenresult set fullname='$fullname' where assignmentId='$aname' and rollno='$id'";	
					   mysql_query($q) or die(mysql_error());
					   header("location:studentInfo.php?Id=$id&up#ui-tabs-3");
					   exit();
					}
		   
	           }else
			   {
			 
			 
			if(move_uploaded_file($temp_name,$dir.$fullname))
			
			  {
				 
				 	    $query="update studentassignment set AssignmentStatus=3 where SAid='$iid' and rollno='$id'";
	   
                        $result=mysql_query($query) or die(mysql_error());
						
						$query2="SELECT * from studentassignment where SAid='$iid' and rollno='$id'";
						
						$reuslt2=mysql_query($query2) or die(mysql_error());
	   
                        $aN=mysql_fetch_array($reuslt2);
						
						$aname=$aN['AssignmentName'];
						
						$result1=mysql_query("select * from studenresult where assignmentId='$aname' and rollno='$id'") or die(mysql_error());
						if(mysql_num_rows($result1)>0)
						 {
							 $fetch=mysql_fetch_array($result1);
							 unlink('../studenresult/'.$fetch['fullname']);
							 $sql="update uploadassignment set uploadStatus=0,Reassign=0 where assignmentId='$iid' and courseId=".$aN['courseId']."  and topicId=".$aN['topicId']." and rollno='$id'";
							 mysql_query($sql) or die(mysql_error());
							 $qqq=mysql_query("update studenresult set fullname='$fullname' where assignmentId='$aname' and rollno='$id'");
							 header("location:studentInfo.php?Id=$id&assign#ui-tabs-3");
						     exit();
						 }else
						 {
							 
						 
						$query3="insert into studenresult values ('','$aname','$id','$fullname')";
						
						$result=mysql_query($query3) or die(mysql_error());
						
						$sql="update uploadassignment set uploadStatus=0,Reassign=0 where assignmentId='$iid' and courseId=".$aN['courseId']."  and topicId=".$aN['topicId']." and rollno='$id'";
	   
	                    $result=mysql_query($sql) or die(mysql_error());
	   
						header("location:studentInfo.php?Id=$id&assign#ui-tabs-3");
						 
						exit();
 
						 }
			  }
			   }
	
		 }else
		 {
			 
			 header("location:studentInfo.php?Id=$id&er#ui-tabs-3");
			 exit();
 
				
			  
		 }
	   	   
   }
?>

<?php

  if(isset($_POST['Re-Assign']))
   {
	   $courseId=$_POST['courseId'];
	   $topicId=$_POST['topicId'];
	   $query="update studentassignment set AssignmentStatus=1 where courseId='$courseId' and topicId='$topicId' and rollno='$id'";
	   $result=mysql_query($query) or die(mysql_error());
	  $query="update uploadassignment set Reassign=0 where courseId='$courseId' and topicId='$topicId' and rollno='$id'";
	   mysql_query($query) or die(mysql_error());
	   header("location:studentInfo.php?Id=$id&a#ui-tabs-3");
	   exit();
	
	   
	   
   }

?>
       

   
        <?php
    $q="select * from assigncourse where rollno='$id'";
	
	$r=mysql_query($q) or die(mysql_error());
	if(mysql_num_rows($r) > 0)
	 {
	   $result=mysql_fetch_array($r);
	
	   $q="select concat_ws(' ',firstname,lastname) as full from tutor where tutorId=".$result['tutorId'];
	   $r=mysql_query($q) or die(mysql_error());
	   
	   $re=mysql_fetch_array($r);
	 }
   
   ?>      
                
                <div id="data">
<script type="text/javascript">
	$(function() {
		
		$("#tabs").tabs({ fx: { height: 'toggle', opacity: 'toggle' } });
	});
	</script>
    <script type="text/javascript">
$(document).ready(function(){
	$(".ui-corner-top").corner("top 10px");
	$(".ui-corner-all").corner("10px");

})
</script>


   
<div style="-moz-border-radius: 10px 10px 10px 10px; width:1144px" class="ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
			    <ul style="-moz-border-radius: 10px 10px 10px 10px;" class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
      <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-tabs-selected ui-state-active"><a href="#tabs-1">Personal Details</a></li>
      <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-9">Employment Details</a></li>
         <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-8">Fee Details</a></li>
            <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-3">Course Details</a></li>
            <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-4">Notes</a></li>
          <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-5">Tasks</a></li>
   </ul><div style="" id="tabs-1" class="tabsContent ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"><ul class="thumbs">

   

      <table width="650" border="0" id="personnaldetails" class="tablestyle">
     <?php /* <tr>
      <td id="col">Assigntutor</td>
      <td id="col2"><?php if(empty($re['full']))
	  
	  { echo "No Tutor";
	  
	    }else{ echo $re['full'];};?></td>
      </tr> */?>
  <tr>
 
    <td id="col">Registration Date:</td>
    <td id="col2"><?php 
	  if(isset($_POST['submit-1']))
	   {
	      	$rr=$_POST['regist'];
			$full=explode('-',$rr);
		?>
        <form action="" method="post">
         <select name="day">
           <option value="<?php echo $full[2]; ?>"><?php echo $full[2];?></option>
                <?php
								 for( $d=01; $d<=31; $d++)
								  {
									  ?>
                                      <option value="<?php echo str_pad($d,2,'0',STR_PAD_LEFT);?>"><?php echo str_pad($d,2,'0',STR_PAD_LEFT);?></option>
                                      <?php
								  }
								
								?>
           </select>
          <select name="month">
           <option value="<?php echo $full[1];?>"><?php echo $full[1];?></option>
          <?php
								 for( $d=01; $d<=12; $d++)
								  {
									  ?>
                                      <option value="<?php echo str_pad($d,2,'0',STR_PAD_LEFT);?>"><?php echo str_pad($d,2,'0',STR_PAD_LEFT);?></option>
                                      <?php
								  }
								
								?>
           
                            
           </select>
            <select name="year">
           <option value="<?php echo $full[0]; ?>"><?php echo $full[0];?></option>
            <?php
								  for($d=date("Y"); $d>=1960; $d--)
								   {
									   if($full[0]==$d)
									    {
										}else{
									   ?>
                                      <option value="<?php echo str_pad($d,2,'0',STR_PAD_LEFT);?>"><?php echo str_pad($d,2,'0',STR_PAD_LEFT);?></option>
                                       <?php
								   }
								   }
								?>
           </select>
        <input type="submit" name="registrationdate" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo date('d/m/Y',strtotime($registrationdate));
		}
		?>
          </td>
    <td>
    <?php if(!isset($_POST['submit-1']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
    <div id="btn">
    <input type="hidden" name="regist" value="<?php echo $registrationdate; ?>" />
     <input type="submit" name="submit-1" class="edit" value=""  />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?>
    </td>
    <td>
    <?php /* if(isset($_POST['submit-1'])){
		$rr=$_POST['regist'];
		?>
        <form action="" method="post">
        <input type="text" name="registdate" value="<?php echo $rr; ?>" />
        <input type="hidden" name="oldregist" value="<?php echo $rr; ?>" />
        <input type="submit" name="registrationdate" value="Update" class="add" />
        </form>
        <?php
		}*/?>
   </td>
  </tr>
  <tr>
    <td id="col">StudentID:</td>
    <td id="col2"><?php echo $rollno;?></td>
  </tr>
  <tr>
    <td id="col">Course:</td>
    <td id="col2"><?php echo $resultSEt['courseName'];?></td>
  </tr>
  <tr>
    <td id="col">First Name:</td>
    <td id="col2"><?php 
	  if(isset($_POST['submit-3']))
	   {
	      	$firstname=$_POST['firstname'];
		?>
        <form action="" method="post">
        <input type="text" name="firstname" value="<?php echo $firstname; ?>" />
        <input type="hidden" name="oldfname" value="<?php echo $firstname; ?>" />
        <input type="submit" name="updatefname" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $fname;
		}
		?></td>
    <td><?php if(!isset($_POST['submit-3']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
    <div id="btn">
    <input type="hidden" name="firstname" value="<?php echo $fname; ?>" />
     <input type="submit" name="submit-3" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col">Last Name:</td>
    <td id="col2"><?php 
	  if(isset($_POST['submit-4']))
	   {
	      	$lname=$_POST['lname'];
		?>
        <form action="" method="post">
        <input type="text" name="lastname" value="<?php echo $lname; ?>" />
        <input type="hidden" name="oldlname" value="<?php echo $lname; ?>" />
        <input type="submit" name="updatelname" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $lname;
		}
		?></td>
    <td><?php if(!isset($_POST['submit-4']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
    <div id="btn">
    <input type="hidden" name="lname" value="<?php echo $lname; ?>" />
     <input type="submit" name="submit-4" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col">Date OF Birth:</td>
    <td id="col2"><?php 
	  if(isset($_POST['submit-5']))
	   {
	      	$dateob=$_POST['dateob'];
			$full=explode('-',$dateob);
		?>
       <form action="" method="post">
             <select name="day">
           <option value="<?php echo $full[2]; ?>"><?php echo $full[2];?></option>
                <?php
								 for( $d=01; $d<=31; $d++)
								  {
									  ?>
                                      <option value="<?php echo str_pad($d,2,'0',STR_PAD_LEFT);?>"><?php echo str_pad($d,2,'0',STR_PAD_LEFT);?></option>
                                      <?php
								  }
								
								?>
           </select>
          <select name="month">
           <option value="<?php echo $full[1];?>"><?php echo $full[1];?></option>
          <?php
								 for( $d=01; $d<=12; $d++)
								  {
									  ?>
                                      <option value="<?php echo str_pad($d,2,'0',STR_PAD_LEFT);?>"><?php echo str_pad($d,2,'0',STR_PAD_LEFT);?></option>
                                      <?php
								  }
								
								?>
           
                            
           </select>
            <select name="year">
           <option value="<?php echo $full[0]; ?>"><?php echo $full[0];?></option>
            <?php
								  for($d=date("Y"); $d>=1960; $d--)
								   {
									   if($full[0]==$d)
									    {
										}else{
									   ?>
                                      <option value="<?php echo str_pad($d,2,'0',STR_PAD_LEFT);?>"><?php echo str_pad($d,2,'0',STR_PAD_LEFT);?></option>
                                       <?php
								   }
								   }
								?>
           </select>
     
          
           
        <input type="submit" name="updatedob" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo date('d/m/Y',strtotime($dob));
		}
		?></td>
    <td><?php if(!isset($_POST['submit-5']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
    <div id="btn">
    <input type="hidden" name="dateob" value="<?php echo $dob; ?>" />
     <input type="submit" name="submit-5" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col">Email: </td>
    <td id="col2"><?php 
	  if(isset($_POST['submit-email']))
	   {
	      	$email=$_POST['email'];
		?>
        <form action="" method="post">
        <input type="text" name="newemail" value="<?php echo $email; ?>" />
        <input type="hidden" name="oldemail" value="<?php echo $email; ?>" />
        <input type="submit" name="updateemail" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $email;
		}
		?></td>
    <td><?php if(!isset($_POST['submit-email']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
    <div id="btn">
    <input type="hidden" name="email" value="<?php echo $email; ?>" />
     <input type="submit" name="submit-email" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col">Address line1:</td>
    <td id="col2"><?php 
	  if(isset($_POST['submit-6']))
	   {
	      	$address1=$_POST['address1'];
		?>
        <form action="" method="post">
        <input type="text" name="newaddress1" value="<?php echo $address1; ?>" />
        <input type="hidden" name="oldaddress1" value="<?php echo $address1; ?>" />
        <input type="submit" name="updateaddress1" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $address;
		}
		?></td>
    <td><?php if(!isset($_POST['submit-6']))
	     {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
    <div id="btn">
    <input type="hidden" name="address1" value="<?php echo $address; ?>" />
     <input type="submit" name="submit-6" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
   <tr>
    <td id="col">City:</td>
    <td id="col2"><?php 
	  if(isset($_POST['submit-7']))
	   {
	      	$city=$_POST['city'];
		?>
        <form action="" method="post">
        <input type="text" name="newcity" value="<?php echo $city; ?>" />
        <input type="hidden" name="oldcity" value="<?php echo $city; ?>" />
        <input type="submit" name="updatecity" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $city;
		}
		?></td>
    <td><?php if(!isset($_POST['submit-7']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
    <div id="btn">
    <input type="hidden" name="city" value="<?php echo $city; ?>" />
     <input type="submit" name="submit-7" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
   <tr>
    <td id="col">PostCode:</td>
    <td id="col2">
	<?php 
	  if(isset($_POST['PoCode']))
	   {
		   
	      	$postcode=$_POST['postcode'];
		?>
        <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
        <input type="text" name="postcodes" value="<?php echo $postcode; ?>" />
        <input type="hidden" name="oldrepostcode" value="<?php echo $postcode; ?>" />
        <input type="submit" name="postcodeupdate" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        
		}
		else{
			 echo $postcode;
		}
		?>
	
	</td>
     <td>
    <?php if(!isset($_POST['PoCode']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
    <div id="btn">
    <input type="hidden" name="postcode" value="<?php echo $postcode; ?>" />
     <input type="submit" name="PoCode" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?>
    </td>
  </tr>
   <tr>
    <td id="col">Country:</td>
    <td id="col2"><?php 
	  if(isset($_POST['submit-8']))
	   {
	      	$country=$_POST['country'];
		?>
            <form action="" method="post">
          <select name="newcountry">
      <option value="<?php echo $country; ?>"><?php echo $country; ?></option>
    <?php
     $q="SELECT * FROM country where name !='$country' order by name";
	 $r=mysql_query($q) or die(mysql_error());
	 while($cont=mysql_fetch_array($r))
	  {
	    ?>
        <option value="<?php echo $cont['name']; ?>"><?php echo $cont['name']; ?></option>
        <?php  
	  }
	?>
    </select>
       
        <input type="submit" name="updatecountry" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $country;
		}
		?></td>
    <td><?php if(!isset($_POST['submit-8']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
    <div id="btn">
    <input type="hidden" name="country" value="<?php echo $country; ?>" />
     <input type="submit" name="submit-8" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col">Phone:</td>
    <td id="col2"><?php 
	  if(isset($_POST['submit-9']))
	   {
	      	$phone=$_POST['phone'];
		?>
        <form action="" method="post">
        <input type="text" name="phone" value="<?php echo $phone; ?>" />
       
        <input type="submit" name="updatephone" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $phone;
		}
		?></td>
    <td><?php if(!isset($_POST['submit-9']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
    <div id="btn">
    <input type="hidden" name="phone" value="<?php echo $phone; ?>" />
     <input type="submit" name="submit-9" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col">Mobile:</td>
    <td id="col2"><?php 
	  if(isset($_POST['submit-10']))
	   {
	      	$mobile=$_POST['mobile'];
		?>
        <form action="" method="post">
        <input type="text" name="mobile" value="<?php echo $mobile; ?>" />
        
        <input type="submit" name="updatemobile" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $mobile;
		}
		?></td>
    <td><?php if(!isset($_POST['submit-10']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
    <div id="btn">
    <input type="hidden" name="mobile" value="<?php echo $mobile; ?>" />
     <input type="submit" name="submit-10" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
   <tr>
    <td id="col">Status:</td>
    <td id="col2">
    <?php 
	  if(isset($_POST['submit-status']))
	   {
	      	$st=$_POST['st'];
		?>
        <form action="" method="post">
         <select name="studstatus" class="cstat" style="width:230px;">
         <option value="">Status</option>
		 <?php $select_status = "SELECT * FROM status WHERE Status = 1";
		 		$select_status2 = mysql_query($select_status);
				while($select_status3 = mysql_fetch_array($select_status2)){
				
		    ?>
         <option value="<?=$select_status3['StatusId'] ?>" <?php if($st == $select_status3['StatusId']){ echo "selected"; }?>><?php echo $select_status3['StatusName'];  ?></option>
        <? } ?>
         </select>
        
       
        <input type="submit" name="updatest" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
		$selectStt = "SELECT * FROM status WHERE StatusId = '".$studentstatus."' ";
		$selectStt2 = mysql_query($selectStt);
		$selectStt3 = mysql_fetch_array($selectStt2);
		echo $selectStt3['StatusName'];
		
		
		}
		?></td>
    <td><?php if(!isset($_POST['submit-status']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
    <div id="btn">
     <input type="hidden" name="st" value="<?php echo $studentstatus; ?>" />
     <input type="submit" name="submit-status" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?>
	
	<?php 
	/*
	 if($studentstatus==1)
	  {
		echo "Active";  
	  }
	  else if($studentstatus==2)
	   {
		 echo "InActive";   
	   }else if($studentstatus==3)
	    {
		  echo "Suspended";	
		}else if($studentstatus==4)
		 {
			echo "Completed"; 
		 }*/
	?></td>
  </tr>
</table>

            </ul>
           
            </div>
            
            <div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="ui-tabs-9"><ul class="thumbs">
               <table width="650" border="0" id="personnaldetails" class="tablestyle">
  <tr>
    <td width="90" id="col1">Job Title:</td>
    <td width="305" id="col2"><?php 
	  if(isset($_POST['updatejobtitle']))
	   {
	      	$jobtitle=$_POST['jobtitle'];
		?>
        <form action="" method="post">
        <input type="text" name="title" value="<?php echo $jobtitle; ?>" />
        
        <input type="submit" name="updatetitle" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $jobtitle;
		}
		?></td>
    <td width="30"><?php if(!isset($_POST['updatejobtitle']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
    <div id="btn">
    <input type="hidden" name="jobtitle" value="<?php echo $jobtitle; ?>" />
     <input type="submit" name="updatejobtitle" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col1">Company Name:</td>
    <td id="col2"><?php 
	  if(isset($_POST['updatecompany']))
	   {
	      	$companyname=$_POST['companyname'];
		?>
        <form action="" method="post">
        <input type="text" name="companyname" value="<?php echo $companyname; ?>" />
        
        <input type="submit" name="updatecomp" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $companyname;
		}
		?></td>
    <td><?php if(!isset($_POST['updatecompany']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
    <div id="btn">
    <input type="hidden" name="companyname" value="<?php echo $companyname; ?>" />
     <input type="submit" name="updatecompany" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col1">Address line1:</td>
    <td id="col2"><?php 
	  if(isset($_POST['updateadd1']))
	   {
	      	
		?>
        <form action="" method="post">
        <input type="text" name="addline1" value="<?php echo $addressline1; ?>" />
        
        <input type="submit" name="upadd1" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $addressline1;
		}
		?></td>
    <td><?php if(!isset($_POST['updateadd1']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
    <div id="btn">
    
     <input type="submit" name="updateadd1" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col1">Address line2:</td>
    <td id="col2"><?php 
	  if(isset($_POST['addressline-2']))
	   {
	      	$lname=$_POST['lname'];
		?>
        <form action="" method="post">
        <input type="text" name="addressline2" value="<?php echo $addressline2; ?>" />
        <input type="submit" name="updateaddressline2" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $addressline2;
		}
		?></td>
    <td><?php if(!isset($_POST['addressline-2']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
    <div id="btn">
    <input type="hidden" name="lname" value="<?php echo $lname; ?>" />
     <input type="submit" name="addressline-2" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col1">Address line3:</td>
    <td id="col2"><?php 
	  if(isset($_POST['addressline-3']))
	   {
	      	$lname=$_POST['lname'];
		?>
        <form action="" method="post">
        <input type="text" name="addressline3" value="<?php echo $addressline3; ?>" />
        
        <input type="submit" name="updateaddressline3" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $addressline3;
		}
		?></td>
    <td><?php if(!isset($_POST['addressline-3']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
    <div id="btn">
    <input type="hidden" name="lname" value="<?php echo $lname; ?>" />
     <input type="submit" name="addressline-3" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col1">City:</td>
    <td id="col2"><?php 
	  if(isset($_POST['e-city']))
	   {
	      	
		?>
        <form action="" method="post">
        <input type="text" name="ecity" value="<?php echo $ecity; ?>" />
        
        <input type="submit" name="updatee-City" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $ecity;
		}
		?></td>
    <td><?php if(!isset($_POST['e-city']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
    <div id="btn">
   
     <input type="submit" name="e-city" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col1">Post Code: </td>
    <td id="col2"><?php 
	  if(isset($_POST['e-postcode']))
	   {
	      
		?>
        <form action="" method="post">
        <input type="text" name="ecode" value="<?php echo $epostcode; ?>" />
       
        <input type="submit" name="epostcode" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $epostcode;
		}
		?></td>
    <td><?php if(!isset($_POST['e-postcode']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
    <div id="btn">
    
     <input type="submit" name="e-postcode" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
  <tr>
    <td id="col1">Country:</td>
    <td id="col2"><?php 
	  if(isset($_POST['updateECountry']))
	   {
	      	//$lname=$_POST['lname'];
		?>
        <form action="" method="post">
            <select name="ecountry">
      <option value="<?php echo $ecountry; ?>"><?php echo $ecountry; ?></option>
    <?php
     $q="SELECT * FROM country where name !='$ecountry' order by name";
	 $r=mysql_query($q) or die(mysql_error());
	 while($cont=mysql_fetch_array($r))
	  {
	    ?>
        <option value="<?php echo $cont['name']; ?>"><?php echo $cont['name']; ?></option>
        <?php  
	  }
	?>
        </select>
        <input type="submit" name="updatemecountry" value="" class="update" />
        <input type="submit" name="submm" class="cancel" value="" onclick="document.href='studentInfo.php'" />
        </form>
        <?php
		
        }else{
			 echo $ecountry;
		}
		?></td>
    <td><?php if(!isset($_POST['updateECountry']))
	 {
		 ?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
    <div id="btn">

     <input type="submit" name="updateECountry" class="edit" value="" />
    </div>
    </form>
    <?php
	 }else{
		?>
       
        <?php
	 }
	?></td>
  </tr>
   
</table>
			</ul>
			</div>
            
            <div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="ui-tabs-8"><ul class="thumbs" style="hieght=300px">
            <?php
             $qi="select * from studentfee where rollno='$id'";
			  
			  $student=mysql_query($qi) or die(mysql_error());
			  
			  $studentfee=mysql_fetch_array($student);
			  
			  $myString = wordwrap($studentfee['fee'], 130, "<br />", true);
			  
			  ?>
              
              
		<p><?php echo $myString; ?></p>
            </ul>
            </div>	
              <div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="ui-tabs-3"><ul class="thumbs">
           <p><strong><span id="stassignhead">Course Name:</span></strong><span id="studenassignment"><?php echo $resultSEt['courseName']; ?></span></p>
              <p><strong><span id="stassignhead">Total Topics:</span></strong><span id="studenassignment"><?php echo $resultSEt['coursetopic'];?></span></p>
              <hr style="color:#CCC;" />
                <?php
				
				$query="select * from topic where courseId='".$resultSEt['courseId']."' ";
				$result=mysql_query($query) or die(mysql_error());
				if(mysql_num_rows($result) > 0)
				 {
				  
				
				?>
                     
                       <table width="1120" border="0" class="tablestyle" style="border-collapse:collapse;">
                       <thead id="stassignhead">
                       <tr style="background-color:#000; color:#fff;font-size:11px; height:20px;"><th width="220" style="text-align:left;padding-left:10px;">Topic Title</th><th width="40" style="text-align:left;padding-left:10px;">Authorize </th><th width="70" style="text-align:left;padding-left:10px;">download Assignment</th><th width="100" style="text-align:left;padding-left:10px;">Upload Result</th><th width="75" style="text-align:left;padding-left:10px;">View Result</th><th width="75" style="text-align:left;padding-left:10px;">Assignment Status</th><th width="50" style="text-align:left;paddin-left:10px;">Re-Permit</th></tr>
                       </thead>
                       <tbody id="studenassignment">
                       <?php
					   
					    while($rSet=mysql_fetch_array($result))
				         { 
					   ?>
  <tr >
    <td style="width:100px; padding-left:10px;"><?php echo $rSet['topicName']; ?></td>
    <td style="width:60px; padding-left:10px;">
    <?php
	 $q="SELECT * FROM studentassignment where topicId=".$rSet['topicId']." and courseId=".$rSet['courseId']." and rollno='$id' order by SAid desc limit 1";
	 $results=mysql_query($q) or die(mysql_error());
	 $afetch=mysql_fetch_array($results);
	 
	 if(mysql_num_rows($results) > 0)
	  {
		  
	 
	echo "Assign";

    }else
	{
	  		?>
    <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-3" method="post" autocomplete="off">
    <!--<input type="text" name="assigndate" style="width:80px; height:20px;" id="ddd" />-->
    <input type="submit" name="submitthis" value="Assign"  style="width:50px; height:20px;" onclick="return confirm('Are you sure to Assign')" />
    <input type="hidden" name="topicIdd" value="<?php echo $rSet['topicId']; ?>" />
    <input type="hidden" name="courseIdd" value="<?php echo $rSet['courseId']; ?>" />
    </form>
    <?php
	}
	
	?>
    
    </td>
    <td style="width:100px; text-align:center;">
    
    <?php 
	$quer22="select * from uploadassignment where topicId=".$rSet['topicId']." and rollno='$id'";
	$result22=mysql_query($quer22) or die(mysql_error());
	$ffe=mysql_fetch_array($result22);
	$assId=$ffe['assignmentId'];
	$qeuer="select * from studenresult where assignmentId='$assId' and rollno='$id'";
	$res=mysql_query($qeuer) or die("error");
	$fe=mysql_fetch_array($res);
	
	if($afetch['AssignmentStatus']==1)
	 { 
	    $q="select * from uploadassignment where topicId=".$rSet['topicId']." and courseId=".$rSet['courseId']." and rollno='$id'";
		$r=mysql_query($q) or die(mysql_error());
		if(mysql_num_rows($r) > 0)
		 {
		 
		   echo "<a href=\"download.php?file=".$ffe['fullname']."\"><img src='../images/download-btn.png' /></a>";
		 }
		 else
		 {
			echo "---------"; 
		 }
     }else if($afetch['AssignmentStatus']==2)
	  {
		 
        	echo "<a href=\"download.php?file=".$ffe['fullname']."\"><img src='../images/download-btn.png' /></a>"; 
			//echo "----------";
	 
      }else if($afetch['AssignmentStatus']==3)
	   {
		   
           /*<a href="../studentresult/<?php //echo $fe['fullname'];?>">View Result &nbsp;&nbsp;&nbsp; <img src="../images/success.gif" /> </a>*/
          echo "<a href=\"download.php?file=".$ffe['fullname']."\"><img src='../images/download-btn.png' /></a>"; 
			
           
	   }else
	   {
		   ?>
		<span>----------</span>  
	   <?php
       }
	?>
	
	
</td>

    <td style="width:160px; padding-left:20px;">
      <?php
	    if($afetch['AssignmentStatus']==2 || $afetch['AssignmentStatus']==3)
		 {
			?>
            
            <form action="" method="post" autocomplete="off" enctype="multipart/form-data">
                 <input type="file" name="upload" style="width:150px;" />
                 <input type="hidden" name="assigid" value="<?php echo $assId; ?>" />
                 <input type="submit" name="add-upload" value="" class="upload"/>
           </form>
            <?php 
			 
		 }
	  
	 
	  ?>
      <?php
	    if( $afetch['AssignmentStatus']==1)
		 {
			 $q="select * from uploadassignment where topicId=".$rSet['topicId']." and courseId=".$rSet['courseId']." and rollno='$id'";
			 $r=mysql_query($q) or die(mysql_error());
			 if(mysql_num_rows($r) > 0)
			  {
		 
			?>
            
            <form action="" method="post" autocomplete="off" enctype="multipart/form-data">
                 <input type="file" name="upload" style="width:150px;" />
                 <input type="hidden" name="assigid" value="<?php echo $assId; ?>" />
                 <input type="submit" name="add-upload" value="" class="upload"/>
           </form>
            <?php 
			  }else
			  {
				echo "--------";  
			  }
			 
		 }
	  
	 
	  ?>
    
    </td>
    <td style="width:100px; padding-left:10px;">
    <?php
	 if($afetch['AssignmentStatus']==3||$afetch['AssignmentStatus']==2 || $afetch['AssignmentStatus']==1)
	  {
	 
           $studenResult=mysql_query("SELECT * from studenresult where rollno='$id' and assignmentId= ".$afetch['AssignmentName']) or die('errr');
		    
			$studentSet=mysql_fetch_array($studenResult);
			if(mysql_num_rows($studenResult) >0)
			 {
			?>
            
            <a href="download.php?rfile=<?php echo $studentSet['fullname'];?>">View Result&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
            
		<?php
			 }else
			 {
				 echo "---------";
			 }
	  }else
	  {
		echo "------";  
	  }
		?>
            
</td>
    <td style="width:92px; padding-left:10px;">
         <?php
	   if($afetch['AssignmentStatus']==3)
	    {
		  	echo "<span class=\"assign\">Completed</span>";
		}
		else if($afetch['AssignmentStatus']==2)
		{
		 echo "<span class=\"tut\">With Tutor</span>";
		}else if($afetch['AssignmentStatus']==1)
		
		{
			echo "<span class=\"as\">With Student</span>";

		}else
		{
		  echo "<span class=\"notassign\">Not Assigned<span>";	
		}
	  
	  ?>
    
    </td>
    <td style="width:40px; padding-left:10px;">
    <?php
	
	 if($afetch['AssignmentStatus']==2 || $afetch['AssignmentStatus']==3 || $afetch['AssignmentStatus']==1)
	  {
	
	?>
    <form action="" method="post">
    <input type="hidden" name="topicId" value="<?php echo $rSet['topicId']; ?>" />
    <input type="hidden" name="courseId" value="<?php echo $rSet['courseId']; ?>" />
    <input type="submit" name="Re-Assign" value="Ok" style="width:22px; height:20px; float:left;" onclick="return confirm('Are you sure to Re Assign')" />
    </form>
      <?php
	   extract($rSet);
        $q="select * from uploadassignment where topicId='$topicId' and courseId='$courseId' and rollno='$id' and Reassign=1";	
		$r=mysql_query($q) or die(mysql_error());
		if(mysql_num_rows($r)>0)
		 {
			?>
            <img src="../images/success.gif" style="float:left;" />
            <?php
		 }
	?>
    <?php
	  }
	?>
    </td>
   </tr>
   <?php
						 }
   ?>

  </tbody>
</table>
<?php

						 }else{
							echo "No Topic exists"; 
						 }
?>
                       </ul>
                       
            
				
            </div>	
             <div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="ui-tabs-4"><ul class="thumbs">
                   
            <?php
			  if(isset($_GET['edit'])) 
			   {
				?>
                <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-4" method="post">
                 <textarea name="note" rows="4" cols="30"></textarea><br />
                 <input type="submit" name="addnote" value="Add Note" class="add2" />
                 <a href="studentInfo.php?Id=<?php echo $id; ?>">Cancel</a>
                
                </form>
                <?php   
			   }else
			   {
				 ?>
                 <a href="studentInfo.php?Id=<?php echo $id;?>&edit#ui-tabs-4" class="add2" style="color:black; padding:5px;">Add Note</a> 
                 <?php  
			   }
			?> 
            
            <?php
			 if(isset($_POST['addnote']))
			  {
				$note=$_POST['note'];
				if(empty($note))
				 {
					header("location:studentInfo.php?Id=$id#ui-tabs-4");
					exit(); 
				 }else
				 {
				$query="insert into studentnote values ('','$note',now(),'$id',3,'$full')";  
				$result=mysql_query($query) or die(mysql_error());
				  $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$ttid."','".$full."','".$_SESSION['tutorrole']."','Added a Note','".date('Y-m-d H:i:s')."')";
			  mysql_query($maintainLogs);
				header("location:studentInfo.php?Id=$id#ui-tabs-4");
				exit();
				 }
			  }
			
			?>

                 
                 <?php
				  $query="SELECT * FROM studentnote where rollno='$id' order by id desc";
				  
				  $result=mysql_query($query) or die(mysql_error());
				  
				  if(mysql_num_rows($result) > 0)
				   {
					?>
                          <table width="800" border="0" style="margin-top:20px;" id="nte">
      
      <?php
	  
	   while($rr=mysql_fetch_array($result))
	    {
			 $all=explode(' ',$rr['edittime']);
					 $date=$all[0];
					 $time=@$all[1];
					   $msg="";
				  if($rr['role']==1)
				   {
					$msg="Admin";   
				   }else if($rr['role']==2)
				    {
						$msg=$rr['name']."(Coordinator)";
					}else if($rr['role']==3)
					 {
						 $msg=$rr['name']."(Tutor)";
					 }
	  ?>
        <tr style="margin-top:20px; width:600px; height:80px; vertical-align:text-top; ">
    <td width="400" id="sty"><?php echo substr($rr['note'],0,90); ?></td>
    <td width="100" style="background-color:#FFF;" ></td>
    <td width="100" style="background-color:#fff; color:black; font-size:10px; ">Added by <?php echo $msg; ?> at <?php echo date("g:i a",strtotime($time)); ?> on <?php echo date('d F Y',strtotime($date)); ?></td>
  </tr>
  <?php
		}
  ?>
</table>
                    <?php  
				   }else
				   {
					   echo "No Note Exists";
				   }
				 ?>              
      
                </ul>
                </div>
                  <div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="ui-tabs-5"><ul class="thumbs">
                <?php
				 if(isset($_GET['edittask']))
				  {
					  $taskId=$_GET['taskId'];
					  $q="select * from tasks where id='$taskId'";
					  $r=mysql_query($q) or die(mysql_error());
					  $fetch=mysql_fetch_array($r);
					  //extract($fetch);
					  $dd=explode('-',$fetch['taskdate']);
					
					  $d=$dd[2].'/'.$dd[1].'/'.$dd[0];
				 ?>
                    <form action="" method="post">
                 <textarea name="task" rows="4" cols="30"><?php echo $fetch['task']; ?></textarea><br /><br />
                   <input type="text" name="date" id="ddd" value="<?php echo $d; ?>" /><br /><br />
                 
                     <select name="taskstatus" class="cstat">
                     <?php
					 
					 if($fetch['taskstatus']==0)
					  {
						  ?>
                          <option value="0">Pending</option>
                          <option value="1">Complete</option>
                          <?php
					  }else if($fetch['taskstatus']==1)
					  {
					  ?>
                      <option value="1">Complete</option>
                      <option value="0">Pending</option>
                      <?php
					  }
					  ?>
                   </select><br />
                  <input type="hidden" name="id" value="<?php echo $taskId; ?>" />
                 <input type="submit" name="updatetask" value="update" class="add2" />
                 <!--<input type="submit" name="" class="add" value="Cancel" 
                 onclick="document.href='studentInfo.php'" />-->
                 <a href="studentInfo.php?Id=<?php echo $id; ?>">Cancel</a>
                
                
                </form>
                 
                 <?php
				   
				  }else{
				
				?>
                
                      
            <?php
			  if(isset($_GET['tasks'])) 
			   {
				?>
                <form action="" method="post">
                 <textarea name="task" rows="4" cols="30"></textarea><br /><br />
                   <input type="text" name="date" id="ddd" value="" /><br />

                 <input type="submit" name="addtasks" value="Add Task" class="add2" />
                 <!--<input type="submit" name="" class="add" value="Cancel" onclick="document.href='studentInfo.php'" />-->
                 <a href="studentInfo.php?Id=<?php echo $id; ?>">Cancel</a>
                
                
                </form>
                <?php   
			   }else
			   {
				 ?>
                 <a href="studentInfo.php?Id=<?php echo $id;?>&tasks#ui-tabs-5" class="add2" style="color:black; padding:5px;">Add Task</a> 
                 <?php  
			   }
			   }
			?> 
         <?php
				  $query="SELECT * FROM tasks where rollno='$id' order by id desc";
				  
				  $result=mysql_query($query) or die(mysql_error());
				  
				  if(mysql_num_rows($result) > 0)
				   {
					   
					?>
                          <table width="900" border="0" style="margin-top:20px;" id="nte">
      
      <?php
	  
	   while($rres=mysql_fetch_array($result))
	    {
			
			 $all=explode(' ',$rres['cdate']);
					 $date=$all[0];
					 $time=@$all[1];
					   $msg="";
				  if($rres['role']==1)
				   {
					$msg="Admin";   
				   }else if($rres['role']==2)
				    {
						$msg="Coordinator";
					}else if($rres['role']==3)
					 {
						 $msg="Tutor";
					 }
	  ?>
                <tr style="margin-top:20px; width:600px; height:80px; vertical-align:text-top; ">
    <td width="400" id="sty"><?php echo substr($rres['task'],0,90); ?></td>
    <td width="80"><?php
    $d1=explode('-',$rres['taskdate']);
	echo $date=$d1[2].'/'.$d1[1].'/'.$d1[0];
     ?></td>
    <td width="100" style="background-color:#FFF;" >
    <a href="studentInfo.php?Id=<?php echo $id;?>&edittask&taskId=<?php echo $rres['id'];?>#ui-tabs-5"><img src="../images/edit-icon.png" /></a>&nbsp;&nbsp;&nbsp;
        <?php
	 if($rres['taskstatus']==1)
	  {
		echo "Completed";  
	  }
	  else
	  {
		echo "Pending";  
	  }
	
	?>
  
     </td>
    <td width="100" style="background-color:#fff; color:black; font-size:10px; ">Added by <?php echo $msg; ?> at <?php echo date("g:i a",strtotime($time)); ?> on <?php echo date('d F Y',strtotime($date)); ?></td>
  </tr>
  <?php
		}
  ?>
</table>
                    <?php  
				   }
				 ?>              

            </ul>
            </div>
                
                
                </div>
                </div>
                                                   
           </div> <!-- end content  -->
          
        </div><!-- end wrapper -->   


  <?php include('../includes/footer.php');?>