r1420 + while() cycle cleanup
authorDenis Ovsienko <infrastation@yandex.ru>
Mon, 24 Dec 2007 16:43:16 +0000 (16:43 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 24 Dec 2007 16:43:16 +0000 (16:43 +0000)
inc/database.php

index ad35bfa5e53c9a557ef973c9660168c58ff0365e..12f7d3f7efa46bd7377a7f81f76cfb320908bb06 100644 (file)
@@ -67,10 +67,19 @@ function getObjectList ($type_id = 0)
                return;
        }
        $ret = array();
-       $clist = array ('id', 'name', 'label', 'barcode', 'objtype_name', 'objtype_id', 'asset_no', 'rack_id', 'Rack_name');
        while ($row = $result->fetch (PDO::FETCH_ASSOC))
        {
-               foreach ($clist as $dummy => $cname)
+               foreach (array (
+                       'id',
+                       'name',
+                       'label',
+                       'barcode',
+                       'objtype_name',
+                       'objtype_id',
+                       'asset_no',
+                       'rack_id',
+                       'Rack_name'
+                       ) as $cname)
                        $ret[$row['id']][$cname] = $row[$cname];
                $ret[$row['id']]['dname'] = displayedName ($ret[$row['id']]);
        }