Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added some files missed in the prevoius commit...

  • Loading branch information...
commit 7675ca2d659ea4aed498c7c010541f0f8f96bbda 1 parent 3dd150e
Mino authored
View
2  include/utils.hrl
@@ -0,0 +1,2 @@
+-define(i2l(Integer),integer_to_list(Integer)).
+-define(l2i(List),list_to_integer(List)).
View
60 src/cartItem.erl
@@ -0,0 +1,60 @@
+%%%-------------------------------------------------------------------
+%%% File : cartItem.erl
+%%% Author : <Mino@X60S>
+%%% Description :
+%%%
+%%% Created : 29 Apr 2010 by <Mino@X60S>
+%%%-------------------------------------------------------------------
+-module (cartItem).
+-compile (export_all).
+
+-include_lib ("nitrogen/include/wf.inc").
+-include("records.hrl").
+
+%%====================================================================
+%% API Functions
+%%====================================================================
+load(Product) when is_record(Product,product)->
+ wf:state(product,Product);
+load(ProdId) ->
+ wf:state(product,db:get_product(ProdId)).
+
+load() ->
+ ?PRINT(wf:state(pathInfo)),
+ case wf:state(pathInfo) of
+ "112"++ProdId ->
+ load(list_to_integer(ProdId)),
+ true;
+ _ -> false
+ end.
+%%====================================================================
+%% Template Functions
+%%====================================================================
+
+id() ->
+ product:id().
+
+name() ->
+ product:name().
+
+url() ->
+ product:url().
+
+img() ->
+ product:img().
+
+description() ->
+ product:description().
+
+price() ->
+ product:price().
+
+buyLink() ->
+ product:buyLink().
+
+quantityTextbox(Class) ->
+ #textbox{class=Class}.
+
+
+event(Event) ->
+ ?PRINT(Event).
View
15 wwwroot/CC_category.tpl
@@ -0,0 +1,15 @@
+<h2>[[[category:name()]]]</h2>
+
+<table>
+ <tr>
+ <th></th>
+ <th class="fullwidth">Name</th>
+ <th>Price</th>
+ <th>Status</th>
+ <th>Quantity</th>
+ <th></th>
+ </tr>
+
+ [[[category:listProducts("CC_listProducts.html")]]]
+</table>
+<hr>
View
18 wwwroot/CC_product.tpl
@@ -0,0 +1,18 @@
+<h2>[[[product:name()]]]</h2>
+
+<div class="column">
+ <img style="width:150px;"
+ src=[[[product:img()]]]/>
+</div>
+
+<div class="column">
+ <strong>Price</strong>[[[product:price()]]] <br/>
+ <strong>Status</strong>status<br/>
+ <strong>Quantity: </strong>[[[product:quantityTextbox(small_textbox)]]]<br/>
+ [[[product:buyLink()]]]
+</div>
+
+<div class="clear"></div>
+
+<h3>Product description</h3>
+[[[product:description()]]]
View
13 wwwroot/cartItem.html
@@ -0,0 +1,13 @@
+<tr>
+ <td>[[[cart:quantityTextbox(small_textbox)]]]</td>
+ <td class="fullwidth">
+ <a href="[[[product:url()]]]">
+ [[[product:name()]]]
+ </a>
+ </td>
+ <td>[[[product:price()]]]</td>
+ <td>[[[cart:rowTotal()]]]</td>
+ <td>updateBtn</td>
+ <td>[[[cart:deleteLink()]]]</td>
+</tr>
+
Please sign in to comment.
Something went wrong with that request. Please try again.