-
Notifications
You must be signed in to change notification settings - Fork 0
/
results.php
executable file
·54 lines (47 loc) · 1.8 KB
/
results.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
require('ExcelPHP/Excel/reader.php');
require('ExcelPHP/Excel/Writer.php');
require('Classes/PHPExcel.php');
require('values.php');
require('functions.php');
session_start();
if(!isset($_SESSION['dept']))
{
session_regenerate_id(true);
session_write_close();
header("Location:loginstaff.php");
}
if(!isset($_SESSION['name']))
{
session_regenerate_id(true);
session_write_close();
header("Location:loginstaff.php");
}
if(!isset($_SESSION['year']))
{
session_regenerate_id(true);
session_write_close();
header("Location:quarterstaff.php");
}
$filename = 'xls/'.$_SESSION['season_name'].'_'.$_SESSION['year'].'_'.$_SESSION['dept'].'final.xls';
if(!isset($_POST['a1']) && !isset($_POST['a2']))
write_excel2($_SESSION['year'],$_SESSION['season'], $_SESSION['dept'], $_SESSION['season_name']);
staffheader($_SESSION['name'],"results.php", $_SESSION['year'], $_SESSION['season_name']);
?>
<h3> <center> View the Results or Download a Hard Copy Below </center></h3>
<!-- Let this button download VictorStylefinal.xls to the user. -->
<form action="results.php" method="post">
<div id="resultset">
<input type="button" name="download" id ="download" value="Download TA Assignment Sheet (.xls)" onClick="window.location.href='<?php print $filename; ?>'">
<input type="submit" name="a1" id ="a1" value="View Assignment #1">
<input type="submit" name="a2" id ="a2" value="View Assignment #2">
</div>
</form>
<?php
//If one of the Views were clicked, then display a table with the contents of the appropriate sheet.
if(isset($_POST['a1']))
victor_table($_SESSION['dept'], $_SESSION['year'], $_SESSION['season_name'], "0");
if(isset($_POST['a2']))
victor_table($_SESSION['dept'], $_SESSION['year'], $_SESSION['season_name'], "1");
?>
</body></html>