Permalink
Browse files

location area name is now displayed in list items

  • Loading branch information...
1 parent e37a355 commit 63e1850bb0a27b53341028dedbf9a757dc45f2e8 Spiros Ioannou committed May 1, 2012
Showing with 10 additions and 4 deletions.
  1. +8 −3 php/datatables_listitems_ajax.php
  2. +2 −1 php/listitems.php
@@ -9,8 +9,9 @@
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
- $aColumns = array('itemid','typedesc','title','itemmodel','dnsname','serial','itemlabel','purchasedate','remdays','username',
- 'statusdesc','name','rackinfo','purchprice','macs','ipv4','ipv6','remadmip','taginfo','softinfo');
+ $aColumns = array('itemid','typedesc','title','itemmodel','dnsname','serial','itemlabel','purchasedate',
+ 'remdays','username','statusdesc','locationname','areaname','rackinfo','purchprice','macs','ipv4','ipv6',
+ 'remadmip','taginfo','softinfo');
include( '../init.php');
@@ -126,6 +127,7 @@
items.id AS itemid,
items.model AS itemmodel,
items.label AS itemlabel,
+ locations.name as locationname,
sn || ' ' || sn2 || ' ' || sn3 AS serial,
(purchasedate+warrantymonths*30*24*60*60-$t)/(60*60*24) AS remdays,
racks.label || ' ' || racks.usize || ' ' || racks.model AS rackinfo,
@@ -138,6 +140,7 @@
JOIN users ON items.userid=users.id
JOIN statustypes ON items.status=statustypes.id
LEFT OUTER JOIN locations ON items.locationid=locations.id
+ LEFT OUTER JOIN locareas ON items.locareaid=locareas.id
LEFT OUTER JOIN racks ON items.rackid=racks.id
$sWhere";
$sth=db_execute($dbh,$sQueryCnt);
@@ -165,7 +168,8 @@
purchasedate,
users.username,
statustypes.statusdesc,
- locations.name,
+ locations.name as locationname,
+ locareas.areaname,
sn || ' ' || sn2 || ' ' || sn3 AS serial,
(purchasedate+warrantymonths*30*24*60*60-$t)/(60*60*24) AS remdays,
racks.label || ' ' || racks.usize || ' ' || racks.model AS rackinfo,
@@ -180,6 +184,7 @@
JOIN statustypes ON items.status=statustypes.id
JOIN users ON items.userid=users.id
LEFT OUTER JOIN locations ON items.locationid=locations.id
+ LEFT OUTER JOIN locareas ON items.locareaid=locareas.id
LEFT OUTER JOIN racks ON items.rackid=racks.id
$sWhere
$sOrder
View
@@ -87,6 +87,7 @@
<th><?php te("User");?></th>
<th><?php te("Status");?></th>
<th><?php te("Location");?></th>
+<th><?php te("Area");?></th>
<th><?php te("Rack");?></th>
<th><?php te("PurchPrice");?></th>
<th><?php te("MACs");?></th>
@@ -98,7 +99,7 @@
</tr>
</thead>
<tbody>
- <td colspan="18" class="dataTables_empty"><?php te("Loading data from server");?></td>
+ <tr> <td colspan="21" class="dataTables_empty"><?php te("Loading data from server");?></td> </tr>
</tbody>
</table>

0 comments on commit 63e1850

Please sign in to comment.