Subversion Repositories computer_asset_manager_v1

Rev

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

<?php

   global $DATABASE_DEFINITION;
   include_once( '../../includes/database.php' );

   /* attributes that can be applied to a device */
   $DATABASE_DEFINITION['attrib'] =   array( 
      'table name' => 'attrib',
      'key field' => 'attrib_id',
      'display columns' => array('name','multiples','attrib_id','added_date','keyname','attrib_category_id','removed_date'),
      'display query' => 'select name,multiples,attrib_id,added_date,keyname,attrib_category_id,removed_date from attrib',
      'field info' => array(
         /* the visible displayed name */
         'name' => array('display name' => 'name' , 'required' => true , 'type' => 'string' , 'width' => 64),
         /* set to true if ultiple entries are allowed */
         'multiples' => array('display name' => 'multiples' , 'type' => 'string' , 'width' => 1),
         'attrib_id' => array('display name' => 'attrib_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
         /* date record was added */
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
         /* used for sysinfo really needs to be separate table */
         'keyname' => array('display name' => 'keyname' , 'type' => 'string' , 'width' => 32),
         'attrib_category_id' => array('display name' => 'attrib_category_id' , 'type' => 'lookup', 'table' => 'attrib_category', 'keyfield' => 'attrib_category_id', 'display_field' => 'name'),
         /* date record was deleted or supserceded */
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date')
      )
   );
   /* just allows us to categorize attributes */
   $DATABASE_DEFINITION['attrib_category']  = array( 
      'table name' => 'attrib_category',
      'key field' => 'attrib_category_id',
      'display columns' => array('attrib_category_id','added_date','name'),
      'display query' => 'select attrib_category_id,added_date,name from attrib_category',
      'field info' => array(
         'attrib_category_id' => array('display name' => 'attrib_category_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
         /* When this category was added */
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
         'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64)
      )
   );
   /* links devices and their attributes together */
   $DATABASE_DEFINITION['attrib_device'] = array( 
      'table name' => 'attrib_device',
      'key field' => 'attrib_device_id',
      'display name' => 'Device Attributes',
      'display columns' => array('attrib_device_id','device_id','attrib_id','value','added_date','removed_date'),
      'display query' => 'select attrib_device_id,attrib_id,value,device_id,added_date,removed_date from attrib_device',
      'field info' => array(
         'attrib_device_id' => array('display name' => 'attrib_device_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
         'device_id' => array('display name' => 'Device' , 'type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
         'attrib_id' => array('display name' => 'Attribute' , 'type' => 'lookup', 'table' => 'attrib', 'keyfield' => 'attrib_id', 'display_field' => 'name'),
         /* The actual value of this attribute. */
         'value' => array('display name' => 'value' , 'type' => 'text'),
         /* date record was added */
         'added_date' => array('display name' => 'Added' , 'required' => true , 'type' => 'date'),
         'removed_date' => array('display name' => 'Removed Date' , 'type' => 'date')
      )
   );
?>