Location: PHPKode > projects > O - OpenSource GroupWare > osgw/notebook/view_note.php
<?php
/**************************************************************************
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   @Authors:	Ryan Thompson(hide@address.com)
***************************************************************************/
include("./data.php");
$service['add_header'] = TRUE;
include("../config.inc.php");
include($here. "/class.notebook.php");
$notes = new notebook;

echo $layout->page_header;
echo $layout->service_header($notes->msg('service_name'), $notes->nav_buttons());

if($_GET['s'])
{
		$results = $share->get_shared_item('nb', 'o_notebook', 'note_id', $user->user_id, $_GET['nid']);
		$display = 'none';
} else {
	$sql = "SELECT o_users.username, o_notebook.* FROM o_notebook
		LEFT JOIN o_users ON  o_notebook.user_id=o_users.user_id
		WHERE note_id='{$_GET['nid']}' AND o_notebook.user_id='{$user->user_id}'";
	$db->query($sql);
	$db->fetch_results();
	$results = $db->record;
	$display = 'block';
}


$sql = "SELECT o_categories.category FROM o_categories 
	LEFT JOIN o_categorize ON o_categorize.category=o_categories.category_id WHERE o_categorize.service='nb' AND
	o_categorize.id='{$_GET['nid']}'";
$db->query($sql);

$db->fetch_results();

echo $html->create_list(
		array("NOTE_ID"=>$results['note_id'],
			"TITLE_TEXT"=>$text['title'],
			"TITLE"=>$results['title'],
			"CATEGORY_TEXT"=>$text['category'],
			"CATEGORY"=>$db->record['category'],
			"NOTE_TEXT"=>$text['note'],
			"NOTE"=>str_replace("\n", "<br />", $results['note']),
			"CREATED_TEXT"=>$text['created'],
			"CREATED"=>date($date->long_date, $results['posted']),
			"EDIT_NOTE"=>$text['edit_note'],
			"EDIT_DISPLAY"=>$display,
			),
		"{$layout->service_theme}/view_note.html");
echo $layout->create_footer();
Return current item: O - OpenSource GroupWare