This repository has been archived by the owner on Jul 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aws.php
90 lines (75 loc) · 2.21 KB
/
aws.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
<?php
include_once 'header.php';
include_once 'database.php';
include_once 'tohtml.php';
include_once 'html2text.php';
echo '<table class="info">
<tr>
<td>
<a href="user_aws_search.php" target="_blank">Click to search AWS database.</a>
</td>
<td>
<a href="summary_aws.php" target="_blank">List of AWS speakers</a>
</td>
</tr>
</table>';
echo '<br />';
if( strtotime( 'today' ) == strtotime( 'this monday' ) )
$today = dbDate( 'this monday' );
else
$today = dbDate( 'next monday' );
$default = array( 'date' => $today );
if( $_GET )
{
if( array_key_exists( 'date', $_GET ) )
$default[ 'date' ] = $_GET[ 'date' ];
else
$default = array( 'date' => $today );
}
echo '
<form method="get" action="">
<table class="aws" border="0">
<tr>
<td>Select a Monday</td>
<td><input class="datepicker" type="text" name="date" value="' .
$default[ 'date' ] . '" ></td>
<td><button type="submit" name="response"
title="Show AWS on this day"
value="show">Show AWSs on This Day</button></td>
</tr>
</table>
</form>
';
echo '<br><br>';
$whichDay = $default[ 'date' ];
echo "<h2>Annual Work Seminars on " .
humanReadableDate( $default[ 'date' ] ) . " </h2>";
$awses = getTableEntries( 'annual_work_seminars', 'date' , "date='$whichDay'" );
$upcoming = getTableEntries( 'upcoming_aws', 'date', "date='$whichDay'" );
$awses = array_merge( $awses, $upcoming );
if( count( $awses ) < 1 )
{
echo alertUser( "I could not find any AWS in my database on this day" );
$holiday = getTableEntry( 'holidays', 'date', array( 'date' => $whichDay ) );
if( $holiday )
{
echo alertUser( "May be due to following" );
echo arrayToTableHTML( $holiday, 'info' );
}
echo printInfo( "That's all I know!" );
echo "<br><br>";
}
else
{
foreach( $awses as $aws )
{
$user = $aws[ 'speaker' ];
$awstext = awsToHTML( $aws, $with_picture = true );
// Link to pdf file.
$awstext .= awsPdfURL( $aws[ 'speaker' ], $aws['date' ] );
echo $awstext;
echo horizontalLine( );
}
}
echo closePage( );
?>