Subversion Repositories computer_asset_manager_v1

Rev

Rev 101 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 101 Rev 103
Line 1... Line 1...
1
<?php
1
<?php
-
 
2
 
2
global $DATABASE_DEFINITION;
3
   global $DATABASE_DEFINITION;
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');
4
   include_once( '../../includes/database.php' );
9
   
5
 
10
   $DATABASE_DEFINITION = array(
-
 
11
   /* attributes that can be applied to a device */
6
   /* attributes that can be applied to a device */
12
   'attrib' => array( 
7
   $DATABASE_DEFINITION['attrib'] =   array( 
13
      'table name' => 'attrib',
8
      'table name' => 'attrib',
14
      'key field' => 'attrib_id',
9
      'key field' => 'attrib_id',
15
      'display columns' => array('attrib_category_id','added_date','name','keyname','removed_date','attrib_id'),
10
      'display columns' => array('name','multiples','attrib_id','added_date','keyname','attrib_category_id','removed_date'),
16
      'display query' => 'select attrib_category_id,added_date,name,keyname,removed_date,attrib_id from attrib',
11
      'display query' => 'select name,multiples,attrib_id,added_date,keyname,attrib_category_id,removed_date from attrib',
17
      'field info' => array(
12
      'field info' => array(
18
         'attrib_category_id' => array('display name' => 'attrib_category_id' , 'type' => 'lookup', 'table' => 'attrib_category', 'keyfield' => 'attrib_category_id', 'display_field' => 'name'),
-
 
19
         /* date record was added */
-
 
20
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
-
 
21
         /* the visible displayed name */
13
         /* the visible displayed name */
22
         'name' => array('display name' => 'name' , 'required' => true , 'type' => 'string' , 'width' => 64),
14
         'name' => array('display name' => 'name' , 'required' => true , 'type' => 'string' , 'width' => 64),
-
 
15
         /* set to true if ultiple entries are allowed */
-
 
16
         'multiples' => array('display name' => 'multiples' , 'type' => 'string' , 'width' => 1),
-
 
17
         'attrib_id' => array('display name' => 'attrib_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10),
-
 
18
         /* date record was added */
-
 
19
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
23
         /* used for sysinfo really needs to be separate table */
20
         /* used for sysinfo really needs to be separate table */
24
         'keyname' => array('display name' => 'keyname' , 'type' => 'string' , 'width' => 32),
21
         'keyname' => array('display name' => 'keyname' , 'type' => 'string' , 'width' => 32),
-
 
22
         'attrib_category_id' => array('display name' => 'attrib_category_id' , 'type' => 'lookup', 'table' => 'attrib_category', 'keyfield' => 'attrib_category_id', 'display_field' => 'name'),
25
         /* date record was deleted or supserceded */
23
         /* date record was deleted or supserceded */
26
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date','default' => null),
24
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date')
27
         'attrib_id' => array('display name' => 'attrib_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int' , 'width' => 10)
-
 
28
      )
25
      )
29
   ),
26
   );
30
   /* just allows us to categorize attributes */
27
   /* just allows us to categorize attributes */
31
   'attrib_category' => array( 
28
   $DATABASE_DEFINITION['attrib_category']  = array( 
32
      'table name' => 'attrib_category',
29
      'table name' => 'attrib_category',
33
      'key field' => 'attrib_category_id',
30
      'key field' => 'attrib_category_id',
34
      'display columns' => array('attrib_category_id','added_date','name'),
31
      'display columns' => array('attrib_category_id','added_date','name'),
35
      'display query' => 'select attrib_category_id,added_date,name from attrib_category',
32
      'display query' => 'select attrib_category_id,added_date,name from attrib_category',
36
      'field info' => array(
33
      'field info' => array(
37
         'attrib_category_id' => array('display name' => 'attrib_category_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
34
         'attrib_category_id' => array('display name' => 'attrib_category_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
38
         /* When this category was added */
35
         /* When this category was added */
39
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
36
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
40
         'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64)
37
         'name' => array('display name' => 'name' , 'type' => 'string' , 'width' => 64)
41
      )
38
      )
42
   ),
39
   );
43
   /* links devices and their attributes together */
40
   /* links devices and their attributes together */
44
   'attrib_device' => array( 
41
   $DATABASE_DEFINITION['attrib_device'] = array( 
45
      'table name' => 'attrib_device',
42
      'table name' => 'attrib_device',
46
      'key field' => 'attrib_device_id',
43
      'key field' => 'attrib_device_id',
-
 
44
      'display name' => 'Device Attributes',
47
      'display columns' => array('added_date','device_id','attrib_id','value','removed_date','attrib_device_id'),
45
      'display columns' => array('attrib_device_id','device_id','attrib_id','value','added_date','removed_date'),
48
      'display query' => 'select added_date,device_id,attrib_id,value,removed_date,attrib_device_id from attrib_device',
46
      'display query' => 'select attrib_device_id,attrib_id,value,device_id,added_date,removed_date from attrib_device',
49
      'field info' => array(
47
      'field info' => array(
50
         /* date record was added */
-
 
51
         'added_date' => array('display name' => 'added_date' , 'required' => true , 'type' => 'date'),
48
         'attrib_device_id' => array('display name' => 'attrib_device_id' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int'),
52
         'device_id' => array('display name' => 'device_id' , 'type' => 'lookup', 'table' => 'device', 'keyfield' => 'device_id', 'display_field' => 'name'),
49
         'device_id' => array('display name' => 'Device' , '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'),
50
         'attrib_id' => array('display name' => 'Attribute' , 'type' => 'lookup', 'table' => 'attrib', 'keyfield' => 'attrib_id', 'display_field' => 'name'),
54
         /* The actual value of this attribute. */
51
         /* The actual value of this attribute. */
55
         'value' => array('display name' => 'value' , 'type' => 'text'),
52
         'value' => array('display name' => 'value' , 'type' => 'text'),
-
 
53
         /* date record was added */
56
         'removed_date' => array('display name' => 'removed_date' , 'type' => 'date','default' => null),
54
         'added_date' => array('display name' => 'Added' , 'required' => true , 'type' => 'date'),
57
         'attrib_device_id' => array('display name' => 'ID' , 'keyfield' => true , 'required' => true , 'readonly' => true , 'type' => 'int')
55
         'removed_date' => array('display name' => 'Removed Date' , 'type' => 'date')
58
      )
56
      )
59
   )
57
   );
60
);
-
 
61
?>
58
?>