#! /bin/sh

#|
 echo Content-type: text/html
 echo ""
 ":";exec /usr/local/bin/mzscheme -r "$0" "$@"
|#

; Copyright 2008 Christopher Michael Rasch
;
; This file is part of Wishforge.

; Wishforge is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.

; Wishforge is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU Affero General Public License for more details.

; You should have received a copy of the GNU Affero General Public License
; along with Wishforge.  If not, see <http://www.gnu.org/licenses/>.

(require (lib "cgi.ss" "net"))
(require (lib "xml.ss" "xml"))
(require (lib "md5.ss"))
(require (file "db.ss"))
(require (file "cookies.ss"))
(require (file "bindings.ss"))

(let ([bidder (ebs "bidder")]
      [wish-login (ebs "wish-login")]
      [symbol (ebs "symbol")]
      [num_bonds (ebs "num_bonds")]
      [bond_amount (ebs "bond_amount")])
    (insert-bid
	bidder
        wish-login
	symbol
	num_bonds
	bond_amount)
    (write-xml/content 
     (xexpr->xml 
      `(HTML
	(HEAD 
	 (TITLE "Wishforge bid created"))
	(BODY
	 (H2 "Your bid has been created") ; TODO - go back to user page
	 (H3 "Wish " ,symbol " created by user " ,wish-login)
	 (H3 "Number of bonds: " ,(format "~a" num_bonds) " Amount per bond: " ,(format "~a" bond_amount))
	 (P)
	 (H3 "Go to the Wishforge " (A ((HREF "/wishforge.html"))
				       "login page")))))))



