FIrst pass implementation to accept payments. Nowhere near complete, but things are working relatively well, and I have a plethora of different attempts saved in comment blocks. I really want to clean up though, so I'm snapshotting it.

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@99 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-12 01:49:24 +00:00
parent ff5c7260f8
commit d45481b770
8 changed files with 1301 additions and 53 deletions

View File

@@ -136,6 +136,61 @@ table.list.ledger td.date.receipt { padding-left: 1em; }
table.list.ledger td.evnrow { background: #f4f4f4; }
/************************************************************
************************************************************
* Forms
*/
form {
margin-right: 20px;
padding: 0;
width: 80%;
}
fieldset {
border: 1px solid #ccc;
margin-top: 4px;
/* padding: 4px 4px; */
}
fieldset legend {
/* background:#fff; */
/* color: #e32; */
/* font-size: 120%; */
font-weight: bold;
}
fieldset fieldset {
margin: 4px 4px;
/* margin-bottom: 20px; */
padding: 4px 4px;
}
fieldset fieldset legend {
font-size: 100%;
font-weight: normal;
}
fieldset fieldset div {
clear: left;
/* margin: 0 20px; */
}
form div {
clear: both;
/* margin-bottom: 1em; */
/* padding: .5em; */
vertical-align: text-top;
}
form div.input {
color: #444;
}
form div.required {
color: #333;
font-weight: bold;
}
form div.submit {
border: 0;
clear: both;
margin-top: 10px;
margin-left: 140px;
}
/************************************************************
************************************************************
* General Style Info
@@ -189,17 +244,3 @@ h4 {
}
/* Forms */
}
input[type=checkbox] {
clear: left;
float: left;
margin: 0px 6px 7px 2px;
width: auto;
}
input[type=radio] {
float:left;
width:auto;
margin: 0 3px 7px 0;
}

116
webroot/js/pmgr.js Normal file
View File

@@ -0,0 +1,116 @@
/**
* Function : dump()
* Arguments: The data - array,hash(associative array),object
* The level - OPTIONAL
* Returns : The textual representation of the array.
* This function was inspired by the print_r function of PHP.
* This will accept some data as the argument and return a
* text that will be a more readable version of the
* array/hash/object that is given.
* Docs: http://www.openjs.com/scripts/others/dump_function_php_print_r.php
*/
function dump(arr,level) {
var dumped_text = "";
if(!level) level = 0;
//The padding given at the beginning of the line.
var level_padding = "";
for(var j=0;j<level+1;j++) level_padding += " ";
if(typeof(arr) == 'object') { //Array/Hashes/Objects
for(var item in arr) {
var value = arr[item];
if(typeof(value) == 'object') { //If it is an array,
dumped_text += level_padding + "'" + item + "' ...\n";
dumped_text += dump(value,level+1);
} else {
dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
}
}
} else { //Stings/Chars/Numbers etc.
dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
}
return dumped_text;
}
function var_dump(element, limit, depth)
{
depth = depth?depth:0;
limit = limit?limit:1;
returnString = '<ol>';
for(property in element)
{
//Property domConfig isn't accessable
if (property != 'domConfig')
{
returnString += '<li><strong>'+ property + '</strong> <small>(' + (typeof element[property]) +')</small>';
if (typeof element[property] == 'number' || typeof element[property] == 'boolean')
returnString += ' : <em>' + element[property] + '</em>';
if (typeof element[property] == 'string' && element[property])
returnString += ': <div style="background:#C9C9C9;border:1px solid black; overflow:auto;"><code>' +
element[property].replace(/</g, '&amp;lt;').replace(/>/g, '&amp;gt;') + '</code></div>';
if ((typeof element[property] == 'object') && (depth < limit))
returnString += var_dump(element[property], limit, (depth + 1));
returnString += '</li>';
}
}
returnString += '</ol>';
if(depth == 0)
{
winpop = window.open("", "","width=800,height=600,scrollbars,resizable");
winpop.document.write('<pre>'+returnString+ '</pre>');
winpop.document.close();
}
return returnString;
}
function htmlEncode(s)
{
//return s;
return s.replace(/&(?!\w+([;\s]|$))/g, "&amp;")
.replace(/</g, "&lt;").replace(/>/g, "&gt;");
}
function addDiv(id_name, div_name, into_div_name, flash, html, script) {
var id = $('#'+id_name).val();
html = '<DIV class="added-div" id="'+div_name+'-'+id+'">' +
html.replace(/%{id}/g, id)
.replace(/%{remove(:([^}]*))?}/g,
'<SPAN class="remove-div-link">' +
'<A HREF="#" onClick="removeElement' + "('"+div_name+"-"+id+"')" + '; return false;">' +
("$2" == "" ? "$2" : 'remove') + '</A>' + '</SPAN>') +
'</DIV>';
if (script != "") {
html += '<SCRIPT TYPE="text/javascript">';
html += script.replace(/%{id}/g, id);
html += '</SCRIPT>';
}
$("#debug").append(htmlEncode(html));
$("#"+into_div_name).append(html);
if (flash) {
$('#'+div_name+'-'+id)
.animate({ backgroundColor: "yellow" }, 300)
.animate({ backgroundColor: "white" }, 500);
}
id = id - 0 + 1;
$('#'+id_name).val(id);
}
function removeElement(elem_id) {
$('#'+elem_id).remove();
}