ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
xhr_table.php
Go to the documentation of this file.
1
<?
php
2
3
/* yadl_spaceid - Skip Stamping */
4
5
// This script returns an HTML table
6
7
header(
'Content-type: text/html'
);
8
9
// Define defaults
10
$rows
= 1;
// default one row
11
$cols
= 1;
// default one column
12
13
// How many rows to get?
14
if
(strlen(
$_GET
[
'rows'
]) > 0) {
15
$rows
=
$_GET
[
'rows'
];
16
}
17
18
// How many columns
19
if
(strlen(
$_GET
[
'cols'
]) > 0) {
20
$cols
=
$_GET
[
'cols'
];
21
}
22
23
// Return the data
24
returnMarkup
(
$rows
,
$cols
);
25
26
function
returnMarkup
(
$rows
,
$cols
) {
27
// start the table
28
$markup =
"<table><thead><tr>"
;
29
30
// build the thead
31
for
(
$i
=0;
$i
<
$cols
;
$i
++) {
32
$markup = $markup.
"<th>header "
.
$i
.
"</th>"
;
33
}
34
$markup = $markup.
"</tr></thead><tbody>"
;
35
36
// build the tbody
37
for
($j=0; $j<
$rows
; $j++) {
38
$markup = $markup.
"<tr>"
;
39
for
(
$i
=0;
$i
<
$cols
;
$i
++) {
40
$markup = $markup.
"<td>data cell "
.$j.
"-"
.
$i
.
"</td>"
;
41
}
42
$markup = $markup.
"</tr>"
;
43
}
44
// end the table
45
$markup = $markup.
"</tbody></table>"
;
46
47
echo
$markup;
48
}
49
?>
$_GET
$_GET["client_id"]
Definition:
cfg.phpunit.template.php:12
$rows
$rows
Definition:
xhr_table.php:10
echo
returnMarkup
returnMarkup($rows, $cols)
Definition:
xhr_table.php:26
$i
$i
Definition:
disco.tpl.php:19
php
$cols
$cols
Definition:
xhr_table.php:11
libs
bower
bower_components
yui2
src
datasource
tests
php
xhr_table.php
Generated on Thu Jan 16 2025 19:01:37 for ILIAS by
1.8.13 (using
Doxyfile
)