Prenova arhiviranja sql tabel s podatki (poleg _active imamo sedaj tudi _archive1, _archive2...)

This commit is contained in:
pero1203 2021-07-23 12:25:40 +02:00
parent 4c7f448de7
commit 386f969595
76 changed files with 243 additions and 245 deletions

View File

@ -120,8 +120,7 @@ class PdfIzvoz {
$this->anketa['uid'] = $global_user_id;
SurveyUserSetting::getInstance()->Init($this->anketa['id'], $this->anketa['uid']);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
else
return false;

View File

@ -146,8 +146,7 @@ class PdfIzvozResults {
{
SurveyUserSetting::getInstance()->Init($this->anketa['id'], $global_user_id);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
else
return false;

View File

@ -90,8 +90,7 @@ class RtfIzvoz {
$this->anketa['uid'] = $global_user_id;
SurveyUserSetting::getInstance()->Init($this->anketa['id'], $this->anketa['uid']);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
else
return false;

View File

@ -115,8 +115,7 @@ class RtfIzvozResults {
{
SurveyUserSetting::getInstance()->Init($this->anketa['id'], $global_user_id);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
else
return false;

View File

@ -84,8 +84,7 @@ class Branching {
SurveyInfo::getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
UserSetting :: getInstance()->Init($global_user_id);
@ -102,7 +101,7 @@ class Branching {
}
/**
* @desc inicializacija branchinga (samo prvi<EFBFBD>, na za<EFBFBD>etku), prepi<EFBFBD>e vrstni red iz normalenga urejanja
* @desc inicializacija branchinga (samo prvic, na zacetku), prepise vrstni red iz normalenga urejanja
*/
function init_branching () {

View File

@ -2172,7 +2172,7 @@ class BranchingAjax {
// komentarji respondentov
elseif ($type == 2) {
$db_table = (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$orderby = $sortpostorder == 1 ? 'DESC' : 'ASC' ;
$sql = sisplet_query("SELECT d.*, u.time_edit FROM srv_data_text".$db_table." d, srv_user u WHERE d.spr_id='0' AND d.vre_id='$spremenljivka' AND u.id=d.usr_id ORDER BY d.id $orderby");

View File

@ -153,8 +153,7 @@ class SurveyAdmin
SurveyInfo::getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$this->survey_type = $this->getSurvey_type($this->anketa);

View File

@ -68,8 +68,7 @@ class SurveyAdminAjax {
SurveyInfo::getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$this->survey_type = $this->SurveyAdmin->getSurvey_type($this->anketa);

View File

@ -58,8 +58,7 @@ class SurveyAdminSettings {
SurveyInfo::getInstance()->SurveyInit($this->anketa);
SurveyInfo::getInstance()->resetSurveyData();
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$this->survey_type = $this->getSurvey_type($this->anketa);

View File

@ -3377,7 +3377,7 @@ class ApiSurvey {
// vstavimo v srv_data_text (email, ime, priimek)
SurveyInfo::getInstance()->SurveyInit($ank_id);
$db_table = (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
foreach ($sys_vars AS $sid => $spremenljivka) {
if ($spremenljivka['variable'] == 'email')
sisplet_query("INSERT INTO srv_data_text" . $db_table . " (spr_id, vre_id, text, usr_id) VALUES ('" . $sid . "', '" . $spremenljivka['vre_id'] . "', '" . $email . "', '" . $usr_id . "')");
@ -3424,7 +3424,7 @@ class ApiSurvey {
// vstavimo v srv_data_text (email, ime, priimek)
SurveyInfo::getInstance()->SurveyInit($ank_id);
$db_table = (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
foreach ($sys_vars AS $sid => $spremenljivka) {
if ($spremenljivka['variable'] == 'email') {
$data_insert = sisplet_query("INSERT INTO srv_data_text" . $db_table . " (spr_id, vre_id, text, usr_id) VALUES ('" . $sid . "', '" . $spremenljivka['vre_id'] . "', '" . $email . "', '" . $usr_id . "')");
@ -3887,7 +3887,7 @@ class ApiSurvey {
// vstavimo v srv_data_text (email, ime, priimek)
SurveyInfo::getInstance()->SurveyInit($ank_id);
$db_table = (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
foreach ($sys_vars AS $sid => $spremenljivka) {
if ($spremenljivka['variable'] == 'email')
sisplet_query("INSERT INTO srv_data_text" . $db_table . " (spr_id, vre_id, text, usr_id) VALUES ('" . $sid . "', '" . $spremenljivka['vre_id'] . "', '" . $email . "', '" . $usr_id . "')");
@ -3934,7 +3934,7 @@ class ApiSurvey {
// vstavimo v srv_data_text (email, ime, priimek)
SurveyInfo::getInstance()->SurveyInit($ank_id);
$db_table = (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
foreach ($sys_vars AS $sid => $spremenljivka) {
if ($spremenljivka['variable'] == 'email') {
$data_insert = sisplet_query("INSERT INTO srv_data_text" . $db_table . " (spr_id, vre_id, text, usr_id) VALUES ('" . $sid . "', '" . $spremenljivka['vre_id'] . "', '" . $email . "', '" . $usr_id . "')");

View File

@ -42,10 +42,9 @@ class Common {
{
if ($anketa) {
self::$anketa = $anketa;
SurveyInfo::getInstance()->SurveyInit(self::$anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
self::$db_table = '_active';
SurveyInfo::getInstance()->SurveyInit(self::$anketa);
self::$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}
@ -240,9 +239,8 @@ class Common {
$sql = sisplet_query("SELECT id FROM srv_user WHERE preview='1' AND time_edit < NOW() - INTERVAL 3 HOUR AND ank_id = '".$sid."'");
# polovimo vrsto tabel za to anketo
$strDbTable = "SELECT db_table FROM srv_anketa WHERE id = $sid";
$qryDbTable = sisplet_query($strDbTable);
list($db_table) = mysqli_fetch_row($qryDbTable);
SurveyInfo::getInstance()->SurveyInit($sid);
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$list = '';
// se je dogajalo da je 0 ... pa se je pojavljal mysql_fetch error
@ -255,6 +253,7 @@ class Common {
}
if ($list != '') {
sisplet_query("BEGIN");
// tabela z respondenti
$deleted = sisplet_query("DELETE FROM srv_user WHERE preview='1' AND id IN ($list) AND ank_id = '$sid'");

View File

@ -47,8 +47,7 @@ class Prevajanje {
SurveySetting::getInstance()->Init($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$row = SurveyInfo::getInstance()->getSurveyRow();

View File

@ -30,9 +30,8 @@ class RecodeValues {
self::$anketa = $anketa;
self::$spremenljivka = $spremenljivka;
SurveyInfo::getInstance()->SurveyInit($anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
self::$db_table = '_active';
SurveyInfo::getInstance()->SurveyInit($anketa);
self::$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
# polovimo manjkajoče privzete vrednosti ankete
self::$smv = new SurveyMissingValues(self::$anketa);

View File

@ -137,8 +137,6 @@ class SurveyAktivnost{
if ($type == 'pages')
$time_edit = 'srv_user_grupa_active.time_edit';
// ker je time_edit vcasih 0000-00-00 bi mogli v teh primerih pobrat time_insert
// $time_edit = 'srv_user_grupa'.$this->db_table.'.time_insert';
elseif ($type == 'users')
$time_edit = 'srv_user.time_edit';
elseif ($type=='analiza')

View File

@ -24,9 +24,7 @@ class SurveyAppendMerge {
SurveyInfo::getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
function display ($merge = false) {

View File

@ -24,8 +24,7 @@ class SurveyConnect {
SurveyInfo::getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
function ajax () {
@ -111,7 +110,24 @@ class SurveyConnect {
if (!$subsql) echo mysqli_error($GLOBALS['connect_db']);
while ($subrow = mysqli_fetch_assoc($subsql)) {
$db_table = ($subrow['db_table'] == 1) ? '_active' : '';
switch($subrow['db_table']){
// Arhivska 1
case '0':
$db_table = '_archive1';
break;
// Arhivska 2
case '2':
$db_table = '_archive2';
break;
// Aktivna anketa
case '1':
default:
$db_table = '_active';
break;
}
$subsql1 = sisplet_query("SELECT d.* FROM srv_data_vrednost".$db_table." d, srv_vrednost v, srv_user u WHERE d.spr_id='$subrow[id]' AND d.vre_id=v.id AND v.variable='$unikat' AND u.id=d.usr_id AND u.deleted='0'");
if (!$subsql1) echo mysqli_error($GLOBALS['connect_db']);

View File

@ -29,9 +29,8 @@ class SurveyCustomReport {
// polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->ank_id);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// Inicializiramo in polovimo nastavitve missing profila
SurveyStatusProfiles::Init($this->ank_id);

View File

@ -794,7 +794,7 @@ class SurveyDiagnostics
}
if (count($spr_id) > 0) {
$db_table = ($this->surveyInfo['db_table'] == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
#preštejemo komentarje uporabnikov na vprašanja
# srv_data_text where spr_id = 0 AND vre_id IN (id-ji spremenljivk)

View File

@ -87,8 +87,7 @@ class SurveyExport
$this->survey = SurveyInfo::getInstance()->getSurveyRow();
# aktivne tabele
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// Preverimo ce ima user dostop
$d = new Dostop();
@ -820,7 +819,7 @@ class SurveyExport
$_max_text_missing_chars = max($_max_text_missing_chars, strlen($mkey . ': '. $missing));
$_max_number_missing_chars = max($_max_number_missing_chars, strlen($mkey));
}
$maxLengthForSpr = self::create_array_SPSS(max($_max_text_missing_chars,$_max_number_missing_chars));
$maxLengthForSpr = $this->create_array_SPSS(max($_max_text_missing_chars,$_max_number_missing_chars));
//$resultString .= .NEW_LINE;
$resultString = $lang['srv_spss_export_base_instructions'];
$resultString .= NEW_LINE.'.'.NEW_LINE.NEW_LINE;
@ -1361,18 +1360,15 @@ class SurveyExport
private function create_array_SPSS($max_missing) {
$array_SPSS = array();
$db_table = ($this->survey['db_table'] == 1) ? '_active' : '';
# poberemo max dolžine iz srv_data_text max(text1,text2)
$str_query = 'SELECT dt.spr_id, MAX(LENGTH(dt.text)) AS length, MAX(LENGTH(dt.text2)) AS length2 FROM srv_data_text'.$db_table.' dt, srv_grupa g, srv_spremenljivka s WHERE dt.spr_id = s.id AND s.gru_id=g.id AND g.ank_id='.$this->sid.' GROUP BY dt.spr_id';
$str_query = 'SELECT dt.spr_id, MAX(LENGTH(dt.text)) AS length, MAX(LENGTH(dt.text2)) AS length2 FROM srv_data_text'.$this->db_table.' dt, srv_grupa g, srv_spremenljivka s WHERE dt.spr_id = s.id AND s.gru_id=g.id AND g.ank_id='.$this->sid.' GROUP BY dt.spr_id';
$_qry_SPSS = sisplet_query($str_query);
while (list($spr_id,$text,$text2) = mysqli_fetch_row($_qry_SPSS)) {
$array_SPSS[$spr_id] = max((int)$text,(int)$text2,$max_missing);
}
$str_query = 'SELECT dt.spr_id, MAX(LENGTH(dt.text)) AS length FROM srv_data_textgrid'.$db_table.' AS dt, srv_grupa g, srv_spremenljivka s WHERE dt.spr_id = s.id AND s.gru_id=g.id AND g.ank_id='.$this->sid.' GROUP BY dt.spr_id';
$str_query = 'SELECT dt.spr_id, MAX(LENGTH(dt.text)) AS length FROM srv_data_textgrid'.$this->db_table.' AS dt, srv_grupa g, srv_spremenljivka s WHERE dt.spr_id = s.id AND s.gru_id=g.id AND g.ank_id='.$this->sid.' GROUP BY dt.spr_id';
$_qry_SPSS = sisplet_query($str_query);
while (list($spr_id,$text) = mysqli_fetch_row($_qry_SPSS)) {
#$this->_array_SPSS[$spr_id]['text2'] = ((int)$text < $this->MISSING_MAX_LENGTH ? $this->MISSING_MAX_LENGTH :$text);
$array_SPSS[$spr_id] = max((int)$text,$array_SPSS[$spr_id],$max_missing);
}
return $array_SPSS;

View File

@ -847,5 +847,33 @@ class SurveyInfo
else
return false;
}
// Vrnemo pripeto ime tabele s podatki ce gre za arhivsko ali aktivno anketo (_active, archive1, archive2...)
public static function getSurveyArchiveDBString() {
$db_table = self::getSurveyColumn('db_table');
switch($db_table){
// Arhivska 1
case '0':
$db_table_string = '_archive1';
break;
// Arhivska 2
case '2':
$db_table_string = '_archive2';
break;
// Aktivna anketa
case '1':
default:
$db_table_string = '_active';
break;
}
return $db_table_string;
}
}
?>

View File

@ -57,9 +57,8 @@ class SurveyParaAnalysis{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$this->_CURRENT_STATUS_FILTER = STATUS_FIELD.' ~ /6|5/';
Common::deletePreviewData($this->anketa);

View File

@ -27,8 +27,7 @@ class SurveyPostProcess {
SurveyInfo::getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
#inicializiramo class za datoteke
$this->SDF = SurveyDataFile::get_instance();

View File

@ -7,11 +7,10 @@ class SurveyRecoding
function __construct($anketa) {
$this->anketa = $anketa;
SurveyInfo::getInstance()->SurveyInit($anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
function Ajax() {

View File

@ -51,9 +51,8 @@ class SurveyReminderTracking{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$this->_CURRENT_STATUS_FILTER = STATUS_FIELD.' ~ /6|5/';
Common::deletePreviewData($this->anketa);

View File

@ -434,7 +434,7 @@ class SurveyRespondents {
global $site_path, $site_url, $lang;
SurveyInfo::getInstance()->SurveyInit(self::getSurveyId());
$db_table = (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
echo '<span>'.$lang['srv_respondents_added_respondents'].':</span>';
echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="' . $site_url . 'admin/survey/index.php?anketa='.self::getSurveyId().'&a=email&m=usermailing_setting" ><span>'.$lang['forward'].'</span></a></span></span>';
@ -669,7 +669,7 @@ class SurveyRespondents {
global $admin_type;
SurveyInfo::getInstance()->SurveyInit(self::getSurveyId());
$db_table = (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// preverimo potrebne sistemske variable
// tu je lahko vejica

View File

@ -140,8 +140,7 @@ class SurveyStatistic {
# poiščemo aktivno anketo
SurveyInfo :: getInstance()->SurveyInit($this->getSurveyId());
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
# nastavimo spremenljivko ali imamo vse default vrednosti
$this->isDefaultFilters = true;

View File

@ -3472,7 +3472,7 @@ class SurveyTelephone {
sisplet_query($strInsert);
# vstavimo v srv_data_text
$db_table = (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
if (count($strInsertDataText) > 0) {
$strInsert = "INSERT INTO srv_data_text".$db_table." (spr_id, vre_id, text, usr_id) VALUES ";
$strInsert .= implode(',',$strInsertDataText);

View File

@ -15,9 +15,7 @@ class SurveyTextAnalysis{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
else {
echo 'Invalid Survey ID!';

View File

@ -51,9 +51,8 @@ class SurveyUsableResp{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$this->_CURRENT_STATUS_FILTER = STATUS_FIELD.' ~ /6|5/';
Common::deletePreviewData($this->anketa);

View File

@ -31,8 +31,7 @@ class Vprasanje {
SurveyInfo::getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
if (SurveyInfo::getInstance()->getSurveyColumn('expanded') == 1)
$this->expanded = 1;

View File

@ -31,8 +31,7 @@ class VprasanjeInline {
SurveyInfo::getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
if (SurveyInfo::getInstance()->getSurveyColumn('expanded') == 1)
$this->expanded = 1;

View File

@ -196,9 +196,7 @@ class SurveyAnalysis {
UserSetting :: getInstance()->Init($global_user_id);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
self::$db_table = '_active';
}
self::$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
# nastavimo vse filtre
self::setUpFilter();

View File

@ -28,9 +28,8 @@ class SurveyAnalysisHelper {
self::$anketa = $anketa;
SurveyInfo::getInstance()->SurveyInit(self::$anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
self::$db_table = '_active';
self::$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}

View File

@ -49,9 +49,8 @@ class SurveyBreak
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->sid);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$this->_CURRENT_STATUS_FILTER = STATUS_FIELD.' ~ /6|5/';
#inicializiramo class za datoteke

View File

@ -104,9 +104,8 @@ class SurveyCrosstabs {
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->sid);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$this->_CURRENT_STATUS_FILTER = STATUS_FIELD.' ~ /6|5/';
# Inicializiramo in polovimo nastavitve missing profila

View File

@ -15,20 +15,20 @@ class SurveyEditsAnalysis{
function __construct($anketa){
if ((int)$anketa > 0){
$this->anketa = $anketa;
if ((int)$anketa > 0){
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
}
else {
echo 'Invalid Survey ID!';
exit();
}
$this->anketa = $anketa;
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
else {
echo 'Invalid Survey ID!';
exit();
}
}

View File

@ -41,9 +41,7 @@ class SurveyMeans{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->sid);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
# Inicializiramo in polovimo nastavitve missing profila
SurveyStatusProfiles::Init($this->sid);

View File

@ -74,9 +74,7 @@ class SurveyMultiCrosstabs {
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->ank_id);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$this->_CURRENT_STATUS_FILTER = STATUS_FIELD.' ~ /6|5/';

View File

@ -37,10 +37,7 @@ class SurveyTTest
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->sid);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
# Inicializiramo in polovimo nastavitve missing profila
SurveyStatusProfiles::Init($this->sid);

View File

@ -189,11 +189,10 @@ class SurveyDataCollect{
$qry_survey = sisplet_query("SELECT *, UNIX_TIMESTAMP(edit_time) AS srv_edit_time FROM srv_anketa WHERE id='".$this->sid."'");
$this->survey = mysqli_fetch_assoc($qry_survey);
SurveyInfo::getInstance()->SurveyInit($this->sid);
// Aktivne tabele za podatke v bazi
if ((int)$this->survey['db_table'] == 1)
$this->db_table = '_active';
else
$this->db_table = '';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// Zadnji cas editiranja ankete
$this->max_anketa_time = (int)$this->survey['srv_edit_time'];

View File

@ -165,8 +165,7 @@ class SurveyDataDisplay{
self::$survey = SurveyInfo::getInstance()->getSurveyRow();
# aktivne tabele
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
self::$db_table = '_active';
self::$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
# ali je anketa tipa SN - social network
self::$is_social_network = (SurveyInfo::getInstance()->checkSurveyModule('social_network')) ? true : false;
@ -3050,11 +3049,9 @@ class SurveyDataDisplay{
echo '<td class="right">'.$text.'</td></tr>';
}
if ( $admin_type <= 1) {
if ( $admin_type <= 1) {
echo '<tr><td class="left">'.$lang['srv_sc_txt1'].':</td>';
echo '<td class="right"><a href="#" onclick="sc_display(\''.self::$usr_id.'\'); return false;">'.$lang['srv_sc_txt2'].'</a></td></tr>';
echo '<td class="right"><a href="#" onclick="sc_display(\''.self::$usr_id.'\'); return false;">'.$lang['srv_sc_txt2'].'</a></td></tr>';
}
}

View File

@ -44,8 +44,7 @@ class SurveyInvitationsNew {
SurveyInfo::SurveyInit($this->sid);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$this->surveySettings = SurveyInfo::getInstance()->getSurveyRow();

View File

@ -122,7 +122,7 @@ class SurveyUnsubscribe {
$anketa = self::$sid;
$db_table = (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$lang_id = (int)$_GET['language'];
if ($lang_id != null) $_lang = '_'.$lang_id; else $_lang = '';

View File

@ -254,8 +254,7 @@ class SurveyInvitationsSqualo {
// če mamo personalizirana email vabila, userje dodamo v bazo
if ($individual == 1) {
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$db_table = '_active';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$inv_variables_link = array('email'=>'email','geslo'=>'password','ime'=>'firstname','priimek'=>'lastname','naziv'=>'salutation','telefon'=>'phone','drugo'=>'custom','odnos'=>'relation','last_status'=>'last_status','sent'=>'sent','responded'=>'responded','unsubscribed'=>'unsubscribed');

View File

@ -23,8 +23,7 @@ class TrackingClass
# poiščemo aktivno anketo
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
if ($_GET['m'] == 'tracking_data')
$this->sub = 'data';
@ -322,7 +321,7 @@ class TrackingClass
# poiščemo aktivno anketo
SurveyInfo :: getInstance()->SurveyInit($anketa);
$db_table = (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
$get = '';
foreach ($_GET AS $key => $val) {

View File

@ -95,9 +95,7 @@ class LatexSurvey{
//if ( SurveyInfo::getInstance()->SurveyInit($this->anketa['id']) && $this->init())
if ( SurveyInfo::getInstance()->SurveyInit($this->anketa) )
{
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1){
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
else{
return false;

View File

@ -102,8 +102,7 @@ class LatexSurveyElement{
{
SurveyUserSetting::getInstance()->Init($anketa, $global_user_id);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
else{
return false;

View File

@ -63,9 +63,7 @@ class XmlSurvey{
//if ( SurveyInfo::getInstance()->SurveyInit($this->anketa['id']) && $this->init())
if ( SurveyInfo::getInstance()->SurveyInit($this->anketa) )
{
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1){
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
else{
return false;

View File

@ -57,8 +57,7 @@ class XmlSurveyElement{
{
SurveyUserSetting::getInstance()->Init($anketa, $global_user_id);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
$this->db_table = '_active';
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
else{
return false;

View File

@ -69,9 +69,7 @@ class Evalvacija{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// Nastavimo clanico kateri pripada anketa
$this->fakulteta = $this->getFakultetaId($anketa);

View File

@ -19,9 +19,7 @@ class Survey360{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}

View File

@ -19,9 +19,7 @@ class Survey3601ka{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}

View File

@ -19,9 +19,7 @@ class SurveyBORZA{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}

View File

@ -39,9 +39,7 @@ class EvoliForm {
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}

View File

@ -21,9 +21,7 @@ class SurveyEmployMeter{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}

View File

@ -21,9 +21,7 @@ class SurveyEvoli{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}

View File

@ -30,9 +30,7 @@ class SurveyTeamMeter{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// Nastavimo se ustrezne parametre za skripto glede na tip izvoza (ime skripte, pdf-ja, csv-ja)
$this->setExecuteParams();

View File

@ -26,9 +26,7 @@ class SurveyMFDPS{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
$this->cacheData();

View File

@ -25,9 +25,7 @@ class SurveyMJU{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}

View File

@ -20,9 +20,7 @@ class SurveyMJUEnote{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}

View File

@ -45,9 +45,7 @@ class SurveyNIJZ{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
else{
die();

View File

@ -19,9 +19,7 @@ class SurveySpeedIndex{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}

View File

@ -54,9 +54,7 @@ class HierarhijaAnalysis
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo::getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
# Inicializiramo in polovimo nastavitve missing profila
SurveyStatusProfiles::Init($this->anketa);

View File

@ -2087,8 +2087,7 @@ class Hierarhija {
}
}
$db_table = (SurveyInfo::getInstance()
->getSurveyColumn('db_table') == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// tukaj pridobimo podatke o anketi za določeno strukturo
// preverimov prvi in zadnji nivo

View File

@ -41,10 +41,7 @@ class HierarhijaHelper
// V kolikor smo na katerikoli strani, potem gledamo po piškotkih
if (isset($get->{'survey-'.$ank_id})) {
$active = '';
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$active = '_active';
}
$active = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// ID uporabnika, glede na njegov piškot
$srv_user = sisplet_query("SELECT id FROM srv_user WHERE cookie='".$get->{'survey-'.$ank_id}."'", "obj")->id;

View File

@ -313,8 +313,7 @@ class HierarhijaIzvoz {
}
}
$db_table = (SurveyInfo::getInstance()
->getSurveyColumn('db_table') == 1) ? '_active' : '';
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
// tukaj pridobimo podatke o anketi za določeno strukturo
// preverimov prvi in zadnji nivo

View File

@ -50,9 +50,7 @@ class SurveyKakovost{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
SurveyAnalysisHelper::getInstance()->Init($this->anketa);

View File

@ -20,9 +20,7 @@ class SurveyPanel{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}

View File

@ -50,9 +50,7 @@ class SurveyUporabnost{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
SurveyAnalysisHelper::getInstance()->Init($this->anketa);

View File

@ -20,9 +20,7 @@ class SurveyVizualizacija{
# polovimo vrsto tabel (aktivne / neaktivne)
SurveyInfo :: getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1) {
$this->db_table = '_active';
}
$this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
}
}

View File

@ -106,9 +106,7 @@ if ($_GET['a'] == 'ankete') {
if (mysqli_num_rows($sql) > 0) {
$row = mysqli_fetch_array($sql);
if ($row['db_table'] == 1) $db_table = '_active'; else $db_table = '';
echo $row['id'].delimiter;
echo $row['insert_uid'].delimiter;
echo $row['a_first'].delimiter;
@ -232,7 +230,24 @@ if ($_GET['a'] == 'ankete') {
while ($row = mysqli_fetch_array($sql)) {
if ($row['db_table'] == 1) $db_table = '_active'; else $db_table = '';
switch($row['db_table']){
// Arhivska 1
case '0':
$db_table = '_archive1';
break;
// Arhivska 2
case '2':
$db_table = '_archive2';
break;
// Aktivna anketa
case '1':
default:
$db_table = '_active';
break;
}
echo $row['id'].delimiter;
echo $row['uid'].delimiter;

View File

@ -99,8 +99,8 @@ class InitClass extends Controller
// polovimo podatke o anketi
SurveyInfo::getInstance()->SurveyInit(get('anketa'));
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
save('db_table', '_active');
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
save('db_table', $db_table);
$rowa = SurveyInfo::getInstance()->getSurveyRow();
@ -453,8 +453,8 @@ class InitClass extends Controller
// polovimo podatke o anketi
\SurveyInfo::getInstance()->SurveyInit(get('anketa'));
if (\SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
save('db_table', '_active');
$db_table = \SurveyInfo::getInstance()->getSurveyArchiveDBString();
save('db_table', $db_table);
\SurveySetting::getInstance()->Init(get('anketa'));
save('usr_id', $_REQUEST['usr_id']);

View File

@ -138,8 +138,9 @@ class StatisticController extends Controller
$sqla = sisplet_query("SELECT starts, expire, statistics, db_table FROM srv_anketa WHERE id ='$row2[ank_id]'");
$rowa = mysqli_fetch_array($sqla);
if ($rowa['db_table'] == 1)
save('db_table', '_active');
SurveyInfo::getInstance()->SurveyInit($row2['ank_id']);
$db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
save('db_table', $db_table);
$text = $rowa['statistics'];

View File

@ -9500,15 +9500,32 @@ INSERT INTO srv_help (help, what) VALUES ('Operatorji', 'srv_if_operator');
UPDATE misc SET value='21.05.25' WHERE what="version";
# Drupal verzija je bila posodobljena in vpišemo na 1ka.si in te
UPDATE misc SET value='7.81' WHERE what="drupal version";
UPDATE misc SET value='21.06.10' WHERE what="version";
INSERT INTO srv_help (what, help) VALUES ('srv_export_full_meta', 'Export data and paradata');
UPDATE misc SET value='21.07.19' WHERE what="version";
UPDATE srv_help SET help='Izvozi podatke in parapodatke' WHERE what='srv_export_full_meta' AND lang='1';
INSERT INTO srv_help (what, help, lang) VALUES ('srv_export_full_meta', 'Export data and paradata', '2');
UPDATE misc SET value='21.07.19' WHERE what="version";
UPDATE misc SET value='21.07.19' WHERE what="version";
# NOVE ARHIVSKE TABELE - STARE SO PREIMENOVANE IN DODANE DODATNE
RENAME TABLE srv_data_vrednost TO srv_data_vrednost_archive1;
RENAME TABLE srv_data_text TO srv_data_text_archive1;
RENAME TABLE srv_data_grid TO srv_data_grid_archive1;
RENAME TABLE srv_data_checkgrid TO srv_data_checkgrid_archive1;
RENAME TABLE srv_data_textgrid TO srv_data_textgrid_archive1;
RENAME TABLE srv_user_grupa TO srv_user_grupa_archive1;
RENAME TABLE srv_tracking TO srv_tracking_archive1;
CREATE TABLE srv_data_vrednost_archive2 LIKE srv_data_vrednost_archive1;
CREATE TABLE srv_data_text_archive2 LIKE srv_data_text_archive1;
CREATE TABLE srv_data_grid_archive2 LIKE srv_data_grid_archive1;
CREATE TABLE srv_data_checkgrid_archive2 LIKE srv_data_checkgrid_archive1;
CREATE TABLE srv_data_textgrid_archive2 LIKE srv_data_textgrid_archive1;
CREATE TABLE srv_user_grupa_archive2 LIKE srv_user_grupa_archive1;
CREATE TABLE srv_tracking_archive2 LIKE srv_tracking_archive1;
UPDATE misc SET value='23.07.19' WHERE what="version";

View File

@ -1,7 +1,7 @@
<?php
/**
*
* Podatke neaktivnih anket, ki se ze nekaj casa niso spreminjale prenese iz _active tabel v navadne - arhivske tabele
* Podatke neaktivnih anket, ki se ze nekaj casa niso spreminjale prenese iz _active tabel v arhivske tabele
*
* NOVA SKRIPTA ZA TABELE
*
@ -30,6 +30,9 @@ $start = (isset($_GET['start'])) ? ' AND id > '.$_GET['start'] : '';
// Limit stevila anket, ki jih naenkrat arhiviramo
$limit = (isset($_GET['limit'])) ? $_GET['limit'] : 200;
$archive_table = '2';
$archive_table_string = '_archive2';
// Arhiviramo specificno anketo
if($survey_id != ''){
@ -50,8 +53,10 @@ else{
}
if (!$sql) { echo mysqli_error($GLOBALS['connect_db']).' 50'; die(); }
echo 'Arhiviranje '.mysqli_num_rows($sql).' anket.<hr>';
// Loop po anketah
while ($row = mysqli_fetch_array($sql)) {
@ -84,7 +89,7 @@ while ($row = mysqli_fetch_array($sql)) {
// Popravimo anketo med arhivske (ni vec _active)
$s = sisplet_query("UPDATE srv_anketa SET db_table = '0' WHERE id = '$row[id]'");
$s = sisplet_query("UPDATE srv_anketa SET db_table = '".$archive_table."' WHERE id = '$row[id]'");
if (!$s) { echo mysqli_error($GLOBALS['connect_db']).' 70'; die(); }
@ -101,8 +106,8 @@ while ($row = mysqli_fetch_array($sql)) {
// ARHIVIRANJE srv_user_grupa
function archive_srv_user_grupa($ank_id){
// Vstavimo v arhivsko tabelo (srv_user_grupa)
$sql1 = sisplet_query("INSERT INTO srv_user_grupa (gru_id, usr_id, time_edit, preskocena)
// Vstavimo v arhivsko tabelo (srv_user_grupa_archive2)
$sql1 = sisplet_query("INSERT INTO srv_user_grupa".$archive_table_string." (gru_id, usr_id, time_edit, preskocena)
SELECT d2.gru_id, d2.usr_id, d2.time_edit, d2.preskocena
FROM srv_user_grupa_active d2, srv_grupa g
WHERE d2.gru_id = g.id
@ -126,8 +131,8 @@ function archive_srv_data_vrednost($ank_id){
// Samo za kopiranje ugasnemo foreign key check, ker obstajajo primeri, kjer usr_id ne obstaja
sisplet_query("SET FOREIGN_KEY_CHECKS=0");
// Vstavimo v arhivsko tabelo (srv_data_vrednost)
$sql1 = sisplet_query("INSERT INTO srv_data_vrednost (spr_id, vre_id, usr_id, loop_id)
// Vstavimo v arhivsko tabelo (srv_data_vrednost_archive2)
$sql1 = sisplet_query("INSERT INTO srv_data_vrednost".$archive_table_string." (spr_id, vre_id, usr_id, loop_id)
SELECT d2.spr_id, d2.vre_id, d2.usr_id, d2.loop_id
FROM srv_data_vrednost_active d2, srv_spremenljivka s, srv_grupa g
WHERE d2.spr_id = s.id
@ -156,7 +161,7 @@ function archive_srv_data_text($ank_id){
sisplet_query("SET FOREIGN_KEY_CHECKS=0");
// Vstavimo v arhivsko tabelo (srv_data_text)
$sql1 = sisplet_query("INSERT INTO srv_data_text (spr_id, vre_id, text, text2, usr_id, loop_id)
$sql1 = sisplet_query("INSERT INTO srv_data_text".$archive_table_string." (spr_id, vre_id, text, text2, usr_id, loop_id)
SELECT d2.spr_id, d2.vre_id, d2.text, d2.text2, d2.usr_id, d2.loop_id
FROM srv_data_text_active d2, srv_spremenljivka s, srv_grupa g
WHERE d2.spr_id = s.id
@ -181,7 +186,7 @@ function archive_srv_data_text($ank_id){
// Samo za kopiranje ugasnemo foreign key check, ker obstajajo primeri, kjer usr_id ne obstaja
sisplet_query("SET FOREIGN_KEY_CHECKS=0");
$sql1 = sisplet_query("INSERT INTO srv_data_text (spr_id, vre_id, text, text2, usr_id, loop_id)
$sql1 = sisplet_query("INSERT INTO srv_data_text".$archive_table_string." (spr_id, vre_id, text, text2, usr_id, loop_id)
SELECT d2.spr_id, d2.vre_id, d2.text, d2.text2, d2.usr_id, d2.loop_id
FROM srv_data_text_active d2, srv_spremenljivka s, srv_grupa g
WHERE d2.spr_id = '0'
@ -212,7 +217,7 @@ function archive_srv_data_grid($ank_id){
sisplet_query("SET FOREIGN_KEY_CHECKS=0");
// Vstavimo v arhivsko tabelo (srv_data_grid)
$sql1 = sisplet_query("INSERT INTO srv_data_grid (spr_id, vre_id, usr_id, grd_id, loop_id)
$sql1 = sisplet_query("INSERT INTO srv_data_grid".$archive_table_string." (spr_id, vre_id, usr_id, grd_id, loop_id)
SELECT d2.spr_id, d2.vre_id, d2.usr_id, d2.grd_id, d2.loop_id
FROM srv_data_grid_active d2, srv_spremenljivka s, srv_grupa g
WHERE d2.spr_id = s.id
@ -237,7 +242,7 @@ function archive_srv_data_grid($ank_id){
// Samo za kopiranje ugasnemo foreign key check, ker obstajajo primeri, kjer usr_id ne obstaja
sisplet_query("SET FOREIGN_KEY_CHECKS=0");
$sql1 = sisplet_query("INSERT INTO srv_data_grid (spr_id, vre_id, usr_id, grd_id, loop_id)
$sql1 = sisplet_query("INSERT INTO srv_data_grid".$archive_table_string." (spr_id, vre_id, usr_id, grd_id, loop_id)
SELECT d2.spr_id, d2.vre_id, d2.usr_id, d2.grd_id, d2.loop_id
FROM srv_data_grid_active d2, srv_spremenljivka s, srv_grupa g, srv_grid_multiple m
WHERE d2.spr_id = m.spr_id AND m.parent=s.id
@ -266,7 +271,7 @@ function archive_srv_data_textgrid($ank_id){
sisplet_query("SET FOREIGN_KEY_CHECKS=0");
// Vstavimo v arhivsko tabelo (srv_data_textgrid)
$sql1 = sisplet_query("INSERT INTO srv_data_textgrid (spr_id, vre_id, usr_id, grd_id, text, loop_id)
$sql1 = sisplet_query("INSERT INTO srv_data_textgrid".$archive_table_string." (spr_id, vre_id, usr_id, grd_id, text, loop_id)
SELECT d2.spr_id, d2.vre_id, d2.usr_id, d2.grd_id, d2.text, d2.loop_id
FROM srv_data_textgrid_active d2, srv_spremenljivka s, srv_grupa g
WHERE d2.spr_id = s.id
@ -291,7 +296,7 @@ function archive_srv_data_textgrid($ank_id){
// Samo za kopiranje ugasnemo foreign key check, ker obstajajo primeri, kjer usr_id ne obstaja
sisplet_query("SET FOREIGN_KEY_CHECKS=0");
$sql1 = sisplet_query("INSERT INTO srv_data_textgrid (spr_id, vre_id, usr_id, grd_id, text, loop_id)
$sql1 = sisplet_query("INSERT INTO srv_data_textgrid".$archive_table_string." (spr_id, vre_id, usr_id, grd_id, text, loop_id)
SELECT d2.spr_id, d2.vre_id, d2.usr_id, d2.grd_id, d2.text, d2.loop_id
FROM srv_data_textgrid_active d2, srv_spremenljivka s, srv_grupa g, srv_grid_multiple m
WHERE d2.spr_id = m.spr_id AND m.parent=s.id
@ -320,7 +325,7 @@ function archive_srv_data_checkgrid($ank_id){
sisplet_query("SET FOREIGN_KEY_CHECKS=0");
// Vstavimo v arhivsko tabelo (srv_data_checkgrid)
$sql1 = sisplet_query("INSERT INTO srv_data_checkgrid (spr_id, vre_id, usr_id, grd_id, loop_id)
$sql1 = sisplet_query("INSERT INTO srv_data_checkgrid".$archive_table_string." (spr_id, vre_id, usr_id, grd_id, loop_id)
SELECT d2.spr_id, d2.vre_id, d2.usr_id, d2.grd_id, d2.loop_id
FROM srv_data_checkgrid_active d2, srv_spremenljivka s, srv_grupa g
WHERE d2.spr_id = s.id
@ -344,7 +349,7 @@ function archive_srv_data_checkgrid($ank_id){
// Se dodatno za kombinirane tabele
// Samo za kopiranje ugasnemo foreign key check, ker obstajajo primeri, kjer usr_id ne obstaja
sisplet_query("SET FOREIGN_KEY_CHECKS=0");
$sql1 = sisplet_query("INSERT INTO srv_data_checkgrid (spr_id, vre_id, usr_id, grd_id, loop_id)
$sql1 = sisplet_query("INSERT INTO srv_data_checkgrid".$archive_table_string." (spr_id, vre_id, usr_id, grd_id, loop_id)
SELECT d2.spr_id, d2.vre_id, d2.usr_id, d2.grd_id, d2.loop_id
FROM srv_data_checkgrid_active d2, srv_spremenljivka s, srv_grupa g, srv_grid_multiple m
WHERE d2.spr_id = m.spr_id AND m.parent=s.id
@ -370,7 +375,7 @@ function archive_srv_data_checkgrid($ank_id){
function archive_srv_tracking($ank_id){
// Vstavimo v arhivsko tabelo (srv_tracking)
$sql1 = sisplet_query("INSERT INTO srv_tracking (`ank_id`, `datetime`, `ip`, `user`, `get`, `post`, `status`, `time_seconds`)
$sql1 = sisplet_query("INSERT INTO srv_tracking".$archive_table_string." (`ank_id`, `datetime`, `ip`, `user`, `get`, `post`, `status`, `time_seconds`)
SELECT d2.ank_id, d2.datetime, d2.ip, d2.user, d2.get, d2.post, d2.status, d2.time_seconds
FROM srv_tracking_active d2
WHERE d2.ank_id = '$ank_id'

View File

@ -11,20 +11,26 @@ include_once ('../settings.php');
$struktura = array();
$podatki = array(
'srv_user' => array(),
'srv_data_checkgrid' => array(),
'srv_data_checkgrid_archive1' => array(),
'srv_data_checkgrid_archive2' => array(),
'srv_data_checkgrid_active' => array(),
'srv_data_glasovanje' => array(),
'srv_data_grid' => array(),
'srv_data_grid_archive1' => array(),
'srv_data_grid_archive2' => array(),
'srv_data_grid_active' => array(),
'srv_data_rating' => array(),
'srv_data_text' => array(),
'srv_data_text_archive1' => array(),
'srv_data_text_archive2' => array(),
'srv_data_text_active' => array(),
'srv_data_textgrid' => array(),
'srv_data_textgrid_archive1' => array(),
'srv_data_textgrid_archive2' => array(),
'srv_data_textgrid_active' => array(),
'srv_data_upload' => array(),
'srv_data_vrednost' => array(),
'srv_data_vrednost_archive1' => array(),
'srv_data_vrednost_archive2' => array(),
'srv_data_vrednost_active' => array(),
'srv_user_grupa' => array(),
'srv_user_grupa_archive1' => array(),
'srv_user_grupa_archive2' => array(),
'srv_user_grupa_active' => array());
@ -102,20 +108,26 @@ if ($handle = opendir($sync_server_path)) {
}
$podatki['srv_user'] = array_merge($podatki['srv_user'], $kljuc['srv_user']);
$podatki['srv_data_checkgrid'] = array_merge($podatki['srv_data_checkgrid'], $kljuc['srv_data_checkgrid']);
$podatki['srv_data_checkgrid_archive1'] = array_merge($podatki['srv_data_checkgrid_archive1'], $kljuc['srv_data_checkgrid_archive1']);
$podatki['srv_data_checkgrid_archive2'] = array_merge($podatki['srv_data_checkgrid_archive2'], $kljuc['srv_data_checkgrid_archive2']);
$podatki['srv_data_checkgrid_active'] = array_merge($podatki['srv_data_checkgrid_active'], $kljuc['srv_data_checkgrid_active']);
$podatki['srv_data_glasovanje'] = array_merge($podatki['srv_data_glasovanje'], $kljuc['srv_data_glasovanje']);
$podatki['srv_data_grid'] = array_merge($podatki['srv_data_grid'], $kljuc['srv_data_grid']);
$podatki['srv_data_grid_archive1'] = array_merge($podatki['srv_data_grid_archive1'], $kljuc['srv_data_grid_archive1']);
$podatki['srv_data_grid_archive2'] = array_merge($podatki['srv_data_grid_archive2'], $kljuc['srv_data_grid_archive2']);
$podatki['srv_data_grid_active'] = array_merge($podatki['srv_data_grid_active'], $kljuc['srv_data_grid_active']);
$podatki['srv_data_rating'] = array_merge($podatki['srv_data_rating'], $kljuc['srv_data_rating']);
$podatki['srv_data_text'] = array_merge($podatki['srv_data_text'], $kljuc['srv_data_text']);
$podatki['srv_data_text_archive1'] = array_merge($podatki['srv_data_text_archive1'], $kljuc['srv_data_text_archive1']);
$podatki['srv_data_text_archive2'] = array_merge($podatki['srv_data_text_archive2'], $kljuc['srv_data_text_archive2']);
$podatki['srv_data_text_active'] = array_merge($podatki['srv_data_text_active'], $kljuc['srv_data_text_active']);
$podatki['srv_data_textgrid'] = array_merge($podatki['srv_data_textgrid'], $kljuc['srv_data_textgrid']);
$podatki['srv_data_textgrid_archive1'] = array_merge($podatki['srv_data_textgrid_archive1'], $kljuc['srv_data_textgrid_archive1']);
$podatki['srv_data_textgrid_archive2'] = array_merge($podatki['srv_data_textgrid_archive2'], $kljuc['srv_data_textgrid_archive2']);
$podatki['srv_data_textgrid_active'] = array_merge($podatki['srv_data_textgrid_active'], $kljuc['srv_data_textgrid_active']);
$podatki['srv_data_upload'] = array_merge($podatki['srv_data_upload'], $kljuc['srv_data_upload']);
$podatki['srv_data_vrednost'] = array_merge($podatki['srv_data_vrednost'], $kljuc['srv_data_vrednost']);
$podatki['srv_data_vrednost_archive1'] = array_merge($podatki['srv_data_vrednost_archive1'], $kljuc['srv_data_vrednost_archive1']);
$podatki['srv_data_vrednost_archive2'] = array_merge($podatki['srv_data_vrednost_archive2'], $kljuc['srv_data_vrednost_archive2']);
$podatki['srv_data_vrednost_active'] = array_merge($podatki['srv_data_vrednost_active'], $kljuc['srv_data_vrednost_active']);
$podatki['srv_user_grupa'] = array_merge($podatki['srv_user_grupa'], $kljuc['srv_user_grupa']);
$podatki['srv_user_grupa_archive1'] = array_merge($podatki['srv_user_grupa_archive1'], $kljuc['srv_user_grupa_archive1']);
$podatki['srv_user_grupa_archive2'] = array_merge($podatki['srv_user_grupa_archive2'], $kljuc['srv_user_grupa_archive2']);
$podatki['srv_user_grupa_active'] = array_merge($podatki['srv_user_grupa_active'], $kljuc['srv_user_grupa_active']);
$uvozeno = true;