17 include_once (
'Class.Log.php');
34 var
$filter =
"/[A-Za-z0-9][A-Za-z0-9_]*/";
123 if (!is_array($this->array))
return;
124 if (($this->arrayobj ==
"FALSE") && !is_array($this->array[$this->
start])) {
127 if (($this->arrayobj ==
"TRUE") && !is_object($this->array[$this->start])) {
149 if (!isset($this->alpha_index))
return;
150 if (!isset($this->ordered_by))
return;
154 foreach ($this->array as $k => $v) {
155 if ($this->arrayobj ==
"TRUE") {
156 $initiale = substr($v->$this->ordered_by, 0, 1);
158 $initiale = substr($v[$this->ordered_by], 0, 1);
161 if ($initiale !=
'') {
162 if (!isset($lettre[$initiale])) {
163 $lettre[$initiale] = $this->
slice * (int)($ind / $this->
slice);
226 if (($this->alpha_index & 1)) $alpha_list = $alpha_up;
227 if (($this->alpha_index & 2)) $alpha_list = $alpha_low;
232 foreach ($alpha_list as $k => $car) {
233 if ($prev) $idx = $idx .
"|";
234 if (!isset($lettre[$car])) {
235 $idx = $idx .
" $car ";
238 $value[0] = $lettre[$car];
241 $idx = $idx .
" $link ";
247 $this->
table_cell($idx, 1,
"center",
"", isset($this->index_class) ? $this->index_class :
'',
"100%");
250 $this->
table_cell(
" ", 1,
"",
"",
"",
"100%");
258 if (!$this->heading)
return;
263 reset($this->fields);
264 foreach ($this->fields as $k => $v) {
265 if (isset($this->headcontent)) {
266 if (isset($this->headcontent[$v])) {
267 $val = $this->headcontent[$v];
275 if (isset($this->sortable_fields[$v])) {
280 $this->
table_heading_cell($val, isset($this->headattr[$v][
"span"]) ? $this->headattr[$v][
"span"] :
'', isset($this->headattr[$v][
"class"]) ? $this->headattr[$v][
"class"] :
'', isset($this->headattr[$v][
"align"]) ? $this->headattr[$v][
"align"] :
'');
289 foreach ($this->array as $key => $val) {
290 if ($ind++ < $this->
start)
continue;
291 if (($this->
slice > 0) && ($ind > ($this->
start + $this->
slice)))
break;
294 if ((!is_array($val)) && (!is_object($val)))
continue;
298 reset($this->fields);
299 foreach ($this->fields as $k => $v) {
300 if ($this->arrayobj ==
"TRUE") {
302 ######## BUG ########### echo $val->Parents->nomp;
305 if (isset($val[$v])) {
311 if (!isset($this->links[$v])) {
312 $this->
table_cell($curval, 1, isset($this->fieldsattr[$v][
"align"]) ? $this->fieldsattr[$v][
"align"] :
'', isset($this->fieldsattr[$v][
"wrap"]) ? $this->fieldsattr[$v][
"wrap"] :
'', isset($this->fieldsattr[$v][
"class"]) ? $this->fieldsattr[$v][
"class"] :
'', isset($this->fieldsattr[$v][
"width"]) ? $this->fieldsattr[$v][
"width"] :
'');
314 reset($this->links[$v][1]);
315 foreach ($this->links[$v][1] as $kk => $var) {
316 if ($this->arrayobj ==
"TRUE") {
319 if (isset($val[$var])) {
327 $this->
table_cell($link, 1, isset($this->fieldsattr[$v][
"align"]) ? $this->fieldsattr[$v][
"align"] :
'', isset($this->fieldsattr[$v][
"wrap"]) ? $this->fieldsattr[$v][
"wrap"] :
'', isset($this->fieldsattr[$v][
"class"]) ? $this->fieldsattr[$v][
"class"] :
'', isset($this->fieldsattr[$v][
"width"]) ? $this->fieldsattr[$v][
"width"] :
'');
336 if ($this->footing) {
338 reset($this->fields);
339 foreach ($this->fields as $k => $v) {
340 if (isset($this->footcontent)) {
341 if (isset($this->footcontent[$v])) {
342 $val = $this->footcontent[$v];
350 $this->
table_cell($val, isset($this->footattr[$v][
"span"]) ? $this->footattr[$v][
"span"] :
'', isset($this->footattr[$v][
"align"]) ? $this->footattr[$v][
"align"] :
'', isset($this->footattr[$v][
"wrap"]) ? $this->footattr[$v][
"wrap"] :
'', isset($this->footattr[$v][
"class"]) ? $this->footattr[$v][
"class"] :
'', isset($this->footattr[$v][
"width"]) ? $this->footattr[$v][
"width"] :
'');
360 if (!$this->
slice || ($this->
slice >=
sizeof($this->array)))
return;
364 $link_prev =
" ";
365 $link_next =
" ";
366 $link_first =
" ";
367 $link_last =
" ";
368 $this->
table_cell($link_prev, 5,
"",
"",
"",
"");
372 $page_num = (int)($this->
start / $this->
slice) + 1;
376 $values_first[0] = 0;
378 $values_last[0] =
sizeof(
$this->array) - (
sizeof($this->array) - (($page_tot - 1) * ($this->
slice)));
383 $link_first = $this->
create_link($this->page_link, $values_first, $this->
first);
386 if ($this->
start + $this->
slice <
sizeof($this->array)) {
390 $link_last = $this->
create_link($this->page_link, $values_last, $this->last);
393 $this->
table_cell($link_first, 1,
"left",
"",
"",
"10%");
394 $this->
table_cell($link_prev, 1,
"left",
"",
"",
"20%");
395 $this->
table_cell(
"$page_num/$page_tot", 1,
"center",
"",
"",
"20%");
396 $this->
table_cell($link_next, 1,
"right",
"",
"",
"20%");
397 $this->
table_cell($link_last, 1,
"right",
"",
"",
"10%");
404 if (isset($this->fields) || ($this->arrayobj ==
"TRUE"))
return;
406 list($key, $val) = each($this->array);
408 foreach ($val as $k => $v) {
409 if (preg_match($this->filter, $k)) $this->fields[] = $k;
415 $this->out = $this->out . sprintf(
"<table%s %s cellpadding=\"0\" %s %s >\n", isset($this->
class) ?
" class=$this->class" :
"", isset($this->border) ?
" border=$this->border" :
"", isset($this->cellspacing) ?
" cellspacing=$this->cellspacing" :
"", isset($this->width) ?
" width=$this->width" :
"");
420 $this->out = $this->out .
"</table>\n";
425 if (!$color && (isset($this->colortab))) {
428 $this->out = $this->out . sprintf(
" <tr%s%s%s>\n", $color ?
" bgcolor=$color" :
"", isset($this->
class) ?
" class=$this->class" :
"", $nbcol ?
" cols=$nbcol" :
"");
433 $this->out = $this->out .
" </tr>\n";
439 $this->out = $this->out . sprintf(
" <tr%s%s>\n", isset($this->index_class) ?
" class=\"$this->index_class\"" :
"", isset($this->indexcolor) ?
" bgcolor=$this->indexcolor" :
"");
444 $this->out = $this->out . sprintf(
" <tr%s%s>\n", isset($this->head_class) ?
" class=\"$this->head_class\"" :
"", isset($this->headcolor) ?
" bgcolor=$this->headcolor" :
"");
451 $w_class =
" class=$class";
453 if (isset($this->
class)) {
454 $w_class =
" class=$this->class";
457 $this->out = $this->out . sprintf(
" <th%s%s%s><p>%s</p></th>\n", $w_class, $colspan ?
" colspan=$colspan" :
"", $align ?
" align=$align" :
"", $val);
464 $w_class =
" class=$class";
466 if (isset($this->
class)) {
467 $w_class =
" class=$this->class";
470 $this->out = $this->out . sprintf(
" <td%s%s%s%s%s><p>%s </p></td>\n", $w_class, $colspan ?
" colspan=$colspan" :
"", $align ?
" align=$align" :
"", $wrap ?
" $wrap" :
"",
$width ?
" width=$width" :
"", $val);
479 $link =
"\$link = sprintf (\"\n<a href=\\\"" . $template .
"\\\">\"";
481 foreach ($values as $key => $val) {
482 $link = $link .
",\"" . $val .
"\"";
484 $link = $link .
");";
486 $link = $link . $text .
"</a>";
table_row_open($nbcol="", $color="")
create_link($template, $values, $text)
table_heading_cell($val, $colspan=1, $class="", $align="left")
table_cell($val, $colspan=1, $align="left", $wrap="", $class="", $width="")