Location: PHPKode > projects > Protoforge > protoforge_v1.2/protoforge/user_resources/User_Resource_Comment/create_User_Resource_Comment.php
<?php $deb=false;
require_once('../../config.inc.php');
require(PF_INCLUDE.'verifyUserID.inc.php');

header('Cache-control: private');

if (isset($_POST['redirect'])) { $redirect = $_POST['redirect']; }
else if (isset($_GET['redirect'])) { $redirect = $_GET['redirect']; }

if (require_once(PF_BASE.'connect.php'))
	$link = connect();

$User_Resource_Comment = new User_Resource_Comment();

if (isset($_GET['id']) && ctype_digit($_GET['id'])) {
	$User_Resource_Comment->set_user_res_id($_GET['id']);
} else {
	$pfutil = new PFUtil();
	$pfutil->error_page('A resource ID must be given.');
}

try {
	$query = 'SELECT TITLE FROM user_resources WHERE USER_RES_ID = '.$User_Resource_Comment->get_user_res_id();
	$result = mysql_query($query);
	if (!$result) throw new Exception('Error retrieving foreign key '.mysql_errno($link));
	if (mysql_num_rows($result) == 1) {
		$row = mysql_fetch_assoc($result);
		$User_Resource_Comment->user_resource_title = $row['TITLE'];
	} else {
		throw new Exception('No entry found for foreign key TITLE');
	}
} catch (Exception $e) {
	$pfutil = new PFUtil();
	$pfutil->error_page($e->getMessage());
}

$pageTitle=PF_SITENAME.' Create Personal Resource Comment';
$linkListObject = 'comment';
require(PF_BASE.'Header.php');
?>
	<?php $titl='Create Personal Resource Comment'; require(PF_BASE.'titl.php'); ?>
	<table border="0" width="100%" cellpadding="5" cellspacing="0">
		<tr class="action">
			<td class="action" align="right">
				&nbsp;
			</td>
		</tr>
	</table>
	<?php include(PF_INCLUDE.'ttt.php'); ?>
	<?php if ($deb) echo $User_Resource_Comment->toString(); ?>
	<form name="info" action="create_User_Resource_Comment_submit.php" method="post">
		<?php if (isset($redirect)) { ?>
			<input type="hidden" name="redirect" value="<?php echo $redirect; ?>"/>
		<?php } ?>
		<input name="user_res_com_id" type="hidden" value="<?php echo $User_Resource_Comment->get_user_res_com_id() ?>"/>
		<input type="hidden" name="user_id" value="<?php echo $uid; ?>"/>
		<input type="hidden" name="user_res_id" value="<?php echo $User_Resource_Comment->get_user_res_id(); ?>"/>

	<table border="0" width="100%" cellspacing="1" cellpadding="5">
		<tr class="result">
			<td class="result" align="right" width="25%">
				<a class="ftt" href="javascript:showTooltip('user_resource_comments','USER_RES_ID');">
					Personal Resource:</a>
			</td>
			<td class="result" align="left" width="75%">
				<a class="result" href="<?php echo PF_ROOT;?>user_resources/User_Resource.php?id=<?php echo $User_Resource_Comment->get_user_res_id();?>&">
					<img class="icon" title="" src="<?php echo PF_ROOT;?>images/package.png"/>&nbsp;
					<?php echo $User_Resource_Comment->user_resource_title;?></a>
			</td>
		</tr>
		<tr class="form">
			<td class="form" align="left" colspan="2">
				<a class="ftt" href="javascript:showTooltip('user_resource_comments','COMMENT');">
					Comment:</a>
				<br/>
				<?php
					$oFCKeditor = new FCKeditor($linkListObject,'100%','200') ;
					$oFCKeditor->Config['CustomConfigurationsPath'] = PF_ROOT.'PF_fckconfig.js';
					$oFCKeditor->BasePath = PF_ROOT.'FCKeditor/';
					$oFCKeditor->Value = $User_Resource_Comment->get_comment();
					$oFCKeditor->Create();
				?>
			</td>
		</tr>
		<tr>
			<td class="form" align="center">
				&nbsp;
			</td>
			<td class="form" align="center">
				<input tabindex="5" type="submit" value=" Create "/>
				<input tabindex="6" type="button" value=" Cancel " onClick="history.back()"/>
			</td>
		</tr>
	</table>

	</form>
	<br/>
	<br/>
<?php
include(PF_BASE.'Footer.php');
?>
Return current item: Protoforge