Index: branches/htmlform/cgi-bin/main.cgi
===================================================================
--- branches/htmlform/cgi-bin/main.cgi	(revision 460)
+++ branches/htmlform/cgi-bin/main.cgi	(revision 461)
@@ -788,4 +788,5 @@
     } # check for freeblocks assignment or IPDB-controlled assignment
 
+##fixme:  HTML must be removed from script!
     $alloc_from = qq($cidr<input type=hidden name=alloc_from value="$cidr">);
 
@@ -802,9 +803,4 @@
   } # if ($webvar{alloctype} =~ /^.i$/)
 
-  open HTML, "../confirm.html"
-	or croak "Could not open confirm.html: $!";
-  my $html = join '', <HTML>;
-  close HTML;
-
 ## node hack
   if ($webvar{node} && $webvar{node} ne '-') {
@@ -812,54 +808,37 @@
     $sth->execute($webvar{node});
     my ($nodename) = $sth->fetchrow_array();
-    $html =~ s/\$\$NODENAME\$\$/$nodename/;
-    $html =~ s/\$\$NODEID\$\$/$webvar{node}/;
-  } else {
-    $html =~ s/\$\$NODENAME\$\$//;
-    $html =~ s/\$\$NODEID\$\$//;
+    $page->param(nodename => $nodename);
+    $page->param(nodeid => $webvar{node});
   }
 ## end node hack
 
-### gotta fix this in final
-  # Stick in customer info as necessary - if it's blank, it just ends
-  # up as blank lines ignored in the rendering of the page
-	my $custbits;
-  $html =~ s|\$\$CUSTBITS\$\$|$custbits|g;
-###
-
   # Stick in the allocation data
-  $html =~ s|\$\$ALLOC_TYPE\$\$|$webvar{alloctype}|g;
-  $html =~ s|\$\$TYPEFULL\$\$|$disp_alloctypes{$webvar{alloctype}}|g;
-  $html =~ s|\$\$ALLOC_FROM\$\$|$alloc_from|g;
-  $html =~ s|\$\$CIDR\$\$|$cidr|g;
-  $webvar{city} = $q->escapeHTML($webvar{city});
-  $html =~ s|\$\$CITY\$\$|$webvar{city}|g;
-  $html =~ s|\$\$CUSTID\$\$|$webvar{custid}|g;
-  $webvar{circid} = $q->escapeHTML($webvar{circid});
-  $html =~ s|\$\$CIRCID\$\$|$webvar{circid}|g;
-  $webvar{desc} = $q->escapeHTML($webvar{desc});
-  $html =~ s|\$\$DESC\$\$|$webvar{desc}|g;
-  $webvar{notes} = $q->escapeHTML($webvar{notes});
-  $html =~ s|\$\$NOTES\$\$|$webvar{notes}|g;
-  $html =~ s|\$\$ACTION\$\$|insert|g;
-
-  my $i=1;
+  $page->param(alloc_type => $webvar{alloctype});
+  $page->param(typefull => $q->escapeHTML($disp_alloctypes{$webvar{alloctype}}));
+  $page->param(alloc_from => $alloc_from);
+  $page->param(cidr => $cidr);
+  $page->param(city => $q->escapeHTML($webvar{city}));
+  $page->param(custid => $webvar{custid});
+  $page->param(circid => $q->escapeHTML($webvar{circid}));
+  $page->param(desc => $q->escapeHTML($webvar{desc}));
+
+##fixme: find a way to have the displayed copy have <br> substitutions
+# for newlines, and the <input> value have either encoded or bare newlines.
+# Also applies to privdata.
+  $page->param(notes => $q->escapeHTML($webvar{notes},'y'));
+
   # Check to see if user is allowed to do anything with sensitive data
   my $privdata = '';
