diff options
Diffstat (limited to 'demos/currency-converter/protected')
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 |