#include <lt2001.style>
#include "edit.style"

<page title="Edit Supply" subtitle="Supply List">

<?

  $dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
	       or die("Unable to connect to SQL server");

  # pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");

  $query = sprintf ("SELECT * FROM supplylist WHERE oid = %d", $oid);

  $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");

  if (pg_NumRows ($sth) > 0) {
    $row = pg_fetch_array ($sth, 0);
  }
?>
<form method=post action=update.php3>
<input type=hidden name=type value="supplylist">
<input type=hidden name=oid value="<? echo $oid; ?>">
<center><table cellpadding=0 cellspacing=1>

<row_input	name=id
		title="<b>Pos.-Nr.</b>"
		value="<? echo $row['id']; ?>"
		maxlength=12
		>
<row_input	name=name
		title="<b>Name</b>"
		value="<? echo $row['name']; ?>"
		>
<row_input	name=height
		title="<b>Height [cm]</b>"
		value="<? echo $row['height']; ?>"
		maxlength=10
		>
<row_input	name=width
		title="<b>Width [cm]</b>"
		value="<? echo $row['width']; ?>"
		maxlength=10
		>
<row_input	name=depth
		title="<b>Depth [cm]</b>"
		value="<? echo $row['depth']; ?>"
		maxlength=10
		>
<row_input	name=img_src
		title="<b>Image</b>"
		value="<? echo $row['img_src']; ?>"
		>
<row_input	name=img_width
		title="<b>Width (Img)</b>"
		value="<? echo $row['img_width']; ?>"
		maxlength=10
		>
<row_input	name=img_height
		title="<b>Height (Img)</b>"
		value="<? echo $row['img_height']; ?>"
		maxlength=10
		>
<row_input	name=price
		title="<b>Price [eur]</b>"
		value="<? echo $row['price']; ?>"
		maxlength=10
		>
<row_textarea	name=comment
		title="<b>Comment</b>"
		value="<? echo $row['comment']; ?>"
		>
<row_radiobox	name=visible
		title="<b>Visible</b>"
		checked_0="<? if ($row['visible']==0) { echo "checked";} ?>"
		checked_1="<? if ($row['visible']==1) { echo "checked";} ?>"
		>


<? if ($oid > 0) { ?>
<row_radiobox	name=delete
		title="<b>Delete</b>"
		checked_0="checked"
		checked_1=""
		>
<? } ?>

<row_submit>

</table></center></form>

</page>

# Local variables:
# mode: text
# mode: auto-fill
# end:
