ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
7header('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?
14if(strlen($_GET['rows']) > 0) {
15 $rows = $_GET['rows'];
16}
17
18// How many columns
19if(strlen($_GET['cols']) > 0) {
20 $cols = $_GET['cols'];
21}
22
23// Return the data
25
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["client_id"]
An exception for terminatinating execution or to throw for unit testing.
$i
Definition: metadata.php:24
$cols
Definition: xhr_table.php:11
returnMarkup($rows, $cols)
Definition: xhr_table.php:26
$rows
Definition: xhr_table.php:10