Location: PHPKode > projects > Protoforge > protoforge_v1.2/protoforge/user_resources/edit_User_Resource.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 = new User_Resource();
try {
	if (isset($_GET['id']) && (trim($_GET['id']) != "")) {
		$User_Resource->dbPopulate($_GET['id'],$link);
		if ($User_Resource->is_error())
			throw new Exception($User_Resource->get_error_string());
	} else {
		throw new Exception( 'No User_Resource selected.<br/><a href="index.php">Search User_Resources</a>' );
	}
} catch (Exception $e) {
	$pfutil = new PFUtil();
	$pfutil->error_page( $e->getMessage() );
}

if ($uid != $User_Resource->get_user_id()) {
	$pfutil = new PFUtil();
	$pfutil->error_page( 'You do not have permission to edit this User_Resource.' );
}

$pageTitle=PF_SITENAME.' Edit Personal Resource';
$linkListObject = 'description';
require(PF_BASE.'Header.php');
?>

<SCRIPT LANGUAGE="JavaScript">
function insertLink() {

	if(!document.forms['links'])
		return;
	var objCheckBoxes = document.forms['links'].elements;
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes) {
		return;
	} else {
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++) {
			if (objCheckBoxes[i].checked == 1) {
				document.info.description.value = document.info.description.value +'\n'+ objCheckBoxes[i].name;
			}
		}
	}
}
</SCRIPT>

    <form name="info" method="post" action="edit_User_Resource_submit.php">

		<?php if (isset($redirect)) { ?>
			<input type="hidden" name="redirect" value="<?php echo $redirect; ?>"/>
		<?php } ?>
		<input name="user_res_id" type="hidden" value="<?php echo $User_Resource->get_user_res_id() ?>"/>
		<input type="hidden" name="user_id" value="<?php echo $uid; ?>"/>

		<?php $titl = 'Edit Personal Resource'; 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'); ?>
		<table border="0" width="100%" cellspacing="1" cellpadding="5">
			<tr class="form">
				<td class="form" align="right">
					<?php echo PF_REQUIRED;?>
					<a class="ftt" href="javascript:showTooltip('user_resources','TITLE');">
						Title:</a>
				</td>
				<td class="form" align="left">
					<input tabindex="1" name="title" id="title" type="textfield" size="50" maxlength="128"
						value="<?php echo str_replace('"','&quot;',$User_Resource->get_title());?>"/>
				</td>
			</tr>
			<tr class="form">
				<td class="form" align="right">
					<?php echo PF_REQUIRED;?>
					<a class="ftt" href="javascript:showTooltip('user_resources','RES_TYPE_ID');">
						Type:</a>
				</td>
				<td class="form" align="left">
					<?php
						$selected_res_type_id = $User_Resource->get_res_type_id();
						$tabindex="4";
	                    include(PF_BASE.'resources/type_selection_box.php');
	                ?>
				</td>
			</tr>
			<tr class="form">
				<td class="form" align="right">
					<?php echo PF_REQUIRED;?>
					<a class="ftt" href="javascript:showTooltip('user_resources','STATUS_ID');">
						Status:</a>
				</td>
				<td class="form" align="left">
					<?php
						$selected_status_id = $User_Resource->get_status_id();
						$tabindex="3";
						include(PF_BASE.'user_resources/res_status_selection_box.php');
					?>
				</td>
			</tr>
			<tr class="form">
				<td class="form" align="left" colspan="2">
					<a class="ftt" href="javascript:showTooltip('user_resources','DESCRIPTION');">
						Description</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->get_description();
						$oFCKeditor->Create();
					?>
				</td>
			</tr>
			<tr>
				<td class="form" align="center">
					&nbsp;
				</td>
				<td class="form" align="center">
					<input tabindex="5" type="submit" name="Submit" value="Update"/>
					<input tabindex="6" type="button" value=" Cancel " onClick="history.back()"/>
				</td>
			</tr>
		</table>

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