Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 757
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 757
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 758
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 758
Notice: require(): read of 2443 bytes failed with errno=12 Cannot allocate memory in /var/www/html/ticnews.com.br/web/wp-content/plugins/google-maps-easy/functions.php on line 44
Notice: require(): read of 2443 bytes failed with errno=12 Cannot allocate memory in /var/www/html/ticnews.com.br/web/wp-content/plugins/google-maps-easy/functions.php on line 44
on' => $v));
}
} else {
$model->addWhere(array($k => $v));
}
}
}
// jqGrid search
$isSearch = reqGmp::getVar('_search');
if($isSearch) {
$searchField = trim(reqGmp::getVar('searchField'));
$searchString = trim(reqGmp::getVar('searchString'));
if(!empty($searchField) && !empty($searchString)) {
// For some cases - we will need to modify search keys and/or values before put it to the model
$model->addWhere(array(
$this->_prepareSearchField($searchField) => $this->_prepareSearchString($searchString)
));
}
}
$model = $this->_prepareModelBeforeListSelect($model);
// Get total pages count for current request
$totalCount = $model->getCount(array('clear' => array('selectFields')));
$totalPages = 0;
if($totalCount > 0) {
$totalPages = ceil($totalCount / $rowsLimit);
}
if($page > $totalPages) {
$page = $totalPages;
}
// Calc limits - to get data only for current set
$limitStart = $rowsLimit * $page - $rowsLimit; // do not put $limit*($page - 1)
if($limitStart < 0)
$limitStart = 0;
$data = $model
->setLimit($limitStart. ', '. $rowsLimit)
->setOrderBy( $this->_prepareSortOrder($orderBy) )
->setSortOrder( $sortOrder )
->getFromTbl();
$data = $this->_prepareListForTbl( $data );
$res->addData('page', $page);
$res->addData('total', $totalPages);
$res->addData('rows', $data);
$res->addData('records', $model->getLastGetCount());
$res = dispatcherGmp::applyFilters($this->getCode(). '_getListForTblResults', $res);
$res->ajaxExec();
}
public function removeGroup() {
$res = new responseGmp();
if($this->getModel()->removeGroup(reqGmp::getVar('listIds', 'post'))) {
$res->addMessage(__('Done', GMP_LANG_CODE));
} else
$res->pushError($this->getModel()->getErrors());
$res->ajaxExec();
}
public function clear() {
$res = new responseGmp();
if($this->getModel()->clear()) {
$res->addMessage(__('Done', GMP_LANG_CODE));
} else
$res->pushError($this->getModel()->getErrors());
$res->ajaxExec();
}
protected function _prepareListForTbl($data) {
return $data;
}
protected function _prepareSearchField($searchField) {
return $searchField;
}
protected function _prepareSearchString($searchString) {
return $searchString;
}
protected function _prepareSortOrder($sortOrder) {
return $sortOrder;
}
}