<% '============================================================================= ' FILE: config.asp ' PURPOSE: Centralized application configuration ' AUTHOR: System ' CREATED: 2025-10-10 ' ' IMPORTANT: This file contains application settings and constants. ' Modify values here rather than hard-coding throughout the app. '============================================================================= '----------------------------------------------------------------------------- ' Database Configuration - ShopDB (primary) '----------------------------------------------------------------------------- ' Set USE_DSN = True for production (DSN-based), False for dev (direct ODBC) Const USE_DSN = False ' DSN configuration (production) Const DB_DSN = "shopdb" Const DB_DSN_USER = "YOUR_DB_USER" Const DB_DSN_PASSWORD = "YOUR_DB_USER" ' Direct ODBC configuration (development) Const DB_DRIVER = "MySQL ODBC 9.4 Unicode Driver" Const DB_SERVER = "192.168.122.1" Const DB_PORT = "3306" Const DB_NAME = "shopdb" Const DB_USER = "YOUR_DB_USER" Const DB_PASSWORD = "YOUR_DB_USER" '----------------------------------------------------------------------------- ' Database Configuration - Employee Database '----------------------------------------------------------------------------- ' Set USE_EMP_DSN = True for production (DSN-based), False for dev (direct ODBC) Const USE_EMP_DSN = True ' DSN configuration (production) Const EMP_DB_DSN = "wjf_employees" Const EMP_DB_DSN_USER = "root" Const EMP_DB_DSN_PASSWORD = "YOUR_EMP_DB_PASSWORD" ' Direct ODBC configuration (development) - configure if needed Const EMP_DB_DRIVER = "MySQL ODBC 9.4 Unicode Driver" Const EMP_DB_SERVER = "localhost" Const EMP_DB_PORT = "3306" Const EMP_DB_NAME = "wjf_employees" Const EMP_DB_USER = "root" Const EMP_DB_PASSWORD = "YOUR_EMP_DB_PASSWORD" '----------------------------------------------------------------------------- ' Application Settings '----------------------------------------------------------------------------- Const APP_SESSION_TIMEOUT = 30 ' Session timeout in minutes Const APP_PAGE_SIZE = 50 ' Default records per page Const APP_CACHE_DURATION = 300 ' Cache duration in seconds (5 minutes) '----------------------------------------------------------------------------- ' Business Logic Configuration '----------------------------------------------------------------------------- Const SERIAL_NUMBER_LENGTH = 7 ' PC serial number length Const SSO_NUMBER_LENGTH = 9 ' Employee SSO number length Const CSF_PREFIX = "csf" ' Printer CSF name prefix Const CSF_LENGTH = 5 ' CSF name total length '----------------------------------------------------------------------------- ' Default Values (for new records) '----------------------------------------------------------------------------- Const DEFAULT_PC_STATUS_ID = 2 ' Status: Inventory Const DEFAULT_MODEL_ID = 1 ' Default model Const DEFAULT_OS_ID = 1 ' Default operating system '----------------------------------------------------------------------------- ' External Services - ServiceNow '----------------------------------------------------------------------------- Const SNOW_BASE_URL = "https://geit.service-now.com/now/nav/ui/search/" Const SNOW_TICKET_PREFIXES = "geinc,gechg,gerit,gesct" ' Valid ServiceNow ticket prefixes '----------------------------------------------------------------------------- ' External Services - Zabbix API '----------------------------------------------------------------------------- Const ZABBIX_URL = "http://10.48.130.113:8080/api_jsonrpc.php" Const ZABBIX_API_TOKEN = "YOUR_ZABBIX_API_TOKEN" '----------------------------------------------------------------------------- ' File Upload '----------------------------------------------------------------------------- Const MAX_FILE_SIZE = 10485760 ' 10MB in bytes Const ALLOWED_EXTENSIONS = "jpg,jpeg,png,gif,pdf" '----------------------------------------------------------------------------- ' Helper Functions '----------------------------------------------------------------------------- '----------------------------------------------------------------------------- ' FUNCTION: GetConnectionString ' PURPOSE: Returns the database connection string based on USE_DSN setting ' RETURNS: DSN connection string (production) or direct ODBC string (dev) '----------------------------------------------------------------------------- Function GetConnectionString() If USE_DSN Then ' Production: DSN-based connection with pooling GetConnectionString = "DSN=" & DB_DSN & ";Uid=" & DB_DSN_USER & ";Pwd=" & DB_DSN_PASSWORD & ";Option=3;Pooling=True;Max Pool Size=100;" Else ' Development: Direct ODBC driver connection GetConnectionString = "Driver={" & DB_DRIVER & "};" & _ "Server=" & DB_SERVER & ";" & _ "Port=" & DB_PORT & ";" & _ "Database=" & DB_NAME & ";" & _ "User=" & DB_USER & ";" & _ "Password=" & DB_PASSWORD & ";" & _ "Option=3;" & _ "Pooling=True;Max Pool Size=100;" End If End Function '----------------------------------------------------------------------------- ' FUNCTION: GetEmployeeConnectionString ' PURPOSE: Returns the employee database connection string based on USE_EMP_DSN ' RETURNS: DSN connection string (production) or direct ODBC string (dev) '----------------------------------------------------------------------------- Function GetEmployeeConnectionString() If USE_EMP_DSN Then ' Production: DSN-based connection GetEmployeeConnectionString = "DSN=" & EMP_DB_DSN & ";Uid=" & EMP_DB_DSN_USER & ";Pwd=" & EMP_DB_DSN_PASSWORD Else ' Development: Direct ODBC driver connection GetEmployeeConnectionString = "Driver={" & EMP_DB_DRIVER & "};" & _ "Server=" & EMP_DB_SERVER & ";" & _ "Port=" & EMP_DB_PORT & ";" & _ "Database=" & EMP_DB_NAME & ";" & _ "User=" & EMP_DB_USER & ";" & _ "Password=" & EMP_DB_PASSWORD & ";" & _ "Option=3;" End If End Function '----------------------------------------------------------------------------- ' FUNCTION: IsValidTicketPrefix ' PURPOSE: Checks if a ticket prefix is valid ServiceNow prefix ' PARAMETERS: prefix - The ticket prefix to validate ' RETURNS: True if valid prefix, False otherwise '----------------------------------------------------------------------------- Function IsValidTicketPrefix(prefix) IsValidTicketPrefix = (InStr(SNOW_TICKET_PREFIXES, LCase(prefix)) > 0) End Function %>