\PDOCrud

PDOCrud - Advance PHP CRUD application generator using PDO File: PDOCrud.php Author: Pritesh Gupta Version: 4.8.1 Release Date: 21-Aug-2016 Last Update : 25-Oct-2020

Copyright (c) 2020 Pritesh Gupta. All Rights Reserved.

/* ABOUT THIS FILE:

PDOCrud is an advance PHP based CRUD(Create, Read, Update and Delete) generator application. It supports Mysql, Pgsql, MSSQL and Sqlite database. By writing just 2-3 lines of code only, you can perform insert/update/delete and select operation. You just to need to create object and call for render function for that table and everything will be generated automatically. PDO Crud supports all types of database fields. Fields will be generated based on the data type. You can remove fields, change type of fields and can do various types of customization.


Summary

Methods
Properties
Constants
__construct()
getSettings()
getSearchData()
setSettings()
dbTable()
joinTable()
crudTableCol()
crudRemoveCol()
crudAddAction()
recordsPerPage()
setRecordsPerPageList()
currentPage()
colTypes()
crudColTooltip()
setPK()
setInlineEdit()
dbOrderBy()
dbLimit()
setSearchCols()
formTag()
formFields()
editFormFields()
formRemoveFields()
formSendEmail()
formSetPrimarykey()
setPrimarykeyValue()
formExportData()
formAddCaptcha()
formDisplayInPopup()
formId()
fieldDisplayOrder()
fieldFormula()
fieldCssClass()
formStaticFields()
fieldRenameLable()
fieldHideLable()
fieldNotMandatory()
fieldAttributes()
fieldTypes()
fieldValidationType()
fieldDependent()
fieldDataBinding()
fieldAddOnInfo()
fieldBlockClass()
fieldGroups()
FormSteps()
fieldTooltip()
fieldDesc()
fieldDataAttr()
fieldRename()
formFieldValue()
formRedirection()
fieldConditionalLogic()
addFieldDesc()
buttonHide()
resizeImage()
thumbnailImage()
crop()
flip()
imageText()
watermark()
setQuery()
bulkCrudUpdate()
tableColFormatting()
viewColFormatting()
tableDataFormatting()
tableColAddition()
tableHeading()
tableSubHeading()
tableColUsingDatasource()
colDependent()
colRename()
colDataAttr()
colSumPerPage()
colSumTotal()
setViewColumns()
setColumnsOrders()
addTooltip()
relatedData()
exportColHeading()
where()
setBackOperation()
setSearchOperator()
crudCall()
addFilter()
setFilterSource()
addAdvSearch()
setAdvSearchSource()
setAdvSearchParam()
setTriggerOperation()
addSidebar()
setDelJoinTableData()
enqueueActions()
enqueueBtnActions()
enqueueBtnTopActions()
dequeueBtnActions()
enqueueHTMLContent()
forgotPassword()
checkDuplicateRecord()
recaptcha()
setSearchColumnDataType()
addDateRangeReport()
exportDB()
setUserSession()
getUserSession()
unsetUserSession()
checkUserSession()
addChart()
fileSavePath()
outputHTMLContent()
outputChartCode()
addPlugin()
subQueryColumn()
enqueueJs()
applyJS()
unsetJs()
multiTableRelation()
multiTableRelationDisplay()
setInvoiceDetails()
outputJs()
outputApplyJs()
invoicePrint()
addCallback()
loadPluginJsCode()
setSkin()
enqueueCss()
unsetCss()
outputCss()
setCurrentLang()
getLangData()
setLangData()
setPortfolioColumn()
setFormSkin()
setAjaxActions()
setJsActions()
setLeftJoinJsActions()
render()
resetFields()
getErrors()
getPDOModelObj()
showChart()
addHTML()
callbackTriggerOperation()
emailPassword()
getInputField()
getSubmitField()
getButtonField()
getGoogleMap()
getTextareaField()
getSelectField()
getRadioButtonField4()
getRadioButtonField()
getCheckboxField4()
getCheckboxField()
getCaptcha()
getImageField()
getListElements()
getSpanField()
getLableField()
getToolTipField()
getAnchorField()
getDescField()
getAjaxLoaderImage()
getSlider()
getImagePreviewField()
getDiv()
getFileUploadField()
getSearchBox()
perPageRecords()
getStepHeader()
getMoodelContent()
getSidebar()
fileUpload()
getRandomKey()
getDirFiles()
arrayToCSV()
arrayToXML()
arrayToHTML()
getPDFObject()
arrayToPDF()
arrayToExcel()
bulkImport()
csvToArray()
excelToArray()
xmlToArray()
sendEmail()
$fileOutputMode
$checkFileName
$checkFileNameCharacters
$replaceOlderFile
$uploadedFileName
$fileUploadPath
$maxSize
$fileSavePath
$pdfFontName
$pdfFontSize
$pdfFontWeight
$pdfAuthorName
$pdfSubject
$excelFormat
$outputXML
$rootElement
$encoding
$rowTagName
$append
$existingFilePath
$delimiter
$enclosure
$isFile
$useFirstRowAsTag
$outputHTML
$tableCssClass
$trCssClass
$htmlTableStyle
$htmlTRStyle
$htmlTDStyle
No constants found
No protected methods found
No protected properties found
N/A
initializeSettings()
initializeBtnActions()
initializeHTMLContent()
initializePlugins()
enqueuePlugin()
handleCallback()
initializeJsSettings()
outputJsSettings()
registerJs()
registerCss()
loadLangData()
savePDOCrudObj()
validate()
handleOperation()
dbSelect()
dbInsert()
checkDuplicateData()
dbUpdate()
dbSaveCrudData()
dbDelete()
dbDeleteSelected()
dbBtnSwitch()
dbSwitch()
dbSaveJoinData()
dbDelJoinData()
emailData()
formatFormData()
cleanInputData()
validateField()
checkCaptchaField()
getResponse()
uploadFormImage()
dbQuickView()
dbRelatedTableView()
dbOnePage()
dbCRUD()
dbSQL()
dbAdvSearch()
setTableHeadings()
setTableColumns()
getSubQuery()
parseSubQuery()
replaceColumns()
getRelatedColumn()
addLimitOrderBy()
getSelectPageLimit()
addJoinCondtion()
getColumnNames()
crudTableColDataSource()
formatTableData()
getAdvSearchControls()
getSearchFieldData()
getInsertForm()
getEditForm()
getViewForm()
getSelectForm()
getEmailForm()
getAutoSuggestData()
getInvoicePDF()
ajaxAction()
getCloneForm()
renderFormData()
renderViewFormData()
getLeftJoinData()
exportTableData()
getJoinFormData()
getStepwiseFormData()
getTabStepData()
getStepyData()
getColSum()
getSortedData()
getExtraData()
getDateRangeFromDate()
exportFormData()
getPrimaryKey()
getColFromJoinTables()
getJoinKeyName()
getJoinKeyValue()
getStaticFields()
getFormTag()
getHTMLData()
getViewHTMLData()
checkJoinKeyField()
getJoinColFullName()
getFormFields()
isAutoIncrementField()
getFieldAttributes()
getPlaceholder()
getFieldClass()
getFieldData()
generateFilterControls()
getFilterControls()
reorderColumn()
getHTMLElementType()
getHTMLElement()
getSubmitData()
getHTMLElementLable()
getHTMLElementBlockClass()
getHTMLElementGroup()
getHTMLElementTooltip()
getHTMLElementDesc()
getHTMLElementAddOn()
getHTMLElementFieldOrder()
getHTMLContent()
getFormPopup()
getRelatedTable()
getRelatedTableTab()
getRelatedTableDefault()
getSidebarData()
addWhereCondition()
applySubQueryWhere()
searchRelData()
formatDatasource()
addError()
encryptPassword()
encrypt()
decrypt()
getDependentData()
getChartData()
getTriggerFormatedData()
getMoodleStartContainer()
getMoodleEndContainer()
getMoodleHeader()
getMoodleBody()
checkValidFileUpload()
getFileExtension()
formatOutputArray()
generateXML()
$tableName
$multi
$form
$formSteps
$formExport
$formCaptcha
$formEmail
$formPopup
$formId
$fieldValidation
$fields
$fieldAttr
$fieldsStatic
$fieldsRemove
$fieldType
$fieldDepend
$fieldNames
$fieldDataBind
$fieldDesc
$fieldAddOn
$fieldBlockClass
$fieldClass
$fieldOrder
$fieldDefaultOrder
$fieldNotRequired
$formFieldVal
$hideFieldName
$hideButton
$fieldGroup
$tooltip
$crudTooltip
$settings
$currentLang
$pdocrudView
$pdocrudErrCtrl
$pdocrudhelper
$pdoTableFormatObj
$pdocrudvalidate
$objKey
$HTMLContent
$pk
$pkVal
$js
$jsSettings
$colApplyJs
$css
$plugins
$message
$tableFieldJoin
$callback
$joinTable
$leftJoin
$columns
$currentpage
$orderByCols
$sortOrder
$tableDataFormat
$colFormat
$colTypes
$colDepends
$colAdd
$colSumPerPage
$colSumTotals
$colNames
$colAttr
$colsRemove
$actions
$btnActions
$search
$filterData
$searchCols
$directCall
$inlineEdit
$tableHeading
$tableSubHeading
$crudCall
$backOperation
$sql
$crudFilter
$crudFilterSource
$recaptcha
$formRedirection
$fieldConditionalLogic
$submitbtnClass
$tableColDatasource
$bulkCrudUpdateCol
$searchOperator
$advSearch
$advSearchDataSource
$advSearchParam
$advSearchData
$imageFlip
$imageText
$watermark
$imageThumbnail
$imageCrop
$imageDimensions
$multiTableRelation
$multiTableRelationDisplay
$chart
$viewColumns
$portfolioCol
$delJoinTableData
$triggerOperation
$forgotPass
$searchColDataType
$fieldFormula
$viewColFormat
$sidebar
$exportColName
$btnTopAction
$dateRangeReport
$dateRangeData
$colOrder
$session
$checkDuplicate
$op
$editFields
$searchBoxCols
$chartData
$recordsPerPageList
$relData
$isRelData
$pdf
$subSelectQuery
$invoiceDetails
$xinvoicePrint
N/A

Properties

$fileOutputMode

$fileOutputMode : 

Type

$checkFileName

$checkFileName : 

Type

$checkFileNameCharacters

$checkFileNameCharacters : 

Type

$replaceOlderFile

$replaceOlderFile : 

Type

$uploadedFileName

$uploadedFileName : 

Type

$fileUploadPath

$fileUploadPath : 

Type

$maxSize

$maxSize : 

Type

$fileSavePath

$fileSavePath : 

Type

$pdfFontName

$pdfFontName : 

Type

$pdfFontSize

$pdfFontSize : 

Type

$pdfFontWeight

$pdfFontWeight : 

Type

$pdfAuthorName

$pdfAuthorName : 

Type

$pdfSubject

$pdfSubject : 

Type

$excelFormat

$excelFormat : 

Type

$outputXML

$outputXML : 

Type

$rootElement

$rootElement : 

Type

$encoding

$encoding : 

Type

$rowTagName

$rowTagName : 

Type

$append

$append : 

Type

$existingFilePath

$existingFilePath : 

Type

$delimiter

$delimiter : 

Type

$enclosure

$enclosure : 

Type

$isFile

$isFile : 

Type

$useFirstRowAsTag

$useFirstRowAsTag : 

Type

$outputHTML

$outputHTML : 

Type

$tableCssClass

$tableCssClass : 

Type

$trCssClass

$trCssClass : 

Type

$htmlTableStyle

$htmlTableStyle : 

Type

$htmlTRStyle

$htmlTRStyle : 

Type

$htmlTDStyle

$htmlTDStyle : 

Type

$tableName

$tableName : 

Type

$multi

$multi : 

Type

$form

$form : 

Type

$formSteps

$formSteps : 

Type

$formExport

$formExport : 

Type

$formCaptcha

$formCaptcha : 

Type

$formEmail

$formEmail : 

Type

$formPopup

$formPopup : 

Type

$formId

$formId : 

Type

$fieldValidation

$fieldValidation : 

Type

$fields

$fields : 

Type

$fieldAttr

$fieldAttr : 

Type

$fieldsStatic

$fieldsStatic : 

Type

$fieldsRemove

$fieldsRemove : 

Type

$fieldType

$fieldType : 

Type

$fieldDepend

$fieldDepend : 

Type

$fieldNames

$fieldNames : 

Type

$fieldDataBind

$fieldDataBind : 

Type

$fieldDesc

$fieldDesc : 

Type

$fieldAddOn

$fieldAddOn : 

Type

$fieldBlockClass

$fieldBlockClass : 

Type

$fieldClass

$fieldClass : 

Type

$fieldOrder

$fieldOrder : 

Type

$fieldDefaultOrder

$fieldDefaultOrder : 

Type

$fieldNotRequired

$fieldNotRequired : 

Type

$formFieldVal

$formFieldVal : 

Type

$hideFieldName

$hideFieldName : 

Type

$hideButton

$hideButton : 

Type

$fieldGroup

$fieldGroup : 

Type

$tooltip

$tooltip : 

Type

$crudTooltip

$crudTooltip : 

Type

$settings

$settings : 

Type

$currentLang

$currentLang : 

Type

$pdocrudView

$pdocrudView : 

Type

$pdocrudErrCtrl

$pdocrudErrCtrl : 

Type

$pdocrudhelper

$pdocrudhelper : 

Type

$pdoTableFormatObj

$pdoTableFormatObj : 

Type

$pdocrudvalidate

$pdocrudvalidate : 

Type

$objKey

$objKey : 

Type

$HTMLContent

$HTMLContent : 

Type

$pk

$pk : 

Type

$pkVal

$pkVal : 

Type

$js

$js : 

Type

$jsSettings

$jsSettings : 

Type

$colApplyJs

$colApplyJs : 

Type

$css

$css : 

Type

$plugins

$plugins : 

Type

$message

$message : 

Type

$tableFieldJoin

$tableFieldJoin : 

Type

$callback

$callback : 

Type

$joinTable

$joinTable : 

Type

$leftJoin

$leftJoin : 

Type

$columns

$columns : 

Type

$currentpage

$currentpage : 

Type

$orderByCols

$orderByCols : 

Type

$sortOrder

$sortOrder : 

Type

$tableDataFormat

$tableDataFormat : 

Type

$colFormat

$colFormat : 

Type

$colTypes

$colTypes : 

Type

$colDepends

$colDepends : 

Type

$colAdd

$colAdd : 

Type

$colSumPerPage

$colSumPerPage : 

Type

$colSumTotals

$colSumTotals : 

Type

$colNames

$colNames : 

Type

$colAttr

$colAttr : 

Type

$colsRemove

$colsRemove : 

Type

$actions

$actions : 

Type

$btnActions

$btnActions : 

Type

$search

$search : 

Type

$filterData

$filterData : 

Type

$searchCols

$searchCols : 

Type

$directCall

$directCall : 

Type

$inlineEdit

$inlineEdit : 

Type

$tableHeading

$tableHeading : 

Type

$tableSubHeading

$tableSubHeading : 

Type

$crudCall

$crudCall : 

Type

$backOperation

$backOperation : 

Type

$sql

$sql : 

Type

$crudFilter

$crudFilter : 

Type

$crudFilterSource

$crudFilterSource : 

Type

$recaptcha

$recaptcha : 

Type

$formRedirection

$formRedirection : 

Type

$fieldConditionalLogic

$fieldConditionalLogic : 

Type

$submitbtnClass

$submitbtnClass : 

Type

$tableColDatasource

$tableColDatasource : 

Type

$bulkCrudUpdateCol

$bulkCrudUpdateCol : 

Type

$searchOperator

$searchOperator : 

Type

$advSearch

$advSearch : 

Type

$advSearchDataSource

$advSearchDataSource : 

Type

$advSearchParam

$advSearchParam : 

Type

$advSearchData

$advSearchData : 

Type

$imageFlip

$imageFlip : 

Type

$imageText

$imageText : 

Type

$watermark

$watermark : 

Type

$imageThumbnail

$imageThumbnail : 

Type

$imageCrop

$imageCrop : 

Type

$imageDimensions

$imageDimensions : 

Type

$multiTableRelation

$multiTableRelation : 

Type

$multiTableRelationDisplay

$multiTableRelationDisplay : 

Type

$chart

$chart : 

Type

$viewColumns

$viewColumns : 

Type

$portfolioCol

$portfolioCol : 

Type

$delJoinTableData

$delJoinTableData : 

Type

$triggerOperation

$triggerOperation : 

Type

$forgotPass

$forgotPass : 

Type

$searchColDataType

$searchColDataType : 

Type

$fieldFormula

$fieldFormula : 

Type

$viewColFormat

$viewColFormat : 

Type

$sidebar

$sidebar : 

Type

$exportColName

$exportColName : 

Type

$btnTopAction

$btnTopAction : 

Type

$dateRangeReport

$dateRangeReport : 

Type

$dateRangeData

$dateRangeData : 

Type

$colOrder

$colOrder : 

Type

$session

$session : 

Type

$checkDuplicate

$checkDuplicate : 

Type

$op

$op : 

Type

$editFields

$editFields : 

Type

$searchBoxCols

$searchBoxCols : 

Type

$chartData

$chartData : 

Type

$recordsPerPageList

$recordsPerPageList : 

Type

$relData

$relData : 

Type

$isRelData

$isRelData : 

Type

$pdf

$pdf : 

Type

$subSelectQuery

$subSelectQuery : 

Type

$invoiceDetails

$invoiceDetails : 

Type

$xinvoicePrint

$xinvoicePrint : 

Type

Methods

__construct()

__construct(string  $multi = false, string  $template = "", string  $skin = "", array  $settings = array()) 

Constructor

Parameters

string $multi

If multiple instance of form used on the same page, then set this true to avoid loading multiple js/css

string $template

Set template directly

string $skin

Set skin/template directly

array $settings

Set default setting at the time of initialization

getSettings()

getSettings(string  $setting) 

Get particular configuaration setting

Parameters

string $setting

Config Key for which setting needs to be retreived return mixed Configuaration setting value

getSearchData()

getSearchData() 

Get search data return array get search data

setSettings()

setSettings(string  $setting, mixed  $value) : object

Set particular configuaration setting

Parameters

string $setting

Config key for setting

mixed $value

Value for setting

Returns

object —

Object of class

dbTable()

dbTable(string  $tableName) : object

Set table name for which form needs to be generated

Parameters

string $tableName

The name of the table to generate form.

Returns

object —

Object of class

joinTable()

joinTable(string  $joinTableName, string  $joinCondition, string  $joinType = "INNER JOIN") : object

Add join between tables, supported join condition are "INNER JOIN" & "LEFT JOIN"

Parameters

string $joinTableName

name of table to be joined

string $joinCondition

join condition e.g.

string $joinType

type of join (Inner or left join)-default is inner join

Returns

object —

Object of class

crudTableCol()

crudTableCol(string  $columns) : object

Set html curd table display columns

Parameters

string $columns

Columns names to be displayed in table format

Returns

object —

Object of class

crudRemoveCol()

crudRemoveCol(string  $columns) : object

Hide a specific crud table columns

Parameters

string $columns

Columns names to be displayed in table format

Returns

object —

Object of class

crudAddAction()

crudAddAction(string  $actionName, string  $colName, array  $displayVal = array(), array  $applyVal = array()) : object

Add a custom action button in crud

Parameters

string $actionName

name of action

string $colName

column name to be action applied

array $displayVal

display value of button based on the column value

array $applyVal

On click, apply value to the column

Returns

object —

Object of class

recordsPerPage()

recordsPerPage(integer  $val) : object

Set how many records per page to be displayed in html table

Parameters

integer $val

no. of records per page e.g. 10

Returns

object —

Object of class

setRecordsPerPageList()

setRecordsPerPageList(array  $val) : object

Set drop down list of records per page

Parameters

array $val

list of records per page e.g 10,25,50,100

Returns

object —

Object of class

currentPage()

currentPage(integer  $pageNo) : object

Sets current page in pagination

Parameters

integer $pageNo

page no. e.g. 2

Returns

object —

Object of class

colTypes()

colTypes(string  $colName, string  $colType, string  $parameters = "") : object

Sets column type in the crud table

Parameters

string $colName

column name to be changed

string $colType

type of column to be set

string $parameters

column parameters

Returns

object —

Object of class

crudColTooltip()

crudColTooltip(string  $colName, string  $tooltip, string  $tooltipIcon = "<i class='glyphicon glyphicon-info-sign'></i>") : object

Tooltip for the column

Parameters

string $colName

Name of columns for which tooltip needs to be added

string $tooltip

Tooltip to be shown

string $tooltipIcon

Icon for the tooltip

Returns

object —

Object of class

setPK()

setPK(string  $columnName) : object

Sets primary key

Parameters

string $columnName

sets primary key

Returns

object —

Object of class

setInlineEdit()

setInlineEdit(boolean  $val = false) : object

Set whether current operation is inline edit or not

Parameters

boolean $val

whether to enable inline edit or not

Returns

object —

Object of class

dbOrderBy()

dbOrderBy(mixed  $orderbyCols) : object

Sets order by condition for crud html table data

Parameters

mixed $orderbyCols

columns names for which data needs to be order by

Returns

object —

Object of class

dbLimit()

dbLimit(integer  $limit) : object

Sets limit of records to be displayed

Parameters

integer $limit

limit of records to be used

Returns

object —

Object of class

setSearchCols()

setSearchCols(array  $cols) : object

Sets search columns

Parameters

array $cols

Set columns to be used for search

Returns

object —

Object of class

formTag()

formTag(string  $formHeading = "", string  $formType = "", array  $class = array(), array  $attr = array()) : object

Set form related parameters e.g. formHeading, formType="horizontal/inline", form class and attribute etc.

Parameters

string $formHeading

Heading of form (fieldset)

string $formType

Type of form (normal, horizontal or inline) for bootstrap

array $class

CSS Class for form

array $attr

Various data attributes for form

Returns

object —

Object of class

formFields()

formFields(array  $fields) : object

Set which fields of table to be displayed in form

Parameters

array $fields

Form fields to displayed only

Returns

object —

Object of class

editFormFields()

editFormFields(array  $fields) : object

Set which fields of table to be displayed in edit form

Parameters

array $fields

Form fields to displayed only

Returns

object —

Object of class

formRemoveFields()

formRemoveFields(array  $fields = array()) : object

Removes specific fields from form

Parameters

array $fields

Fields to removed from form

Returns

object —

Object of class

formSendEmail()

formSendEmail(string  $from, string  $to, string  $subject, string  $message, boolean  $saveDb = false) : object

Set email related settings if form sends email instead of insert/update operation

Parameters

string $from

From email

string $to

To email

string $subject

Subject of email

string $message

Message of the email

boolean $saveDb

whether to save msg in database or not

Returns

object —

Object of class

formSetPrimarykey()

formSetPrimarykey(string  $pk, string  $pkval) : object

Set primary key and value for update form

Parameters

string $pk

Set primary key field name

string $pkval

Set primary key value for which data needs to be retreived

Returns

object —

Object of class

setPrimarykeyValue()

setPrimarykeyValue(string  $pkval) : object

Set primary key and value for update form

Parameters

string $pkval

Set primary key value for which data needs to be retreived

Returns

object —

Object of class

formExportData()

formExportData(string  $exportType = "pdf") : object

Export related settings, instead of inserting data in database, you can directly export it to PDF, CSV, Excel and XML

Parameters

string $exportType

Whether to export in pdf, csv, excel or xml

Returns

object —

Object of class

formAddCaptcha()

formAddCaptcha(string  $fieldName) : object

Add captcha in form

Parameters

string $fieldName

Name of field for captcha

Returns

object —

Object of class

formDisplayInPopup()

formDisplayInPopup(string  $buttonContent = "", string  $headerContent = "", string  $directCall = false) : object

Display form in popup on click on some button

Parameters

string $buttonContent

Text for the button

string $headerContent

Header text for the popup

string $directCall

Set this true to use it for form directly

Returns

object —

Object of class

formId()

formId(string  $id) : object

Sets ID of Form

Parameters

string $id

ID of the form

Returns

object —

Object of class

fieldDisplayOrder()

fieldDisplayOrder(array  $fields) : object

Change display order of the fields

Parameters

array $fields

fields in ascending order to be displayed in form

Returns

object —

Object of class

fieldFormula()

fieldFormula(string  $field, string  $formatType, array  $paramaters) : object

Set field formula to change the value of field dynamically during insert/update operation

Parameters

string $field

Field to be modified

string $formatType

Type of formula, e.g. string or formula(math forumula)

array $paramaters

parameters to be used for formula

Returns

object —

Object of class

fieldCssClass()

fieldCssClass(string  $fieldName, array  $fieldClass = array()) : object

Set specific css class to the different fields

Parameters

string $fieldName

field name for which css class name needs to be applied

array $fieldClass

css class name for the field

Returns

object —

Object of class

formStaticFields()

formStaticFields(string  $fieldName, string  $fieldType, string  $fieldValue = "", string  $extra = "static", string  $dbField = "") : object

Add static fields to the form

Parameters

string $fieldName

name of static field

string $fieldType

type of field, e.g. radio, checkbox etc

string $fieldValue

Value of the field

string $extra

Whether it is static field or database field

string $dbField

Database field name if it is database field type

Returns

object —

Object of class

fieldRenameLable()

fieldRenameLable(string  $fieldName, string  $lableName) : object

Rename the field label name

Parameters

string $fieldName

field name for which lable name needs to be changed

string $lableName

lable name to be set

Returns

object —

Object of class

fieldHideLable()

fieldHideLable(string  $fieldName, boolean  $takeSpace = false) : object

Hide the field label name

Parameters

string $fieldName

field name for label needs to be hidden

boolean $takeSpace

whether hidden lable should take space or not

Returns

object —

Object of class

fieldNotMandatory()

fieldNotMandatory(string  $fieldName) : object

Removes required attribute from fields

Parameters

string $fieldName

field name for which required attribute needs to be removed

Returns

object —

Object of class

fieldAttributes()

fieldAttributes(string  $fieldName, array  $attr = array()) : object

Sets the data attribute of field

Parameters

string $fieldName

field name for attribute needs to set

array $attr

Array of data attributes with key as attribute name and value as attribute value

Returns

object —

Object of class

fieldTypes()

fieldTypes(string  $fieldName, string  $type, string  $parameters = "") : object

Sets the type of field

Parameters

string $fieldName

field name for types needs to be set

string $type

Field type

string $parameters

Field parameters

Returns

object —

Object of class

fieldValidationType()

fieldValidationType(string  $fieldName, string  $validation, string  $param = "true", string  $errorMsg = "", string  $fieldType = "table") : object

Sets the validation require for the field

Parameters

string $fieldName

field name for validation needs to be set

string $validation

validation like required, email etc

string $param

value of validation, default is true

string $errorMsg

error message to be displayed

string $fieldType

field type

Returns

object —

Object of class

fieldDependent()

fieldDependent(string  $dependent, string  $dependOn, string  $colName) : object

Sets the dependent field to be loaded on change of depend on field

Parameters

string $dependent

field name to be changed on onchange operation of dependOn field

string $dependOn

field that change will cause trigger change

string $colName

name of col, needs to be retrived to change the field value

Returns

object —

Object of class

fieldDataBinding()

fieldDataBinding(string  $fieldName, mixed  $dataSource, string  $key, mixed  $val, string  $bind = "db", string  $separator = " ", string  $where = array(), string  $orderby = array()) : object

Sets data binding of the field i.e. load the field data from some datasource

Parameters

string $fieldName

field name to be bind

mixed $dataSource

data source either tablename or array of data

string $key

name of col, that will serve as data key

mixed $val

name of col as string or array of columns, that will serve as field value

string $bind

whether datasource is db table or array or sql, default is db table

string $separator

Separator string in case of $val is an array of columns. Default value is " "

string $where

Where condition for the datasource

string $orderby

Order by clause for the datasource

Returns

object —

Object of class

fieldAddOnInfo()

fieldAddOnInfo(string  $fieldName, string  $position, string  $addOnText) : object

Sets input addon information for the bootstrap

Parameters

string $fieldName

field name for input addon needs to be added

string $position

position of addon text, whether before or after input it needs to be added

string $addOnText

add on content that will be added in html format

Returns

object —

Object of class

fieldBlockClass()

fieldBlockClass(string  $fieldName, string  $class) : object

Sets the class of complete input block inside a bootstrap form-group class

Parameters

string $fieldName

field name for which block class needs to be added

string $class

class name like col-sm-8 etc.

Returns

object —

Object of class

fieldGroups()

fieldGroups(string  $groupName, array  $fields = array()) : object

Group fields together like first_name and last_name under Full name group

Parameters

string $groupName

Any unuique name of group e.g. full_name

array $fields

array of fields like array(first_name, last_name)

Returns

object —

Object of class

FormSteps()

FormSteps(array  $fields, string  $stepName, string  $stepType = "stepy", string  $attr = array()) : object

Divide form fields into various steps/tabs

Parameters

array $fields

Array of fields that will be in same tab

string $stepName

Name of step(Tab)

string $stepType

Step type either stepy or tabs

string $attr

Attributes of the step

Returns

object —

Object of class

fieldTooltip()

fieldTooltip(string  $fieldName, string  $tooltip, string  $tooltipIcon = "<i class='glyphicon glyphicon-info-sign'></i>") : object

Tooltip for the field

Parameters

string $fieldName

Name of field for which tooltip needs to be added

string $tooltip

Tooltip to be shown

string $tooltipIcon

Icon for the tooltip

Returns

object —

Object of class

fieldDesc()

fieldDesc(string  $fieldName, string  $desc) : object

Set description of the field

Parameters

string $fieldName

Field for which description needs to be set

string $desc

Description of the field

Returns

object —

Object of class

fieldDataAttr()

fieldDataAttr(string  $colName, array  $attr = array()) : object

Set attributes of field

Parameters

string $colName

column name for which attribute to be added

array $attr

attribute to be set

Returns

object —

Object of class

fieldRename()

fieldRename(string  $fieldName, string  $newName) : object

Rename a field name

Parameters

string $fieldName

field name to renamed

string $newName

new field name to be used

Returns

object —

Object of class

formFieldValue()

formFieldValue(string  $fieldName, string  $value, boolean  $fieldHidden = false, string  $tablename = "") : object

Set a value of field

Parameters

string $fieldName

field name to renamed

string $value

value of the field

boolean $fieldHidden

Wheter that field is hidden or not

string $tablename

Tablename = Required only when using join table field name

Returns

object —

Object of class

formRedirection()

formRedirection(string  $redirectionURL, boolean  $reset = false) : object

Redirects to some other url after form submission

Parameters

string $redirectionURL

url to be redirected

boolean $reset

whether to reset it to empty string when no data present.

Returns

object —

Object of class

fieldConditionalLogic()

fieldConditionalLogic(string  $fieldname, string  $condition, string  $op = "=", string  $field, string  $task) : object

Add conditional logic to the form fields like

Parameters

string $fieldname

field name which trigger event

string $condition

Conditional logic to be checked

string $op

Operator to b used

string $field

field names to be affected

string $task

Operation(task) to be applied

Returns

object —

Object of class

addFieldDesc()

addFieldDesc(string  $elementName, string  $desc, string  $type = "field") : object

Add field description

Parameters

string $elementName

element for which tooltip needs to be added

string $desc

description of the field

string $type

type of element whether element or column

Returns

object —

Object of class

buttonHide()

buttonHide(  $buttonname = "cancel") : object

Hide the cancel button

Parameters

$buttonname

Returns

object —

Object of class

resizeImage()

resizeImage(array  $dimensions = array()) : object

Set the resize dimension

Parameters

array $dimensions

dimensions of image

Returns

object —

Object of class

thumbnailImage()

thumbnailImage(integer  $width, integer|null  $height = null, string  $focal = 'center') : object

Trim the image and resize to exactly This function attempts to get the image to as close to the provided dimensions as possible, and then crops the remaining overflow (from the center) to get the image to be the size specified. Useful for generating thumbnails.

Parameters

integer $width
integer|null $height

If omitted - assumed equal to $width

string $focal

Returns

object —

Object of class

crop()

crop(integer  $x1, integer  $y1, integer  $x2, integer  $y2) : \SimpleImage

Crop an image

Parameters

integer $x1

Left

integer $y1

Top

integer $x2

Right

integer $y2

Bottom

Returns

\SimpleImage

flip()

flip(string  $direction) : object

Flip an image horizontally or vertically

Parameters

string $direction

x|y

Returns

object —

Object of clas

imageText()

imageText(string  $text, string  $font_file, float|integer  $font_size = 12, string|array  $color = '#000000', string  $position = 'center', integer  $x_offset, integer  $y_offset, string|array  $stroke_color = null, string  $stroke_size = null, string  $alignment = null, integer  $letter_spacing) : object

Add text to an image

Parameters

string $text
string $font_file
float|integer $font_size
string|array $color
string $position
integer $x_offset
integer $y_offset
string|array $stroke_color
string $stroke_size
string $alignment
integer $letter_spacing

Returns

object —

Object of clas

watermark()

watermark(string  $overlay, string  $position = 'center', float|integer  $opacity = 1, integer  $xOffset, integer  $yOffset) 

Set the overlay image (Watermark) Overlay an image on top of another, works with 24-bit PNG alpha-transparency

Parameters

string $overlay

An image filename or a SimpleImage object

string $position

center|top|left|bottom|right|top left|top right|bottom left|bottom right

float|integer $opacity

Overlay opacity 0-1

integer $xOffset

Horizontal offset in pixels

integer $yOffset

Vertical offset in pixels return object Object of class

setQuery()

setQuery(string  $sql) : object

Set sql

Parameters

string $sql

Query to be executed

Returns

object —

Object of class

bulkCrudUpdate()

bulkCrudUpdate(string  $colName, string  $fieldType, array  $attr = array(), array  $fieldData = array()) : object

Bulk crud table update function to update multiple rows of data simultanously

Parameters

string $colName

Column name to be formatted

string $fieldType

type of field

array $attr

Attributes of field

array $fieldData

Data for the field

Returns

object —

Object of class

tableColFormatting()

tableColFormatting(string  $colName, string  $formatType, array  $paramaters = array()) : object

Format the particular columns of table

Parameters

string $colName

Column name to be formatted

string $formatType

type of format

array $paramaters

parameters based on the formatting type

Returns

object —

Object of class

viewColFormatting()

viewColFormatting(string  $colName, string  $formatType, array  $paramaters = array()) : object

Format the particular columns of view form

Parameters

string $colName

Column name to be formatted

string $formatType

type of format

array $paramaters

parameters based on the formatting type

Returns

object —

Object of class

tableDataFormatting()

tableDataFormatting(string  $applyOn, string  $formatType, array  $condition = array(), array  $apply = array()) : object

Format the particular entry of column of table

Parameters

string $applyOn

Column name to be formatted

string $formatType

type of format

array $condition

format condition ot be matched

array $apply

rules toe be applied

Returns

object —

Object of class

tableColAddition()

tableColAddition(string  $colName, string  $type, array  $paramaters = array()) : object

Add a new column to the table

Parameters

string $colName

Column name to be added

string $type

type of column

array $paramaters

parameters on basis of which column to be added

Returns

object —

Object of class

tableHeading()

tableHeading(string  $heading) : object

Change table heading

Parameters

string $heading

table heading to be changed

Returns

object —

Object of class

tableSubHeading()

tableSubHeading(string  $subHeading) : object

Change table sub heading

Parameters

string $subHeading

table sub heading to be changed

Returns

object —

Object of class

tableColUsingDatasource()

tableColUsingDatasource(string  $colname, string  $data, string  $joinColName, string  $dataCol, string  $dataSource = "db") : object

Set content of crud col based on the value from another table or array of data

Parameters

string $colname

crud table column name to be replaced

string $data

Name of table (if datasource = db) or array to get data

string $joinColName

Join column name (if datasource = db)

string $dataCol

Data column name (if datasource = db)

string $dataSource

dataSource = db or datasource = array

Returns

object —

Object of class

colDependent()

colDependent(  $dependentCol,   $tableName,   $dependentOn) 

Parameters

$dependentCol
$tableName
$dependentOn

colRename()

colRename(string  $colName, string  $newName) : object

Rename a column name

Parameters

string $colName

column name to renamed

string $newName

new column name to be used

Returns

object —

Object of class

colDataAttr()

colDataAttr(string  $colName, array  $attr = array()) : object

Set attributes of column

Parameters

string $colName

column name for which attribute to be added

array $attr

attribute to be set

Returns

object —

Object of class

colSumPerPage()

colSumPerPage(string  $colName) : object

Get sum per page for column

Parameters

string $colName

column name for sum to be calculated

Returns

object —

Object of class

colSumTotal()

colSumTotal(string  $colName) : object

Get total sum for column

Parameters

string $colName

column name for sum to be calculated

Returns

object —

Object of class

setViewColumns()

setViewColumns(string  $columns) : object

Set view display columns

Parameters

string $columns

Columns names to be displayed in table format

Returns

object —

Object of class

setColumnsOrders()

setColumnsOrders(array  $columnOrder) : object

Set order of columns to be displayed

Parameters

array $columnOrder

New Column order you want to display

Returns

object —

Object of class

addTooltip()

addTooltip(string  $elementName, string  $toolTip, string  $type = "field") : object

Add tool tip

Parameters

string $elementName

element for which tooltip needs to be added

string $toolTip

tooltip to be added

string $type

type of element whether element or column

Returns

object —

Object of class

relatedData()

relatedData(string  $mainTableCol, string  $relTable, mixed  $relTableCol, mixed  $relDisplayCol, array  $where = array(), array  $orderby = array(), mixed  $fieldType = "select") : object

Get related column data as list from other tables

Parameters

string $mainTableCol

Column name of the main table

string $relTable

Related table name

mixed $relTableCol

Matching related table columns

mixed $relDisplayCol

Related table column to be display

array $where

where condition array

array $orderby

Order by condition array

mixed $fieldType

Field type to be displayed for that field, default is "select", if empty, then textarea will be shown

Returns

object —

Object of class

exportColHeading()

exportColHeading(string  $colName, string  $newName) : object

Rename a export/print column heading

Parameters

string $colName

column name to renamed

string $newName

new column name to be used

Returns

object —

Object of class

where()

where(string  $colName, string  $val, string  $operator = "=", string  $andOroperator = "", string  $bracket = "") : object

Add where condition

Parameters

string $colName

column name for which where condition to be applied

string $val

value of column

string $operator

any operator like =, !=, default value is "="

string $andOroperator

whether to use "and" or "or" operator, if empty, default andOrOperator = "and" will be used

string $bracket

whether to use opening "(" or closing bracket ")", leave empty if not required

Returns

object —

Object of class

setBackOperation()

setBackOperation(boolean  $operation = true) : object

Set whether current operation is back button operation or not

Parameters

boolean $operation

true/false, current operation is back button operation or not

Returns

object —

Object of class

setSearchOperator()

setSearchOperator(string  $operator = "=") : object

Set search operator

Parameters

string $operator

Set search operator 'like', '>', '>=', '<','=<' etc

Returns

object —

Object of class

crudCall()

crudCall(boolean  $show = false) : object

whether current call is direct or called usign CRUD operation

Parameters

boolean $show

true/false, whether current call is direct or called usign CRUD operation

Returns

object —

Object of class

addFilter()

addFilter(string  $filterName, string  $displayText, string  $matchingCol, string  $filterType) : object

Add advanced filter option

Parameters

string $filterName

unique filter name

string $displayText

display text for filter

string $matchingCol

column to be matched

string $filterType

type of filter , default is radio button

Returns

object —

Object of class

setFilterSource()

setFilterSource(string  $filterName, mixed  $dataSource, string  $key, string  $val, string  $bind = "db") : object

Set data source of filter

Parameters

string $filterName

unique filter name

mixed $dataSource

data source either tablename or array of data

string $key

name of col, that will serve as data key

string $val

name of col, that will serve as field valye

string $bind

whether datasource is db table or array, default is db table

Returns

object —

Object of class

addAdvSearch()

addAdvSearch(array  $columns) : object

Add advanced search options

Parameters

array $columns

Column names to be searched

Returns

object —

Object of class

setAdvSearchSource()

setAdvSearchSource(string  $columnName, mixed  $dataSource, string  $key, string  $val, string  $bind = "db") : object

Set data source of advance search columns

Parameters

string $columnName

column name to be searched

mixed $dataSource

data source either tablename or array of data

string $key

name of col, that will serve as data key

string $val

name of col, that will serve as field valye

string $bind

whether datasource is db table or array, default is db table

Returns

object —

Object of class

setAdvSearchParam()

setAdvSearchParam(string  $columnName, string  $displayText, string  $searchType) : object

Add advanced search column parameter

Parameters

string $columnName

unique filter name

string $displayText

display text for filter

string $searchType

type of filter , default is radio button

Returns

object —

Object of class

setTriggerOperation()

setTriggerOperation(string  $tableName, array  $colVal, array  $where, string  $operationType = "update", string  $event = "after_update") : object

Trigger another operation after current operation completed e.g. update another table's data

Parameters

string $tableName

unique table name

array $colVal

array of column name and value

array $where

where condition with column name and value

string $operationType

operation type i.e. insert update or delete

string $event

At which event, we need to perform this operation i.e. before_update, after_update

Returns

object —

Object of class

addSidebar()

addSidebar(string  $sidebarImage, string  $sidebarHeading1, string  $sidebarHeading2, array  $sidebarURLs, string  $position = "left") : object

Add sidebar to existing data in edit/view form

Parameters

string $sidebarImage

column name of image or url of image

string $sidebarHeading1

column name for sidebar heading 1 or some text

string $sidebarHeading2

column name for sidebar heading 2 or some text

array $sidebarURLs

sidebar urls

string $position

Position of the sidebar (either left or right)

Returns

object —

Object of class

setDelJoinTableData()

setDelJoinTableData(boolean  $delJoinTableData = true) : object

set whether to delete join table data or not

Parameters

boolean $delJoinTableData

set true to delete the join table data else false

Returns

object —

Object of class

enqueueActions()

enqueueActions(array  $action, string  $type = "switch", mixed  $text = "", string  $colName = "", array  $attr = array()) : object

enqueue col based actions

Parameters

array $action

action values

string $type

type of action

mixed $text

text to be used

string $colName

name of column

array $attr

attribute of columns

Returns

object —

Object of class

enqueueBtnActions()

enqueueBtnActions(array  $actionName, mixed  $action, string  $type = "switch", mixed  $text = "", string  $colName = "", array  $attr = array(), string  $cssClass = "") : object

enqueue button actions

Parameters

array $actionName

name of acion

mixed $action

action values

string $type

type of action

mixed $text

text to be used

string $colName

name of column

array $attr

attribute of columns

string $cssClass

Css Class of buton

Returns

object —

Object of class

enqueueBtnTopActions()

enqueueBtnTopActions(array  $actionName, mixed  $text = "", string  $url = "javascript:;", array  $attr = array(), string  $cssClass = "") : object

enqueue button actions

Parameters

array $actionName

name of acion

mixed $text

text to be used

string $url

url

array $attr

attribute of columns

string $cssClass

Css Class of buton

Returns

object —

Object of class

dequeueBtnActions()

dequeueBtnActions() : object

dequeue button actions

Returns

object —

Object of class

enqueueHTMLContent()

enqueueHTMLContent(string  $html) : object

Add some html content in the form (normally added at the end of form)

Parameters

string $html

html content to be added

Returns

object —

Object of class

forgotPassword()

forgotPassword(string  $email, string  $password, string  $from = array(), string  $subject = "", string  $message = "", string  $encryption = "md5") : object

Send email with password to email address

Parameters

string $email

Email field of the table

string $password

password field of the table

string $from

from email to be used to send email

string $subject

subject of the email

string $message

message of the meail

string $encryption

encryption to be used, default type md5

Returns

object —

Object of class

checkDuplicateRecord()

checkDuplicateRecord(array  $fields) : object

Checks for duplicate record before inserting data

Parameters

array $fields

fields to be checked for duplicacy

Returns

object —

Object of class

recaptcha()

recaptcha(string  $siteKey, string  $secret) : object

Add recaptcha

Parameters

string $siteKey

site key

string $secret

secret

Returns

object —

Object of class

setSearchColumnDataType()

setSearchColumnDataType(string  $columnName, string  $dataType) : object

Add data type of search column

Parameters

string $columnName

name of column

string $dataType

data type e.g. datetime

Returns

object —

Object of class

addDateRangeReport()

addDateRangeReport(string  $text, string  $type, string  $dateField) : object

Add date range report buttons (eg daily ,monthly ,yearly report button)

Parameters

string $text

Name/Text of the button

string $type

Type of the report to be generated.

string $dateField

date field in the database to be used

Returns

object —

Object of class

exportDB()

exportDB(string  $filename, string  $includeTables = array(), string  $excludeTables = array()) : object

Export complete database

Parameters

string $filename

File name

string $includeTables

Include particular tables

string $excludeTables

Exclude particular tables

Returns

object —

Object of class

setUserSession()

setUserSession(string  $sessionName, string  $val) : object

Set session for select operation for user login management. By default, it checks value against database table, if it doesn't find value in database tab;e then value will be treated as string and will be saved in session.

Parameters

string $sessionName

Name/Text of the session

string $val

Value of the session (column name of table or some fixed value)

Returns

object —

Object of class

getUserSession()

getUserSession(string  $sessionKey = "") 

Get array of sessions or particular session value, set by user for user management functionality using setSession function

Parameters

string $sessionKey

session key that needs to be retrived (optional) return array sesion set by user using setSession function

unsetUserSession()

unsetUserSession(string  $sessionKey = "") : boolean

Unset array of sessions or particular session value, set by user for user management functionality using setSession function

Parameters

string $sessionKey

session key that needs to be unset (optional)

Returns

boolean —

If session is unset successfully, return true else return false

checkUserSession()

checkUserSession(string  $sessionKey = "", string  $val = array()) : boolean

Check whether session is set or not by user for user management functionality using setSession function

Parameters

string $sessionKey

session key that needs to be checked (optional)

string $val

value that needs to be checked (optional)

Returns

boolean —

return true/false depending upon session set or not

addChart()

addChart(string  $chartName, string  $chartType, mixed  $dataSource, string  $key, string  $val, string  $bind = "db", string  $param = array()) : object

Add pie chart, bar chart, google charts etc using add chart function

Parameters

string $chartName

Name of the chart

string $chartType

Chart type

mixed $dataSource

data source either tablename or array of data

string $key

name of col, that will serve as data key

string $val

name of col, that will serve as field valye

string $bind

whether datasource is db table or array or sql, default is db table

string $param

data parameter for the chart element

Returns

object —

Object of class

fileSavePath()

fileSavePath(string  $uploadPath = "", string  $downloadPath = "") : object

Modify the file upload path and download path later

Parameters

string $uploadPath

Path of upload folder

string $downloadPath

Path of download folder

Returns

object —

Object of class

outputHTMLContent()

outputHTMLContent(boolean  $output = true) 

Output html content and clears html content, can be called at specific places to output content

Parameters

boolean $output

if true output the content else return the content. return mixed Object of class or html content

outputChartCode()

outputChartCode(  $output = true) 

Parameters

$output

addPlugin()

addPlugin(string  $pluginName) : object

Add js/css based plugin, plugin needs to be placed inside plugins folder with js files under js folder and css files under css folder

Parameters

string $pluginName

Name of the plugin to be added, make sure plugins folder is readable

Returns

object —

Object of class

subQueryColumn()

subQueryColumn(string  $columnName, string  $query) : object

Allows you to add the dynamic column based on sub query

Parameters

string $columnName

Alias column name to be used for the query

string $query

Sub Query to be used

Returns

object —

Object of class

enqueueJs()

enqueueJs(string  $jsName, string  $jsPath) : object

Add javascript by specify js name and path of js, it will be loaded with other scripts

Parameters

string $jsName

Name of javascript to be loaded

string $jsPath

Path of javascript to be loaded

Returns

object —

Object of class

applyJS()

applyJS(string  $applyOn, string  $applyOnVal, string  $functionName, string  $action = "on_form_load", string  $options = array()) : object

Add directly javascript

Parameters

string $applyOn

Apply on element name

string $applyOnVal

Value to be used of that element

string $functionName

function name

string $action

action to be used

string $options

options for that function

Returns

object —

Object of class

unsetJs()

unsetJs(string  $jsName) : object

Removes already enqueue js, useful for removing js that are already included in your page

Parameters

string $jsName

Name of javascript to be removed

Returns

object —

Object of class

multiTableRelation()

multiTableRelation(string  $field1, string  $field2, \PDOCrud  $obj, string  $renderParam = "CRUD") : object

Multi Table Relation (nested table) - Editing of related records in other table

Parameters

string $field1

field name of object to matched

string $field2

field name of 2nd object to be matched

\PDOCrud $obj

2nd table (object)

string $renderParam

render type, default is CRUD

Returns

object —

Object of class

multiTableRelationDisplay()

multiTableRelationDisplay(string  $display, string  $title) 

Set display type of table and title in case of tabs

Parameters

string $display

display type e.g. tab

string $title

title of tab return mixed Object of class or js content

setInvoiceDetails()

setInvoiceDetails(array  $headerFields = array()) 

Set invoice table header details

Parameters

array $headerFields

data array containing all header fields information return mixed Object of class or js content

outputJs()

outputJs(boolean  $output = true) 

Output js

Parameters

boolean $output

if true output the content else return the content. return mixed Object of class or js content

outputApplyJs()

outputApplyJs(boolean  $output = true) 

Output javascript added using the apply js

Parameters

boolean $output

if true output the content else return the content. return mixed Object of class or js content

invoicePrint()

invoicePrint(string  $sql, string  $path = "") 

Set the invoice print action button

Parameters

string $sql

Sql to be used for getting the data

string $path

path of xinvoice, default is in library return mixed Object of class or js content

addCallback()

addCallback(string  $eventName, string  $callback) : object

Add callback function to be called on certain event

Parameters

string $eventName

Eventname for which callback function needs to be called

string $callback

Name of callback function

Returns

object —

Object of class

loadPluginJsCode()

loadPluginJsCode(string  $pluginName, string  $elementName, array  $params = array()) 

Loads plugin js code, must be called after render function

Parameters

string $pluginName

Name of plugin

string $elementName

Element name for which plugin needs to be called

array $params

list of parameters/options for the plugin js code return string String of js code

setSkin()

setSkin(mixed  $skin) : object

Set skin

Parameters

mixed $skin

Name of skin

Returns

object —

Object of class

enqueueCss()

enqueueCss(string  $cssName, string  $cssPath) : object

Add css by specify css name and path of css, it will be loaded with other css

Parameters

string $cssName

Name of css to be loaded

string $cssPath

Path of css to be loaded

Returns

object —

Object of class

unsetCss()

unsetCss(string  $cssName) : object

Removes already enqueue css, useful for removing css that are already included in your page

Parameters

string $cssName

Name of css to be removed

Returns

object —

Object of class

outputCss()

outputCss(boolean  $output = true) 

Output css

Parameters

boolean $output

if true output the content else return the content. return mixed Object of class or css content

setCurrentLang()

setCurrentLang(string  $lang) : object

Set current language

Parameters

string $lang

language to be used

Returns

object —

Object of class

getLangData()

getLangData(string  $param) 

Return language data

Parameters

string $param

Get data for language return sting language translation for the parameter

setLangData()

setLangData(string  $param, string  $val) : object

Set language data

Parameters

string $param

lanuguage key for which data needs to save

string $val

Value for the language parameter

Returns

object —

Object of class

setPortfolioColumn()

setPortfolioColumn(integer  $columns) : object

Set portfolio column

Parameters

integer $columns

no of columns to be used per row

Returns

object —

Object of class

setFormSkin()

setFormSkin(string  $skin) : object

Set Form skin

Parameters

string $skin

Name of skin

Returns

object —

Object of class

setAjaxActions()

setAjaxActions(string  $elementName, string  $event, string  $callbackFunc, string  $returnValueElement = "", array  $otherElements = array()) : object

Set/Call ajax actions for the form elements on some js event

Parameters

string $elementName

Name of table column (element name) you want to apply event

string $event

Javascript event name

string $callbackFunc

Function to be called upon

string $returnValueElement

On which element, return value should be displayed

array $otherElements

Other elements to be passed along if any

Returns

object —

Object of class

setJsActions()

setJsActions(string  $element, string  $formula, string  $event, string  $eventFields = array()) : object

Set/Call js actions for the form elements on some js event

Parameters

string $element

Main element, On which element, calculated value should be displayed

string $formula

Formula to be applied

string $event

Javascript event, this will be applied on formula fields if no event fields passed

string $eventFields

Event fields if any

Returns

object —

Object of class

setLeftJoinJsActions()

setLeftJoinJsActions(string  $element, string  $formula, string  $event, string  $eventFields) : object

Set/Call js actions for the left join form elements

Parameters

string $element

Main element, On which, calculated value should be displayed

string $formula

Formula to be applied

string $event

Javascript event, this will be applied on formula fields if no event fields passed

string $eventFields

Event fields

Returns

object —

Object of class

render()

render(  $operationType = "CRUD",   $data = array()) 

Parameters

$operationType
$data

resetFields()

resetFields() 

getErrors()

getErrors() 

Return errors return array array of error list

getPDOModelObj()

getPDOModelObj() 

showChart()

showChart(  $charts) 

Parameters

$charts

addHTML()

addHTML(  $data) 

Parameters

$data

callbackTriggerOperation()

callbackTriggerOperation(  $data,   $obj) 

Parameters

$data
$obj

emailPassword()

emailPassword(  $data,   $obj) 

Parameters

$data
$obj

getInputField()

getInputField(  $fieldName,   $attr = array(),   $data = array(),   $type = "text",   $fieldClass = array(),   $fieldId = "") 

Parameters

$fieldName
$attr
$data
$type
$fieldClass
$fieldId

getSubmitField()

getSubmitField(  $fieldName,   $attr = array(),   $data = array(),   $fieldClass = array()) 

Parameters

$fieldName
$attr
$data
$fieldClass

getButtonField()

getButtonField(  $fieldName,   $attr,   $data = array(),   $fieldClass = array()) 

Parameters

$fieldName
$attr
$data
$fieldClass

getGoogleMap()

getGoogleMap(  $fieldName,   $attr,   $data,   $fieldClass = array()) 

Parameters

$fieldName
$attr
$data
$fieldClass

getTextareaField()

getTextareaField(  $fieldName,   $attr,   $data,   $fieldClass = array()) 

Parameters

$fieldName
$attr
$data
$fieldClass

getSelectField()

getSelectField(  $fieldName,   $attr,   $data,   $fieldData,   $fieldClass = array()) 

Parameters

$fieldName
$attr
$data
$fieldData
$fieldClass

getRadioButtonField4()

getRadioButtonField4(  $fieldName,   $attr,   $data,   $fieldData,   $fieldClass = array()) 

Parameters

$fieldName
$attr
$data
$fieldData
$fieldClass

getRadioButtonField()

getRadioButtonField(  $fieldName,   $attr,   $data,   $fieldData,   $fieldClass = array()) 

Parameters

$fieldName
$attr
$data
$fieldData
$fieldClass

getCheckboxField4()

getCheckboxField4(  $fieldName,   $attr,   $data,   $fieldData,   $fieldClass = array()) 

Parameters

$fieldName
$attr
$data
$fieldData
$fieldClass

getCheckboxField()

getCheckboxField(  $fieldName,   $attr,   $data,   $fieldData,   $fieldClass = array()) 

Parameters

$fieldName
$attr
$data
$fieldData
$fieldClass

getCaptcha()

getCaptcha(  $fieldName) 

Parameters

$fieldName

getImageField()

getImageField(  $imageSrc,   $attr = array(),   $imageClass = array()) 

Parameters

$imageSrc
$attr
$imageClass

getListElements()

getListElements(  $data,   $attr = array(),   $position = "1",   $listElementTag = "ul") 

Parameters

$data
$attr
$position
$listElementTag

getSpanField()

getSpanField(  $spanText,   $spanClass = array()) 

Parameters

$spanText
$spanClass

getLableField()

getLableField(  $lableText,   $lableFor,   $lableClass = array()) 

Parameters

$lableText
$lableFor
$lableClass

getToolTipField()

getToolTipField(  $tooltip,   $tooltipIcon) 

Parameters

$tooltip
$tooltipIcon

getAnchorField()

getAnchorField(  $text,   $url = "javascript:;",   $attr = array(),   $anchorClass = array()) 

Parameters

$text
$url
$attr
$anchorClass

getDescField()

getDescField(  $helpMsg = "") 

Parameters

$helpMsg

getAjaxLoaderImage()

getAjaxLoaderImage(  $imagepath) 

Parameters

$imagepath

getSlider()

getSlider(  $attr = array(),   $fieldClass = array()) 

Parameters

$attr
$fieldClass

getImagePreviewField()

getImagePreviewField(  $fieldName,   $attr = array(),   $data = array(),   $type = "text",   $fieldClass = array()) 

Parameters

$fieldName
$attr
$data
$type
$fieldClass

getDiv()

getDiv(  $divId = "",   $params = array(),   $content = "") 

Parameters

$divId
$params
$content

getFileUploadField()

getFileUploadField(  $fieldName,   $attr,   $data,   $fieldData,   $fieldClass = array()) 

Parameters

$fieldName
$attr
$data
$fieldData
$fieldClass

getSearchBox()

getSearchBox(  $columns,   $data = array()) 

Parameters

$columns
$data

perPageRecords()

perPageRecords(  $totalRecords,   $data = array()) 

Parameters

$totalRecords
$data

getStepHeader()

getStepHeader(  $stepId,   $stepName,   $type = "tab") 

Parameters

$stepId
$stepName
$type

getMoodelContent()

getMoodelContent(  $fieldName,   $buttonContent,   $headerContent,   $bodyContent) 

Parameters

$fieldName
$buttonContent
$headerContent
$bodyContent

getSidebar()

getSidebar(  $data) 

Parameters

$data

fileUpload()

fileUpload(string  $fileName, string  $fileUploadPath = "", integer  $maxSize = 10000000, array  $allowedFileTypes = array()) : boolean

Upload files using html file control. You can apply various restriction to make file uploading more secure.

Parameters

string $fileName

file upload control

string $fileUploadPath

Path to upload file

integer $maxSize

Max size allowed, default is 10000000

array $allowedFileTypes

Allowed file types

Returns

boolean —

return true if file uploaded successfully else false

getRandomKey()

getRandomKey(  $allowSpecialChar = false) 

Returns a random key.

Parameters

$allowSpecialChar

getDirFiles()

getDirFiles(  $dir,   $extension = "") 

Returns array of files inside a directory

Parameters

$dir
$extension

arrayToCSV()

arrayToCSV(array  $csvArray, string  $outputFileName = "file.csv") 

Generates the csv file as output from the array provided.

Returns true if operation performed successfully else return false.

Parameters

array $csvArray

Associative array with key as column name and value as table values.

string $outputFileName

Output csv file name

arrayToXML()

arrayToXML(array  $xmlArray, string  $outputFileName = "file.xml") 

Generates the xml as output from the array provided. Returns true if operation performed successfully else return false

Parameters

array $xmlArray

Associative array with key as column name and value as table values.

string $outputFileName

Output xml file name

arrayToHTML()

arrayToHTML(array  $htmlArray, array  $outputFileName = "file.html", boolean  $isCalledFromPDF = false) 

Generates the html table as output from the array provided.

Parameters

array $htmlArray

Associative array with key as column name and value as table values.

array $outputFileName

Output file name

boolean $isCalledFromPDF

This function is used internally in arrayToPDF() also, to check whether it is called directly or using the pdf function

getPDFObject()

getPDFObject() 

arrayToPDF()

arrayToPDF(array  $pdfArray, string  $outputFileName = "") 

Generates the pdf as output from the array provided. Returns true if operation performed successfully else return false

Parameters

array $pdfArray

Associative array with key as column name and value as table values.

string $outputFileName

Output pdf file name

arrayToExcel()

arrayToExcel(array  $excelArray, string  $outputFileName = "file.xlsx") 

Generates the excel file as output from the array provided.

Parameters

array $excelArray

Associative array with key as column name and value as table values.

string $outputFileName

Output excel file name

bulkImport()

bulkImport(string  $fileName, string  $tableName) 

Import data from csv/xml/excel file to database table directly. The key name(column name) must match the table column name to insert the data properly.

Parameters

string $fileName

Name or path of file.

string $tableName

Name of database table.

csvToArray()

csvToArray(string  $fileName) 

Returns the array as output from the csv provided.

Parameters

string $fileName

Name or path of csv file.

excelToArray()

excelToArray(string  $fileName) 

Returns the array as output from the excel provided.

Parameters

string $fileName

Name or path of excel file.

xmlToArray()

xmlToArray(string  $xmlSource,   $isFile = true) 

Returns the array as output from the xml provided.

Parameters

string $xmlSource

Name or path of xml file.

$isFile

sendEmail()

sendEmail(array  $to, string  $subject, string  $message, array  $from = array(), string  $altMessage = "", array  $cc = array(), array  $bcc = array(), array  $attachments = array(), string  $mode = "PHPMAIL", array  $smtp = array(),   $isHTML = true) : boolean

Sends email using phpmailer

Parameters

array $to

List of receipient

string $subject

Subject of email

string $message

Message of email

array $from

List of senders

string $altMessage

For non html clients

array $cc

List of cc

array $bcc

List of bcc

array $attachments

List of attachments

string $mode

Send mail using php mail function or SMTP, default is phpmail function

array $smtp

SMTP authentication details if SMTP mode is used

$isHTML

Returns

boolean —

return true if email function works properly

initializeSettings()

initializeSettings() 

Initialize Settings when object of class created, from the config.php settings

initializeBtnActions()

initializeBtnActions() 

initializeHTMLContent()

initializeHTMLContent() 

initializePlugins()

initializePlugins() : object

Initialize plugins to be loaded directly from the config file

Returns

object —

Object of class

enqueuePlugin()

enqueuePlugin() 

handleCallback()

handleCallback(  $eventName,   $data) 

Parameters

$eventName
$data

initializeJsSettings()

initializeJsSettings() 

outputJsSettings()

outputJsSettings(  $output = true) 

Parameters

$output

registerJs()

registerJs() 

registerCss()

registerCss() 

loadLangData()

loadLangData() 

savePDOCrudObj()

savePDOCrudObj() 

validate()

validate(  $operationType,   $data) 

* ***************** private functions *************************************

Parameters

$operationType
$data

handleOperation()

handleOperation(  $operationType = "CRUD",   $data = array()) 

Parameters

$operationType
$data

dbSelect()

dbSelect(  $data) 

Parameters

$data

dbInsert()

dbInsert(  $data) 

Parameters

$data

checkDuplicateData()

checkDuplicateData(  $fields,   $data) 

Parameters

$fields
$data

dbUpdate()

dbUpdate(  $data) 

Parameters

$data

dbSaveCrudData()

dbSaveCrudData(  $data) 

Parameters

$data

dbDelete()

dbDelete(  $data) 

Parameters

$data

dbDeleteSelected()

dbDeleteSelected(  $data) 

Parameters

$data

dbBtnSwitch()

dbBtnSwitch(  $data) 

Parameters

$data

dbSwitch()

dbSwitch(  $data) 

Parameters

$data

dbSaveJoinData()

dbSaveJoinData(\PDOModel  $pdoModelObj,   $data,   $lastInsertId,   $operation = "insert") 

Parameters

\PDOModel $pdoModelObj
$data
$lastInsertId
$operation

dbDelJoinData()

dbDelJoinData(\PDOModel  $pdoModelObj,   $data,   $lastInsertId,   $operation = "delete") 

Parameters

\PDOModel $pdoModelObj
$data
$lastInsertId
$operation

emailData()

emailData(  $data) 

Parameters

$data

formatFormData()

formatFormData(  $values) 

Parameters

$values

cleanInputData()

cleanInputData(  $val) 

Parameters

$val

validateField()

validateField(  $field,   $val,   $values = array()) 

Parameters

$field
$val
$values

checkCaptchaField()

checkCaptchaField(  $val) 

Parameters

$val

getResponse()

getResponse(  $data) 

Parameters

$data

uploadFormImage()

uploadFormImage(  $val) 

Parameters

$val

dbQuickView()

dbQuickView(  $data) 

Parameters

$data

dbRelatedTableView()

dbRelatedTableView(  $data) 

Parameters

$data

dbOnePage()

dbOnePage(  $data) 

Parameters

$data

dbCRUD()

dbCRUD(  $data) 

Parameters

$data

dbSQL()

dbSQL(  $data) 

Parameters

$data

dbAdvSearch()

dbAdvSearch() 

setTableHeadings()

setTableHeadings() 

setTableColumns()

setTableColumns(  $pdoModelObj) 

Parameters

$pdoModelObj

getSubQuery()

getSubQuery(  $pdoModelObj) 

Parameters

$pdoModelObj

parseSubQuery()

parseSubQuery(  $query,   $cols) 

Parameters

$query
$cols

replaceColumns()

replaceColumns(  $matches) 

Parameters

$matches

getRelatedColumn()

getRelatedColumn(  $relData,   $alias = true) 

Parameters

$relData
$alias

addLimitOrderBy()

addLimitOrderBy(\PDOModel  $pdoModelObj,   $data = array(),   $recordPerPage = 10) 

Parameters

\PDOModel $pdoModelObj
$data
$recordPerPage

getSelectPageLimit()

getSelectPageLimit(  $recordPerPage) 

Parameters

$recordPerPage

addJoinCondtion()

addJoinCondtion(\PDOModel  $pdoModelObj,   $showLeftJoinCol = false) 

Parameters

\PDOModel $pdoModelObj
$showLeftJoinCol

getColumnNames()

getColumnNames(  $cols,   $encrypt = true) 

Parameters

$cols
$encrypt

crudTableColDataSource()

crudTableColDataSource() 

formatTableData()

formatTableData(  $result) 

Parameters

$result

getAdvSearchControls()

getAdvSearchControls() 

getSearchFieldData()

getSearchFieldData(  $fieldName) 

Parameters

$fieldName

getInsertForm()

getInsertForm() 

getEditForm()

getEditForm(  $data = array()) 

Parameters

$data

getViewForm()

getViewForm(  $data) 

Parameters

$data

getSelectForm()

getSelectForm() 

getEmailForm()

getEmailForm() 

getAutoSuggestData()

getAutoSuggestData(  $data) 

Parameters

$data

getInvoicePDF()

getInvoicePDF(  $data) 

Parameters

$data

ajaxAction()

ajaxAction(  $data) 

Parameters

$data

getCloneForm()

getCloneForm(  $data = array()) 

Parameters

$data

renderFormData()

renderFormData(  $data,   $submitData = array(),   $type = "insert") 

Parameters

$data
$submitData
$type

renderViewFormData()

renderViewFormData(  $result,   $columns,   $leftJoinData,   $data) 

Parameters

$result
$columns
$leftJoinData
$data

getLeftJoinData()

getLeftJoinData() 

exportTableData()

exportTableData(  $data) 

Parameters

$data

getJoinFormData()

getJoinFormData(\PDOModel  $pdoModelObj,   $data,   $result = array(),   $edit = false) 

Parameters

\PDOModel $pdoModelObj
$data
$result
$edit

getStepwiseFormData()

getStepwiseFormData(  $data,   $viewData = array()) 

Parameters

$data
$viewData

getTabStepData()

getTabStepData(  $data,   $viewData) 

Parameters

$data
$viewData

getStepyData()

getStepyData(  $data,   $viewData) 

Parameters

$data
$viewData

getColSum()

getColSum(  $data) 

Parameters

$data

getSortedData()

getSortedData(  $data) 

Parameters

$data

getExtraData()

getExtraData() 

getDateRangeFromDate()

getDateRangeFromDate(  $type) 

Parameters

$type

exportFormData()

exportFormData(  $data) 

Parameters

$data

getPrimaryKey()

getPrimaryKey(  $tableName,   $cols = array()) 

Parameters

$tableName
$cols

getColFromJoinTables()

getColFromJoinTables(  $cols,   $pdoModelObj) 

Parameters

$cols
$pdoModelObj

getJoinKeyName()

getJoinKeyName(  $joinCondition) 

Parameters

$joinCondition

getJoinKeyValue()

getJoinKeyValue(  $keyName,   $result) 

Parameters

$keyName
$result

getStaticFields()

getStaticFields(  $fields) 

Parameters

$fields

getFormTag()

getFormTag(  $inlineform = false) 

Parameters

$inlineform

getHTMLData()

getHTMLData(  $fields,   $table,   $result = array(),   $leftJoin = false,   $innerJoin = false) 

Parameters

$fields
$table
$result
$leftJoin
$innerJoin

getViewHTMLData()

getViewHTMLData(  $result,   $table) 

Parameters

$result
$table

checkJoinKeyField()

checkJoinKeyField(  $fieldName,   $tableName) 

Parameters

$fieldName
$tableName

getJoinColFullName()

getJoinColFullName(  $colName) 

Parameters

$colName

getFormFields()

getFormFields(  $fields) 

Parameters

$fields

isAutoIncrementField()

isAutoIncrementField(  $fieldExtra) 

Parameters

$fieldExtra

getFieldAttributes()

getFieldAttributes(  $fieldName) 

Parameters

$fieldName

getPlaceholder()

getPlaceholder(  $fieldName) 

Parameters

$fieldName

getFieldClass()

getFieldClass(  $fieldName) 

Parameters

$fieldName

getFieldData()

getFieldData(  $fieldName) 

Parameters

$fieldName

generateFilterControls()

generateFilterControls() 

getFilterControls()

getFilterControls(  $selectedData = array()) 

Parameters

$selectedData

reorderColumn()

reorderColumn(  $results) 

Parameters

$results

getHTMLElementType()

getHTMLElementType(  $fieldName,   $fieldType) 

Parameters

$fieldName
$fieldType

getHTMLElement()

getHTMLElement(  $fieldName,   $htmlType,   $attr = array(),   $data = array(),   $fieldData = array(),   $fieldClass = array(),   $fieldId = "") 

Parameters

$fieldName
$htmlType
$attr
$data
$fieldData
$fieldClass
$fieldId

getSubmitData()

getSubmitData(  $action = "insert",   $submitClass = "") 

Parameters

$action
$submitClass

getHTMLElementLable()

getHTMLElementLable(  $fieldName,   $encryptedFieldName,   $type = "") 

Parameters

$fieldName
$encryptedFieldName
$type

getHTMLElementBlockClass()

getHTMLElementBlockClass(  $fieldName) 

Parameters

$fieldName

getHTMLElementGroup()

getHTMLElementGroup(  $fieldName) 

Parameters

$fieldName

getHTMLElementTooltip()

getHTMLElementTooltip(  $fieldName) 

Parameters

$fieldName

getHTMLElementDesc()

getHTMLElementDesc(  $fieldName) 

Parameters

$fieldName

getHTMLElementAddOn()

getHTMLElementAddOn(  $fieldName,   $position = "before") 

Parameters

$fieldName
$position

getHTMLElementFieldOrder()

getHTMLElementFieldOrder(  $fieldName) 

Parameters

$fieldName

getHTMLContent()

getHTMLContent(  $html) 

Parameters

$html

getFormPopup()

getFormPopup(  $form) 

Parameters

$form

getRelatedTable()

getRelatedTable(  $data,   $result) 

Parameters

$data
$result

getRelatedTableTab()

getRelatedTableTab(  $data,   $result) 

Parameters

$data
$result

getRelatedTableDefault()

getRelatedTableDefault(  $data,   $result) 

Parameters

$data
$result

getSidebarData()

getSidebarData(  $data,   $result) 

Parameters

$data
$result

addWhereCondition()

addWhereCondition(\PDOModel  $pdoModelObj,   $data = array()) 

Parameters

\PDOModel $pdoModelObj
$data

applySubQueryWhere()

applySubQueryWhere(  $col,   $text, \PDOModel  $pdoModelObj) 

Parameters

$col
$text
\PDOModel $pdoModelObj

searchRelData()

searchRelData(  $pdoModelObj,   $data,   $column = "") 

Parameters

$pdoModelObj
$data
$column

formatDatasource()

formatDatasource(  $dataSource) 

Parameters

$dataSource

addError()

addError(  $error) 

Parameters

$error

encryptPassword()

encryptPassword(  $method,   $val) 

Parameters

$method
$val

encrypt()

encrypt(  $string) 

Returns an encrypted string

Parameters

$string

decrypt()

decrypt(  $string) 

Returns decrypted original string

Parameters

$string

getDependentData()

getDependentData(  $data) 

Parameters

$data

getChartData()

getChartData(  $chartName,   $chartType) 

Parameters

$chartName
$chartType

getTriggerFormatedData()

getTriggerFormatedData(  $colVal,   $data) 

Parameters

$colVal
$data

getMoodleStartContainer()

getMoodleStartContainer(  $fieldName) 

Parameters

$fieldName

getMoodleEndContainer()

getMoodleEndContainer() 

getMoodleHeader()

getMoodleHeader(  $headerContent) 

Parameters

$headerContent

getMoodleBody()

getMoodleBody(  $bodyContent) 

Parameters

$bodyContent

checkValidFileUpload()

checkValidFileUpload(  $fileName,   $fileUploadPath,   $maxSize,   $allowedFileTypes) 

Parameters

$fileName
$fileUploadPath
$maxSize
$allowedFileTypes

getFileExtension()

getFileExtension(  $fileName) 

Returns extention of file

Parameters

$fileName

formatOutputArray()

formatOutputArray(  $data) 

Parameters

$data

generateXML()

generateXML(  $xmlArray,   $xmlObject,   $rootElement = "root") 

Parameters

$xmlArray
$xmlObject
$rootElement