-
Notifications
You must be signed in to change notification settings - Fork 0
/
djcDateTests.php
executable file
·104 lines (76 loc) · 3.6 KB
/
djcDateTests.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
include('control/connectionVars.php');
include('classes/InstructionSession.php');
include('classes/User.php');
include('control/functions.php');
require_once('control/startSession.php');
// Insert the page header
$page_title = 'djc Date Tests';
include('includes/header.php');
?>
<h2>Date tests</h2>
<?php
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME)
or die('Error connecting to the stupid database');
$query ='select '.
's.sesdID as sessionID, '.
's.sesdDate as Date '.
'from '.
'sessiondesc s; ';
// 9 columns.
$output = '<table id="dateTest"><thead id="dateTestHead"><tr>'.
"<th>ID</th>".
'<th>MySQL Date</th>'.
'<th>US Date</th>'.
'<th>Week#</th>'.
'<th>Semester</th>'.
'<th>Fiscal Year</th>'.
'<th>AcademicYear</th>'.
'<th>SemesterQuery</th>'.
'<th>FY Query</th>'.
'<th>AY Query</th>'.
'</tr></thead><tbody>';
$result = mysqli_query($dbc, $query) or die('This is an outrage-in testingDates. '.$query);
if(!$result){echo "this is an outrage: ".mysqli_error($dbc)."\n $query";}
while ( $row = mysqli_fetch_assoc( $result) )
{
$id=$row['sessionID'];
$date=$row['Date'];
$USDate= toUSDate($date);
$WeekNumber = toWeekNumber($date);
$Semester= toSemester($date);
$FiscalYear= toFiscalYear($date);
$AcademicYear=toAcademicYear($date);
$SemesterQuery= inSemester($Semester);
$FYQuery = inFiscalYear($FiscalYear);
$AYQuery= inAcademicYear($AcademicYear);
$output.="<tr class='outcomesMapa'>".
"<td class='outcomesMapa'>$id</td>".
"<td class='outcomesMapa'>$date</td>".
"<td class='outcomesMapa'>$USDate</td>".
"<td class='outcomesMapa'>$WeekNumber</td>".
"<td class='outcomesMapa'>$Semester</td>".
"<td class='outcomesMapa'>$FiscalYear</td>".
"<td class='outcomesMapa'>$AcademicYear</td>".
"<td class='outcomesMapa'>$SemesterQuery</td>".
"<td class='outcomesMapa'>$FYQuery</td>".
"<td class='outcomesMapa'>$AYQuery</td></tr>";
}
$output.='</tbody></table>';
echo $output;
?>
<script type="text/javascript">
var oTable = $('#outcomesMapa').dataTable({
"sDom": 'T<"clear">lfrtip',
"bStateSave": true,
"bLengthChange": false,
"bPaginate": false,
"oTableTools": { "sSwfPath":"swf/copy_csv_xls_pdf.swf" }
}).rowGrouping({
bExpandableGrouping: true /*,
asExpandedGroups: [] */
});
</script>
<?php
include('includes/footer.php');
?>