|
static | getFormValue ($name, $default='') |
|
static | get_form_value ($name, $default='') |
|
static | get ($name, $default='') |
|
static | getDate ($name, $default='', $format='Y-m-d') |
|
static | dateRangePicker ($one='date1', $two='date2', $week_start=1) |
|
static | date_range_picker ($one='date1', $two='date2', $week_start=1) |
|
static | storePicker ($field_name='store') |
|
static | dateAndDepartmentForm ($departments, $supers=array(), $fake_supers=false) |
|
static | standardItemFields () |
|
static | standardDateFields () |
|
static | standardItemFromWhere () |
|
static FormLib::dateAndDepartmentForm |
( |
|
$departments, |
|
|
|
$supers = array() , |
|
|
|
$fake_supers = false |
|
) |
| |
|
static |
Generate a very standard form with date and department fields
- Parameters
-
$departments | [array] of DepartmentModels |
$supers | [array] of SuperDeptNamesModels [optional] default empty array |
$fake_supers | [boolean] include -1 and -2 as All Retail and All [optional] default false |
- Returns
- [string] html form
static FormLib::dateRangePicker |
( |
|
$one = 'date1' , |
|
|
|
$two = 'date2' , |
|
|
|
$week_start = 1 |
|
) |
| |
|
static |
Get a fieldset to select certain date ranges Requires JQquery
- Parameters
-
$one | id for date input (default 'date1') |
$two | id for date input (default 'date2') |
$week_start | day number (default 1/Monday) |
- Returns
- HTML string
calculate all the applicable dates in PHP
static FormLib::getDate |
( |
|
$name, |
|
|
|
$default = '' , |
|
|
|
$format = 'Y-m-d' |
|
) |
| |
|
static |
Get form input as a formatted date
- Parameters
-
$name | [string] form field |
$default | [mixed, optional] default value if form input is omitted or invalid |
$format | [string, optional] date format string. Default is Y-m-d. |
static FormLib::getFormValue |
( |
|
$name, |
|
|
|
$default = '' |
|
) |
| |
|
static |
Safely fetch a form value
- Parameters
-
$name | the field name |
$default | default value if the form value doesn't exist |
- Returns
- The form value, if available, otherwise the default.
static FormLib::standardDateFields |
( |
) | |
|
|
static |
Generate standard date fields with date_range_picker
static FormLib::standardItemFields |
( |
) | |
|
|
static |
Build a standardized set of for querying items Currently includes tabs for: department / superdepartment brand vendor like code
static FormLib::standardItemFromWhere |
( |
) | |
|
|
static |
Generate FROM and WHERE clauses with appropriate parameters and joins based on the standard form submissions.
- Returns
- [keyed array]
- query [string] from and where clauses
- args [array] corresponding parameters
static FormLib::storePicker |
( |
|
$field_name = 'store' ) | |
|
|
static |
Get <select> box for the store ID
- Parameters
-
$field_name | [string] select.name (default 'store') |
- Returns
- keyed [array]
- html => [string] select box
- names => [array] store names
The documentation for this class was generated from the following file:
- fannie/classlib2.0/lib/FormLib.php