\Csz_admin_model

Summary

Methods
Properties
Constants
__construct()
load_config()
getLatestVersion()
getPreviousVersion()
chkVerUpdate()
findNextVersion()
getLang()
getCurPages()
countTable()
pageSetting()
getIndexData()
getUser()
getUserEmail()
createUser()
updateUser()
removeUser()
removeData()
removeDataAndFile()
dropTable()
chkMd5Time()
sessionLoginChk()
getLangISOfromName()
getLangNamefromISO()
cszCopyright()
coreCss()
coreJs()
coreMetatags()
getSocial()
updateSocial()
updateSettings()
file_upload()
sortNav()
getPagesAll()
getPluginAll()
getAllMenu()
getDropMenuAll()
getMenuArrange()
insertMenu()
updateMenu()
findLangDataUpdate()
insertLang()
updateLang()
syncLabelLang()
updateLabel()
chkPageName()
insertPage()
updatePage()
insertFileUpload()
insertForms()
updateForms()
preTypeFields()
renameFields()
execSqlFile()
chkPluginActive()
insertWidget()
updateWidget()
insertLinks()
updateBFSettings()
saveWhiteIP()
saveBlackIP()
insertBanner()
updateBanner()
saveActionsLogs()
setMaintenance()
unsetMaintenance()
getFormDraft()
getDraftArray()
getSaveDraftJS()
makePrivateKey()
getPrivateKey()
getIndexDataFromObj()
getPluginXML()
pluginLatestVer()
chkPluginInst()
chkPluginUpdate()
pluginNextVer()
cszGenerateMeta()
exportCSV()
findPrimaryKey()
pluginUninstall()
getServerIp()
getSoftwareInfo()
dirSize()
usageSpace()
memUsage()
getMemLimit()
getDisabledFunctions()
insertCarousel()
updateCarousel()
insertCarouselUpload()
getAllPluginWidget()
insertPWidget()
updatePWidget()
showLoadingImg()
jsredirect()
$db
$dbforge
$config
$load
$session
No constants found
No protected methods found
No protected properties found
N/A
setcahetime()
thumbnail()
imageToFile()
setLatestVer()
cszCredit()
getNiceFileSize()
$cachetime
N/A

Properties

$db

$db : \CI_DB_query_builder

Type

\CI_DB_query_builder

$dbforge

$dbforge : \CI_DB_forge

Type

\CI_DB_forge

$config

$config : \CI_Config

Type

\CI_Config

$load

$load : \CI_Loader

Type

\CI_Loader

$session

$session : \CI_Session

Type

\CI_Session

$cachetime

$cachetime : 

Type

Methods

__construct()

__construct() 

load_config()

load_config() : object

load_config

Function for load settings from database

Returns

object —

or FALSE

getLatestVersion()

getLatestVersion(string  $xml_url = '', boolean  $is_ci = FALSE) : \versoin

getLatestVersion

Function for get latest version from xml url

Parameters

string $xml_url

xml url file

boolean $is_ci

CI update check

Returns

\versoin —

string

getPreviousVersion()

getPreviousVersion(string  $xml_url = '', boolean  $is_ci = FALSE) : \versoin

getPreviousVersion

Function for get previous version from xml url

Parameters

string $xml_url

xml url file

boolean $is_ci

CI update check

Returns

\versoin —

string

chkVerUpdate()

chkVerUpdate(string  $cur_ver, string  $xml_url = '', boolean  $is_ci = FALSE) : true

chkVerUpdate

Function for check version for update

Parameters

string $cur_ver

current version

string $xml_url

xml url file

boolean $is_ci

CI update check

Returns

true —

or false

findNextVersion()

findNextVersion(string  $cur_txt, string  $xml_url = '', boolean  $is_ci = FALSE) : string

findNextVersion

Function for check version for update

Parameters

string $cur_txt

current version

string $xml_url

xml url file

boolean $is_ci

CI update check

Returns

string —

or false

getLang()

getLang() : string

getLang

Function for get backend language

Returns

string

getCurPages()

getCurPages() : string

