DBMS_FORMDatabese Formulars / Lists
this class can be used to handel all kind of forms needed it is administrated through the admin link: /admin/dbms
SRCVERSION 2
Located in /db/forms/DBMS_FORM.phpclass (line 68)
| Class | Description |
|---|---|
DBMS_FORMAJAX
|
Class DBMS_FORMAJAX |
DBMS_FIELD
&addClassField
(string $class, string $key, [array $dbDesc = NULL], [string $label = ""], [string $tbl = DBMS_NO_DBFIELD], [boolean $debug = FALSE])
DBMS_FIELD
&addField
(string $key, [string $type = "unknown"], [array $dbDesc = NULL], [string $label = ""], [string $tbl = DBMS_NO_DBFIELD], [boolean $debug = FALSE])
DBMS_FIELD;
&addFieldObj
(DBMS_FIELD $field, [boolean $keepTable = TRUE], [boolean $debug = FALSE], [boolean $keepSort = FALSE])
void
&addNoDbClassField
( $class, $key, [ $label = ""], [ $tbl = DBMS_NO_DBFIELD], [ $debug = FALSE])
void
&addNoDbField
( $key, [ $label = ""], [ $type = "unknown"], [ $tbl = DBMS_NO_DBFIELD], [ $debug = FALSE])
void
&addPKField
( $key, [ $label = ""], [ $type = "unknown"], [ $dbDesc = NULL], [ $tbl = DBMS_NO_DBFIELD], [ $debug = FALSE])
boolean
checkForNVL
(array $postArr, [string $table = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
void
en_disAbleField
(boolean $enabled, string $fldName, [int $mode = -1], [string $tbl = ""], [boolean $debug = FALSE])
void
getCSVHeadLine
([array $row = NULL], [char $fldSep = ';'], [char $txtSep = '"'], [boolean $allFields = FALSE], [boolean $debug = FALSE])
void
getCSVLine
(array $row, [char $fldSep = ';'], [char $txtSep = '"'], [boolean $allFields = FALSE], [boolean $debug = FALSE])
string
getHTMLFormButtons
([int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
string
getHTMLFormFromArray
(array $DBVAL, [int $mode = FRM_MODE_READONLY], [string $frmAction = ""], [string $nextURI = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
string
getHTMLFormNoRights
([int $usrId = 0], [int $mode = FRM_READONLY], [array $dbVal = NULL], [string $txtInfo = ""], [boolean $debug = FALSE])
string
getHTMLLstFromCursor
(DBCURSOR $cursor, &$nofRows, [array $links = NULL], [string $sortLnk = NULL], [boolean $debug = FALSE], int $nofRows)
void
getHTMLLstFromQuery
( &$nofRows, [ $query = ""], [ $links = NULL], [ $sortLnk = NULL], [ $limit = 0], [ $offset = 0], [ $debug = FALSE])
boolean
getInsertCols
(array $postArr, string &$cmd, [string $table = ""], [boolean $debug = FALSE])
boolean
getInsertValues
(array $postArr, string &$cmd, [string $table = ""], [ $arrName = "DBVAL"], [boolean $debug = FALSE])
string
getJavaCode
([int $mode = FRM_MODE_READONLY], [boolean $withJSInc = FALSE], [boolean $debug = FALSE], string $frmName)
string
getListHeaderRow
( &$noCols, [array $links = NULL], [ $sortLnk = ""], [boolean $debug = FALSE], int $noCols, string $sortLink)
string
getListRow
(array $row, &$rowNr, [array $links = NULL], [boolean $debug = FALSE], int $rowNr)
string
getTableFromArray
(array $DBVAL, [int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
boolean
getUpdateValues
(array $postArr, string &$cmd, [string $table = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
array
getValueArray
(array $postArr, [string $table = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
bool
getWhereValues
(array $postArr, &$cmd, [string $table = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE], string $cmd)
boolean
mergeFormFields
( &$frmMerge, [boolean $prepend = FALSE], [boolean $debug = FALSE], DBMS_FORM $frmMerge)
DBMS_FIELD
&newField
(string $class, string $key, [string $tbl = DBMS_NO_DBFIELD], [int $orderNr = 0], [string $label = ""], [array $dbDesc = NULL], [boolean $debug = FALSE])
void
setHTMLFORM_objectVar
(array $DBVAL, [int $mode = FRM_MODE_READONLY], [string $frmAction = ""], [string $nextURI = ""], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
void
writeField
(string $name, int $mode, any $val, [string $arrName = "DBVAL"], [boolean $debug = FALSE])
void
writeListRow
(array $row, int $rowNr, array $links, [array $fields = NULL], [string $trTag = ""], [array $tdDesc = ""], [boolean $debug = FALSE])
void
writeSearchForm
([string $arrName = "DBSEARCH"], [string $trTag = ""], [boolean $debug = FALSE])
string
writeTableFromArray
( $DBVAL, [int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE], DB_xxx $DBOBJ, string $query)
string
writeTableFromQuery
(DB_xxx $DBOBJ, string $query, [int $mode = FRM_MODE_READONLY], [string $arrName = "DBVAL"], [boolean $debug = FALSE])
bool;
xmlExport
([string $xmlfile = ""], [boolean $base64 = TRUE], [boolean $debug = FALSE], [boolean $echoXML = TRUE])
boolean
$debugDelete
= FALSE (line 193)
boolean
$debugInsert
= FALSE (line 183)
boolean
$debugMode
= FALSE (line 128)
boolean
$debugUpdate
= FALSE (line 188)
array
$errors
= array() (line 137)
mixed
$FRMADDBUTTONS
= "" (line 260)
string
$FRMDELETEURL
= NULL (line 229)
longstring
$frmDesc
= NULL (line 84)
string
$FRMEDITURL
= NULL (line 225)
array
$frmFields
= array() (line 100)
int
$frmId
(line 72)
array
$frmJoin
= array() (line 110)
array
$frmKeys
= array() (line 96)
mixed
$FRMLST_ADDBEFORELINKS
= "" (line 257)
int
$FRMLST_LIMIT
(line 246)
mixed
$FRMLST_ROWADD
= "" (line 253)
mixed
$FRMLST_TABLEADD
= "" (line 252)
some layout vars
mixed
$FRMLST_TDADD
= "" (line 255)
mixed
$FRMLST_TDFLDADD
= "" (line 256)
string
$FRMLST_THADD
= "class=\"lstHeader\"" (line 177)
mixed
$FRMLST_TRADD
= "" (line 254)
int
$frmMode
(line 219)
show mode of the form
string
$frmName
= NULL (line 76)
mixed
$FRMNOBUTTONS
= FALSE (line 261)
string
$frmQuery
= "" (line 104)
string
$frmRevision
= 1 (line 80)
array
$frmRights
= array() (line 116)
array
$frmTables
= array() (line 88)
mixed
$FRMTAGADD
= "" (line 259)
string
$gDBIDX
= "USRDB" (line 163)
string
$HTMLFORM_arrayName
= "DBVAL" (line 235)
array
$HTMLFORM_button_src
= array() (line 156)
string
$HTMLFORM_URL_back
= "" (line 240)
boolean
$isTblDefault
= FALSE (line 92)
linuxTimestamp
$lastDBCheck
(line 122)
array
$layoutFields
= array() (line 199)
boolean
$lstShowRowNr
= FALSE (line 205)
AJAX_FORM
$myAjaxObj
= NULL (line 277)
the ajax object for the form NOTE: the class source is not automaticaly implemented
string
$myClassSrcFile
= __FILE__ (line 267)
string
$myDBMS_TABLEOBJ_class
= "" (line 149)
string
$myDBMS_TABLEOBJ_include
= "" (line 143)
string
$myHTMLName
= "" (line 212)
name of the html forms
adds a new field and get the class out of type
adds a new field and get the class out of type if the class could not derived from $GLOBALS['DBMS_FIELD_CLASSES'][$type] DBMS_FIELD is used
adds afield object to the form
adds a field object to the form
adds a table to the form
checks if all required (NOT NULL FIELDS) are set
removes the cache files of the form
countListCols
returns the number of cols the list table has
creates a form
creates a db column out of a field
deletes field
disables a field in a FRM_MODE_NEW or FRM_MODE_EDIT if (mode == -1) FRM_MODE_NEW and FRM_MODE_EDIT are used
disables a field in a FRM_MODE_NEW or FRM_MODE_EDIT if (mode == -1) FRM_MODE_NEW and FRM_MODE_EDIT are used
disables or enables a field in a FRM_MODE_NEW or FRM_MODE_EDIT if (mode == -1) FRM_MODE_NEW and FRM_MODE_EDIT are used
checks if a field with $fldName exists for table $tbl (if not empty)
generates frmFields out of a string generated with DBMS_FORM::db_setFieldLst
generates a string to store the fieldlist into a blob (text) field
transform a key to a dbusable column name (only letters, numbers and underscore)
populates the join array $frmJoin
first find all primary keys if a primary key COLNAME occures more then 1 time an array with field names (TABLENAME.COLNAME) as value is added to $frmJoin[COLNAME]
returns an array with all auto_inc fields
returns the class file
returns the csv header line (column names)
returns a csv line
returns the db ojbect of the form and ensures the db object is connected
returns an array representing the table row of the form object
returns an array with the field default values;
returns the error in a string
returns a pointer to a field object
returns an array of pointers to the form fields
returns an array of fields (for compatibility with new version (OCSP_FORM)
generates a sql from statement
returns the html code for the form buttons row (colspan=2)
beside the method parameters the HTMLFORM object:
button images are derived from $this->HTMLFORM_button_src[] array
in read only mode if userCanEdit editbutton is added link is $this::FRMEDITURL or $this::HTMLFORM_URL_reload?FRMCMD=EDIT if userCanDelete delete button is added only if not emtpy $this::FRMDELETEURL
returns the html code for the complete form
object vars used you can set them to change layout or enlarge functionality
returns the html code for the hidden form fields
beside the method parameters the HTMLFORM object:
returns a html statement for no rights errors
returns the html code for list from a database cursor object
$cursor->fetchArrayFld() is called to get the row
NOTE: use getList_SQLFieldLst() in the select statement if you have a LEFT JOIN to get the right fields and values
layout class var used:
returns the name of the form in the html form
<form name="....">
generates a string with the column names to use in an insert statement appends a comma seperated list to $cmd
generates a string with comma seperated slashed field values to use in an insert statement together with DMBS_FORM::getInsertCols()
example:
gets the html (javaScriptCode) for the formular start
returns the key array
returns an array with key=column name and value = label of the form
echos the list header Row
class = "lstHeader" is added to <a> html tag $this->FRMLST_THADD is added to <th>
returns the htmlCode for a list row
layout class var used:
if $links['EDIT'] isset each data colum is link to the url if the link key == fldname the link is added to the field
returns the SQL-Fieldlist for Lists
returns the value of an object variable
returns the relaod url
returns an object value for a row
returns a query string for the row in $rowArr
generates a where statement for search
returns the form table rows
returns an 2 dimensional array of all form data [table][col]
returns an array with links to use in a tab NOTE templates are not parsed
generates a sql update statement key = value pares NOTE $cmd call by reference!!
as this only APPENDS key=value pares to seperated with a "," to the command you have to take care for a valid sql statement
ATTANTION: the , is only set between key=value
example:
returns an array with values checked against the form sets the form errors in case of array but always returns the array check the form for errors with this::hasErrors() before proceeding
appends the values set in postArr to $cmd to use in SQL Where
$cmd .= [AND] DBMS_FIELD::getAssignment()
returns the form field array
returns if the form has a sortcolumn (DBMS_FIELD_ORDERNR)
hides all fields of a table
set a field hidden
returns if the form is reloaded
loads the form form the database
returns true if a row with $this->id is fetched from the db NOTE: table columns are hard coded changes to the database table can create errors
sets lstShowRowNr
merges the fields of an other form to $this if ($prepend) is true the fields will be prepended else appended to the fieldlist
creates a new field
returns the link url for a row
$link is array with keys:
private method checks right from table T_DBMS_FORMRIGHTS
check if the form is relaoded and we have to use the posted values instead of $aktRow if $aktRow is not an array the form default values are used
removes a table from the form
removes all fields of a Table
marks the form as new it will be inserted on $this::storeToDb
sets the object values from a data array
adds an error to this::errors
sets the error array
sets a field object
sets myForm in each field
sets the button array
sets object HTMLFORM variables:
sets the name of the form in the html form
<form name="....">
sets the value of an object variable
set a field not hidden
enable field in list
stores a form object to database table T_DBMS_FORM
uses $GLOBALS['USRDB'] as database object calls
unserializes a fieldRow (array element)
checks if the table has changed
checks if a user is allowed to delete the data
checks if a user is allowed to edit (update) the data
checks if a user is allowed to export the data
checks if a user is allowed to add (insert) new data
returns if the user is allowed in mode
checks if a user is allowed to show the data
check if the form uses $aTable
echos the form errors
writes a field and sets the fields form Id
echos a html table row <tr> ... </tr> for a row
NOTE: sets the global $FORMS_LISTROW only use this global var in function called within this function it is used in field objects to access values of other fields with global ${$arrName}
link array creates a <a ></a> HTML code with the folowing attributes (if array links[attrib] ! empty)
if $links['EDIT'] isset each data colum is link to the url
echos a searchForm
writes a form table from a query
writes a form table from a query
exports the form to an xml file
exports the form to an xml file
Documentation generated on Thu, 08 Jan 2009 17:43:36 +0100 by phpDocumentor 1.4.0a2