0) {
$this->anketa = $anketa;
}
else {
die("Napaka!");
}
}
public function quota_display($condition, $long_alert=0) {
global $lang;
$echo = '';
$echo .= '';
if ($condition < 0) {
$rowC = Cache::srv_spremenljivka($condition < 0 ? -$condition : $condition);
$echo .= $rowC['variable'].' = ';
}
$sql = sisplet_query("SELECT * FROM srv_quota WHERE cnd_id = '$condition' ORDER BY vrstni_red ASC");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
$bracket = 0;
$i = 0;
while ($row = mysqli_fetch_array($sql)) {
if ($i++ != 0)
if ($row['operator'] == 0)
$echo .= ' + ';
elseif ($row['operator'] == 1)
$echo .= ' - ';
elseif ($row['operator'] == 2)
$echo .= ' * ';
elseif ($row['operator'] == 3)
$echo .= ' / ';
for ($i=1; $i<=$row['left_bracket']; $i++)
if ($long_alert == 1)
$echo .= ' ( ';
else
$echo .= ' ( ';
// Pri kvotah imamo vedno count
$echo .= $lang['srv_quota'].' (';
// spremenljivke
if ($row['spr_id'] > 0) {
// obicne spremenljivke
if ($row['vre_id'] == 0) {
$row1 = Cache::srv_spremenljivka($row['spr_id']);
if ($row1['tip'] != 7) {
$variable = $row1['variable'];
}
// number
else {
$variable = $row1['variable'].'['.($row['grd_id']+1).']';
}
}
// multigrid, checkbox, radio
elseif ($row['grd_id'] == 0) {
$sql1 = sisplet_query("SELECT variable FROM srv_vrednost WHERE id = '$row[vre_id]'");
if (!$sql1) echo mysqli_error($GLOBALS['connect_db']);
$row1 = mysqli_fetch_array($sql1);
$rowS = Cache::srv_spremenljivka($row['spr_id']);
if ($rowS['tip'] != 1) {
$variable = $row1['variable'];
}
else{
$variable = $rowS['variable'].'_'.$row1['variable'];
}
}
// multichecckbox, multinumber
elseif ($row['grd_id'] > 0) {
$sql1 = sisplet_query("SELECT variable FROM srv_vrednost WHERE id = '$row[vre_id]'");
if (!$sql1) echo mysqli_error($GLOBALS['connect_db']);
$row1 = mysqli_fetch_array($sql1);
$sql1g = sisplet_query("SELECT variable FROM srv_grid WHERE id = '$row[grd_id]'");
if (!$sql1g) echo mysqli_error($GLOBALS['connect_db']);
$row1g = mysqli_fetch_array($sql1g);
$variable = $row1['variable'].'['.$row1g['variable'].']';
}
if ($long_alert) $echo .= '';
$echo .= $variable;
if ($long_alert) $echo .= '';
// konstante
} elseif ($row['spr_id'] < 0) {
$echo .= $lang['srv_quota_status_'.(-1*$row['spr_id'])];
}
// Pri kvotah imamo vedno count
$echo .= ')';
for ($i=1; $i<=$row['right_bracket']; $i++)
if ($long_alert == 1)
$echo .= ' ) ';
else
$echo .= ' ) ';
}
$echo .= '';
if ($long_alert) {
$quota_check = $this->quota_check($condition);
if ( $quota_check != 0) {
if ($quota_check == 1)
$echo .= '
'.$lang['srv_error_spremenljivka'].'';
elseif ($quota_check == 2)
$echo .= '
'.$lang['srv_error_spremenljivka'].'';
elseif ($quota_check == 3)
$echo .= '
'.$lang['srv_error_oklepaji'].'';
}
}
return $echo;
}
// Izpise urejanje kvote
private function quota_editing ($condition, $vrednost=0) {
global $lang;
echo '