Changeset 34 for trunk/phpgwapi/inc/adodb/tohtml.inc.php
- Timestamp:
- 06/29/07 15:17:46 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpgwapi/inc/adodb/tohtml.inc.php
r2 r34 1 1 <?php 2 2 /* 3 V4. 51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.3 V4.93 10 Oct 2006 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved. 4 4 Released under both BSD license and Lesser GPL library license. 5 5 Whenever there is any discrepancy between the two licenses, … … 10 10 11 11 // specific code for tohtml 12 GLOBAL $gSQLMaxRows,$gSQLBlockRows; 13 12 GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND; 13 14 $ADODB_ROUND=4; // rounding 14 15 $gSQLMaxRows = 1000; // max no of rows to download 15 16 $gSQLBlockRows=20; // max no of rows per table block … … 36 37 // 37 38 // RETURNS: number of rows displayed 39 40 38 41 function rs2html(&$rs,$ztabhtml=false,$zheaderarray=false,$htmlspecialchars=true,$echo = true) 39 42 { 40 43 $s ='';$rows=0;$docnt = false; 41 GLOBAL $gSQLMaxRows,$gSQLBlockRows ;44 GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND; 42 45 43 46 if (!$rs) { … … 53 56 for ($i=0; $i < $ncols; $i++) { 54 57 $field = $rs->FetchField($i); 55 if ($zheaderarray) $fname = $zheaderarray[$i]; 56 else $fname = htmlspecialchars($field->name); 57 $typearr[$i] = $rs->MetaType($field->type,$field->max_length); 58 //print " $field->name $field->type $typearr[$i] "; 59 58 if ($field) { 59 if ($zheaderarray) $fname = $zheaderarray[$i]; 60 else $fname = htmlspecialchars($field->name); 61 $typearr[$i] = $rs->MetaType($field->type,$field->max_length); 62 //print " $field->name $field->type $typearr[$i] "; 63 } else { 64 $fname = 'Field '.($i+1); 65 $typearr[$i] = 'C'; 66 } 60 67 if (strlen($fname)==0) $fname = ' '; 61 68 $hdr .= "<TH>$fname</TH>"; … … 78 85 switch($type) { 79 86 case 'D': 80 if (!strpos($v,':')) { 87 if (empty($v)) $s .= "<TD> </TD>\n"; 88 else if (!strpos($v,':')) { 81 89 $s .= " <TD>".$rs->UserDate($v,"D d, M Y") ." </TD>\n"; 82 break;83 90 } 91 break; 84 92 case 'T': 85 $s .= " <TD>".$rs->UserTimeStamp($v,"D d, M Y, h:i:s") ." </TD>\n"; 93 if (empty($v)) $s .= "<TD> </TD>\n"; 94 else $s .= " <TD>".$rs->UserTimeStamp($v,"D d, M Y, h:i:s") ." </TD>\n"; 86 95 break; 96 97 case 'N': 98 if (abs(abs($v) - round($v,0)) < 0.00000001) 99 $v = round($v); 100 else 101 $v = round($v,$ADODB_ROUND); 87 102 case 'I': 88 case 'N':89 103 $s .= " <TD align=right>".stripslashes((trim($v))) ." </TD>\n"; 90 104
Note: See TracChangeset
for help on using the changeset viewer.