<?php

function show#record#($#primarykey#=null){
	if (!isset($#primarykey#)) $#primarykey#=GETVAL('#primarykey#');
	
	global $db;
	
	$user=userinfo();
	$gsid=$user['gsid']+0;
	
	$query="select * from #tablename# where gsid=? and #primarykey#=?";
	$rs=sql_prep($query,$db,array($gsid,$#primarykey#));
	
	if (!$myrow=sql_fetch_array($rs)) die(_tr('record_removed'));
	
#iterator-fieldlist-myrowlist#	

	header('newtitle:'.tabtitle(htmlspecialchars($#dispfield#)));
	makechangebar('#record#_'.$#primarykey#,"update#record#($#primarykey#,'".makegskey('update#record#_'.$#primarykey#)."');");
?>
<div class="section">
	<div class="sectiontitle"><?echo htmlspecialchars($#dispfield#);?></div>

	<div class="col">


#iterator-fieldlist-detailview#
	
	<div class="inputrow">
		<button onclick="update#record#(<?echo $#primarykey#;?>,'<?emitgskey('update#record#_'.$#primarykey#);?>');"><?tr('button_update');?></button>

		&nbsp; &nbsp;
		<button class="warn" onclick="del#record#(<?echo $#primarykey#;?>,'<?emitgskey('del#record#_'.$#primarykey#);?>');"><?tr('button_delete');?></button>


	</div>


	</div>
	<div class="col">

	</div>
	<div class="clear"></div>
</div>
<?
}