Subversion Repositories computer_asset_manager_v1

Rev

Rev 99 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

<?php
global $DATABASE_DEFINITION;
define ( MAX_INPUT_FIELD_DISPLAY, 40 ); // this is the maximum input field size
define ( IMAGE_DIRECTORY, '/pictures/' );  // relative URL where pictures are stored
define ( EDIT_IMAGE_HEIGHT, 100 );         // height for thumbnail of pictuers
define ( MAX_UPLOAD_FILE_SIZE, 1024*1024*10 ); // 10 meg
define (DEFAULT_TEXTAREA_HEIGHT, 5 );
define ( DEFAULT_TABLE, 'attrib');
   
   $DATABASE_DEFINITION = array(
   /* attributes that can be applied to a device */
   'attrib' => array( 
      'table name' => 'attrib',
      'key field' => 'attrib_id',
      'display columns' => array('attrib_category_id','added_date','name','keyname','removed_date','attrib_id'),
      'display query' => 'select attrib_category_id,added_date,name,keyname,removed_date,attrib_id from attrib',
      'field info' => array(
         'attrib_category_id' => array('display name' => 'attrib_category_id' , 'type' => 'lookup', 'table' => 'attrib_category', 'keyfield' => 'attrib_category_id', 'display_field' => 'name'),
         /* date record was added */
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
         /* the visible displayed name */
         'name' => array('display name' => 'name' , 'required' => true , 'type' => 'string' , 'width' => 64),
         /* used for sysinfo really needs to be separate table */
         'keyname' => array('display name' => 'keyname' , 'type' => 'string' , 'width' => 32),
         /* date record was deleted or supserceded */
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date','default' => null),
         'attrib_id' => array('display name' => 'attrib_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10)
      )
   ),
   /* just allows us to categorize attributes */
   '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 */
   'attrib_device' => array( 
      'table name' => 'attrib_device',
      'key field' => 'attrib_device_id',
      'display columns' => array('added_date','device_id','attrib_id','value','removed_date','attrib_device_id'),
      'display query' => 'select added_date,device_id,attrib_id,value,removed_date,attrib_device_id from attrib_device',
      'field info' => array(
         /* date record was added */
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
         'device_id' => array('display name' => 'device_id' , 'type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
         'attrib_id' => array('display name' => 'attrib_id' , 'type' => 'lookup', 'table' => 'attrib', 'keyfield' => 'attrib_id', 'display_field' => 'name'),
         /* The actual value of this attribute. */
         'value' => array('display name' => 'value' , 'type' => 'text'),
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date','default' => null),
         'attrib_device_id' => array('display name' => 'ID' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int')
      )
   )
);
?>