Subversion Repositories computer_asset_manager_v1

Rev

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

Rev Author Line No. Line
99 rodolico 1
<?php
2
global $DATABASE_DEFINITION;
101 rodolico 3
define ( MAX_INPUT_FIELD_DISPLAY, 40 ); // this is the maximum input field size
4
define ( IMAGE_DIRECTORY, '/pictures/' );  // relative URL where pictures are stored
5
define ( EDIT_IMAGE_HEIGHT, 100 );         // height for thumbnail of pictuers
6
define ( MAX_UPLOAD_FILE_SIZE, 1024*1024*10 ); // 10 meg
7
define (DEFAULT_TEXTAREA_HEIGHT, 5 );
8
define ( DEFAULT_TABLE, 'attrib');
9
 
10
   $DATABASE_DEFINITION = array(
11
   /* attributes that can be applied to a device */
12
   'attrib' => array( 
99 rodolico 13
      'table name' => 'attrib',
14
      'key field' => 'attrib_id',
101 rodolico 15
      'display columns' => array('attrib_category_id','added_date','name','keyname','removed_date','attrib_id'),
16
      'display query' => 'select attrib_category_id,added_date,name,keyname,removed_date,attrib_id from attrib',
99 rodolico 17
      'field info' => array(
101 rodolico 18
         'attrib_category_id' => array('display name' => 'attrib_category_id' , 'type' => 'lookup', 'table' => 'attrib_category', 'keyfield' => 'attrib_category_id', 'display_field' => 'name'),
99 rodolico 19
         /* date record was added */
101 rodolico 20
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
21
         /* the visible displayed name */
22
         'name' => array('display name' => 'name' , 'required' => true , 'type' => 'string' , 'width' => 64),
23
         /* used for sysinfo really needs to be separate table */
24
         'keyname' => array('display name' => 'keyname' , 'type' => 'string' , 'width' => 32),
25
         /* date record was deleted or supserceded */
26
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date','default' => null),
27
         'attrib_id' => array('display name' => 'attrib_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10)
99 rodolico 28
      )
101 rodolico 29
   ),
30
   /* just allows us to categorize attributes */
31
   'attrib_category' => array( 
32
      'table name' => 'attrib_category',
33
      'key field' => 'attrib_category_id',
34
      'display columns' => array('attrib_category_id','added_date','name'),
35
      'display query' => 'select attrib_category_id,added_date,name from attrib_category',
36
      'field info' => array(
37
         'attrib_category_id' => array('display name' => 'attrib_category_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
38
         /* When this category was added */
39
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
40
         'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64)
41
      )
42
   ),
43
   /* links devices and their attributes together */
44
   'attrib_device' => array( 
99 rodolico 45
      'table name' => 'attrib_device',
46
      'key field' => 'attrib_device_id',
101 rodolico 47
      'display columns' => array('added_date','device_id','attrib_id','value','removed_date','attrib_device_id'),
48
      'display query' => 'select added_date,device_id,attrib_id,value,removed_date,attrib_device_id from attrib_device',
99 rodolico 49
      'field info' => array(
101 rodolico 50
         /* date record was added */
51
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
52
         'device_id' => array('display name' => 'device_id' , 'type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
53
         'attrib_id' => array('display name' => 'attrib_id' , 'type' => 'lookup', 'table' => 'attrib', 'keyfield' => 'attrib_id', 'display_field' => 'name'),
54
         /* The actual value of this attribute. */
55
         'value' => array('display name' => 'value' , 'type' => 'text'),
56
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date','default' => null),
57
         'attrib_device_id' => array('display name' => 'ID' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int')
99 rodolico 58
      )
101 rodolico 59
   )
60
);
99 rodolico 61
?>