CORE POS - IS4C
The CORE POS front end
Static Public Member Functions | List of all members
COREPOS\pos\lib\MiscLib Class Reference

Static Public Member Functions

static baseURL ($check_file="css/pos.css")
 
static base_url ($check_file="css/pos.css")
 
static nullwrap ($num, $char=false)
 
static truncate2 ($num)
 
static pingport ($host, $dbms)
 
static win32 ()
 
static scaleObject ()
 
static goodBeep ()
 
static rePoll ()
 
static errorBeep ()
 
static twoPairs ()
 
static getAllIPs ()
 
static getNumbers ($string)
 
static centStrToDouble ($str)
 
static jqueryFile ()
 

Detailed Description

MiscLib Generic functions

Member Function Documentation

static COREPOS\pos\lib\MiscLib::baseURL (   $check_file = "css/pos.css")
static

Path detection. Find the relative URL for POS root.

Parameters
$check_filefile to search for
Returns
A relative URL with trailing slash
static COREPOS\pos\lib\MiscLib::errorBeep ( )
static

Send error beep message to the scale

static COREPOS\pos\lib\MiscLib::getAllIPs ( )
static

Use ipconfig.exe or ifconfig, depending on OS, to determine all available IP addresses

Returns
[array] of [string] IP addresses

First: use OS utilities to check IP(s) This should be most complete but also may be blocked by permission settings

PHP 5.3 adds gethostname() function Try getting host name and resolving to an IP

static COREPOS\pos\lib\MiscLib::goodBeep ( )
static

Send good beep message to the scale

static COREPOS\pos\lib\MiscLib::nullwrap (   $num,
  $char = false 
)
static

Sanitizes values

Parameters
$numa value
$char[optional] boolean is character
Returns
a sanitized value

Probably an artifact of ASP implementation. In practice any argument that evaluates to False get translated to integer zero.

static COREPOS\pos\lib\MiscLib::pingport (   $host,
  $dbms 
)
static

Connect to a host briefly

Parameters
$hostname or IP
$dbmsdatabase type (supported: mysql, mssql)
Returns
  • 1 on success
  • 0 on failure

This still works if the environment doesn't have ping or ping has odd output. It also verifies the database is running as well as the host is up.

static COREPOS\pos\lib\MiscLib::rePoll ( )
static

Send re-poll message to the scale

static COREPOS\pos\lib\MiscLib::scaleObject ( )
static

Get the scale wrapper object

Returns
An ScaleDriverWrapper object

The driver is chosen via "scaleDriver" in session. If the object cannot be found this returns zero

static COREPOS\pos\lib\MiscLib::truncate2 (   $num)
static

Convert number to string with two decimal digits

Parameters
$numa number
Returns
formatted string
static COREPOS\pos\lib\MiscLib::twoPairs ( )
static

Send two pairs beep message to the scale

static COREPOS\pos\lib\MiscLib::win32 ( )
static

Guess whether PHP is running on windows

Returns
1 - windows 0 - not windows

The documentation for this class was generated from the following file: