
/**
 * $Id: MoxTable.js,v 1.1.2.3 2006/06/11 18:28:40 cschmidt Exp $
 */
 
 
function MoxTable() {
 	
 	this.arrData = new Array();
 	this.nTableCount = null;
 	
 	/** sum of columns in the db */
 	this.setTableCount = function (nTableCount) {
 		this.nTableCount = nTableCount;
 	}
 	
 	
 	/** return sum of columns from the table without limit */
 	this.getTableCount = function () {
 		return this.nTableCount;
 	}
 	
 	/** add a moxdata-object to the table*/
 	this.add = function (moxData){
		this.arrData[this.arrData.length] = moxData; 	
 	}
 	
 	/** returns all data in the tableobject */
 	this.getDatas = function getDatas(){
 		return this.arrData;
 	}
 
}


function MoxData(){
	
	this.arrData = new Array();
	this.arrDataNames = new Array();
	this.arrDataValue = new Array();
	/** set the id from object */
	this.setID = function (sValue) {
		this.arrData["id"] = sValue;
	}
	
	this.getID = function () {
		return this.arrData["id"];
	}
	
	/** set a data by param */
	this.setData = function (sParam, sValue) {
		this.arrData[sParam] = sValue;
		this.arrDataNames[this.arrDataNames.length] = sParam;
		this.arrDataValue[this.arrDataValue.length] = sValue;
	}
	
	/** get data over the param */
	this.getData = function (sParam) {
		return this.arrData[sParam];
	}
	
	/** get the data array */
	this.getDatas = function () {
		return this.arrData;
	}
	
	/** get the data array */
	this.getNames = function () {
		return this.arrDataNames;
	}
	
	/** get the data array */
	this.getValues = function () {
		return this.arrDataValue;
	}
	
	this.hasData = function (sParam) {
		return this.arrData[sParam]!=null;
	}
	
	this.toString = function () {
		var sOut ="";
		for(var i=0;i<this.arrDataNames.length;i++) {
			var sName = this.arrDataNames[i];
			sOut +=  sName + "=" + this.arrData[sName]+"<br>\n";
		}
		return sOut;
	}
	
}