getCurPages

Function for count in the tableget current for backend

Returns

string

countTable()

countTable(string  $table, string  $search_sql = '') : integer

countTable

Function for count in the table

Parameters

string $table

DB table

string $search_sql

DB condition

Returns

integer

pageSetting()

pageSetting(string  $base_url, string  $total_row, string  $result_per_page, string  $num_link, string  $uri_segment = '') 

pageSetting

Function for pagination settings

Parameters

string $base_url

Base url for link

string $total_row

Total result

string $result_per_page

result limit per page

string $num_link

Number for show the page exclude ...

string $uri_segment

Uri secment for use pageination

getIndexData()

getIndexData(string  $table, string  $limit, string  $offset, string  $orderby = '', string  $sort = '', string  $search_sql = '', string  $groupby = '', string  $join_db = '', string  $join_where = '', string  $join_type = '', string  $sel_field = '*') : array

getIndexData

Function for get data for index page (support pageination)

Parameters

string $table

DB table

string $limit

DB limit

string $offset

DB offset

string $orderby

DB order by field. Default is 'timestamp_create'

string $sort

DB sort by asc or desc. Default is 'desc'

string $search_sql

DB where condition. NULL if not need. Example "name='Joe' AND status LIKE '%boss%' OR status1 LIKE '%active%" for string. And array('field'=>'value') for array

string $groupby

DB group by field. NULL if not need

string $join_db

Table to join or NULL

string $join_where

Join condition or NULL

string $join_type

Join type ('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER') or NULL

string $sel_field

DB field select. Default is (*)

Returns

array

getUser()

getUser(string  $id,   $type = '') : object

getUser

Function for get member data

Parameters

string $id

member id

$type

Returns

object —

or FALSE

getUserEmail()

getUserEmail(string  $id) : string

getUserEmail

Function for get member email

Parameters

string $id

member id

Returns

string

createUser()

createUser(string  $member = FALSE) 

createUser

Parameters

string $member

member is TRUE Function for create the new user

updateUser()

updateUser(string  $id, boolean  $backend = TRUE) : TRUE

updateUser

Function for update the user

Parameters

string $id

member id

boolean $backend

TRUE for login on backend

Returns

TRUE —

or FALSE

removeUser()

removeUser(string  $id) 

removeUser

Function for remove the user

Parameters

string $id

member id

removeData()

removeData(string  $table, string  $id_field, string  $id_val = '') 

removeData

Function for remove the data

Parameters

string $table

DB table

string $id_field

DB id field

string $id_val

DB id value

removeDataAndFile()

removeDataAndFile(string  $table, string  $id_field, string  $id_val, string  $file_path, string  $file_sql_field) 

removeDataAndFile

Function for remove the data and file

Parameters

string $table

DB table

string $id_field

DB id field

string $id_val

DB id value

string $file_path

file upload path

string $file_sql_field

DB field name of file

dropTable()

dropTable(string  $table_name) 

dropTable

Function for drop the DB table

Parameters

string $table_name

DB table

chkMd5Time()

chkMd5Time(string  $md5, string  $table = '') : TRUE

chkMd5Time

Function for check the user md5 time for forgot the password link

Parameters

string $md5

md5 from user DB

string $table

DB table

Returns

TRUE —

or FALSE

sessionLoginChk()

sessionLoginChk() : TRUE

sessionLoginChk

Function for check the session from client browser

Returns

TRUE —

or FALSE

getLangISOfromName()

getLangISOfromName(string  $lang_name = 'english') : string

getLangISOfromName

Function for get the language code from name

Parameters

string $lang_name

Language name

Returns

string

getLangNamefromISO()

getLangNamefromISO(string  $lang_iso) : string

getLangNamefromISO

Function for get the language name from code

Parameters

string $lang_iso

Language code

Returns

string

cszCopyright()

cszCopyright() 

cszCopyright

Function for show website footer credit Please do not remove or change this fuction

coreCss()

coreCss(string  $more_css = '', boolean  $more_include = TRUE) : String

coreCss

