public function __construct($table, $data) { $this->table = $table; $this->friendlytable = ucfirst(str_replace(TABLEPREFIX, '', $table)); $this->cols = dbfn::_getfields($table); $this->params = array(); foreach ($this->cols as $col) { $oTemp = new colparams($this->table, $col); $this->params[$col] = $oTemp->_getvalues(); } $this->datain = $data; $this->process(); //fb($this,FIREPHP::TRACE); }
public function __construct($table, $cid = 'new') { global $view; $this->option = $view; $this->table = $table; $this->cid = $cid; $this->cols = dbfn::_getfields("aimnotes"); $this->popup = req::_('popup'); $this->editing = req::_('editing'); $this->params = array(); foreach ($this->cols as $col) { $oTemp = new colparams($this->table, $col); $this->params[$col] = $oTemp->_getvalues(); } }
* 8/21/2014 - Added comment header */ /** ** ** ** ** ** ** ** ** ** * SETUP PARAMETERS */ global $view; global $option; $option = req::_('option', 'default'); $view = req::_('view', $option); $frm_name = req::_('frm_name'); /** ** ** ** ** ** ** ** ** ** * PROCESS FORM */ switch ($frm_name) { case 'frm_tableparam': $oParams = new colparams(req::_('_table'), req::_('_col')); $oParams->_set($_POST); $output = $oParams->_store(); break; case 'frm_editor': $table = req::_('table_name'); // table name $prikey = dbfn::_getprimary($table); // get primary key name of table $id = req::_($prikey); // get id of record $oEditor = new editor($table, $id); $oEditor->_getData(); $oEditor->_setData($_POST); $output = $oEditor->_storeData(); break;
public function _getDataChanges() { #setup variables $changes = array(); #determine differences between old values and new $delta = $this->is_update ? array_diff_assoc($this->datadb, $this->data) : $this->data; // if new record #iterate through to build list of changes foreach ($delta as $key => $value) { if (array_search($key, $this->fields) === false) { unset($delta[$key]); } else { $oParams = new colparams($this->table, $key); $params = $oParams->_getvalues(); $field_name = $params->qv_label; if (strpos(strtolower($field_name), "password") === false) { $changes[] = $this->is_update ? "{$field_name} changed from '{$this->datadb[$key]}' to '{$this->data[$key]}'" : "{$field_name} initially set to '{$this->data[$key]}'"; } else { $changes[] = $this->is_update ? "{$field_name} changed" : "{$field_name} set"; } } } $this->changes = implode("\n", $changes); return $this->changes; }
* Last Updated: 8/21/2014 * * Changelog: * 8/21/2014 - Added comment header */ /** ** ** ** ** ** ** ** ** ** * SETUP PARAMETERS */ global $view; global $option; $option = req::_('option', 'default'); $view = req::_('view', $option); /** ** ** ** ** ** ** ** ** ** * PROCESS THE REQUEST */ switch ($option) { case 'update_options': $table = req::_('table'); $col = req::_('col'); $val = req::_('value'); $oParams = new colparams($table, $col); $params = $oParams->_getvalues(); $return = editor::_getOptions($params, $val); echo $return; break; } ?>