0) || (isset ($anketa) && $anketa > 0)) {
$this->anketa = (isset ($_REQUEST['anketa']) && $_REQUEST['anketa'] > 0) ? $_REQUEST['anketa'] : $anketa;
} else {
return 'Anketa ID ne obstaja';
}
# poiščemo aktivno anketo
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
if (isset($_GET['m']) && $_GET['m'] == 'tracking_data')
$this->sub = 'data';
elseif (isset($_GET['appendMerge']) && $_GET['appendMerge'] == '1')
$this->sub = 'append';
else
$this->sub = 'survey';
// Filter po statusu
if (isset($_GET['status']) && in_array($_GET['status'], array('0', '1', '2', '3', '4', '5', '6')))
$this->status = " AND status = '{$_GET[status]}' ";
return $this;
}
private static $_instance;
/**
* V kolikor razred kličemo statično
*
* @return instance
*/
public static function init()
{
if (!static::$_instance)
static::$_instance = new TrackingClass();
return static::$_instance;
}
/**
* Filter po statusih
* Filter omogoča, da se prvi parameter ne upošteva statusa, v koliko ni filtra upošteva vse statuse.
* Drugi parameter naredi inverzno operacijo - išče samo po tem statusu
* 0 => urejanje
* 1 => uvoz podatkov
* 2 => analiza
* 3 => reporti
* 4 => podatki
* 5 => objava - vabila
* 6 => hierarhija
* 20 => hierarhija - splošno
* 21 => hierarhija - gradnja strukture
* 22 => hierarhija - uporabniki
*
* @param (int or array) $exclude_status
* @param (boolean) $invert_status
* @return $this
*/
public function filter($exclude_status = null, $invert_status = false)
{
$opcija = '!';
if ($invert_status)
$opcija = '';
if (!is_null($exclude_status) && is_int($exclude_status)) {
$this->status = " AND status " . $opcija . "= '" . $exclude_status . "' ";
} elseif (!is_null($exclude_status) && is_array($exclude_status)) {
if (!empty($opcija)) {
$this->status = " AND status NOT IN (" . implode(',', $exclude_status) . ")";
} else {
$this->status = " AND status IN (" . implode(',', $exclude_status) . ")";
}
}
return $this;
}
/**
* @desc prikaze tracking sprememb
* status:
* -1 => unknown
* 0 => urejanje
* 1 => uvoz podatkov
* 2 => analiza
* 3 => reporti
* 4 => podatki
* 5 => objava - vabila
* 20 => hierarhija - splošno
* 21 => hierarhija - gradnja strukture
* 22 => hierarhija - uporabniki
*/
public function trackingDisplay()
{
global $lang;
$surveyName = SurveyInfo::getInstance()->getSurveyTitle();
echo '