Function for load core css

Parameters

string $more_css

additional css

boolean $more_include

for include the css file or FALSE

Returns

String

coreJs()

coreJs(string  $more_js = '', boolean  $more_include = TRUE) : String

coreJs

Function for load core js

Parameters

string $more_js

additional js

boolean $more_include

for include the js file or FALSE

Returns

String

coreMetatags()

coreMetatags(string  $desc_txt, string  $more_metatags = '') : String

coreMetatags

Function for load core metatag

Parameters

string $desc_txt

page description

string $more_metatags

additional meta tags text

Returns

String

getSocial()

getSocial() : object

getSocial

Function for get the social

Returns

object —

or FALSE

updateSocial()

updateSocial() 

updateSocial

Function for update the social

updateSettings()

updateSettings() 

updateSettings

Function for update the settings

file_upload()

file_upload(string  $photo, string  $photo_name1, string  $tmp_photo, string  $uploaddir, string  $photo_id, string  $paramiter, string  $yearR = '', integer  $maxSizeR = 1900, boolean  $resize = TRUE, integer  $limitsize = 100) : String

file_upload

Function for upload file

Parameters

string $photo

File from $_FILE['tmp_name']

string $photo_name1

File name from $_FILE['name']

string $tmp_photo

Temp file. Can null if noting

string $uploaddir

Path to save the file

string $photo_id

New file name

string $paramiter

Other paramiter for new file name. Can null if noting

string $yearR

Year for directory

integer $maxSizeR

Max the photo size (pixel). For image file only. Default 1900px

boolean $resize

for resize enable. Default is TRUE (enable)

integer $limitsize

Limit file size to upload (Mega Byte). Default 100 MB

Returns

String —

(New filename)

sortNav()

sortNav() 

sortNav

Function for save the navigation by sort

getPagesAll()

getPagesAll() : array

getPagesAll

Function for get all pages

Returns

array

getPluginAll()

getPluginAll() : array

getPluginAll

Function for get all plugin

Returns

array

getAllMenu()

getAllMenu(integer  $drop_page_menu_id, string  $lang = '', integer  $position) : object

getAllMenu

Function for get all menu

Parameters

integer $drop_page_menu_id

1 = drop menu, 0 = main menu

string $lang

language code

integer $position

menu position 0 = Top, 1 = Bottom

Returns

object —

or FALSE id not found

getDropMenuAll()

getDropMenuAll() : array

getDropMenuAll

Function for get all drop down menu

Returns

array

getMenuArrange()

getMenuArrange(string  $mainmenu_id) : integer

getMenuArrange

Function for get next number for arrange

Parameters

string $mainmenu_id

for main menu. Default is 0

Returns

integer

insertMenu()

insertMenu() 

insertMenu

Function for insert new menu

updateMenu()

updateMenu(string  $id) 

updateMenu

Function for update the menue

Parameters

string $id

Menu id

findLangDataUpdate()

findLangDataUpdate(string  $lang_iso) 

findLangDataUpdate

Function for find the lang update. When delete Lang, wiil update all page of lang to default.

Parameters

string $lang_iso

language code

insertLang()

insertLang() 

insertLang

Function for create new language

updateLang()

updateLang(string  $id) 

updateLang

Function for update the language

Parameters

string $id

language id

syncLabelLang()

syncLabelLang() 

syncLabelLang

Function for synchronize the language with general label for frontend

updateLabel()

updateLabel(string  $id) 

updateLabel

Function for update the general label

Parameters

string $id

general label id

chkPageName()

chkPageName(  $page_name_input) : string

chkPageName

Function for check page name

Parameters

$page_name_input

Returns

string

insertPage()

insertPage() 

insertPage

Function for create new page

updatePage()

updatePage(string  $id) 

updatePage

Function for update the page

Parameters

string $id

page id

insertFileUpload()

insertFileUpload(string  $year, string  $fileupload) 

insertFileUpload

Function for insert the file upload into db

Parameters

string $year

year

string $fileupload

file name from file_upload function

insertForms()

insertForms() 

