晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 sh-3ll

HOME


sh-3ll 1.0
DIR:/home/bolconlineco/public_html/coordinator/includes/
Upload File :
Current File : //home/bolconlineco/public_html/coordinator/includes/inc.php
<?php
  if(isset($_GET['msg']))
   {
	   ?>
	   <span class="error">Assignment Assign Successfully</span>
      <?php 
	  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-3';\",2500);</script>";
   }

?>
<?php

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

?>
<?php

  if(isset($_GET['nv']))
   {
	   ?>
	   <span class="error">Please Select A Vaid Type of File</span>
      <?php 
	  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-12';\",2500);</script>";
   }

?>
<?php

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

?>

<?php

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

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

?>
<?php
  if(isset($_GET['fe']))
   {
	   ?>
	   <span class="error">Fee Added Successfully</span>
      <?php 
	  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-8';\",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['e']))
			  {
				?>
                <span class="error">This Email is already registerd</span>
                <?php  
				  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id';\",2500);</script>";
	   
   
			  }
			
			?>
             <?php
			 if(isset($_GET['up']))
			  {
				?>
                <span class="error">Result Re-Uploaded Successfully</span>
                <?php  
				  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-3';\",2500);</script>";
	   
   
			  }
			
			?>
            <?php
			 if(isset($_GET['er']))
			  {
				?>
                <span class="error">Please Select a Valid type</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 Assignment Founds</span>
                <?php  
				  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-3';\",2500);</script>";
	   
   
			  }
						?>
						            <?php
			 if(isset($_GET['af']))
			  {
				?>
                         <span class="error"> Inserted Successfully</span>
                <?php  
				  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-8';\",2500);</script>";
	   
   
			  }
						?>
                         <?php
			 if(isset($_GET['uf']))
			  {
				?>
                         <span class="error"> Update Successfully</span>
                <?php  
				  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-8';\",2500);</script>";
	   
   
			  }
						?>
						
			        <?php
			        // start of tutor change
			 if(isset($_GET['ter']))
			  {
				?>
                <span class="error">No Tutor Selected</span>
                <?php  
				  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-3';\",2500);</script>";
	   
   
			  }
						?>
                         <?php
			 if(isset($_GET['tas']))
			  {
				?>
                <span class="error">Tutor Updated Successfully </span>
                <?php  
				  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id#ui-tabs-3';\",2500);</script>";
	   
   
			  }
			  // end of tutor change code
						?>	
                        
                         <?php
			 if(isset($_GET['csuccss']))
			  {
				?>
                <span class="error">Password Change Successfully </span>
                <?php  
				  echo "<script>setTimeout(\"location.href = 'studentInfo.php?Id=$id';\",2500);</script>";
	   
   
			  }
			  // end of tutor change code
						?>		

                      
          <?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());
		  /**/
		 // 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());
		  // 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());
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}else if(isset($_POST['updatetitle']))
		  {
			$title = !empty($_POST['titles'])?$_POST['titles']:$_POST['title'];
						   
						   if($title==3)
						    {
							 $title=sql_strip($_POST['title']);	
							}
							
			$query="update student set title='$title' where rollno='$id'";
			$result=mysql_query($query) or die(mysql_error());
			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());
		    //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());
		    //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());
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}
		  elseif(isset($_POST['updateaddress2']))
	    {
		  	$newaddress2=$_POST['newaddress2'];
			
			$query="update student set address2='$newaddress2' where rollno='$id'";
		    $result=mysql_query($query) or die(mysql_error());
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}
		  elseif(isset($_POST['updateaddress3']))
	    {
		  	$newaddress3=$_POST['newaddress3'];
			
			$query="update student set address3='$newaddress3' where  rollno='$id'";
		    $result=mysql_query($query) or die(mysql_error());
		    //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());
		    //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());
		    //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());
		    //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());
		    //header("location:studentInfo.php?Id=$id");
		    //exit();
			echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
		}
		   elseif(isset($_POST['updatest']))
	    {
		  	$studstatus=$_POST['studstatus'];
			if($studstatus==3)
			 {
				 $dat=$_POST['titles'];
				$query="update student set studentstatus='$studstatus',comp_date='$dat' where rollno='$id'";
			  $result=mysql_query($query) or die(mysql_error());
			 // header("location:studentInfo.php?Id=$id");
			  //exit();
			  echo "<script>window.location.href='studentInfo.php?Id=$id'</script>"; 
			 }
			 else
			 {
			
			  $query="update student set studentstatus='$studstatus' where rollno='$id'";
			  $result=mysql_query($query) or die(mysql_error());
			 // header("location:studentInfo.php?Id=$id");
			  //exit();
			  echo "<script>window.location.href='studentInfo.php?Id=$id'</script>";
			 }
		}
		  elseif(isset($_POST['updateemail']))
	    {
		  	$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>";
			   }
			 }
		}else if(isset($_POST['updatepass']))
		 {
			 $passemail=$_POST['passemail'];
			 $newpass=md5($_POST['newpass']);
			 $passquery="update admin set userPass='$newpass' where username='$passemail'";
			 $headers="";
											
										  $str="";
										 
										  $headers .= "Content-type: text/html; charset=iso-8859-1\n";	
									
										  $headers .= 'From:admissions@bolc.co.uk' . "\r\n";
										  
										  $subject = "Result uploaded";
										  
										  $str.="Your Password Change";
										  
										  $str.="Your New Password:".$_POST['newpass'];
										  
										  $message = "<html><body>".$str."</body></html>";
										  
										  
										  mail($passemail, $subject, $message, $headers,"-f".$email);
										  
			                              mysql_query($passquery)or die(mysql_error());
			 
			 
			 echo "<script>window.location.href='studentInfo.php?Id=$id&csuccss'</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());
			 //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());
			 // 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());
			   //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());
			  //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());
			 // 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());
			  //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());
			  //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());
			 // 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'];
			  //$assigndate=$_POST['assigndate'];
			  //$submit=explode('/',$assigndate);
	          //$submitted=$submit[2].'-'.$submit[1].'-'.$submit[0];
			  
			  //if(empty($assigndate))
			   //{
				//header("location:studentInfo.php?Id=$id&err#ui-tabs-3");   
			   //}
			   //else
			   //{
				   $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',1,0)";
	                  $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();	
					}
			  
			 
			   
			   
		   //}
		   }
		   
		   if(isset($_POST['addtasks']))
		    {
			  $taks=$_POST['task'];
	
			  
			  $date1=$_POST['taskdate'];
			            $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());
			  header("location:studentInfo.php?Id=$id&task#ui-tabs-5");
			  exit();
			}
			
			if(isset($_POST['updatetask']))
			 {
				$task=$_POST['task'];
				$date1= $_POST['date'];
				$d1=explode('/',$date1);
					    $date=$d1[2].'-'.$d1[1].'-'.$d1[0];
				$idd=$_POST['id'];
				$q="update tasks set task='$task',taskdate='$date',cdate=now() where id='$idd' and rollno='$id'";
				$r=mysql_query($q) or die(mysql_error());
				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']); 
						 }
						$update=date('Y-m-d');
					   $q = "update studenresult set fullname='$fullname',uploaddate='$update' where assignmentId='$aname' and rollno='$id'";	
					   
					   mysql_query($q) or die(mysql_error());
					    
						                  $headers="";
											
										  $str="";
										 
										  $headers .= "Content-type: text/html; charset=iso-8859-1\n";	
									
										  $headers .= 'From:admissions@bolc.co.uk' . "\r\n";
										  
										  $subject = "Result uploaded";
										  
										  $str.="Result uploaded log on to your account to view your result";
										  
										  $message = "<html><body>".$str."</body></html>";
										  
										  
										  mail($email, $subject, $message, $headers,"-f".$email);
					   
										  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',uploaddate='$update' 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','$update')";
						
						$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();
	
	   
	   
   }
// start of change tutor code
?>

<?php
 if(isset($_POST['changeTutor']))
  {
	  $chgetutor=$_POST['chgetutor'];
	  if($chgetutor==0) 
	  {
		
		  
		 
		  //sleep(5);
		  header("location:studentInfo.php?Id=$id&ter#ui-tabs-3");
		  exit();
		 
	  }
	  else
	  {
		
		$query="update assigncourse set tutorId='$chgetutor' where rollno='$id'";
		$result=mysql_query($query) or die(mysql_error());
		$query="update uploadassignment set tutorId='$chgetutor' where rollno='$id'";
		mysql_query($query) or die(mysql_error());
		header("location:studentInfo.php?Id=$id&tas#ui-tabs-3");
		exit();
		
		 
	  }
  }
// end of change tutor
?>





   
       <?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);
	 }
   
   ?>