Form.php
This contains Wizard’s Toolkit functions for building HTML form fields.
These are universal functions required for saving of data, priming fields, hidden fields, etc.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Tags
Table of Contents
- wtkPageReadOnlyCheck() : true
- This function can be called at top of page to determine if page should be read-only.
- wtkFormHidden() : HTML
- Create hidden form field
- wtkFormPrepUpdField() : mixed
- wtkFormWriteUpdField() : mixed
- wtkFormPrimeField() : hidden
- Prime Field
Functions
wtkPageReadOnlyCheck()
This function can be called at top of page to determine if page should be read-only.
wtkPageReadOnlyCheck(
string
$fncPage
,
string
$fncId)
: true
If page is being converted to PDF (aka printed) then it will always be considered Read-Only. If the page is currently being edited by someone else, then this will return that it should be readonly and it will set the global variable $gloFormMsg with the information of who is currently editing the page including their phone number. This is based on the wtkLoginLog table and only triggers if the person is currently on the page and it has not been more than 3 hours since they opened the page.
Parameters
- $fncPage : string
-
name of page
- $fncId : string
-
id of data being looked up on page
Tags
Return values
true —if page should be read-only; otherwise returns false
wtkFormHidden()
Create hidden form field
wtkFormHidden(
string
$fncName
,
string
$fncValue)
: HTML
Parameters
- $fncName : string
-
used to create name and id of input field
- $fncValue : string
-
value of field
Return values
HTML —for hidden form field
wtkFormPrepUpdField()
wtkFormPrepUpdField
(
mixed
$fncTable
,
mixed
$fncField
,
mixed
$fncFormType
) : mixed
Parameters
- $fncTable : mixed
- $fncField : mixed
- $fncFormType : mixed
Return values
mixed —wtkFormWriteUpdField()
wtkFormWriteUpdField
() : mixed
Return values
mixed —wtkFormPrimeField()
Prime Field
wtkFormPrimeField(
string
$fncTable
,
string
$fncField
,
string
$fncValue)
: hidden
If (and only if) page is in ADD mode then this function will create a hidden form field on the page with the value you passed. Upon leaving the page that value will be primed in the insert for this table.
Parameters
- $fncTable : string
-
SQL data table name
- $fncField : string
-
aka column name
- $fncValue : string
-
to be saved
Tags
Return values
hidden —form field