Location: PHPKode > projects > Web-NoteTaker > notetaker/include/print.php
<?php
// NoteTaker
// Created and Coded by Bo Ahlberg
// Copyright 2008 by Bo Ahlberg ( bahlberg at mac.com )
// This code is licensed "AS-IS", No warranty is expressed or implied as to the
// suitability of this software for any purpose. Further, this code is licensed
//	under the:
//    Creative Commons Attribution-Share Alike 3.0 United States License
// This means you are free to:
//		to Share - to copy, distribute, display, and perorm work
//	  to remix - to make derivative works
//  Under the Following Conditions:
//		Attribution - You must attribute the work in the manner 
//    		specified by the author or licensor (but not in any way 
//    		that suggests that they endorse you or your use of the work).
//    Share Alike. If you alter, transform, or build upon this work, 
//				you may distribute the resulting work only under the same, 
//				similar or a compatible license.
//	For any reuse or distribution, you must make clear to others the license 
//		terms of this work. The best way to do this is with a link to this web page.
//	Any of the above conditions can be waived if you get permission from the 
//		copyright holder.
//	Apart from the remix rights granted under this license, nothing in this 
//		license impairs or restricts the author's moral rights.
//

function printMeeting( $meeting )
{
	$page = makeTable( 100, makeRow( makePageHeader( $meeting ) )
												 .makeRow( makeCell( 1, listAttending(  $meeting ), '', '', '15%' )
												 					.makeCell( 1, makeNotesBody(  $meeting ), '', '', '55%' )
												 					.makeCell( 1, makeActionPark( $meeting ), '', '', '30%' ) ) );
												 					
	return $page;
}

function makePageHeader( $meeting )
{
	return makeRow( makeCell( 3, "Meeting Notes" ) )
				.makeRow( makeCell( 3, printMeetingHeader( $meeting ) ) );
}

function printMeetingHeader( $meeting )
{	global $proplist;
	if ( $meeting > 0 )
	{
		$item = $proplist['meet'][$meeting];
		$ret = makeRow( makeCell( 1, 
															makeTable( 100, makeRow(  makeCell( 1, "Project",  "", '', "0*" ).makeCell( 1, $proplist['proj'][$item['projID']]['projName'], "", '' ) )
																						 .makeRow(  makeCell( 1, "Subject",  "", '', "0*" ).makeCell( 1, $item['meetSubject'],  "", '' ) )
																						 .makeRow(  makeCell( 1, "Location", "", '', "0*" ).makeCell( 1, $item['meetLocation'], "", '' ) )
																						 .makeRow(  makeCell( 1, "Date",     "", '', "0*" ).makeCell( 1, $item['meetDate'],     "", '' ) )
																						  ) ) );
	}
	return makeTable( 100, $ret );

}

function makeNotesBody( $meeting )
{
	$ret = "";
	$ret.= makeRow( makeCell( 1, "Meeting notes", '' ) );
	if ( $meeting > 0 )
	{	
		$rows = getNotes( $meeting, " itemTypeID IN( SELECT typesID FROM types WHERE typesName = 'Notes' ) ORDER BY itemTime" );
		$ret.= makeRow( makeCell( 1, "Notes", '' ) );
		$ret.= printFormatNotes( $rows );
		$rows = getNotes( $meeting, " itemTypeID IN( SELECT typesID FROM types WHERE typesName = 'Requirements' ) ORDER BY itemTime" );
		$ret.= makeRow( makeCell( 1, "Requirements", '' ) );
		$ret.= printFormatNotes( $rows );
		$rows = getNotes( $meeting, " itemTypeID IN( SELECT typesID FROM types WHERE typesName = 'Comments' ) ORDER BY itemTime" );
		$ret.= makeRow( makeCell( 1, "Comments", '' ) );
		$ret.= printFormatNotes( $rows );
	}
	else
		$ret.= makeRow( makeCell( 1, makeItem( "" ) ) );
		
	return makeTable( 100, $ret );
}

function printFormatNotes( $rows )
{	$ret = "";
	$count = 1;
	foreach( $rows as $row )
	{
		$ret.= makeRow( makeCell( 1, makeItem( $row ) ) );
		$count++;
	}
	return $ret;
}

function makeActionPark( $meeting )
{
	$ret = "";
	$rows = getNotes( $meeting, " itemTypeID IN( SELECT typesID FROM types WHERE typesName = 'Action Item' ) ORDER BY itemTime" );
	$ret.= makeRow( makeCell( 1, "Action Items", '' ) );
	$ret.= printFormatNotes( $rows );
	$rows = getNotes( $meeting, " itemTypeID IN( SELECT typesID FROM types WHERE typesName = 'Parking Lot' ) ORDER BY itemTime" );
	$ret.= makeRow( makeCell( 1, "Parking Lot", '' ) );
	$ret.= printFormatNotes( $rows );
		
	return makeTable( 100, $ret );
}

?>
Return current item: Web-NoteTaker