insertForms

Function for insert the forms

updateForms()

updateForms(string  $id) 

updateForms

Function for update the form

Parameters

string $id

form id

preTypeFields()

preTypeFields(string  $type, string  $name) : array

preTypeFields

Function for prepare the field type

Parameters

string $type

field type

string $name

field name

Returns

array

renameFields()

renameFields(string  $type, string  $oldname, string  $newname) : array

renameFields

Function for rename the field

Parameters

string $type

field type

string $oldname

old field name

string $newname

new field name

Returns

array

execSqlFile()

execSqlFile(string  $sql_file) : FALSE

execSqlFile

Function for import the sql file into db

Parameters

string $sql_file

sql file path

Returns

FALSE —

if sql file not found

chkPluginActive()

chkPluginActive(string  $plugin_config_filename) : TRUE

chkPluginActive

Function for check the plugin is active

Parameters

string $plugin_config_filename

plugin config filename

Returns

TRUE —

or FALSE

insertWidget()

insertWidget() 

insertWidget

Function for insert the new widget

updateWidget()

updateWidget(string  $id) 

updateWidget

Function for update the widget

Parameters

string $id

widget id

insertLinks()

insertLinks() 

insertLinks

Function for insert the new widget

updateBFSettings()

updateBFSettings() 

updateBFSettings

Function for update the Brute Force Protection settings

saveWhiteIP()

saveWhiteIP() 

saveWhiteIP

Function for insert the new whitelist IP Address

saveBlackIP()

saveBlackIP() 

saveBlackIP

Function for insert the new blacklist IP Address

insertBanner()

insertBanner() 

insertBanner

Function for insert the new banner

updateBanner()

updateBanner(string  $id) 

updateBanner

Function for update the banner

Parameters

string $id

banner id

saveActionsLogs()

saveActionsLogs(string  $url, string  $actions, string  $note = '') 

saveActionsLogs

Function for save the login log into database

Parameters

string $url

current url

string $actions

actions text

string $note

note text

setMaintenance()

setMaintenance() 

setMaintenance

Function for set the maintenance mode on frontend

unsetMaintenance()

unsetMaintenance() 

unsetMaintenance

Function for unset the maintenance mode on frontend

getFormDraft()

getFormDraft() : Object

getFormDraft

Function for get data from form draft

Returns

Object —

or FALSE

getDraftArray()

getDraftArray(  $array_key) : Object

getFormDraft

Function for get data from form draft

Parameters

$array_key

Returns

Object —

or FALSE

getSaveDraftJS()

getSaveDraftJS() : String

getSaveDraftJS

Function for get data from form draft

Returns

String

makePrivateKey()

makePrivateKey() 

makePrivateKey

Function for make private key from db

getPrivateKey()

getPrivateKey() : String

getPrivateKey

Function for get private key from db

Returns

String

getIndexDataFromObj()

getIndexDataFromObj(object  $data, integer  $limit,   $offset = 1) : object

getIndexDataFromObj

Function for get data for index page from object data (support pageination)

Parameters

object $data

Object data from xml

integer $limit

limit [show limit]

$offset

Returns

object —

or FALSE

getPluginXML()

getPluginXML(string  $xml_url = '', string  $key_search = '', string  $search = '') : object

getPluginXML

Function for get latest version from xml url

Parameters

string $xml_url

xml url file

string $key_search

key search from xml

string $search

search from xml

Returns

object —

or FALSE

pluginLatestVer()

pluginLatestVer(string  $plugin_config_filename) : String

pluginLatestVer

Function for get latest version from xml url

Parameters

string $plugin_config_filename

for plugin config filename

Returns

String —

or FALSE

chkPluginInst()

chkPluginInst(string  $plugin_config_filename) : TRUE

chkPluginInst

Function for get latest version from xml url

Parameters

string $plugin_config_filename

for plugin config filename

Returns

TRUE —

or FALSE

chkPluginUpdate()

chkPluginUpdate(string  $cur_ver, string  $last_ver) : true

chkPluginUpdate

Function for check version for plugin update

