Your IP : 10.3.227.210


Current Path : /home/bolconlineco/public_html/coordinator/
Upload File :
Current File : /home/bolconlineco/public_html/coordinator/report_final.php

<?php 
ob_start();
session_start();
include('includes/header.php');

if(!isset($_SESSION['coordinator']) || $_SESSION['coordinatorrole'] != 2) {
    header("location:../index.php");
    exit();
}

if(isset($_GET['statuschange'])) {
    $Update_View = "Update submitted_final_assignment SET viewed = 1 WHERE Sfaid = '".$_GET['statuschange']."' ";
    mysql_query($Update_View);
    header("location:report_final.php");
}
   
if(isset($_GET['statusundo'])) {
    echo  $Update_View = "Update submitted_final_assignment SET viewed = 0 WHERE Sfaid = '".$_GET['statusundo']."' ";
    mysql_query($Update_View);
    header("location:report_final.php");
}  ?>

<script language="javascript" src="includes/jquery.js"></script>

<div id="content">

    <h3 class="page-title">Reports</h3>

    <ul class="page-breadcrumb breadcrumb">
        <li><i class="fa fa-home"></i> <a href="dashbord.php"> Home </a> <i class="fa fa-angle-right"></i> </li>
        <li class="active">Report Management</li>
    </ul>

    <table class="tablestyle table table-striped table-bordered table-hover" id="sample_2">
<thead>
    <tr>
        <th>Sr</th>
        <th>Report</th>
        <th>Date</th>
        <th>Status</th>
    </tr>
</thead>
<tbody>
   <?php
   $per_page=10;
	if (isset($_GET['page'])) {
		$page = $_GET['page'];
	}

	else {

	$page=1;

	}
	$start_from = ($page-1) * $per_page;
	$countThis = $start_from + 1;
	$selectMynew = "SELECT * FROM submitted_final_assignment ORDER BY Sfaid desc";
	$selectMynew2 = mysql_query($selectMynew) or die(mysql_error());
  
   while($selectMynew3 = mysql_fetch_array($selectMynew2)){
   
   ?>
   <?php if($selectMynew3['viewed'] == 0){ ?>
   <tr>
   <?php } else{  ?>
   <tr>
   <?php } ?>
   <td align="center"><?php echo $countThis;  ?></td>
   <td><?php
   $selectStudentName = "SELECT CONCAT(fname,\" \",lname) AS fullname FROM student WHERE rollno = '".$selectMynew3['StudentId']."'";
   $selectStudentName2 = mysql_query($selectStudentName) or die(mysql_error());
   $selectStudentName3 = mysql_fetch_array($selectStudentName2);
   $selectCourseName = "SELECT courseName FROM course WHERE courseID = '".$selectMynew3['CourseId']."' " ;
   $selectCourseName2 = mysql_query($selectCourseName) or die(mysql_error());
   $selectCourseName3 = mysql_fetch_array($selectCourseName2);
   echo  $selectStudentName3['fullname'] . " Submitted Final Assignment on " . $selectCourseName3[0];
   
  // echo;
   
    ?></td>
   <td align="center"><?php echo $selectMynew3['date'];  ?></td>
   <td align="center">  <?php if($selectMynew3['viewed'] == 0){ ?><a href="report_final.php?statuschange=<?php echo $selectMynew3['Sfaid'] ?>" style="text-decoration:none; font-size:12px;">Mark as Viewed</a><?php } else{ ?> viewed <a href="report_final.php?statusundo=<?php echo $selectMynew3['Sfaid'] ?>" style="text-decoration:none; font-size:12px;">(undo)</a> <?php } ?></td>
   </tr>
   <?php $countThis++;} ?>
   </tbody>
   </table>
   <?php
   //$page = $_GET'page'];
	$url = $_SERVER['REQUEST_URI'];
	//echo $pag = substr($url, strrpos($url, '/') + 1);
    $que = "SELECT * FROM submitted_final_assignment ORDER BY Sfaid desc";
	$res = mysql_query($que);
	$total_records = mysql_num_rows($res);
	$total_pages = ceil($total_records / $per_page); ?>
    </div>
                                                     
           </div> <!-- end content  -->
          
        </div><!-- end wrapper -->   
       
  
       
       


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