Check this style

Show off your Coranto-powered web sites in here!
Want to get some ideas as to what Coranto can do? Come on in, and browse...

Moderator: Spunkmeyer

Check this style

Postby SrNupsen » Wed Aug 22, 2007 11:27 am

Just wanted to share with you a crazy news style I made for my current developing project. Note that newlines will be converted to <br />, so everything except the PHP code needs to be kept on the same line.

Code: Select all
<If: Sub: isNewValue: CustomField_produktgruppe>
<a name="<Field: CustomField_produktgruppe>">
<tr><td colspan="6">&nbsp;</td></tr>
<tr class="overskrift_skjema"><td colspan="6"><Field: CustomField_produktgruppe></td></tr>
<tr><td colspan="6">&nbsp;</td></tr>
<tr><td>&nbsp;</td><td><b>Poser</b></td><td><b>Sjaktel</b></td><td colspan="3"><b>Kilo</b></td></tr>
</If>
<?php
$pose = rawurlencode ("<Field: CustomField_produktnavn> (pose)");
$sjaktel = rawurlencode ("<Field: CustomField_produktnavn> (sjaktel)");
$kilo = rawurlencode ("<Field: CustomField_produktnavn> (kilo)");
?>
<tr><td><Field: CustomField_produktnavn></td><td><input <?php if (!empty($errors[$pose])) { echo "style=\"border: 2px solid red;\" onmouseover=\"return overlib('Ugyldig verdi!');\" onmouseout=\"return nd();\" ";}?>type="text" name="<?=$pose?>" size="2" maxlength="3" value="<?php echo $_POST[$pose]; ?>"> à <Field: CustomField_produktpris_pose></td><td><input <?php if (!empty($errors[$sjaktel])) { echo "style=\"border: 2px solid red;\" onmouseover=\"return overlib('Ugyldig verdi!');\" onmouseout=\"return nd();\" ";}?>type="text" name="<?=$sjaktel?>" size="2" maxlength="3" value="<?php echo $_POST[$sjaktel]; ?>"> à <Field: CustomField_produktpris_sjaktel></td><td><input <?php if (!empty($errors[$kilo])) { echo "style=\"border: 2px solid red;\" onmouseover=\"return overlib('Ugyldig verdi!');\" onmouseout=\"return nd();\" ";}?>type="text" name="<?=$kilo?>" size="2" maxlength="3" value="<?php echo $_POST[$kilo]; ?>"> à <Field: CustomField_produktpris_kilo></td><td><EasyEdit: Edit></td><td><EasyEdit: Delete></td></tr>


You'll notice use of the IsNewValue addon to create gray headers for each product group (yes, it's actually an order form in Norwegian), along with the great Overlib library by Erik Bosrup to present mouseover descriptions of errors in input fields. Each field is repopulated using PHP code (if user typed something and then clicked OK - form validation).

I also spent a lot of time figuring out how to give the input fields a valid "name" attribute, as this is controlled by what my employee puts into the field "product_name". To make sure the name attribute doesn't contain any illegal characters, i use PHP's rawurlencode function.


You can see it in action by visiting http://www.noindexing.please/www.okourt ... oranto.php (replace 'www.noindexing.please' with 'luxor.domeneshop.no' ;) ) - try putting in some values, but MAKE SURE YOU MAKE SOME MISTAKES like putting letters instead of numbers. If you don't, you'll go to the validate sub which I haven't completed yet, so you'll only see a blank page :)


I think it's yet another example of how everything can be done with Coranto. The whole point of this form is (of course) that the admin can edit, delete and add products and prices from within Coranto, and that the order form will update itself accordingly. If he or she is logged in to Coranto, he/she will even see small "Edit" and "Delete" buttons next to each item, thanks to Parahead's EasyEdit addon.
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby Jackanape » Wed Aug 22, 2007 1:15 pm

Sweet! Now, there's something I never thought of!
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby Rocky » Thu Oct 25, 2007 11:42 pm

Working link? I can't get that to work, even if when doing that frustrating url substitution. :evil:
Rocky
Rocky
 
Posts: 41
Joined: Sat Feb 03, 2007 9:20 pm

Postby SrNupsen » Fri Oct 26, 2007 12:53 am

Tough luck... My employer asked me to take it down, as they won't be using that version. But The site is still being developed at http://dev.okourt.no

Sorry for tricking you into URL manipulation to no avail

SrNupsen :lol:
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway


Return to Showcase

Who is online

Users browsing this forum: No registered users and 2 guests

cron