0) { $this->_anketa = $anketa; } else { throw new Exception('Error: survey ID is missing. (HashUrl)'); } } catch (Exception $e) { die( $e->getMessage().' Exiting script!'); } return $this; } public function ajax() { $action = $_GET['a']; switch ($action) { case 'showLinks' : self :: showUrlLinks(); break; case 'addLink' : self :: addLink(); break; case 'saveComment' : self :: saveComment(); case 'saveRefresh' : self :: saveRefresh(); case 'saveAccessPassword' : self :: saveAccessPassword(); break; case 'deleteLink' : self :: deleteLink(); break; default: $this->showUrlLinks(); break; } } function showUrlLinks($msg=null){ global $lang, $site_url; $podstran = $_REQUEST['podstran']; $m = $_REQUEST['m']; echo '
'.($msg); echo '
'; } $hashUrl = new HashUrl($this->_anketa); $links = $hashUrl->getSurveyHashes(); if (count($links) == 0){ echo ''.$lang['srv_public_link_noLink'].'
'; } echo ''.$lang['srv_public_link_addLink'].'
'; // Dodaten link posebej za NIJZ global $site_domain; if($site_domain == 'anketa.nijz.si' && ($podstran == 'data' || $podstran == 'data_nijz')){ echo 'NIJZ - '.$lang['srv_public_link_addLink'].'
'; } if (count($links) > 0){ echo ''; echo ' | '; echo ' | '.$lang['srv_inv_archive_comment'].' | '; echo ''.$lang['url'].' | '; echo ''.$lang['srv_analiza_archive_access_password_label'].' | '; echo ''.$lang['srv_public_link_refresh'].' | '; echo ''.$lang['srv_public_link_linkTo'].' | '; echo ''.$lang['srv_public_link_creationDate'].' | '; echo ''.$lang['srv_public_link_created'].' | '; echo '
---|---|---|---|---|---|---|---|---|
'; echo ''; echo ' | '; echo ''; echo $lang['srv_hash_url_'.$link['properties']['a']]; echo ' | '; echo ''; echo ''; print_r($link['comment']); echo ' | '; echo ''; //if this link is edited, inform editor of mobile App or API users echo ''; echo $site_url.'podatki/'.$this->_anketa.'/'.$link['hash'].'/'; echo ' | '; echo ''; echo ''; print_r($link['access_password']); echo ' | '; echo ''; echo ''; echo ' | '; echo ''; if ($link['page'] == $hashUrl::PAGE_DATA){ $page = $lang['srv_public_link_data']; } if ($link['page'] == $hashUrl::PAGE_ANALYSIS){ $page = $lang['srv_public_link_analyse']; } echo $page; if ($link['properties']['a'] == A_ANALYSIS && isset($link['properties']['m'])) { if ($link['properties']['m'] == M_ANALYSIS_DESCRIPTOR || $link['properties']['m'] == M_ANALYSIS_FREQUENCY || $link['properties']['m'] == M_ANALYSIS_SUMMARY || $link['properties']['m'] == M_ANALYSIS_SUMMARY_NEW || $link['properties']['m'] == M_ANALYSIS_CREPORT || $link['properties']['m'] == M_ANALYSIS_CHARTS) { echo ' (' . $lang['srv_'.$link['properties']['m']].')'; } } echo ' | '; echo ''; echo $link['add_date']; echo ' | '; echo ''; echo $link['email']; echo ' | '; echo '