Your IP : 10.1.73.149


Current Path : /home/bolconlineco/public_html/student/
Upload File :
Current File : //home/bolconlineco/public_html/student/studymaterials.php

<?php 
  ob_start();
  session_start();
  ?>
<?php include('header.php'); ?>
<?php
if(!isset($_SESSION['studentname']) || $_SESSION['studentrole'] != 4)
 {
	header("location:../index.php");
	exit(); 
 }
 //echo date('y-m-d H:i:s');
?> 
          
             <div id="content">
             	<span class="left"> </span><h2> Student Site Panel </h2><span class="right"></span>
	<div id="frm">
  
					
					
</div>
<?php
  if(isset($_GET['msg']))
   {
	   echo $_GET['msg'];
   }
   $rollno=$_SESSION['rollno'];
?>
                      
                <div id="data">
                 <div id="data-info">
                 <?php
				 /*
				       $result=mysql_query("select * from assigncourse where rollno='$rollno'");
					    if(mysql_num_rows($result) > 0 )
						 {
						$resultSet=mysql_fetch_array($result);
						
						extract($resultSet);
						$query1="select courseName from course where courseId='$courseid'";
						$result1=mysql_query($query1) or die(mysql_error());
						$rowSet=mysql_fetch_array($result1);
						extract($rowSet);
				 ?>
                <div id="info" style="margin-top:10px;">
                <p style="margin-bottom:10px;"><span style="font-weight:bolder;">Course Name:</span><?php echo $courseName; ?></p>
                <?php
                        $query2="select topicId,topicName from topic where courseId='$courseid'";
						$result2=mysql_query($query2) or die(mysql_error());
						
						while($rowSet2=mysql_fetch_array($result2))
						  {
							  extract($rowSet2);
				             $q001="select * from topicstudy where topicId='$topicId'";
				             $res001=mysql_query($q001) or die(mysql_error());	
							 if(mysql_num_rows($res001) > 0)
							  {		  
						?>
                <p style="margin-bottom:10px; "><span style="font-weight:bolder;">Topic Name:</span><?php echo $topicName; ?> </p>
              

              <?php
			    $q001="select * from topicstudy where topicId='$topicId'";
				  $res001=mysql_query($q001) or die(mysql_error());
				  if(mysql_num_rows($res001) > 0)
				   {
			  ?>
               <table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr id="title">
                            <th class="small">Materials Name</th>
                            <th class="small">Downloads</th>
		                 </tr>
                  <?php
				  
				  while($row=mysql_fetch_array($res001))
				   {
				  
				  ?>
						<tr class="values even">
							<td class="small"><?php echo $row['name']; ?></td>
							<td class="small">
                            	<a  href="../StudyMaterials/<?php echo $row['path']; ?>"><img src="../images/download.png" /></a>
                            </td>
	                   </tr>
                  <?php
				   }
				   }
				   }
						  
				  ?>
                </table>
                
                <?php
				
						  }
						 }
						 else
						 {
							 echo "You have no course Assign yet"; 
						 }*/
				?>
                <?php
				 $q="SELECT * FROM studentassignment where AssignmentStatus=1 and rollno='$rollno'";
				 
				 $ress=mysql_query($q) or die(mysql_error());
				 /*
				  while($re=mysql_fetch_array($r))
				   {
					 echo $re['AssignmentName'];
					 echo "<br>";   
				   }*/
				   if(mysql_num_rows($r) > 0)
				    {
						
				      while($res=mysql_fetch_array($ress))
					   {
						 
						 $q="select topicName from topic where topicId=".$res['topicId'];
						 
						 $r=mysql_query($q) or die(mysql_error());   
						 
						 $ss=mysql_fetch_array($r);
						 
						 echo "<p>Topic Name: ".$ss['topicName']."</p>";
						 
						  $q2="select * from topicstudy where topicId=".$res['topicId']." and courseId=".$res['courseId'];
						  $r2=mysql_query($q2) or die(mysql_error());
						   if(mysql_num_rows($r2) > 0)
						    {?>
								<table width="500" border="0" cellspacing="0" cellpadding="0">
						<tr id="title">
                            <th class="small">Materials Name</th>
                            <th class="small">Downloads</th>
		                 </tr>
								<?php
								while($ss=mysql_fetch_array($r2))
								 {
									?>
                                    <tr class="values even">
							          <td class="small"><?php echo $ss['name']; ?></td>
							             <td class="small">
                            	            <a  href="download.php?rr=<?php echo urlencode($ss['path']); ?>"><img src="../images/download.png" /></a>
                                          </td>
	                                  </tr>
                                    
                                    <?php
									
									 
								 }
								
								
							}else
							{
							  echo "No Study Materials";	
							}
							?>
                            </table>
                        <br />
<br />
<br />
<br />

                            <?php
						   
					   }
				  
				    
					}else
					{
					  echo "No Study materials";	
					}
				?>
                 <?php
			  if(isset($_GET['rr']))
			   {
                    /*flush();
					ob_clean();
					*/
				  $file="../StudyMaterials/".$_GET['rr']; 
				  header('Content-Disposition: attachment; filename="'.basename($file).'"');
				  //header('Content-Type: application/octet-stream');
				 header("Content-type: application/pdf");
				  //header('Content-Transfer-Encoding: binary');
				  
				  //header('Content-Length: ' . filesize($file));
				  readfile($file);
				  

			   }
?>
                  </div>
					</div>																						
				</div><!-- end data -->
                                                   
           </div> <!-- end content  -->
          
        </div><!-- end wrapper -->   


  <?php include('../includes/footer.php');?>
      <?php
					   /*
					    $result=mysql_query("select * from assigncourse where rollno=9188");
					    $resultSet=mysql_fetch_array($result);
						extract($resultSet);
						$query1="select courseName from course where courseId='$courseid'";
						$result1=mysql_query($query1) or die(mysql_error());
						$rowSet=mysql_fetch_array($result1);
						extract($rowSet);
						$query2="select topicName from topic where courseId='$courseid'";
						$result2=mysql_query($query2) or die(mysql_error());
						$rowSet2=mysql_fetch_array($result2);
					    extract($rowSet2);
					   ?>
						 <ul class="values even">
							<li><?php echo $courseName; ?></li>
							<li><?php echo $topicName; ?></li>
							
													
							
                            <li><?php echo $courseName; ?></li>
						
                            </ul><!-- end values -->
                            <?php
						*/
							?>