"
#####
# Display top banner data
#
topbanner
puts -nonewline "
"
html "
Chamorro Standard Time: $curdate
"
if {$response(link) == "home"} {
#control center
html "Welcome
$login(email). Here's what you can do here:"
html "
"
} elseif {$response(link) == "postform"} {
html "
Posting an Ad
"
html "Please fill out the following form
completely. HTML code is not allowed
"
if {[defined posterror]} {
html "$posterror"
}
adform
} elseif {$response(link) == "finishedposting"} {
html "
Posting an Ad
"
html "Your ad has been posted and will expire 2 week from today
"
html "
Back Home"
} elseif {$response(link) == "list"} {
if {![defined response(cat)]} {
html "
You need to select a category first
"
} else {
html "
Category: $response(cat)
"
if $login(count) {
html "\[
Post an ad in this category \]"
}
html "
"
dbCatch {
dbSelect "item, price, id
from classifieds
where category = [dbQuote $response(cat)]
and expires > curdate()
order by created desc
" adlist {
html "- $adlist(item): $adlist(price)
"
}
}
html "
"
}
} elseif {$response(link) == "view"} {
if {![defined response(id)]} {
html "
You are using this page wrong.
"
} else {
html "
"
dbCatch {
dbSelect "*
from classifieds
where id = [dbQuote $response(id)]
order by created desc
" addata {}
html "
"
html "$addata(item)
"
html "- Asking: $addata(price)
"
regsub -all "\n" $addata(descript) "
" addata(descript)
html "- $addata(descript)
"
html "
"
html "
"
html "
"
html "
"
}
}
} elseif {$response(link) == "contactform"} {
html "
Contact poster
"
html "You need to fill out the form
completely"
contactform
} elseif {$response(link) == "contactcomplete"} {
html "
Messages has been sent.
"
} elseif {$response(link) == "listown"} {
html "
Your posts
"
html "Click to edit, expire or re-post ad. If you do not re-post an expired ad within 4 days it will be deleted."
html "
"
set now [clock seconds]
dbCatch {
dbSelect "item, price, id, expires
from classifieds
where email = [dbQuote $login(email)]
order by created desc, category asc
" adlist {
set exprsecs [clock scan "$adlist(expires)"]
set fill "- $adlist(item) "
append fill "Expires: [display_nice_date_time2 $adlist(expires)]"
if {$exprsecs <= $now} {
puts -nonewline "
$fill
"
} else {
puts -nonewline $fill
}
puts -nonewline " "
}
}
html "
"
html "
Back Home"
} elseif {$response(link) == "finishededit"} {
html "
Editing your post
"
html "Your ad has been $response(return)
"
html "
Back Home"
} elseif {$response(link) == "editform"} {
html "
Editing your post
"
html "Please fill out the following form
completely. HTML code is not allowed
"
dbSelect "* from classifieds where id = [dbQuote $response(id)] and email = [dbQuote $login(email)]" addata {}
foreach n [array names addata] {
set response($n) $addata($n)
}
adform
html "
Back Home"
} elseif {$response(link) == "aup"} {
#show acceptable use policy (aup)
include /usr/local/apache_1.3.33/htdocs/classifieds/aup.htm
} elseif {$response(link) == "nocookie"} {
html "
Inorder to use this service you need to allow cookies to be set. Change your browser prefs and revisit this page
"
} elseif {$response(link) == "login" && ![defined loginerror]} {
#login form
html "Enter your email address and password. If you are a Kuentos customer you do not have to register. Simply enter your username in this format: username@guam.net.
If you are not a Kuentos customer you need to register by entering your email address and click on the \"Register\" button.
"
loginform
} elseif {[defined loginerror]} {
html "Enter your email address and password. If you are a Kuentos customer you do not have to register. Simply enter your username in this format: username@guam.net.
If you are not a Kuentos customer you need to register by entering your email address and click on the \"Register\" button.
"
html "$loginerror"
loginform
} elseif {$response(link) == "logout"} {
html "$logoutmesg"
} elseif {$response(link) == "sentvalemail"} {
html "
A validation link has been sent to your email. You have 24 hours to validate or you will have to re-register.
"
} elseif {[defined response(passedval)]} {
html "
New registration
"
html "Please enter a password you wish to use for your new on-line classified account."
if {[defined passerr]} {
html $passerr
}
passform
} elseif {$response(link) == "finishedregister"} {
html "
New registration
"
html "Welcome to the improved free online classified ads. Before using this service you should read the
Acceptible Use Policy."
loginform
} else {
#display welcome messaged
html {
Welcome to Guam's best place to buy, sell, trade stuff on-line. Browse for things by clicking on the categories to the left. If you want to post Ads and you are currently a Kuentos customer you can simply use your username/password to
login and start posting.
If you are not a Kuentos customer you can still use the classifieds by registering. It's simple, free and fun for the whole family. Before using this service you should read the
Acceptible Use Policy.
}
html {
}
html "
10 most recent ads
"
html "
"
dbSelect "item, price, id, category
from classifieds where expires > curdate() order by created desc limit 10" ads {
html "- $ads(item): $ads(price)
"
}
html "
"
html {
}
}
puts -nonewline "
"
#footer
guam.net.footer
puts -nonewline "