summaryrefslogtreecommitdiff
path: root/demos/currency-converter/protected
diff options
context:
space:
mode:
authorwei <>2006-12-23 00:22:48 +0000
committerwei <>2006-12-23 00:22:48 +0000
commit6b685cc4e496c5eabbb3e6415fb7fdf0474bf0f1 (patch)
tree7a5859c07da28454b894a3ca003fede8880da4e4 /demos/currency-converter/protected
parent2c221ea67d0512961beea8fbcb30b23865c16bb0 (diff)
add currency-converter tutorial
Diffstat (limited to 'demos/currency-converter/protected')
-rw-r--r--demos/currency-converter/protected/.htaccess1
-rw-r--r--demos/currency-converter/protected/pages/Home.page51
-rw-r--r--demos/currency-converter/protected/pages/Home.php15
-rw-r--r--demos/currency-converter/protected/runtime/global.cache1
4 files changed, 68 insertions, 0 deletions
diff --git a/demos/currency-converter/protected/.htaccess b/demos/currency-converter/protected/.htaccess
new file mode 100644
index 00000000..3418e55a
--- /dev/null
+++ b/demos/currency-converter/protected/.htaccess
@@ -0,0 +1 @@
+deny from all \ No newline at end of file
diff --git a/demos/currency-converter/protected/pages/Home.page b/demos/currency-converter/protected/pages/Home.page
new file mode 100644
index 00000000..47b91344
--- /dev/null
+++ b/demos/currency-converter/protected/pages/Home.page
@@ -0,0 +1,51 @@
+<%@ Theme="Basic" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
+<com:THead Title="Currency Converter" />
+<body>
+<com:TForm>
+ <fieldset>
+ <legend>Currency Converter</legend>
+ <div class="rate-field">
+ <com:TLabel ForControl="currencyRate" Text="Exchange Rate per $1:" />
+ <com:TTextBox ID="currencyRate" />
+ <com:TRequiredFieldValidator
+ ControlToValidate="currencyRate"
+ Display="Dynamic"
+ ErrorMessage="Please enter a currency rate." />
+ <com:TCompareValidator
+ ControlToValidate="currencyRate"
+ DataType="Float"
+ ValueToCompare="0"
+ Operator="GreaterThan"
+ Display="Dynamic"
+ ErrorMessage="Please enter a positive currency rate." />
+ </div>
+ <div class="dollar-field">
+ <com:TLabel ForControl="dollars" Text="Dollars to Convert:" />
+ <com:TTextBox ID="dollars" />
+ <com:TRequiredFieldValidator
+ ControlToValidate="dollars"
+ Display="Dynamic"
+ ErrorMessage="Please enter the amount you wish to calculate." />
+ <com:TDataTypeValidator
+ ControlToValidate="dollars"
+ DataType="Float"
+ Display="Dynamic"
+ ErrorMessage="Please enter a number." />
+ </div>
+ <div class="total-field">
+ <span class="total-label">Amount in Other Currency:</span>
+ <com:TActiveLabel ID="total" CssClass="result" />
+ </div>
+ <div class="convert-button">
+ <com:TActiveButton Text="Convert" OnClick="convert_clicked" >
+ <prop:ClientSide.OnLoading>
+ $('<%= $this->total->ClientID %>').innerHTML = "calculating..."
+ </prop:ClientSide.OnLoading>
+ </com:TActiveButton>
+ </div>
+ </fieldset>
+</com:TForm>
+</body>
+</html> \ No newline at end of file
diff --git a/demos/currency-converter/protected/pages/Home.php b/demos/currency-converter/protected/pages/Home.php
new file mode 100644
index 00000000..dcf9339e
--- /dev/null
+++ b/demos/currency-converter/protected/pages/Home.php
@@ -0,0 +1,15 @@
+<?php
+Prado::using('System.Web.UI.ActiveControls.*');
+class Home extends TPage
+{
+ public function convert_clicked($sender, $param)
+ {
+ if($this->Page->IsValid)
+ {
+ $rate = floatval($this->currencyRate->Text);
+ $dollars = floatval($this->dollars->Text);
+ $this->total->Text = $rate * $dollars;
+ }
+ }
+}
+?> \ No newline at end of file
diff --git a/demos/currency-converter/protected/runtime/global.cache b/demos/currency-converter/protected/runtime/global.cache
new file mode 100644
index 00000000..81ed6269
--- /dev/null
+++ b/demos/currency-converter/protected/runtime/global.cache
@@ -0,0 +1 @@
+a:1:{s:35:"prado:securitymanager:validationkey";s:38:"44099869715766197794850216601377650299";} \ No newline at end of file