Subversion Repositories computer_asset_manager_v2

Rev

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

<?php

/* Auto generated from SQL script by ./sql2admin_hash.pl version 1.01. */

global $DATABASE_DEFINITION; // make variable available to all scripts

define ( 'MAX_INPUT_FIELD_DISPLAY', 40 ); // this is the maximum input field size
define ( 'FILES_DIRECTORY', '/files/' );  // relative URL where pictures are stored
define ( 'EDIT_IMAGE_HEIGHT', 100 );      // height for thumbnail of pictures
define ( 'MAX_UPLOAD_FILE_SIZE', 1024*1024*10 ); // 10 meg
define ( 'DEFAULT_TEXTAREA_HEIGHT', 5 );
define ( 'DEFAULT_TABLE', 'owners');
   
$DATABASE_DEFINITION = array(
   'users' => array( 
      'table name' => 'users',
      'display name' => 'Users',
      'comment' => 'logins to system',
      'key field' => 'id',
      'display columns' => array(
         'ID',
         'Uername',
         'Group',
         'e-mail',
         'Created',
         'Removed'
      ),
      'display query' => 'select users.id,users.username,groups.name "group",users.email,date(users.created) created,date(users.removed) removed from users left outer join groups on users.group_id = groups.id',
      'field info' => array(
         'id' => array(
            'display name' => 'Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'username' => array(
            'display name' => 'Username' ,
            'unique'  =>  true ,
            'comment' => 'login user name' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'password' => array(
            'display name' => 'Password' ,
            'comment' => 'encrypted password' ,
            'required' => true ,
            'type' => 'password' ,
            'width' => 32
         ),
         'group_id' => array(
            'display name' => 'Group Id' ,
            'type' => 'lookup' ,
            'table' => 'groups' ,
            'keyfield' => 'id' ,
            'display_field' => 'name'
         ),
         'where_clause' => array(
            'display name' => 'Where Clause' ,
            'comment' => 'appended to all queries used to limit the access the user has to records' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'email' => array(
            'display name' => 'Email' ,
            'comment' => 'email address so we can contact them' ,
            'type' => 'string' ,
            'width' => 64
         ),
         'notes' => array(
            'display name' => 'Notes' ,
            'comment' => 'Any notes you want' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'created' => array(
            'display name' => 'Created' ,
            'required' => true ,
            'type' => 'datetime' ,
            'width' => 0
         ),
         'removed' => array(
            'display name' => 'Removed' ,
            'comment' => 'Date removed' ,
            'required' => false ,
            'type' => 'datetime' ,
            'width' => 0
         )
      )
   ),
   'groups' => array( 
      'table name' => 'groups',
      'display name' => 'Groups',
      'comment' => 'holds users groups for the ACL code',
      'key field' => 'id',
      'display columns' => array(
         'id',
         'name',
         'created',
         'modified'
      ),
      'display query' => 'select id,name,created,modified from groups',
      'field info' => array(
         'id' => array(
            'display name' => 'Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'name' => array(
            'display name' => 'Name' ,
            'unique'  =>  true ,
            'comment' => 'name of this group' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 100
         ),
         'created' => array(
            'display name' => 'Created' ,
            'required' => true ,
            'type' => 'datetime' ,
            'width' => 0
         ),
         'modified' => array(
            'display name' => 'Modified' ,
            'required' => false ,
            'type' => 'datetime' ,
            'width' => 0
         )
      )
   ),
   'owners' => array( 
      'table name' => 'owners',
      'display name' => 'Owners',
      'comment' => 'holds owners information',
      'key field' => 'id',
      'display columns' => array(
         'id',
         'name',
         'notes',
         'created',
         'removed'
      ),
      'display query' => 'select id,name,notes,created,removed from owners',
      'field info' => array(
         'id' => array(
            'display name' => 'Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'name' => array(
            'display name' => 'Name' ,
            'unique'  =>  true ,
            'comment' => 'Name of owner' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'notes' => array(
            'display name' => 'Notes' ,
            'comment' => 'Any notes you want' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'created' => array(
            'display name' => 'Created' ,
            'required' => true ,
            'type' => 'datetime' ,
            'width' => 0
         ),
         'removed' => array(
            'display name' => 'Removed' ,
            'comment' => 'Date removed' ,
            'required' => false ,
            'type' => 'datetime' ,
            'width' => 0
         )
      )
   ),
   'sites' => array( 
      'table name' => 'sites',
      'display name' => 'Sites',
      'comment' => 'holds site information',
      'key field' => 'id',
      'display columns' => array(
         'id',
         'name',
         'notes',
         'created',
         'removed'
      ),
      'display query' => 'select id,name,notes,created,removed from sites',
      'field info' => array(
         'id' => array(
            'display name' => 'Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'name' => array(
            'display name' => 'Name' ,
            'unique'  =>  true ,
            'comment' => 'Name of site' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'notes' => array(
            'display name' => 'Notes' ,
            'comment' => 'Any notes you want' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'created' => array(
            'display name' => 'Created' ,
            'required' => true ,
            'type' => 'datetime' ,
            'width' => 0
         ),
         'removed' => array(
            'display name' => 'Removed' ,
            'comment' => 'Date removed' ,
            'required' => false ,
            'type' => 'datetime' ,
            'width' => 0
         )
      )
   ),
   'device_types' => array( 
      'table name' => 'device_types',
      'display name' => 'Device Types',
      'comment' => 'holds types of devices, such as computer, router, etc...',
      'key field' => 'id',
      'display columns' => array(
         'id',
         'name',
         'system',
         'notes',
         'created',
         'removed'
      ),
      'display query' => 'select id,name,system,notes,created,removed from device_types',
      'field info' => array(
         'id' => array(
            'display name' => 'Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'name' => array(
            'display name' => 'Name' ,
            'unique'  =>  true ,
            'comment' => 'short name for display' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'system' => array(
            'display name' => 'System' ,
            'comment' => 'If true (1) this is a system. Set to 0 for printers etc...' ,
            'type' => 'tinyint' ,
            'width' => 1
         ),
         'notes' => array(
            'display name' => 'Notes' ,
            'comment' => 'Any notes you want' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'created' => array(
            'display name' => 'Created' ,
            'required' => true ,
            'type' => 'datetime' ,
            'width' => 0
         ),
         'removed' => array(
            'display name' => 'Removed' ,
            'comment' => 'Date removed' ,
            'required' => false ,
            'type' => 'datetime' ,
            'width' => 0
         )
      )
   ),
   'attributes' => array( 
      'table name' => 'attributes',
      'display name' => 'Attributes',
      'comment' => 'lookup table of possible attributes to devices',
      'key field' => 'id',
      'display columns' => array(
         'id',
         'name',
         'notes',
         'created',
         'removed'
      ),
      'display query' => 'select id,name,notes,created,removed from attributes',
      'field info' => array(
         'id' => array(
            'display name' => 'Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'name' => array(
            'display name' => 'Name' ,
            'unique'  =>  true ,
            'comment' => 'short name for display' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'notes' => array(
            'display name' => 'Notes' ,
            'comment' => 'Any notes you want' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'created' => array(
            'display name' => 'Created' ,
            'required' => true ,
            'type' => 'datetime' ,
            'width' => 0
         ),
         'removed' => array(
            'display name' => 'Removed' ,
            'comment' => 'Date removed' ,
            'required' => false ,
            'type' => 'datetime' ,
            'width' => 0
         )
      )
   ),
   'devices' => array( 
      'table name' => 'devices',
      'display name' => 'Devices',
      'comment' => 'holds computers, cards that make them up, etc...',
      'key field' => 'id',
      'display columns' => array(
         'id',
         'serial_number',
         'name',
         'parent_id',
         'device_type_id',
         'site_id',
         'owner_id',
         'notes',
         'created',
         'removed'
      ),
      'display query' => 'select id,serial_number,name,parent_id,device_type_id,site_id,owner_id,notes,created,removed from devices',
      'field info' => array(
         'id' => array(
            'display name' => 'Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'serial_number' => array(
            'display name' => 'Serial Number' ,
            'comment' => 'serial number of device' ,
            'required' => false ,
            'type' => 'string' ,
            'width' => 64
         ),
         'name' => array(
            'display name' => 'Name' ,
            'comment' => 'name of device' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 255
         ),
         'parent_id' => array(
            'display name' => 'Parent Id' ,
            'type' => 'lookup' ,
            'table' => 'devices' ,
            'keyfield' => 'id' ,
            'display_field' => 'name'
         ),
         'device_type_id' => array(
            'display name' => 'Device Type Id' ,
            'type' => 'lookup' ,
            'table' => 'device_types' ,
            'keyfield' => 'id' ,
            'display_field' => 'name'
         ),
         'site_id' => array(
            'display name' => 'Site Id' ,
            'type' => 'lookup' ,
            'table' => 'sites' ,
            'keyfield' => 'id' ,
            'display_field' => 'name'
         ),
         'owner_id' => array(
            'display name' => 'Owner Id' ,
            'type' => 'lookup' ,
            'table' => 'owners' ,
            'keyfield' => 'id' ,
            'display_field' => 'name'
         ),
         'notes' => array(
            'display name' => 'Notes' ,
            'comment' => 'Any notes you want' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'created' => array(
            'display name' => 'Created' ,
            'required' => true ,
            'type' => 'datetime' ,
            'width' => 0
         ),
         'removed' => array(
            'display name' => 'Removed' ,
            'comment' => 'Date removed' ,
            'required' => false ,
            'type' => 'datetime' ,
            'width' => 0
         )
      )
   ),
   'device_aliases' => array( 
      'table name' => 'device_aliases',
      'display name' => 'Device Aliases',
      'comment' => 'aliases for devices',
      'key field' => 'id',
      'display columns' => array(
         'id',
         'name',
         'device_id',
         'notes',
         'created',
         'removed'
      ),
      'display query' => 'select id,name,device_id,notes,created,removed from device_aliases',
      'field info' => array(
         'id' => array(
            'display name' => 'Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'name' => array(
            'display name' => 'Name' ,
            'unique'  =>  true ,
            'comment' => 'short name for display' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'device_id' => array(
            'display name' => 'Device Id' ,
            'type' => 'lookup' ,
            'table' => 'devices' ,
            'keyfield' => 'id' ,
            'display_field' => 'name'
         ),
         'notes' => array(
            'display name' => 'Notes' ,
            'comment' => 'Any notes you want' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'created' => array(
            'display name' => 'Created' ,
            'required' => true ,
            'type' => 'datetime' ,
            'width' => 0
         ),
         'removed' => array(
            'display name' => 'Removed' ,
            'comment' => 'Date removed' ,
            'required' => false ,
            'type' => 'datetime' ,
            'width' => 0
         )
      )
   ),
   'attributes_devices' => array( 
      'table name' => 'attributes_devices',
      'display name' => 'Attributes Devices',
      'comment' => 'Each device can have multiple attributes and values',
      'key field' => 'id',
      'display columns' => array(
         'id',
         'device_id',
         'attributes_id',
         'attribute_value',
         'created',
         'removed'
      ),
      'display query' => 'select id,device_id,attributes_id,attribute_value,created,removed from attributes_devices',
      'field info' => array(
         'id' => array(
            'display name' => 'Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'device_id' => array(
            'display name' => 'Device Id' ,
            'type' => 'lookup' ,
            'table' => 'devices' ,
            'keyfield' => 'id' ,
            'display_field' => 'name'
         ),
         'attributes_id' => array(
            'display name' => 'Attributes Id' ,
            'type' => 'lookup' ,
            'table' => 'attributes' ,
            'keyfield' => 'id' ,
            'display_field' => 'name'
         ),
         'attribute_value' => array(
            'display name' => 'Attribute Value' ,
            'comment' => 'the actual value of the attribute in question' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'created' => array(
            'display name' => 'Created' ,
            'required' => true ,
            'type' => 'datetime' ,
            'width' => 0
         ),
         'removed' => array(
            'display name' => 'Removed' ,
            'comment' => 'Date removed' ,
            'required' => false ,
            'type' => 'datetime' ,
            'width' => 0
         )
      )
   ),
   'files' => array( 
      'table name' => 'files',
      'display name' => 'Files',
      'comment' => 'Files which can be associated with an owner site or device',
      'key field' => 'id',
      'display columns' => array(
         'id',
         'original_name',
         'name_on_disk',
         'mime_type_id',
         'device_id',
         'site_id',
         'owner_id',
         'created',
         'removed'
      ),
      'display query' => 'select id,original_name,name_on_disk,mime_type_id,device_id,site_id,owner_id,created,removed from files',
      'field info' => array(
         'id' => array(
            'display name' => 'Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'original_name' => array(
            'display name' => 'Original Name' ,
            'comment' => 'original file name' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'name_on_disk' => array(
            'display name' => 'Name On Disk' ,
            'unique'  =>  true ,
            'comment' => 'name of file on disk' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'mime_type_id' => array(
            'display name' => 'Mime Type Id' ,
            'type' => 'lookup' ,
            'table' => 'mime_types' ,
            'keyfield' => 'id' ,
            'display_field' => 'name'
         ),
         'device_id' => array(
            'display name' => 'Device Id' ,
            'type' => 'lookup' ,
            'table' => 'devices' ,
            'keyfield' => 'id' ,
            'display_field' => 'name'
         ),
         'site_id' => array(
            'display name' => 'Site Id' ,
            'type' => 'lookup' ,
            'table' => 'sites' ,
            'keyfield' => 'id' ,
            'display_field' => 'name'
         ),
         'owner_id' => array(
            'display name' => 'Owner Id' ,
            'type' => 'lookup' ,
            'table' => 'owners' ,
            'keyfield' => 'id' ,
            'display_field' => 'name'
         ),
         'created' => array(
            'display name' => 'Created' ,
            'required' => true ,
            'type' => 'datetime' ,
            'width' => 0
         ),
         'removed' => array(
            'display name' => 'Removed' ,
            'comment' => 'Date removed' ,
            'required' => false ,
            'type' => 'datetime' ,
            'width' => 0
         )
      )
   ),
   'mime_types' => array( 
      'table name' => 'mime_types',
      'display name' => 'Mime Types',
      'comment' => 'just keeps a list of standard MIME types for use with filess',
      'key field' => 'id',
      'display columns' => array(
         'id',
         'name',
         'embed',
         'extension'
      ),
      'display query' => 'select id,name,embed,extension from mime_types',
      'field info' => array(
         'id' => array(
            'display name' => 'Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'name' => array(
            'display name' => 'Name' ,
            'comment' => 'the web definition of the mime type' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'embed' => array(
            'display name' => 'Embed' ,
            'comment' => 'If true (1) can be viewed on web page' ,
            'default' => 0 ,
            'type' => 'tinyint' ,
            'width' => 1
         ),
         'extension' => array(
            'display name' => 'Extension' ,
            'comment' => 'standard file extension used for this MIME type' ,
            'type' => 'string' ,
            'width' => 5
         )
      )
   )
);


include( 'database_def_local.php' );

?>