]> git.nbdom.net Git - nb.git/commitdiff
db.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 23 Jun 2015 16:25:00 +0000 (17:25 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 23 Jun 2015 16:25:00 +0000 (17:25 +0100)
lib/php/db.php

index 73880cd1a76b66201a0d9f5c480d43f390540db8..56f838d02a45d70e9a45f4dab7a0cf945bce8b09 100644 (file)
@@ -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] = '<a href="'.$count_fields.'">' . $row[$f] . '</a>';
+        }
+
+        $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 = '<table class="'.$this->name.' rows border">'.PHP_EOL;
 
     $html .= '<tr class="'.$this->name.' row bold">';
+    #$html .= '<th class="EDIT"></th>';
     foreach (array_keys($this->fields()) as $f) {
       $html .= '<th class="'.$f.'">'.$this->url_sort($f).'</th>';
     }