Subversion Repositories computer_asset_manager_v1

Rev

Rev 101 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
101 rodolico 1
<?php
2
 
3
   function attributeView( $parameters ) {
4
      //if ( isset( $parameters['device_id'] ) ) {
5
         $where = "attrib_device.device_id = $parameters[device_id]";
6
         $join = 'join device on (device.device_id = attrib_device.device_id)';
7
      /*
8
      } elseif ( isset( $parameters['site_id'] ) ) {
9
         $where = "owner_type = 's' and owner_id = $parameters[site_id]";
10
         $join = 'join site on (site.site_id = file.owner_id)';
11
      } elseif ( isset( $parameters['client_id'] ) ) {
12
         $where = "owner_type = 'c' and owner_id = $parameters[client_id]";
13
         $join = 'join client on (client.client_id = file.owner_id)';
14
      } else {
15
         return null;
16
      }
17
      */
18
      //$nameField = queryHTMLLink( 'modules/file/display.php?file_id=', 'attri', 'file.name', true );
19
      //$deleteField = queryHTMLLink( 'modules/file/delete.php?file_id=', 'file.file_id', "'Delete'" );
20
      //$editField = queryHTMLLink( 'modules/file/upload_file.html?file_id=', 'file.file_id', "'Edit'" );
21
      //concat( '<a href=\"', file.file_id, '\"', 'target=\"_blank\">', file.name, '</a>')      
22
      $query = "select 
23
                   attrib.name 'Name', 
102 rodolico 24
                   attrib_device.value 'Description'
101 rodolico 25
                from attrib_device
26
                     left outer join attrib using (attrib_id)
27
                     $join
28
                where
29
                   $where
30
                   and attrib_device.removed_date is null
31
                order by attrib.name, attrib_device.added_date";
32
      //print "<pre>$query</pre>";
33
      return queryToTable( $query );
34
   }
35
 
36
   function queryAttribHTMLLink ( $url, $hrefLink, $hrefDisplay, $newPage = false ) {
37
      return "concat( '<a href=\"', '$url', $hrefLink, '\"'," . ( $newPage ? " 'target=\"_blank\"', " : '' ) . "'>', $hrefDisplay, '</a>')";
38
   }
39
 
40
?>