From: Nicolas Boisselier Date: Tue, 23 Jun 2015 16:25:00 +0000 (+0100) Subject: db.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=d9b98b0401851e3cbda0bc6e6d4850e66a89bfbe;p=nb.git db.php --- diff --git a/lib/php/db.php b/lib/php/db.php index 73880cd1..56f838d0 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -663,16 +663,24 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. $count = 0; while ($row = $st->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) { - $count ++; + $count++; + $count_fields = 0; foreach ($this->fields() as $f => $spec) { if (!$spec['extra']) { if ($escape) $row[$f] = htmlspecialchars($row[$f]); } + if ($this->db->type == 'sqlite' and preg_match('/^float\((?:\d+,)?(\d+)\)/',$spec['type'],$m)) { $row[$f] = sprintf('%.'.$m[1].'f',$row[$f]); } + + if ($count_fields === 0) { + #$row[$f] = '' . $row[$f] . ''; + } + + $count_fields++; /* only if in latin1 if ($_REQUEST['format'] == 'csv') { $row[$f] = utf8_encode($row[$f]); @@ -684,6 +692,7 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. } + #if ($format == 'table') array_unshift($row,'EDIT'); echo $this->{"rows_rec_$format"}($row); } @@ -790,6 +799,7 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. $html = ''.PHP_EOL; $html .= ''; + #$html .= ''; foreach (array_keys($this->fields()) as $f) { $html .= ''; }
'.$this->url_sort($f).'