adodb 최신버전으로 변경

<? 를 <?php 로 변경
This commit is contained in:
2018-01-11 19:28:35 +09:00
parent feff33715f
commit 7b3b674dee
450 changed files with 19425 additions and 32248 deletions
+28 -28
View File
@@ -1,12 +1,14 @@
<?php
<?php
/*
V4.93 10 Oct 2006 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
@version v5.20.9 21-Dec-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Some pretty-printing by Chris Oxenreider <oxenreid@state.net>
*/
*/
// specific code for tohtml
GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
@@ -47,17 +49,17 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
printf(ADODB_BAD_RS,'rs2html');
return false;
}
if (! $ztabhtml) $ztabhtml = "BORDER='1' WIDTH='98%'";
//else $docnt = true;
$typearr = array();
$ncols = $rs->FieldCount();
$hdr = "<TABLE COLS=$ncols $ztabhtml><tr>\n\n";
for ($i=0; $i < $ncols; $i++) {
for ($i=0; $i < $ncols; $i++) {
$field = $rs->FetchField($i);
if ($field) {
if ($zheaderarray) $fname = $zheaderarray[$i];
else $fname = htmlspecialchars($field->name);
else $fname = htmlspecialchars($field->name);
$typearr[$i] = $rs->MetaType($field->type,$field->max_length);
//print " $field->name $field->type $typearr[$i] ";
} else {
@@ -70,17 +72,17 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
$hdr .= "\n</tr>";
if ($echo) print $hdr."\n\n";
else $html = $hdr;
// smart algorithm - handles ADODB_FETCH_MODE's correctly by probing...
$numoffset = isset($rs->fields[0]) ||isset($rs->fields[1]) || isset($rs->fields[2]);
while (!$rs->EOF) {
$s .= "<TR valign=top>\n";
for ($i=0; $i < $ncols; $i++) {
if ($i===0) $v=($numoffset) ? $rs->fields[0] : reset($rs->fields);
else $v = ($numoffset) ? $rs->fields[$i] : next($rs->fields);
$type = $typearr[$i];
switch($type) {
case 'D':
@@ -89,7 +91,7 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
if (empty($v)) {
$s .= "<TD> &nbsp; </TD>\n";
} else {
$s .= " <TD>".$rs->UserDate($v,"D d, M Y") ."</TD>\n";
$s .= " <TD>".$rs->UserDate($v,"D d, M Y") ."</TD>\n";
}
break;
}
@@ -97,7 +99,7 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
if (empty($v)) $s .= "<TD> &nbsp; </TD>\n";
else $s .= " <TD>".$rs->UserTimeStamp($v,"D d, M Y, H:i:s") ."</TD>\n";
break;
case 'N':
if (abs(abs($v) - round($v,0)) < 0.00000001)
$v = round($v);
@@ -107,7 +109,7 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
$vv = stripslashes((trim($v)));
if (strlen($vv) == 0) $vv .= '&nbsp;';
$s .= " <TD align=right>".$vv ."</TD>\n";
break;
/*
case 'B':
@@ -134,11 +136,11 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
$v = trim($v);
if (strlen($v) == 0) $v = '&nbsp;';
$s .= " <TD>". str_replace("\n",'<br>',stripslashes($v)) ."</TD>\n";
}
} // for
$s .= "</TR>\n\n";
$rows += 1;
if ($rows >= $gSQLMaxRows) {
$rows = "<p>Truncated at $gSQLMaxRows</p>";
@@ -146,10 +148,10 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
} // switch
$rs->MoveNext();
// additional EOF check to prevent a widow header
if (!$rs->EOF && $rows % $gSQLBlockRows == 0) {
//if (connection_aborted()) break;// not needed as PHP aborts script, unlike ASP
if ($echo) print $s . "</TABLE>\n\n";
else $html .= $s ."</TABLE>\n\n";
@@ -159,17 +161,17 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows,$ADODB_ROUND;
if ($echo) print $s."</TABLE>\n\n";
else $html .= $s."</TABLE>\n\n";
if ($docnt) if ($echo) print "<H2>".$rows." Rows</H2>";
return ($echo) ? $rows : $html;
}
// pass in 2 dimensional array
function arr2html(&$arr,$ztabhtml='',$zheaderarray='')
{
if (!$ztabhtml) $ztabhtml = 'BORDER=1';
$s = "<TABLE $ztabhtml>";//';print_r($arr);
if ($zheaderarray) {
@@ -179,11 +181,11 @@ function arr2html(&$arr,$ztabhtml='',$zheaderarray='')
}
$s .= "\n</TR>";
}
for ($i=0; $i<sizeof($arr); $i++) {
$s .= '<TR>';
$a = $arr[$i];
if (is_array($a))
if (is_array($a))
for ($j=0; $j<sizeof($a); $j++) {
$val = $a[$j];
if (empty($val)) $val = '&nbsp;';
@@ -197,5 +199,3 @@ function arr2html(&$arr,$ztabhtml='',$zheaderarray='')
$s .= '</TABLE>';
print $s;
}
?>