Skip to content

Instantly share code, notes, and snippets.

View xbukovsk-zz's full-sized avatar

Václav Bukovský xbukovsk-zz

View GitHub Profile
@xbukovsk-zz
xbukovsk-zz / sqlSelect.php
Created November 30, 2015 22:11
sql select
<? php
public static function getAllIndicatorValuesOverview($userId = null) {
$surveys = self::getConnection()->query(
'SELECT surveys.surveyId,surveys.year,user.organizationName
FROM surveys
LEFT JOIN user ON surveys.userId=user.userId'
)->fetchAll();
foreach($surveys as &$survey) {
@xbukovsk-zz
xbukovsk-zz / indicatorValuesGrid.php
Last active November 30, 2015 21:05
Problem with Mesour\Datagrid
<? php
protected function createComponentIndicatorValuesDatagrid($name) {
if($this->user->isInRole('admin')) {
$values = IndicatorModel::getIndicatorValuesForGrid();
} else {
$values = IndicatorModel::getIndicatorValuesForGrid($this->user->id);
}
$indicators = IndicatorModel::getAllIndicators();