<?php
/*****
To set the selected status_id set $selected_status_id to the status id you want selected.
If $selected_status_id is not set then the empty cell will be selected..
To set the tab index of the selection box set $tabindex="4"; or whatever the number is you want.
******/
if (is_null($selected_status_id)) {
$selected_status_id = '';
}
if (require_once(PF_BASE.'connect.php'))
$link = connect();
$status_query = 'SELECT STATUS_ID,STATUS FROM resource_status ORDER BY STATUS ASC';
$status_result = mysql_query($status_query);
if (!$status_result) {
$pfutil = new PFUtil();
$pfutil->error_page('Unable to select resource status values.');
}
?>
<select<?php echo (!is_null($tabindex)) ? ' tabindex="'.$tabindex.'"' : '';?> name="status_id">
<?php while ($row = mysql_fetch_assoc($status_result)) { ?>
<option <?php echo ($row['STATUS_ID']==$selected_status_id)?'selected':'';?> value="<?php echo $row['STATUS_ID'];?>"><?php echo $row['STATUS'];?></option>
<?php }
if ($status_result) mysql_free_result($status_result);
?>
</select>