colums and rows from the same items

Im still working on a competition-system for a lanparty. I want to make a new form to enter matches’ scores. It should look like this:

               Clan 1      BHG       Clan 3
Clan 1          X          2-1 (3)
BHG            1-2 (0)      X
Clan 3                                X

Note: The number between ( and ) doesnt have to be there
Note: I can live with it to show this, and when you click an a item, you get an entrie in a tabpanel of the selected item where you can enter the scores.

In this case all clans from the selected poule has to be both row and column. And the value of the table must be showed. How can i make this?

I would suggest you write a method that takes the list of “clans” and scores and displays it in a table using HTML in an HTML area.

In each cell of the table you can put a hyperlink which calls a servoy method which can handle the data entry. The hyperlink can send parameters to the method telling it what “clan’s” scores are being edited/entered.

For entering the scores you could either provide fields right on the same form and a “save” button, or you could open a separate form using showFormInDialog().

Once a score has been entered, save the entered data to the db and rebuild the html table to reflect the change.

If you need more specifics let me know.

Thank! that really helped, but I got stuck again. I’ve quite a nasty structure to store the data. To show you, I’ve put a screenshot from phpMyAdmin in the attachment. As you can see, a clan can be in both clan1_id and clan2_id and so is its score.
In the table I want to make, an item always has to be in 2 cells, as you can see in my previous example.

How do you think, I can get the values in the right box?

One thing i came up with:
Create a dataset with all values an store them in a second array. In case of the screenshot, this array would look like this:

scnd_array[1][2] = “110 - 115 (0)”
scnd_array[2][1] = “115 - 110 (3)”
scnd_array[3][4] = “8 - 2 (3)”
scnd_array[4][3] = “2 - 8 (0)”

In this case, this would work quite well when you look at the keys (i++), but when clans 12,19,3 and 1 are in one poule this get kinda nasty.

So, is this a good idea and is this key-problem fixable, or do you have another way to achieve this

In this case AND if I knew more about the programming language, something like this should do the trick:

var query = "SELECT * FROM `match`"
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 100);

var scnd_array = new Array();
for ( var i = 1 ; i <= dataset.getMaxRowIndex() ; i++ )
{
    dataset.rowIndex = i;
	if(dataset[3] > dataset[5])
	{
		scnd_array[dataset[2]][dataset[4]] = dataset[3] + "-" + dataset[5] + "(3)";
		scnd_array[dataset[4]][dataset[2]] = dataset[5] + "-" + dataset[3] + "(0)";
	}
	if(dataset[3] < dataset[5])
	{
		scnd_array[dataset[2]][dataset[4]] = dataset[3] + "-" + dataset[5] + "(0)";
		scnd_array[dataset[4]][dataset[2]] = dataset[5] + "-" + dataset[3] + "(3)";
	}
	if(dataset[3] < dataset[5])
	{
		scnd_array[dataset[2]][dataset[4]] = dataset[3] + "-" + dataset[5] + "(1)";
		scnd_array[dataset[4]][dataset[2]] = dataset[5] + "-" + dataset[3] + "(1)";
	}
}

var temp_html = '<html><table>' // starts the html string

for ( var i = 1 ; i <= 4 ; i++ )
{
	temp_html += '<tr>';
	for ( var j = 1 ; j <= 4 ; j++ )
	{
		temp_html += '<td>' + scnd_array[i][j] + '</td>';
	}
	temp_html += '</tr>';
}

temp_html += '</tr></table></html>' // closes the html string 
globals.html_match_table = temp_html;

What do I do wrong here?