Parameters

string $cur_ver

current version

string $last_ver

latest version

Returns

true —

or false

pluginNextVer()

pluginNextVer(string  $cur_txt, string  $last_ver) : string

pluginNextVer

Function for check next version for plugin update

Parameters

string $cur_txt

current version

string $last_ver

latest version

Returns

string —

or false

cszGenerateMeta()

cszGenerateMeta() 

exportCSV()

exportCSV(\srting  $filename, \srting  $table, array  $field_sel = "", \srting  $where = "", string  $orderby = "", string  $sort = "ASC", string  $groupby = '') : string

Export the database to csv

Parameters

\srting $filename

Filename

\srting $table

Database Table to export

array $field_sel

Database field to select to export

\srting $where

Where condition

string $orderby

Order by field or NULL

string $sort

asc or desc or NULL

string $groupby

Group by field or NULL

Returns

string —

File download

findPrimaryKey()

findPrimaryKey(\srting  $table) : string|array

Find the primary key from db table

Parameters

\srting $table

Database Table

Returns

string|array

pluginUninstall()

pluginUninstall(string  $plugin_config_filename) : TRUE

pluginUninstall

Function for clean uninstall the plugin from the CMS

Parameters

string $plugin_config_filename

for plugin config filename

Returns

TRUE —

or FALSE

getServerIp()

getServerIp() 

getSoftwareInfo()

getSoftwareInfo(string  $mode = 'a') : string

Returns information about the operating system PHP is running on

Parameters

string $mode

[optional]

mode is a single character that defines what information is returned: 'a': This is the default. Contains all modes in the sequence "s n r v m".

Returns

string —

the description, as a string.

dirSize()

dirSize(\directory  $directory) : integer

Get the directory size

Parameters

\directory $directory

Returns

integer

usageSpace()

usageSpace() 

memUsage()

memUsage() 

getMemLimit()

getMemLimit() 

getDisabledFunctions()

getDisabledFunctions() 

insertCarousel()

insertCarousel() 

insertCarousel

Function for insert the new carousel

updateCarousel()

updateCarousel(string  $id) 

updateCarousel

Function for update the carousel

Parameters

string $id

banner id

insertCarouselUpload()

insertCarouselUpload(string  $carousel_widget_id, string  $carousel_type, string  $fileupload = '', string  $youtube_url = '', string  $photo_url = '') 

insertCarouselUpload

Function for upload the carousel photo

Parameters

string $carousel_widget_id

carousel widget id

string $carousel_type

carousel type into database

string $fileupload

file upload path into database

string $youtube_url

youtube url into database

string $photo_url

photo url into database

getAllPluginWidget()

getAllPluginWidget() : array

getAllPluginWidget

Function for insert the new carousel

Returns

array

insertPWidget()

insertPWidget() 

insertPWidget

Function for insert the new plugin widget

updatePWidget()

updatePWidget(string  $id) 

updatePWidget

Function for update the plugin widget

Parameters

string $id

widget id

showLoadingImg()

showLoadingImg() 

jsredirect()

jsredirect(  $url,   $delay = 500) 

Parameters

$url
$delay

setcahetime()

setcahetime(integer  $minute) 

setcahetime Set the cache time (In minute)

Parameters

integer $minute

the minute of cache time

thumbnail()

thumbnail(  $inputFileName,   $uploaddir,   $maxSize = 500) 

Create a thumbnail image from $inputFileName no taller or wider than $maxSize. Returns the new image resource or false on error.

Author: mthorn.net

Parameters

$inputFileName
$uploaddir
$maxSize

imageToFile()

imageToFile(  $im,   $fileName,   $quality = 75) 

Save the image to a file. Type is determined from the extension.

$quality is only used for jpegs. Author: mthorn.net

Parameters

$im
$fileName
$quality

setLatestVer()

setLatestVer() : array

getLatestVerArray

Function for get latest version from xml url

Returns

array

cszCredit()

cszCredit() 

getNiceFileSize()

getNiceFileSize(  $bytes) 

Parameters

$bytes