Your IP : 10.1.73.149


Current Path : /home/bolconlineco/www/student/
Upload File :
Current File : /home/bolconlineco/www/student/forum.php

<?php 
  ob_start();
  session_start();
  ?>
  <?php include('header.php');?> 
  
<?php
if(!isset($_SESSION['studentname']) || $_SESSION['studentrole'] != 4)
 {
	header("location:../index.php");
	exit(); 
 }
?>      
<?php
					     if(isset($_GET['id']))
						  {
							 $id = $_GET['id'];
							 
							 $query = "select * from tbl_forum where id='$id'";
							 
							 $result = mysql_query($query) or die(mysql_error());
							 
							 $fetch = mysql_fetch_array($result);
							 
							 extract($fetch);  
							 list($year,$month,$data)=explode('-',$topic_date);
						  }
					   
					   ?>
    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN EXAMPLE TABLE PORTLET-->
            <div class="portlet box blue">
                <div class="portlet-title clearfix" style="overflow: hidden;">
                    <div class="caption"><?php echo $topic_name ?></div><div class="right">By &nbsp;&nbsp;&nbsp;<?php echo $topic_user ?>&nbsp;&nbsp; on &nbsp;&nbsp; <?php echo $data.'/'.$month.'/'.$year;?></a></div>
                </div>
                <div class="portlet-body">

                    <div id="content">

                        
                         <?php
						  $queryReply="select * from tbl_reply where topic_id='$id'";
						  $resultReply=mysql_query($queryReply) or die(mysql_error());
						  $numrows=mysql_num_rows($resultReply);
						
						?>
                        <p style="font-size: 20px;
padding: 20px;"><?php echo $numrows; ?> reply</p>
                        <?php
						   while($row=mysql_fetch_array($resultReply))
						    {
								list($year,$month,$data)=explode('-',$row['topic_date']);
						?><div class="repeat">
                         <div class="left"><?php echo $row['topic_reply']; ?></div><div class="right">By &nbsp;&nbsp;&nbsp;<?php echo $row['topic_user']; ?>&nbsp;&nbsp; on &nbsp;&nbsp; <?php echo $data.'/'.$month.'/'.$year;?></div>
                       </div>
                     <?php
							}
					 ?>
                      </div>  
                      <form action="" method="post" class="form-horizental">
                         <h2>Leave Your Reply</h2>
                         <textarea name="description" id="description" class="form-control" rows="9"></textarea>
                         <input type="submit" name="reply" value="Reply" class="add2 btn btn-success" style="margin-top: 10px;"/>
                       </form>
                     
                   
              
      
			 
                  </div><!-- end row  -->  
                  
              
                        <?php
						
						  if(isset($_POST['reply']))
						   {
							   
							   $description=$_POST['description'];
							   $date=date('Y-m-d');
							   
							   $query1= "insert into tbl_reply values ('','$id','$description','$fullname','$date',1)";
							   $result1= mysql_query($query1) or die(mysql_error());
							   header("location:forum.php?id=$id");
							   exit();
							   
						   }
						
						?>
                        
                     
       </div>
       </div>
       </div>
       </div>
       </div>

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

<script>
	CKEDITOR.replace( 'description',
    {
		width : '800px', 
        filebrowserBrowseUrl : '<?php echo $url;?>combine/cms/ckfinder/ckfinder.html',
        filebrowserImageBrowseUrl : '<?php echo $url;?>combine/cms/ckfinder/ckfinder.html?Type=Images',
        filebrowserFlashBrowseUrl : '<?php echo $url;?>combine/cms/ckfinder/ckfinder.html?Type=Flash',
        filebrowserUploadUrl : '<?php echo $url;?>combine/cms/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
        filebrowserImageUploadUrl : '<?php echo $url;?>combine/cms/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
        filebrowserFlashUploadUrl : '<?php echo $url;?>combine/cms/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
    });
	</script>
<?php include('../includes/footer.php');?>