-  if ($IPDBacl{$authuser} =~ /s/) {
-    $privdata = qq(<tr class="color).($i%2).qq("><td>Restricted data:</td>).
-        "<td class=regular>".$q->escapeHTML($webvar{privdata}).
-	qq(<input type=hidden name=privdata value=").$q->escapeHTML($webvar{privdata}).
-	qq("></td></tr>\n);
-    $i++;
-  }
-# We're going to abuse $$PRIVDATA$$ to stuff in some stuff for billing.
-  $privdata .= "<input type=hidden name=billinguser value=$webvar{userid}>\n"
+  $page->param(privdata => $q->escapeHTML($webvar{privdata},'y'))
+	if $IPDBacl{$authuser} =~ /s/;
+
+  # Yay!  This now has it's very own little home.
+  $page->param(billinguser => $webvar{userid})
 	if $webvar{userid};
-  $html =~ s/\$\$PRIVDATA\$\$/$privdata/g;
-
-  $i = $i % 2;
-  $html =~ s/\$\$BUTTONROWCOLOUR\$\$/color$i/;
-
-  print $html;
+
+##fixme:  this is only needed iff confirm.tmpl/confirm.html and
+# confirmRemove.html/confirmRemove.tmpl are merged (quite possible, just
+# a little tedious)
+  $page->param(action => "insert");
 
 } # end confirmAssign
Index: branches/htmlform/ipdb.css
===================================================================
--- branches/htmlform/ipdb.css	(revision 460)
+++ branches/htmlform/ipdb.css	(revision 461)
@@ -138,4 +138,9 @@
 }
 
+td {
+	padding-right: 2px;
+	padding-left: 2px;
+}
+
 /* Generic classes */
 .indent {
Index: branches/htmlform/templates/confirm.tmpl
===================================================================
--- branches/htmlform/templates/confirm.tmpl	(revision 461)
+++ branches/htmlform/templates/confirm.tmpl	(revision 461)
@@ -0,0 +1,82 @@
+<div class="heading">Please confirm</div>
+<div class="indent">
+<table class="regular" cellspacing="1" cellpadding="1">
+
+<tr class="row0">
+<td>CIDR block to be allocated:</td>
+<td><TMPL_VAR NAME=cidr></td>
+</tr>
+
+<tr class="row1">
+<td>Block allocation is taken from:</td>
+<td><TMPL_VAR NAME=alloc_from></td>
+</tr>
+
+<tr class="row0">
+<td>City:</td>
+<td><TMPL_VAR NAME=city></td>
+</tr>
+
+<tr class="row1">
+<td>Demarc switch/wifi tower:</td>
+<td><TMPL_VAR NAME=nodename></td>
+</tr>
+
+<tr class="row0">
+<td>Allocation type:</td>
+<td><TMPL_VAR NAME=typefull></td>
+</tr>
+
+<tr class="row1">
+<td>Customer ID:</td>
+<td><TMPL_VAR NAME=custid></td>
+</tr>
+
+<tr class="row0">
+<td valign="top">Circuit ID:</td>
+<td><TMPL_VAR NAME=circid></td>
+</tr>
+
+<tr class="row1">
+<td valign="top">Description/name:</td>
+<td><TMPL_VAR NAME=desc></td>
+</tr>
+
+<tr class="row0">
+<td valign="top">Notes:</td>
+<td><TMPL_VAR NAME=notes></td>
+</tr>
+
+<TMPL_IF privdata>
+<tr class="row1">
+<td>Restricted data:</td>
+<td><TMPL_VAR NAME=privdata></td>
+</tr>
+</TMPL_IF>
+
+<!-- warn -->
+<tr class="<TMPL_IF privdata>row0<TMPL_ELSE>row1</TMPL_IF>">
+<td class="center" colspan="2">
+<form method="POST" action="main.cgi" class="regular">
+<fieldset><legend></legend>
+<input type="hidden" name="fullcidr" value="<TMPL_VAR NAME=cidr>">
+<input type="hidden" name="city" value="<TMPL_VAR NAME=city>">
+<input type="hidden" name="node" value="<TMPL_VAR NAME=nodeid>">
+<input type="hidden" name="alloctype" value="<TMPL_VAR NAME=alloc_type>">
+<input type="hidden" name="custid" value="<TMPL_VAR NAME=custid>">
+<input type="hidden" name="circid" value="<TMPL_VAR NAME=circid>">
+<input type="hidden" name="desc" value="<TMPL_VAR NAME=desc>">
+<input type="hidden" name="notes" value="<TMPL_VAR NAME=notes>">
+<TMPL_IF privdata>
+<input type="hidden" name="privdata" value="<TMPL_VAR NAME=privdata>">
+</TMPL_IF>
+<TMPL_IF billinguser>
+<input type="hidden" name="billinguser" value="<TMPL_VAR NAME=billinguser>">
+</TMPL_IF>
+<input type="hidden" name="action" value="<TMPL_VAR NAME=action>">
+<input type="button" value="Back" onclick="history.go(-1)"><input type="submit" value="Confirm">
+</fieldset>
+</form>
+</td></tr>
+</table>
+</div>
