$meetingcat=$_REQUEST['meetingcat'];
$selectedmonth=$_REQUEST['selectedmonth'];
$selectedyear=$_REQUEST['selectedyear'];
$hostname = "localhost";
$user = "citizen";
$password = "m1nut3mAn";
$dbName = "council";
#Set current month and year
$thismonth=date("n");
$thisyear=date("Y");
#Store this variable so when the page posts to itself, the values are retained
$selectedcat=$meetingcat;
#Open this page and show the current month and year agendas for the appropriate category
If (is_null($selectedmonth)){
$selectedmonth=$thismonth;}
If (is_null($selectedyear)){
$selectedyear="2010";}
#Make the connection and select the table
($GLOBALS["___mysqli_ston"] = mysqli_connect($hostname, $user, $password)) or Die("Server is not responding.");
((bool)mysqli_query($GLOBALS["___mysqli_ston"], "USE " . $dbName)) or Die("Database does not exist or is not available");
#Select the query to run according to the selection that was made in this page. If this is the first entry
#to the page, then it will only show the appropriate minutes/agendas as specified by the variable 8 lines above.
If ($selectedmonth=='all'){
$query="SELECT IDkey, month, day, year, meetinglocation, meetingtitle, meetingtime, agenda, minutes, addendum, otherdoc, otherdocname, meetingcat
FROM minutes
WHERE year='$selectedyear' AND meetingcat LIKE '%$selectedcat%'
ORDER BY month, day";
//print($query);
$textmonth='View All Months';
$result = mysqli_query($GLOBALS["___mysqli_ston"], $query);
if($result == 0){
die(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));}}
else
{
$query="SELECT IDkey, month, day, year, meetinglocation, meetingtitle, meetingtime, agenda, minutes, addendum, otherdoc, otherdocname, meetingcat
FROM minutes
WHERE month='$selectedmonth' AND year='$selectedyear' AND meetingcat LIKE '%$selectedcat%'
ORDER BY month, day";
// print($query);
$result = mysqli_query($GLOBALS["___mysqli_ston"], $query);
if(!$result){
die(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));}}
#Set next and previous month and Numeric month to Text Month
If ($selectedmonth=='1'){
$nextmonth='2';
$prevmonth='12';
$textmonth='January';}
else
If ($selectedmonth=='2'){
$nextmonth='3';
$prevmonth='1';
$textmonth='February';}
else
If ($selectedmonth=='3'){
$nextmonth='4';
$prevmonth='2';
$textmonth='March';}
else
If ($selectedmonth=='4'){
$nextmonth='5';
$prevmonth='3';
$textmonth='April';}
else
If ($selectedmonth=='5'){
$nextmonth='6';
$prevmonth='4';
$textmonth='May';}
else
If ($selectedmonth=='6'){
$nextmonth='7';
$prevmonth='5';
$textmonth='June';}
else
If ($selectedmonth=='7'){
$nextmonth='8';
$prevmonth='6';
$textmonth='July';}
else
If ($selectedmonth=='8'){
$nextmonth='9';
$prevmonth='7';
$textmonth='August';}
else
If ($selectedmonth=='9'){
$nextmonth='10';
$prevmonth='8';
$textmonth='September';}
else
If ($selectedmonth=='10'){
$nextmonth='11';
$prevmonth='9';
$textmonth='October';}
else
If ($selectedmonth=='11'){
$nextmonth='12';
$prevmonth='10';
$textmonth='November';}
else
If ($selectedmonth=='12'){
$nextmonth='1';
$prevmonth='11';
$textmonth='December';}
$num_rows = mysqli_num_rows($result);
if($num_rows==0){
$no_records="
No $selectedcattext meetings have been entered for the month of $textmonth $selectedyear.
";}
else
?>
while($row = mysqli_fetch_row($result))
{
$IDkey=$row[0];
$month=$row[1];
$day=$row[2];
$year=$row[3];
$meetinglocation=$row[4];
$meetingtitle=$row[5];
$meetingtime=$row[6];
$agenda=$row[7];
$minutes=$row[8];
$addendum=$row[9];
$otherdoc=$row[10];
$otherdocname=$row[11];
$meetingcat=$row[12];
$query2="SELECT DAYNAME('$year-$month-$day')";
$result2 = mysqli_query($GLOBALS["___mysqli_ston"], $query2);
if(!$result2){
die(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));}
//Get the day of the week
$weekday=mysqli_fetch_row($result2);
$query3="SELECT DATE_FORMAT('$year-$month-$day','%D')";
$result3 = mysqli_query($GLOBALS["___mysqli_ston"], $query3);
if(!$result3){
die(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));}
//Get the suffix of the day of the month
$suffix=mysqli_fetch_row($result3);
If ($month=='1'){
$month='January';}
else
If ($month=='2'){
$month='February';}
else
If ($month=='3'){
$month='March';}
else
If ($month=='4'){
$month='April';}
else
If ($month=='5'){
$month='May';}
else
If ($month=='6'){
$month='June';}
else
If ($month=='7'){
$month='July';}
else
If ($month=='8'){
$month='August';}
else
If ($month=='9'){
$month='September';}
else
If ($month=='10'){
$month='October';}
else
If ($month=='11'){
$month='November';}
else
If ($month=='12'){
$month='December';}
?>
echo "$weekday[0] $month $suffix[0], $year @ $meetingtime" ?>
|
echo $meetingtitle ?>
echo $meetinglocation ?>
|
$queryD="SELECT directory
FROM meetingcat
WHERE category='$meetingcat'";
//print($queryD);
$resultD = mysqli_query($GLOBALS["___mysqli_ston"], $queryD);
if(!$resultD)
print(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
while($rowD = mysqli_fetch_row($resultD))
{
$dirpath=$rowD[0];
//print($dirpath2);
}
If (strlen($agenda)>5){
$agendapath=" Agenda ";}
else
$agendapath="";
If (strlen($minutes)>5){
$minutespath=" Minutes ";}
else
$minutespath="";
If (strlen($addendum)>5){
$addendumpath=" Addendum ";}
else
$addendumpath="";
If (strlen($otherdoc)>5){
$otherdocpath=" $otherdocname";}
else
$otherdocpath="";
?>
echo $agendapath;
echo $minutespath;
echo $addendumpath;
echo $otherdocpath;
?>
|
} ?>
echo $no_records ?>
|