Subversion Repositories computer_asset_manager_v2

Rev

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

<?php

/* 
   Auto generated from SQL script by ../library/sql2admin_hash.pl version 1.1. 
   do not edit this file. Edit DatabaseDefinition.local.php as changes
   to that file will not be overwritten by subsequent runs of this
   script.
*/

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 picturse
define ( 'MAX_UPLOAD_FILE_SIZE', 1024*1024*10 ); // 10 meg
define ( 'DEFAULT_TEXTAREA_HEIGHT', 5 );
define ( 'DEFAULT_TABLE', 'FILL ME IN');
   
$DATABASE_DEFINITION = array(
   '_system' => array( 
      'table name' => '_system',
      'display name' => 'System',
      'comment' => 'Basically a configuration file equivilent to a windows INI ',
      'key field' => '_system_id ',
      'display columns' => array(
         '_system_id',
         'group_name',
         'key_name',
         'theValue'
      ),
      'display query' => 'select _system_id,group_name,key_name,theValue from _system',
      'field info' => array(
         '_system_id' => array(
            'display name' => 'System Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'group_name' => array(
            'display name' => 'Group Name' ,
            'comment' => 'used to group keys together' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'key_name' => array(
            'display name' => 'Key Name' ,
            'comment' => 'key into this value' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'theValue' => array(
            'display name' => 'Thevalue' ,
            'comment' => 'the actual value of this entry' ,
            'required' => false ,
            'type' => 'text' ,
            'width' => 0
         )
      )
   ),
   '_user' => array( 
      'table name' => '_user',
      'display name' => 'User',
      'comment' => 'user access to program',
      'key field' => ' _user_id ',
      'display columns' => array(
         '_user_id',
         'username',
         'name',
         'email',
         'notes',
         'passwd',
         'access',
         'added_date',
         'removed_date'
      ),
      'display query' => 'select _user_id,username,name,email,notes,passwd,access,added_date,removed_date from _user',
      'field info' => array(
         '_user_id' => array(
            'display name' => 'User Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'username' => array(
            'display name' => 'Username' ,
            'comment' => 'user name for logging in' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 32
         ),
         'name' => array(
            'display name' => 'Name' ,
            'comment' => 'common name of user' ,
            'type' => 'string' ,
            'width' => 64
         ),
         'email' => array(
            'display name' => 'Email' ,
            'comment' => 'email address of user' ,
            'type' => 'string' ,
            'width' => 64
         ),
         'notes' => array(
            'display name' => 'Notes' ,
            'comment' => 'any notes about user' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'passwd' => array(
            'display name' => 'Passwd' ,
            'comment' => 'encrypted password of user' ,
            'type' => 'string' ,
            'width' => 256
         ),
         'access' => array(
            'display name' => 'Access' ,
            'comment' => 'sql to determine what records user can view' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'added_date' => array(
            'display name' => 'Added Date' ,
            'comment' => 'Date record added to database' ,
            'required' => true ,
            'type' => 'date' ,
            'width' => 0
         ),
         'removed_date' => array(
            'display name' => 'Removed Date' ,
            'comment' => 'Date record marked as removed' ,
            'required' => false ,
            'type' => 'date' ,
            'width' => 0
         )
      )
   ),
   '_menu' => array( 
      'table name' => '_menu',
      'display name' => 'Menu',
      'comment' => 'We keep the entire menu structure here so modules can modify it',
      'key field' => '_menu_id',
      'display columns' => array(
         '_menu_id',
         'parent_id',
         'caption',
         'url'
      ),
      'display query' => 'select _menu_id,parent_id,caption,url from _menu',
      'field info' => array(
         '_menu_id' => array(
            'display name' => 'Menu Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'parent_id' => array(
            'display name' => 'Parent Id' ,
            'type' => 'lookup' ,
            'table' => '_menu' ,
            'keyfield' => '_menu_id' ,
            'display_field' => 'name'
         ),
         'caption' => array(
            'display name' => 'Caption' ,
            'comment' => 'The actual caption displayed' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 20
         ),
         'url' => array(
            'display name' => 'Url' ,
            'comment' => 'the url of the page/script to call or null if this contains sub-options' ,
            'required' => false ,
            'type' => 'string' ,
            'width' => 120
         )
      )
   ),
   'client' => array( 
      'table name' => 'client',
      'display name' => 'Client',
      'comment' => 'Stores information about a particlar client/owner',
      'key field' => 'client_id',
      'display columns' => array(
         'client_id',
         'name',
         'notes',
         'internal_notes',
         'added_date',
         'removed_date'
      ),
      'display query' => 'select client_id,name,notes,internal_notes,added_date,removed_date from client',
      'field info' => array(
         'client_id' => array(
            'display name' => 'Client Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'name' => array(
            'display name' => 'Name' ,
            'comment' => 'Name of the client' ,
            'type' => 'string' ,
            'width' => 64
         ),
         'notes' => array(
            'display name' => 'Notes' ,
            'comment' => 'Any notes you want to enter' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'internal_notes' => array(
            'display name' => 'Internal Notes' ,
            'comment' => 'private notes accessible only to technicians' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'added_date' => array(
            'display name' => 'Added Date' ,
            'comment' => 'Date record added to database' ,
            'required' => true ,
            'type' => 'date' ,
            'width' => 0
         ),
         'removed_date' => array(
            'display name' => 'Removed Date' ,
            'comment' => 'Date record marked as removed' ,
            'required' => false ,
            'type' => 'date' ,
            'width' => 0
         )
      )
   ),
   'site' => array( 
      'table name' => 'site',
      'display name' => 'Site',
      'comment' => 'Stores information about a particlar physical site',
      'key field' => 'site_id',
      'display columns' => array(
         'site_id',
         'name',
         'notes',
         'added_date',
         'removed_date'
      ),
      'display query' => 'select site_id,name,notes,added_date,removed_date from site',
      'field info' => array(
         'site_id' => array(
            'display name' => 'Site Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'name' => array(
            'display name' => 'Name' ,
            'comment' => 'Name of the site' ,
            'type' => 'string' ,
            'width' => 64
         ),
         'notes' => array(
            'display name' => 'Notes' ,
            'comment' => 'Any notes you want to enter' ,
            'type' => 'text' ,
            'width' => 0
         ),
         'added_date' => array(
            'display name' => 'Added Date' ,
            'comment' => 'Date record added to database' ,
            'required' => true ,
            'type' => 'date' ,
            'width' => 0
         ),
         'removed_date' => array(
            'display name' => 'Removed Date' ,
            'comment' => 'Date record marked as removed' ,
            'required' => false ,
            'type' => 'date' ,
            'width' => 0
         )
      )
   ),
   'device' => array( 
      'table name' => 'device',
      'display name' => 'Device',
      'comment' => 'stores information about an individual device or other device',
      'key field' => 'device_id',
      'display columns' => array(
         'device_id',
         'name',
         'notes',
         'device_type_id',
         'added_date',
         'removed_date'
      ),
      'display query' => 'select device_id,name,notes,device_type_id,added_date,removed_date from device',
      'field info' => array(
         'device_id' => array(
            'display name' => 'Device Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'name' => array(
            'display name' => 'Name' ,
            'comment' => 'name of the device or device' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'notes' => array(
            'display name' => 'Notes' ,
            'comment' => 'any notes we want to store' ,
            'required' => false ,
            'type' => 'text' ,
            'width' => 0
         ),
         'device_type_id' => array(
            'display name' => 'Device Type Id' ,
            'type' => 'lookup' ,
            'table' => 'device_type' ,
            'keyfield' => 'device_type_id' ,
            'display_field' => 'name'
         ),
         'added_date' => array(
            'display name' => 'Added Date' ,
            'comment' => 'Date record added to database' ,
            'required' => true ,
            'type' => 'date' ,
            'width' => 0
         ),
         'removed_date' => array(
            'display name' => 'Removed Date' ,
            'comment' => 'Date record marked as removed' ,
            'required' => false ,
            'type' => 'date' ,
            'width' => 0
         )
      )
   ),
   'device_device' => array( 
      'table name' => 'device_device',
      'display name' => 'Device Device',
      'comment' => 'joins device to another device',
      'key field' => 'device_device_id',
      'display columns' => array(
         'device_device_id',
         'device_id',
         'parent_id',
         'added_date',
         'removed_date'
      ),
      'display query' => 'select device_device_id,device_id,parent_id,added_date,removed_date from device_device',
      'field info' => array(
         'device_device_id' => array(
            'display name' => 'Device Device Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'device_id' => array(
            'display name' => 'Device Id' ,
            'type' => 'lookup' ,
            'table' => 'device' ,
            'keyfield' => 'device_id' ,
            'display_field' => 'name'
         ),
         'parent_id' => array(
            'display name' => 'Parent Id' ,
            'type' => 'lookup' ,
            'table' => 'device' ,
            'keyfield' => 'device_id' ,
            'display_field' => 'name'
         ),
         'added_date' => array(
            'display name' => 'Added Date' ,
            'comment' => 'Date record added to database' ,
            'required' => true ,
            'type' => 'date' ,
            'width' => 0
         ),
         'removed_date' => array(
            'display name' => 'Removed Date' ,
            'comment' => 'Date record marked as removed' ,
            'required' => false ,
            'type' => 'date' ,
            'width' => 0
         )
      )
   ),
   'device_type' => array( 
      'table name' => 'device_type',
      'display name' => 'Device Type',
      'comment' => 'simply a list of device types ie computer printer whatever',
      'key field' => 'device_type_id',
      'display columns' => array(
         'device_type_id',
         'name',
         'flags',
         'added_date',
         'removed_date'
      ),
      'display query' => 'select device_type_id,name,flags,added_date,removed_date from device_type',
      'field info' => array(
         'device_type_id' => array(
            'display name' => 'Device Type Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 10
         ),
         'name' => array(
            'display name' => 'Name' ,
            'comment' => 'the visible displayed name' ,
            'required' => true ,
            'type' => 'string' ,
            'width' => 64
         ),
         'flags' => array(
            'display name' => 'Flags' ,
            'comment' => 'flags for this device type' ,
            'default' => 1 ,
            'type' => 'int' ,
            'width' => 0
         ),
         'added_date' => array(
            'display name' => 'Added Date' ,
            'comment' => 'date record was added' ,
            'required' => true ,
            'type' => 'date' ,
            'width' => 0
         ),
         'removed_date' => array(
            'display name' => 'Removed Date' ,
            'comment' => 'date record was deleted/supserceded' ,
            'required' => false ,
            'type' => 'date' ,
            'width' => 0
         )
      )
   ),
   'alias' => array( 
      'table name' => 'alias',
      'display name' => 'Alias',
      'comment' => 'Allows client, site and device to have multiple names',
      'key field' => 'alias_id',
      'display columns' => array(
         'alias_id',
         'source',
         'id',
         'site',
         'name'
      ),
      'display query' => 'select alias_id,source,id,site,name from alias',
      'field info' => array(
         'alias_id' => array(
            'display name' => 'Alias Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'source' => array(
            'display name' => 'Source' ,
            'comment' => 'the table this alias comes from' ,
            'type' => 'string' ,
            'width' => 64
         ),
         'id' => array(
            'display name' => 'Id' ,
            'keyfield' => true ,
            'required' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'site' => array(
            'display name' => 'Site' ,
            'type' => 'or' ,
            'width' => 0
         ),
         'name' => array(
            'display name' => 'Name' ,
            'comment' => 'the alias for the device' ,
            'type' => 'string' ,
            'width' => 64
         )
      )
   ),
   'client_site' => array( 
      'table name' => 'client_site',
      'display name' => 'Client Site',
      'comment' => 'A client owns a site',
      'key field' => 'client_site_id',
      'display columns' => array(
         'client_site_id',
         'client_id',
         'site_id',
         'added_date',
         'removed_date'
      ),
      'display query' => 'select client_site_id,client_id,site_id,added_date,removed_date from client_site',
      'field info' => array(
         'client_site_id' => array(
            'display name' => 'Client Site Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'client_id' => array(
            'display name' => 'Client Id' ,
            'type' => 'lookup' ,
            'table' => 'client' ,
            'keyfield' => 'client_id' ,
            'display_field' => 'name'
         ),
         'site_id' => array(
            'display name' => 'Site Id' ,
            'type' => 'lookup' ,
            'table' => 'site' ,
            'keyfield' => 'site_id' ,
            'display_field' => 'name'
         ),
         'added_date' => array(
            'display name' => 'Added Date' ,
            'comment' => 'Date record added to database' ,
            'required' => true ,
            'type' => 'date' ,
            'width' => 0
         ),
         'removed_date' => array(
            'display name' => 'Removed Date' ,
            'comment' => 'Date record marked as removed' ,
            'required' => false ,
            'type' => 'date' ,
            'width' => 0
         )
      )
   ),
   'client_device' => array( 
      'table name' => 'client_device',
      'display name' => 'Client Device',
      'comment' => 'Links client and device tables',
      'key field' => 'client_device_id',
      'display columns' => array(
         'client_device_id',
         'client_id',
         'device_id',
         'added_date',
         'removed_date'
      ),
      'display query' => 'select client_device_id,client_id,device_id,added_date,removed_date from client_device',
      'field info' => array(
         'client_device_id' => array(
            'display name' => 'Client Device Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'client_id' => array(
            'display name' => 'Client Id' ,
            'type' => 'lookup' ,
            'table' => 'client' ,
            'keyfield' => 'client_id' ,
            'display_field' => 'name'
         ),
         'device_id' => array(
            'display name' => 'Device Id' ,
            'type' => 'lookup' ,
            'table' => 'device' ,
            'keyfield' => 'device_id' ,
            'display_field' => 'name'
         ),
         'added_date' => array(
            'display name' => 'Added Date' ,
            'comment' => 'Date record added to database' ,
            'required' => true ,
            'type' => 'date' ,
            'width' => 0
         ),
         'removed_date' => array(
            'display name' => 'Removed Date' ,
            'comment' => 'Date record marked as removed' ,
            'required' => false ,
            'type' => 'date' ,
            'width' => 0
         )
      )
   ),
   'site_device' => array( 
      'table name' => 'site_device',
      'display name' => 'Site Device',
      'comment' => 'Links site and device tables',
      'key field' => ' site_device_id ',
      'display columns' => array(
         'site_device_id',
         'site_id',
         'device_id',
         'added_date',
         'removed_date'
      ),
      'display query' => 'select site_device_id,site_id,device_id,added_date,removed_date from site_device',
      'field info' => array(
         'site_device_id' => array(
            'display name' => 'Site Device Id' ,
            'keyfield' => true ,
            'required' => true ,
            'readonly' => true ,
            'autoincrement' => true ,
            'type' => 'int' ,
            'width' => 0
         ),
         'site_id' => array(
            'display name' => 'Site Id' ,
            'type' => 'lookup' ,
            'table' => 'site' ,
            'keyfield' => 'site_id' ,
            'display_field' => 'name'
         ),
         'device_id' => array(
            'display name' => 'Device Id' ,
            'type' => 'lookup' ,
            'table' => 'device' ,
            'keyfield' => 'device_id' ,
            'display_field' => 'name'
         ),
         'added_date' => array(
            'display name' => 'Added Date' ,
            'comment' => 'Date record added to database' ,
            'required' => true ,
            'type' => 'date' ,
            'width' => 0
         ),
         'removed_date' => array(
            'display name' => 'Removed Date' ,
            'comment' => 'Date record marked as removed' ,
            'required' => false ,
            'type' => 'date' ,
            'width' => 0
         )
      )
   )
);
include('DatabaseDefinition.local.php');
?>