diff options
Diffstat (limited to 'admin/survey/classes/surveyAnalysis/class.SurveyAnalysisArchive.php')
-rw-r--r-- | admin/survey/classes/surveyAnalysis/class.SurveyAnalysisArchive.php | 570 |
1 files changed, 326 insertions, 244 deletions
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyAnalysisArchive.php b/admin/survey/classes/surveyAnalysis/class.SurveyAnalysisArchive.php index 6d937c5..cc5237e 100644 --- a/admin/survey/classes/surveyAnalysis/class.SurveyAnalysisArchive.php +++ b/admin/survey/classes/surveyAnalysis/class.SurveyAnalysisArchive.php @@ -21,9 +21,17 @@ */
-define("SAA_FOLDER", "AnalysisArchive");
+if(!defined("SAA_FOLDER")) define("SAA_FOLDER", "AnalysisArchive");
+
define("DEFAULT_DURATION", " +3 month"); // privzet čas trajanja athiva
+define("M_ANALIZA_SUMS", "sums");
+define("M_ANALIZA_DESCRIPTOR", "descriptor");
+define("M_ANALIZA_FREQUENCY", "frequency");
+define("M_ANALIZA_CROSSTAB", "crosstabs");
+define("M_ANALIZA_STATISTICS", "statistics");
+
+
class SurveyAnalysisArchive {
@@ -32,7 +40,7 @@ class SurveyAnalysisArchive { // konstrutor
protected function __construct() {}
// kloniranje
- final private function __clone() {}
+ private function __clone() {}
/**
* Inicializacija
@@ -78,7 +86,9 @@ class SurveyAnalysisArchive { 'edit' => true #stolpec spreminajl
);
+
$ArchiveTypes = array(M_ANALIZA_SUMS => 0, M_ANALIZA_DESCRIPTOR=>1, M_ANALIZA_FREQUENCY=>2, M_ANALIZA_CROSSTAB=>3, M_ANALYSIS_MEANS=>4, M_ANALYSIS_TTEST=>5, M_ANALYSIS_BREAK=>6, M_ANALYSIS_CHARTS=>7, M_ANALYSIS_CREPORT=>8);
+
#ponastavimo želene vrednosti
foreach ($fields AS $key => $value) {
$defaultFields[$key] = $value;
@@ -86,7 +96,7 @@ class SurveyAnalysisArchive { $users = array();
$qry = "SELECT saa.*, UNIX_TIMESTAMP(saa.date) as insert_date, UNIX_TIMESTAMP(saa.duration) as duration_d, DATEDIFF(saa.duration, CURDATE()) as days_left"
- # da ne delamo vlkege poizvedbe kadar ni potrebno
+ # da ne delamo velike poizvedbe, kadar ni potrebno
. ($defaultFields['insert'] ? " , us1.name as iname, us1.surname as isurname, us1.email as iemail " : "" )
. ($defaultFields['edit'] ? " , us2.name as ename, us2.surname as esurname, us2.email as eemail " : "" )
. " FROM srv_analysis_archive as saa "
@@ -96,73 +106,68 @@ class SurveyAnalysisArchive { $s = sisplet_query($qry);
if (mysqli_num_rows($s) > 0 ) {
-
- if($defaultFields['create_new']){
+
echo '<fieldset>';
echo '<legend>'.$lang['srv_archive_analysis'].'</legend>';
- echo $lang['srv_analiza_archive_generate_quick'];
-
- echo '</fieldset>';
+ echo '<p>'.$lang['srv_analiza_archive_note1'].'</p>';
+ echo '<p class="top16 bottom16">'.$lang['srv_analiza_archive_generate_quick'].'</p>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" type="button" onclick="doArchiveAnaliza();">'.$lang['srv_analiza_archive_generate_quick_button'].'</button>';
+ echo '</div>';
+
+ echo '<p class="bold">'.$lang['srv_analiza_archive_list'].'</p>';
+
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
+
+ echo '<table>';
+ echo '<tr>';
- echo '<br />';
- }
+ //Stolpec za ikone - prazen header
+ echo '<th></th>';
- echo '<table class="arch_tbl anl_bt anl_bl" style="width:100%">';
- echo '<tr>';
- if ($defaultFields['delete'])
- echo '<td class="anl_bck gray anl_bb anl_br anl_ac">'.$lang['srv_analiza_archive_lbl_delete'].'</td>';
- if ($defaultFields['edit'])
- echo '<td class="anl_bck gray anl_bb anl_br anl_ac">'.$lang['srv_analiza_archive_lbl_edit'].'</td>';
- if ($defaultFields['email'])
- echo '<td class="anl_bck gray anl_bb anl_br anl_ac">'.$lang['srv_analiza_archive_lbl_send'].'</td>';
if ($defaultFields['name'])
- echo '<td class="anl_bck gray anl_bb anl_br anl_ac">'.$lang['srv_analiza_archive_lbl_name'].'</td>';
+ echo '<th>'.$lang['srv_analiza_archive_lbl_name'].'</th>';
if ($defaultFields['note'])
- echo '<td class="anl_bck gray anl_bb anl_br anl_ac">'.$lang['srv_analiza_archive_lbl_note'].'</td>';
- if ($defaultFields['access'])
- echo '<td class="anl_bck gray anl_bb anl_br anl_ac">'.$lang['srv_analiza_archive_lbl_access'].'</td>';
+ echo '<th>'.$lang['srv_analiza_archive_lbl_note'].'</th>';
if ($defaultFields['type'])
- echo '<td class="anl_bck gray anl_bb anl_br anl_ac">'.$lang['srv_analiza_archive_lbl_type'].'</td>';
+ echo '<th>'.$lang['srv_analiza_archive_lbl_type'].'</th>';
if ($defaultFields['date'])
- echo '<td class="anl_bck gray anl_bb anl_br anl_ac">'.$lang['srv_analiza_archive_lbl_date'].'</td>';
+ echo '<th>'.$lang['srv_analiza_archive_lbl_date'].'</th>';
if ($defaultFields['duration'])
- echo '<td class="anl_bck gray anl_bb anl_br anl_ac">'.$lang['srv_analiza_archive_lbl_duration'].'</td>';
+ echo '<th>'.$lang['srv_analiza_archive_lbl_duration'].'</th>';
if ($defaultFields['insert'])
- echo '<td class="anl_bck gray anl_bb anl_br anl_ac">'.$lang['srv_analiza_archive_lbl_author'].'</td>';
+ echo '<th>'.$lang['srv_analiza_archive_lbl_author'].'</th>';
if ($defaultFields['edit'])
- echo '<td class="anl_bck gray anl_bb anl_br anl_ac">'.$lang['srv_analiza_archive_lbl_editor'].'</td>';
+ echo '<th>'.$lang['srv_analiza_archive_lbl_editor'].'</th>';
+ if ($defaultFields['access'])
+ echo '<th>'.$lang['srv_analiza_archive_lbl_access'].'</th>';
+
echo '</tr>';
while ($row = mysqli_fetch_assoc($s)) {
echo '<tr id="AnalysisArchiveRow_'.$row['id'].'">';
- if ($defaultFields['delete']) {
- echo '<td class="anl_bb anl_br anl_ac">';
- echo '<span>';
- echo '<a href="/" onclick="AnalysisArchiveDelete(\'' . $row['id'] . '\'); return false;" title="">';
- echo '<img src="img_0/delete_red.png" alt="" />';
- echo '</a>';
- echo '</span>';
- echo '</td>';
- }
- if ($defaultFields['edit']) {
- echo '<td class="anl_bb anl_br anl_ac">';
- echo '<span>';
- echo '<a href="/" onclick="AnalysisArchiveEdit(\'' . $row['id'] . '\'); return false;" title="">';
- echo '<img src="img_0/edit.png" alt="" />';
- echo '</a>';
- echo '</span>';
- echo '</td>';
- }
- if ($defaultFields['email']) {
- echo '<td class="anl_bb anl_br anl_ac">';
- echo '<span>';
- echo '<a href="/" onclick="emailArchiveAnaliza(\'' . $row['id'] . '\'); return false;" title="">';
- echo '<img src="icons/icons/email_link.png" alt="" />';
- echo '</a>';
- echo '</span>';
- echo '</td>';
- }
+
+ //Stolpec za ikone - vrstice
+ echo '<td>';
+ echo '<div class="icon_holder multiple">';
+
+ echo '<span class="faicon open_icon blue aslink" onclick="window.open(\''.$site_url.'admin/survey/AnalysisArchive.php?anketa='.self::$sid.'&aid='. $row['id']. '\', \'_blank\'); return false;"></span>';
+
+ if ($defaultFields['email'])
+ echo '<span class="faicon fa-share-alt blue aslink" onclick="emailArchiveAnaliza(\'' . $row['id'] . '\'); return false;"></span>';
+ if ($defaultFields['edit'])
+ echo '<span class="faicon edit blue aslink" onclick="AnalysisArchiveEdit(\'' . $row['id'] . '\'); return false;"></span>';
+ if ($defaultFields['delete'])
+ echo '<span class="faicon trash empty blue aslink" onclick="AnalysisArchiveDelete(\'' . $row['id'] . '\'); return false;"></span>';
+
+ echo '</div>';
+ echo '</td>';
+
+
+
if ($defaultFields['name']) {
echo '<td class="anl_bb anl_br">';
echo '<span>';
@@ -180,9 +185,6 @@ class SurveyAnalysisArchive { if ($defaultFields['note']) {
echo '<td class="anl_bb anl_br">'.$row['note'].'</td>';
}
- if ($defaultFields['access']) {
- echo '<td class="anl_bb anl_br">'.$lang['srv_analiza_arhiviraj_access_'.$row['access']].'</td>';
- }
if ($defaultFields['type']) {
$key = $lang['srv_analiza_arhiviraj_type_'.$row['type']];
echo '<td class="anl_bb anl_br anl_ac">'.$key.'</td>';
@@ -212,17 +214,30 @@ class SurveyAnalysisArchive { echo $row['eemail'];
echo '</td>';
}
+ if ($defaultFields['access']) {
+ echo '<td class="anl_bb anl_br">'.$lang['srv_analiza_arhiviraj_access_'.$row['access']].'</td>';
+ }
echo '</tr>';
}
echo '</table>';
+
+ echo '</div>';
+ echo '</div>';
+
+ echo '</fieldset>';
+
}
else {
echo '<fieldset>';
echo '<legend>'.$lang['srv_archive_analysis'].'</legend>';
- echo $lang['srv_analiza_archive_note_no_archive'];
- echo '<br/><br/>';
- echo $lang['srv_analiza_archive_generate_quick'];
+ echo '<p class="bold bottom16">'.$lang['srv_analiza_archive_note_no_archive'].'</p>';
+ echo '<p>'.$lang['srv_analiza_archive_note1'].'</p>';
+ echo '<p class="top16 bottom16">'.$lang['srv_analiza_archive_generate_quick'].'</p>';
+
+ echo '<div class="button_holder bottom0">';
+ echo '<button class="medium blue" type="button" onclick="doArchiveAnaliza();">'.$lang['srv_analiza_archive_generate_quick_button'].'</button>';
+ echo '</div>';
echo '</fieldset>';
}
@@ -297,7 +312,7 @@ class SurveyAnalysisArchive { $text .= $creport_title;
}
else{
- $text .= $lang['srv_analiza_archive_title'].$lang['srv_analiza_arhiviraj_type_'.$type];
+ $text .= $lang['srv_analiza_archive_title'].($type!==null?$lang['srv_analiza_arhiviraj_type_'.$type]:'');
}
$text .= ($survey_hide_title == 1) ? '</h2>' : '</h3>';
@@ -317,98 +332,129 @@ class SurveyAnalysisArchive { static function DisplayDoArchive() {
global $lang, $site_url;
- echo '<div id="div_analiza_archive_name" class="divPopUp">'."\n";
+ echo '<div id="div_analiza_archive_name" class="divPopUp">';
echo '<div class="popup_close"><a href="#" onClick="cancleArchiveAnaliza(); return false;">✕</a></div>';
- echo '<h2>'.$lang['srv_analiza_arhiv'].'</h2>';
-
- echo $lang['srv_analiza_arhiviraj_ime'];
- echo ': <input id="newAnalysisArchiveName" name="newAnalysisArchiveName" type="text" size="60" />'."\n";
+ echo '<h2><span class="faicon arhiv blue"></span>'.$lang['srv_analiza_archive_generate_quick_button'].'</h2>';
- echo '<br class="clr" />';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_analiza_arhiviraj_ime'].':</span>';
+ echo '<input id="newAnalysisArchiveName" class="text large" name="newAnalysisArchiveName" type="text"/>';
+ echo '</div>';
- echo '<div>';
- echo $lang['srv_analiza_archive_note'].':';
- echo '<textarea name="newAnalysisArchiveNote" id="newAnalysisArchiveNote" style="height:50px; width:100%"></textarea>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_analiza_archive_note'].':</span>';
+ echo '<textarea class="textarea" name="newAnalysisArchiveNote" id="newAnalysisArchiveNote"></textarea>';
echo '</div>';
- echo '<br class="clr" />';
- echo '<div>';
+
+ echo '<div class="alaysis_archive_wrap">';
// dostop
- echo '<div class="floatLeft">';
- echo $lang['srv_analiza_archive_access'].':';
- echo '<br/><input type="radio" name="newAnalysisArchiveAccess" value="0" checked="true" onchange="toggleAnalysisArchiveAccessPassword();"/> '.$lang['srv_analiza_archive_access_all'];
- echo '<br/><input type="radio" name="newAnalysisArchiveAccess" value="1" onchange="toggleAnalysisArchiveAccessPassword();"/> '.$lang['srv_analiza_archive_access_admins'];
- echo '<br/><input type="radio" name="newAnalysisArchiveAccess" value="2" onchange="toggleAnalysisArchiveAccessPassword();"/> '.$lang['srv_analiza_archive_access_password'];
- echo '<br/><div id="newAnalysisArchiveAccessPasswordDiv" style="visibility: hidden;">'.$lang['srv_analiza_archive_access_password_label'].'<input type="text" name="newAnalysisArchiveAccessPassword" id="newAnalysisArchiveAccessPassword" maxlength="25" />';
- echo '</div></div>';
- echo '<div class="floatLeft anl_w110" > </div>';
-
+ echo '<div class="alaysis_archive_left">';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_analiza_archive_access'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="newAnalysisArchiveAccess0" name="newAnalysisArchiveAccess" value="0" checked="true" onchange="toggleAnalysisArchiveAccessPassword();"/>';
+ echo '<label for="newAnalysisArchiveAccess0">'.$lang['srv_analiza_archive_access_all'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="newAnalysisArchiveAccess1" name="newAnalysisArchiveAccess" value="1" onchange="toggleAnalysisArchiveAccessPassword();"/>';
+ echo '<label for="newAnalysisArchiveAccess1">'.$lang['srv_analiza_archive_access_admins'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="newAnalysisArchiveAccess2" name="newAnalysisArchiveAccess" value="2" onchange="toggleAnalysisArchiveAccessPassword();"/>';
+ echo '<label for="newAnalysisArchiveAccess2">'.$lang['srv_analiza_archive_access_password'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item indent" id="newAnalysisArchiveAccessPasswordDiv">';
+ echo $lang['srv_analiza_archive_access_password_label'].':';
+ echo '<input type="text" class="text large" name="newAnalysisArchiveAccessPassword" id="newAnalysisArchiveAccessPassword" maxlength="25" />';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>'; //left
+
// trajanje
- echo '<div class="floatLeft">';
- echo $lang['srv_analiza_archive_duration'].':';
- echo '<br/>';
+ echo '<div class="alaysis_archive_right">';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_analiza_archive_duration'].':</span>';
+
$date = date("Y-m-d");// current date
$duration = strtotime(date("Y-m-d", strtotime($date)) . " +3 month");
$duration = date("d.m.Y",$duration);
+
+ echo '<div class="setting_item">';
echo '<input type="radio" name="newAADurationType" id="newAADurationFixed" value="0" checked="true" />';
+ echo '<label for="newAADurationFixed">';
printf ($lang['srv_analiza_archive_duration_default'], $duration);
- echo '<br/>';
- echo '<input type="radio" name="newAADurationType" id="newAADurationUser" value="1" />'.$lang['srv_analiza_archive_duration_custom'].' <input id="newAnalysisArchiveDuration" type="text" name="newAnalysisArchiveDuration" value="' . $duration . '" disabled/>
- <span class="faicon calendar_icon icon-as_link" id="duration_img"></span>
- <script type="text/javascript">
- Calendar.setup({
- inputField : "newAnalysisArchiveDuration",
- ifFormat : "%d.%m.%Y",
- button : "duration_img",
- singleClick : true
- });
- </script>
- ';
- echo '<br/>';
- echo '<input type="radio" name="newAADurationType" id="newAADurationPermanent" value="2" />'.$lang['srv_permanent_archive'];
+ echo '</label>';
echo '</div>';
-
- echo '<div class="clr"></div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="newAADurationType" id="newAADurationUser" value="1" />';
+ echo '<label for="newAADurationUser">'.$lang['srv_analiza_archive_duration_custom'].'</label>';
+ echo '<input id="newAnalysisArchiveDuration" class="text medium" type="text" name="newAnalysisArchiveDuration" value="' . $duration . '" readonly/>';
+ echo '<span class="faicon calendar_icon blue pointer" id="duration_img"></span>
+ <script type="text/javascript">
+ Calendar.setup({
+ inputField : "newAnalysisArchiveDuration",
+ ifFormat : "%d.%m.%Y",
+ button : "duration_img",
+ singleClick : true
+ });
+ </script>
+ ';
echo '</div>';
-
- echo '<div class="div_curent_archives">'."\n";
- echo $lang['srv_analiza_current_archives'];
- if (true) {
- self :: ListArchive(array('create_new'=>false, 'delete'=>false, 'edit'=>false, 'email'=>false, 'access'=>false, 'note'=>false, 'type'=>true, 'access'=>false, 'name_link'=>true,'duration'=>false, 'insert'=>true, 'edit'=>false));
- #self :: ListArchive(array('delete'=>false, 'edit'=>false, 'email'=>false, 'access'=>false, 'note'=>false, 'type'=>false, 'access'=>false, 'name_link'=>true, 'duration'=>false, 'insert'=>false, 'edit'=>false));
- } else {
- echo $lang['srv_analiza_no_current_archives'];
- }
-
- echo '</div>'."\n"; // end: div_curent_archives
-
-
- if ($_GET['podstran'] == M_ANALYSIS_CROSSTAB || $_POST['podstran'] == M_ANALYSIS_CROSSTAB) {
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_create'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="submitArchiveCrosstabs(); return false;"><span>'.$lang['srv_analiza_arhiviraj_create'].'</span></a></span></span>'."\n";
- } else if ($_GET['podstran'] == M_ANALYSIS_MEANS || $_POST['podstran'] == M_ANALYSIS_MEANS) {
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_create'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="submitArchiveMeans(); return false;"><span>'.$lang['srv_analiza_arhiviraj_create'].'</span></a></span></span>'."\n";
- } else if ($_GET['podstran'] == M_ANALYSIS_TTEST || $_POST['podstran'] == M_ANALYSIS_TTEST) {
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_create'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="submitArchiveTTest(); return false;"><span>'.$lang['srv_analiza_arhiviraj_create'].'</span></a></span></span>'."\n";
- } else if ($_GET['podstran'] == M_ANALYSIS_BREAK || $_POST['podstran'] == M_ANALYSIS_BREAK) {
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_create'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="submitArchiveBreak(); return false;"><span>'.$lang['srv_analiza_arhiviraj_create'].'</span></a></span></span>'."\n";
- } else if ($_GET['podstran'] == M_ANALYSIS_CHARTS || $_POST['podstran'] == M_ANALYSIS_CHARTS) {
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_create'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="submitArchiveChart(); return false;"><span>'.$lang['srv_analiza_arhiviraj_create'].'</span></a></span></span>'."\n";
- } else if ($_GET['podstran'] == M_ANALYSIS_CREPORT || $_POST['podstran'] == M_ANALYSIS_CREPORT) {
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_create'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="submitArchiveCReport(); return false;"><span>'.$lang['srv_analiza_arhiviraj_create'].'</span></a></span></span>'."\n";
- } else {
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_create'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="submitArchiveAnaliza(); return false;"><span>'.$lang['srv_analiza_arhiviraj_create'].'</span></a></span></span>'."\n";
- }
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_cancle'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="cancleArchiveAnaliza(); return false;"><span>'.$lang['srv_analiza_arhiviraj_cancle'].'</span></a></span></span>'."\n";
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="newAADurationType" id="newAADurationPermanent" value="2" />';
+ echo '<label for="newAADurationPermanent">'.$lang['srv_permanent_archive'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</div>'; //right
- echo '</div>'."\n"; // end div_analiza_archive_name
+ echo '</div>'; //wrap
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" title="'.$lang['srv_analiza_arhiviraj_cancle'].'" onClick="cancleArchiveAnaliza(); return false;">'.$lang['srv_analiza_arhiviraj_cancle'].'</button>';
+
+ $action = '';
+
+ if(isset($_GET['podstran'])){
+ if ($_GET['podstran'] == M_ANALYSIS_CROSSTAB || $_POST['podstran'] == M_ANALYSIS_CROSSTAB) {
+ $action = 'submitArchiveCrosstabs();';
+ } else if ($_GET['podstran'] == M_ANALYSIS_MEANS || $_POST['podstran'] == M_ANALYSIS_MEANS) {
+ $action = 'submitArchiveMeans();';
+ } else if ($_GET['podstran'] == M_ANALYSIS_TTEST || $_POST['podstran'] == M_ANALYSIS_TTEST) {
+ $action = 'submitArchiveTTest();';
+ } else if ($_GET['podstran'] == M_ANALYSIS_BREAK || $_POST['podstran'] == M_ANALYSIS_BREAK) {
+ $action = 'submitArchiveBreak();';
+ } else if ($_GET['podstran'] == M_ANALYSIS_CHARTS || $_POST['podstran'] == M_ANALYSIS_CHARTS) {
+ $action = 'submitArchiveChart();';
+ } else if ($_GET['podstran'] == M_ANALYSIS_CREPORT || $_POST['podstran'] == M_ANALYSIS_CREPORT) {
+ $action = 'submitArchiveCReport();';
+ } else {
+ $action = 'submitArchiveAnaliza();';
+ }
+ }
+ else {
+ $action = 'submitArchiveAnaliza();';
+ }
+
+ echo '<button class="medium blue" title="'.$lang['srv_analiza_arhiviraj_create'].'" onclick="'.$action.' return false;">'.$lang['srv_analiza_arhiviraj_create'].'</button>';
+
+ echo '</div>';
+
+ echo '</div>'; // end div_analiza_archive_name
}
static function DisplayCreatedArchive($aid=null, $name) {
global $lang, $site_url;
- echo '<div id="div_analiza_archive_name" class="divPopUp">'."\n";
+ echo '<div id="div_analiza_archive_name" class="divPopUp">';
echo '<div class="popup_close"><a href="#" onClick="closeArchiveAnaliza(); return false;">✕</a></div>';
@@ -416,39 +462,29 @@ class SurveyAnalysisArchive { $CAE = self::CheckArchiveExistance($aid);
if ( $CAE > 0) {
- echo '<div>';
+ echo '<p class="bottom16">';
printf( $lang['srv_analiza_arhiviraj_success'],$name);
- echo '</div>';
- echo '<br/>';
+ echo '</p>';
- echo '<div>';
+ $archive_link = $site_url.'admin/survey/AnalysisArchive.php?anketa='.self::$sid.'&aid='. $aid;
+
+ echo '<p>';
echo $lang['srv_analiza_arhiviraj_success_note'];
- echo '<br/>';
- echo '<span>';
- echo '<a href="'.$site_url.'admin/survey/AnalysisArchive.php?anketa='.self::$sid.'&aid='. $aid . '" target="_blank" title="">';
- echo $site_url.'admin/survey/AnalysisArchive.php?anketa='.self::$sid.'&aid='. $aid;
+ echo ': <a href="'.$site_url.'admin/survey/AnalysisArchive.php?anketa='.self::$sid.'&aid='. $aid . '" target="_blank" title="">';
+ echo $archive_link;
echo '</a>';
- echo '</span>';
+ echo '<span class="faicon copy empty pointer blue link-left" onClick="CopyToClipboard(\''.$archive_link.'\'); actionNotePopup(\'text_copied\', \'success\');"></span>';
+ echo '</p>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" title="'.$lang['srv_analiza_arhiviraj_close'].'" onClick="closeArchiveAnaliza(); return false;">'.$lang['srv_analiza_arhiviraj_close'].'</button>';
+ //echo '<button class="medium blue" title="'.$lang['srv_analiza_arhiviraj_send_mail'].'" onclick="emailArchiveAnaliza(\''.$aid.'\'); return false;">'.$lang['srv_analiza_arhiviraj_send_mail'].'</button>';
echo '</div>';
-
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_close'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="closeArchiveAnaliza(); return false;"><span>'.$lang['srv_analiza_arhiviraj_close'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_send_mail'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="emailArchiveAnaliza(\''.$aid.'\'); return false;" ><span><img src="icons/icons/email_link.png" alt="" /> '.$lang['srv_analiza_arhiviraj_send_mail'].'</span></a></span></span>'."\n";
} else {
self::DisplayError($CAE);
}
-
- # seznam arhivov
- echo '<br class="clr" />';
- echo '<div class="div_curent_archives">'."\n";
- echo $lang['srv_analiza_current_archives'];
- if (true) {
- self :: ListArchive(array('delete'=>false, 'edit'=>false, 'email'=>false, 'access'=>false, 'note'=>false, 'type'=>true, 'access'=>false, 'name_link'=>true,'duration'=>false, 'insert'=>true, 'edit'=>false));
- } else {
- echo $lang['srv_analiza_no_current_archives'];
- }
- echo '</div>'."\n"; // end: div_curent_archives
- echo '</div>'."\n"; // end div_analiza_archive_name
+ echo '</div>'; // end div_analiza_archive_name
}
static function EmailArchive($aid) {
@@ -458,63 +494,74 @@ class SurveyAnalysisArchive { echo '<div class="popup_close"><a href="#" onClick="cancleArchiveAnaliza(); return false;">✕</a></div>';
- echo '<h2>'.$lang['srv_analiza_arhiv'].'</h2>';
+ echo '<h2>'.$lang['srv_export_hover_archive_mail'].'</h2>';
# preverimo obstoj datoteke, in dostop
$CAE = self::CheckArchiveExistance($aid);
if ( $CAE > 0) {
# vsebina emaila in naslovi
- echo '<div id="div_archives_email_left">'."\n";
-
- echo '<p>'.$lang['srv_analiza_archive_message_note'].'</p>';
-
- echo '<div ><label for="email_archive_list">'.$lang['srv_analiza_archive_message_emails'].':</label>'."\n";
- echo '<textarea name="email_archive_list" rows="4" id="email_archive_list" ></textarea>'."\n";
- echo '</div>';
-
- echo '<br>';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="email_archive_list">'.$lang['srv_analiza_archive_message_emails'].'</label>';
+ echo '<textarea class="textarea email" name="email_archive_list" id="email_archive_list" ></textarea>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="subject">' . $lang['srv_inv_archive_subject_text'] . ': </label>';
+ echo '<input type="text" class="text large wauto" name="email_archive_subject" id="email_archive_subject" value="'.$lang['srv_analiza_arhiviraj_mail_subject'].'"/>';
+ echo '</div>';
- echo '<div class="anl_dash_bt">';
- echo '<br/><label for="subject">' . $lang['subject'] . ': </label>';
- echo '<input type="text" name="email_archive_subject" id="email_archive_subject" value="'.$lang['srv_analiza_arhiviraj_mail_subject'].'" size="90"/></p>';
- echo '<p><label for="email_archive_text">' . $lang['text'] . ':</label>'."\n";
+ echo '<labelfor="email_archive_text">' . $lang['message'] . ':</label>';
+
+ echo '<div id="div_archives_email_wrap">';
+ echo '<div id="div_archives_email_left">';
$signature = Common::getEmailSignature();
echo '<textarea name="email_archive_text" id="email_archive_text" rows="2" >' . nl2br($lang['srv_analiza_arhiviraj_mail_text'].$signature). '</textarea>'."\n";
- echo '</div>';
+
echo '<script type="text/javascript">'."\n";
echo 'if ($("#email_archive_text")) {'."\n";
echo ' create_editor(\'email_archive_text\', false);'."\n";
echo '}'."\n";
echo '</script>'."\n";
-
- echo '</div>'."\n";
- #gumbi
+
+ echo '</div>'; #left
+
echo '<div id="div_archives_email_right" >'."\n";
+
+ //Navodila
+ echo '<div class="message_instructions">';
+
+ echo '<p class="bold caps bottom32">'.$lang['srv_alert_instruction1'].'</p>';
+ echo '<p class="bottom32">'.$lang['srv_alert_instruction1c'].'</p>';
- echo '<div id="div_archives_email_buttons">';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_do_send_mail'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="sendEmailArchiveAnaliza(\''.$aid.'\'); return false;"><span>'.$lang['srv_analiza_arhiviraj_do_send_mail'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_close'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="cancleArchiveAnaliza(); return false;"><span>'.$lang['srv_analiza_arhiviraj_close'].'</span></a></span></span>'."\n";
- echo '<br class="clr" />';
+ echo '<div class="sistemske">';
+ echo '<p>'.$lang['srv_alert_instruction_link_archive'].'</p>';
+ echo '<p>'.$lang['srv_alert_instruction_URL_archive'].'</p>';
+ echo '<p>'.$lang['srv_alert_instruction_name_archive'].'</p>';
+ echo '<p>'.$lang['srv_alert_instruction_survey'].'</p>';
+ echo '<p>'.$lang['srv_alert_instruction_date'].'</p>';
+ echo '<p>'.$lang['srv_alert_instruction_site'].'</p>';
echo '</div>';
- echo '<div id="div_error">';
- # navodila
- echo $lang['srv_analiza_arhiviraj_mail_note_0'];
- echo '</div>';
- echo '<br/>';
- echo '<br/>';
- echo '<div id="div_error">';
- # navodila
- echo $lang['srv_analiza_arhiviraj_mail_note_1'];
+
echo '</div>';
+
+ echo '</div>'; //right
+
+ echo '</div>'; //wrap
+
+ #gumbi
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="cancleArchiveAnaliza(); return false;">'.$lang['srv_analiza_arhiviraj_close'].'</button>';
+ echo '<button class="medium blue" onclick="sendEmailArchiveAnaliza(\''.$aid.'\'); return false;">'.$lang['srv_analiza_arhiviraj_do_send_mail'].'</button>';
echo '</div>';
- echo '<br class="clr" />';
+
} else {
self::DisplayError($CAE);
}
- echo '</div>'."\n"; // end div_analiza_archive_name
+ echo '</div>'; // end div_analiza_archive_name
}
static function SendEmailArchive($aid = null, $subject, $text, $emails) {
@@ -524,7 +571,7 @@ class SurveyAnalysisArchive { echo '<div class="popup_close"><a href="#" onClick="cancleArchiveAnaliza(); return false;">✕</a></div>';
- echo '<h2>'.$lang['srv_analiza_arhiv'].'</h2>';
+ echo '<h2>'.$lang['srv_export_hover_archive_mail'].'</h2>';
$CAE = self::CheckArchiveExistance($aid);
if ( $CAE > 0) {
@@ -625,19 +672,21 @@ class SurveyAnalysisArchive { echo 'Pri pošiljanju e-mailov je prišlo do napake!';
}
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_close'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="cancleArchiveAnaliza(); return false;"><span>'.$lang['srv_analiza_arhiviraj_close'].'</span></a></span></span>'."\n";
- echo '<br class="clr" />';
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onclick="closeArchiveAnaliza(); return false;">'.$lang['srv_analiza_arhiviraj_close'].'</button>';
+ echo '</div>';
+
} else {
self::DisplayError($CAE);
}
- echo '</div>'."\n"; // end div_analiza_archive_name
+ echo '</div>'; // end div_analiza_archive_name
}
static function EditArchive($aid) {
global $lang, $site_url, $site_path, $global_user_id;
- echo '<div id="div_analiza_archive_name" class="divPopUp">'."\n";
+ echo '<div id="div_analiza_archive_name" class="divPopUp PopUpNarrow">'."\n";
echo '<div class="popup_close"><a href="#" onClick="cancleArchiveAnaliza(); return false;">✕</a></div>';
@@ -649,31 +698,53 @@ class SurveyAnalysisArchive { $s = sisplet_query("SELECT *, UNIX_TIMESTAMP(duration) as duration_d FROM srv_analysis_archive WHERE id='".$aid."' AND sid='".self::$sid."'");
$row = mysqli_fetch_assoc($s);
- echo $lang['srv_analiza_arhiviraj_ime'];
- echo ': <input id="newAnalysisArchiveName" name="newAnalysisArchiveName" type="text" size="60" value="'.$row['name'].'"/>'."\n";
- echo '<br class="clr" />';
- echo '<div>';
- echo $lang['srv_analiza_archive_note'].':';
- echo '<textarea name="newAnalysisArchiveNote" id="newAnalysisArchiveNote" style="height:50px; width:100%">'.$row['note'].'</textarea>';
- echo '</div>';
- echo '<div>';
- // dostop
- echo '<div class="floatLeft">';
- echo $lang['srv_analiza_archive_access'].':';
- echo '<br/><input type="radio" name="newAnalysisArchiveAccess" value="0"'.((int)$row['access'] == 0 ? ' checked="true"' : '').' onchange="toggleAnalysisArchiveAccessPassword();"/> '.$lang['srv_analiza_archive_access_all'];
- echo '<br/><input type="radio" name="newAnalysisArchiveAccess" value="1"'.((int)$row['access'] == 1 ? ' checked="true"' : '').' onchange="toggleAnalysisArchiveAccessPassword();"/> '.$lang['srv_analiza_archive_access_admins'];
- echo '<br/><input type="radio" name="newAnalysisArchiveAccess" value="2"'.((int)$row['access'] == 2 ? ' checked="true"' : '').' onchange="toggleAnalysisArchiveAccessPassword();"/> '.$lang['srv_analiza_archive_access_password'];
- echo '<br/><div id="newAnalysisArchiveAccessPasswordDiv" style="visibility: '.((int)$row['access'] == 2 ? 'visible' : 'hidden').';">'.$lang['srv_analiza_archive_access_password_label'].'<input type="text" name="newAnalysisArchiveAccessPassword" id="newAnalysisArchiveAccessPassword" maxlength="25" value="'.$row['access_password'].'"/>';
- echo '</div></div>';
-
- echo '<div class="floatLeft anl_w110" > </div>';
- // trajanje
- echo '<div class="floatLeft">';
- echo $lang['srv_analiza_archive_duration'].':';
- echo '<br/>';
- echo '<input id="newAnalysisArchiveDuration" type="text" name="newAnalysisArchiveDuration" value="' . date('d.m.Y',$row['duration_d']) . '" disabled/>
- <span class="faicon calendar_icon icon-as_link" id="duration_img"></span>
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_analiza_arhiviraj_ime'].':</span>';
+ echo '<input id="newAnalysisArchiveName" class="text large" name="newAnalysisArchiveName" type="text" value="'.$row['name'].'"/>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_analiza_archive_note'].':</span>';
+ echo '<textarea class="textarea" name="newAnalysisArchiveNote" id="newAnalysisArchiveNote">'.$row['note'].'</textarea>';
+ echo '</div>';
+
+ echo '<div class="alaysis_archive_wrap">';
+ // dostop
+ echo '<div class="alaysis_archive_left">';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_analiza_archive_access'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="newAnalysisArchiveAccess0" name="newAnalysisArchiveAccess" value="0" '.((int)$row['access'] == 0 ? ' checked="true"' : '').' onchange="toggleAnalysisArchiveAccessPassword();"/>';
+ echo '<label for="newAnalysisArchiveAccess0">'.$lang['srv_analiza_archive_access_all'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="newAnalysisArchiveAccess1" name="newAnalysisArchiveAccess" value="1" '.((int)$row['access'] == 1 ? ' checked="true"' : '').' onchange="toggleAnalysisArchiveAccessPassword();"/>';
+ echo '<label for="newAnalysisArchiveAccess1">'.$lang['srv_analiza_archive_access_admins'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="newAnalysisArchiveAccess2" name="newAnalysisArchiveAccess" value="2" '.((int)$row['access'] == 2 ? ' checked="true"' : '').' onchange="toggleAnalysisArchiveAccessPassword();"/>';
+ echo '<label for="newAnalysisArchiveAccess2">'.$lang['srv_analiza_archive_access_password'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item indent" id="newAnalysisArchiveAccessPasswordDiv">';
+ echo $lang['srv_analiza_archive_access_password_label'].':';
+ echo '<input type="text" class="text large" name="newAnalysisArchiveAccessPassword" id="newAnalysisArchiveAccessPassword" maxlength="25" />';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>'; //left
+
+ // trajanje
+ echo '<div class="alaysis_archive_right">';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_analiza_archive_duration'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input id="newAnalysisArchiveDuration" class="text medium" type="text" name="newAnalysisArchiveDuration" value="' . date('d.m.Y',$row['duration_d']) . '" readonly/>';
+ echo '<span class="faicon calendar_icon blue pointer" id="duration_img"></span>
<script type="text/javascript">
Calendar.setup({
inputField : "newAnalysisArchiveDuration",
@@ -683,14 +754,20 @@ class SurveyAnalysisArchive { });
</script>
';
-
- echo '</div>';
- echo '<div class="clr"></div>';
- echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
+
+ echo '</div>'; //right
+
+ echo '</div>'; //wrap
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" title="'.$lang['srv_analiza_arhiviraj_cancle'].'" onClick="cancleArchiveAnaliza(); return false;">'.$lang['srv_analiza_arhiviraj_close'].'</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_analiza_arhiviraj_create'].'" onclick="saveArchiveAnaliza(\''.$aid.'\'); return false;">'.$lang['srv_analiza_arhiviraj_save'].'</button>';
+ echo '</div>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="saveArchiveAnaliza(\''.$aid.'\'); return false;"><span>'.$lang['srv_analiza_arhiviraj_save'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_close'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="cancleArchiveAnaliza(); return false;"><span>'.$lang['srv_analiza_arhiviraj_close'].'</span></a></span></span>'."\n";
- echo '<br class="clr" />';
} else {
self::DisplayError($CAE);
}
@@ -744,7 +821,7 @@ class SurveyAnalysisArchive { #podtki profila
$s = sisplet_query("SELECT filename, access FROM srv_analysis_archive WHERE id='".$aid."' AND sid='".self::$sid."'");
- if ($_GET['debug'] == 1) {
+ if (isset($_GET['debug'])&&$_GET['debug'] == 1) {
print_r("SELECT * FROM srv_analysis_archive WHERE id='".$aid."' AND sid='".self::$sid."'");
}
if (mysqli_num_rows($s)) {
@@ -811,10 +888,6 @@ class SurveyAnalysisArchive { static function ViewArchive($aid) {
global $site_path, $global_user_id, $lang, $site_url;
- #izpišemo osnovni html
- $sql = sisplet_query("SELECT * FROM misc WHERE what='name'");
- $row = mysqli_fetch_array($sql);
-
// nastavimo jezik
if (self::$sid > 0) {
$sql = sisplet_query("SELECT lang_admin FROM srv_anketa WHERE id = '".self::$sid."'");
@@ -836,10 +909,10 @@ class SurveyAnalysisArchive { echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
echo '<head>'."\n";
- echo '<title>'.$row['value'].'</title>'."\n";
+ echo '<title>'.(isset($row['value'])?$row['value']:'').'</title>'."\n";
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'."\n";
echo '<script type="text/javascript" src="script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
- if ($_GET['mode'] != 'old') {
+ if (isset($_GET['mode'])&&$_GET['mode'] != 'old') {
echo '<script type="text/javascript" src="minify/g=jsnew"></script>'."\n";
} else {
echo '<script type="text/javascript" src="minify/g=js"></script>'."\n";
@@ -933,8 +1006,9 @@ class SurveyAnalysisArchive { echo '</div>';
if ($showButton) {
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_close'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="closeArchiveAnaliza(); return false;"><span>'.$lang['srv_analiza_arhiviraj_close'].'</span></a></span></span>'."\n";
- echo '<br class="clr" />';
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onclick="closeArchiveAnaliza(); return false;">'.$lang['srv_analiza_arhiviraj_close'].'</button>';
+ echo '</div>';
}
}
@@ -990,11 +1064,14 @@ class SurveyAnalysisArchive { $CAE = self::CheckArchiveExistance($aid);
if ( $CAE > 0) {
- echo '<h2>Ali ste prepričani?</h2>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_delete'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="doDeleteArchiveAnaliza(\''.$aid.'\'); return false;"><span>'.$lang['srv_analiza_arhiviraj_delete'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper" title="'.$lang['srv_analiza_arhiviraj_cancle'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="cancleArchiveAnaliza(); return false;"><span>'.$lang['srv_analiza_arhiviraj_cancle'].'</span></a></span></span>'."\n";
-
- echo '<br class="clr" />';
+ echo '<h2>'.$lang['srv_analiza_archive_list_delete'].'</h2>';
+
+ echo '<p class="bottom16">'.$lang['srv_analiza_archive_list_delete_text'].'</p>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" title="'.$lang['srv_analiza_arhiviraj_cancle'].'" onclick="cancleArchiveAnaliza(); return false;">'.$lang['srv_analiza_arhiviraj_cancle'].'</button>';
+ echo ' <button class="medium blue" title="'.$lang['srv_analiza_arhiviraj_delete'].'" onclick="doDeleteArchiveAnaliza(\''.$aid.'\'); return false;">'.$lang['srv_analiza_arhiviraj_delete'].'</button>';
+ echo '</div>';
}
else {
#izpišemo error
@@ -1208,7 +1285,10 @@ class SurveyAnalysisArchive { *
*/
static function createArchiveFromAnaliza() {
+
$content = null;
+ $settings = array();
+
if($_POST['podstran'] == 'charts'){
# kreiramo arhiv za grafe
$SC = new SurveyChart();
@@ -1229,13 +1309,15 @@ class SurveyAnalysisArchive { if ($_POST['podstran'] == 'anal_arch') {
$_POST['podstran'] = 'sumarnik';
}
+
if (!isset($_POST['content'])) {
SurveyAnalysis::Init(self::$sid);
SurveyAnalysis::setUpIsForArchive(true);
SurveyAnalysis::setUpReturnAsHtml(true);
$content = SurveyAnalysis::Display();
- } else {
+ }
+ else {
$content = $_POST['content'];
}
}
@@ -1249,13 +1331,13 @@ class SurveyAnalysisArchive { $ArchiveTypes = array(M_ANALIZA_SUMS => 0, M_ANALIZA_DESCRIPTOR=>1, M_ANALIZA_FREQUENCY=>2, M_ANALIZA_CROSSTAB=>3, M_ANALYSIS_MEANS=>4, M_ANALYSIS_TTEST=>5, M_ANALYSIS_BREAK=>6, M_ANALYSIS_CHARTS=>7, M_ANALYSIS_CREPORT=>8);
if (isset($_POST['podstran']))
- $type = $ArchiveTypes[$_POST['podstran']];
- if (isset($content) && trim($content) != null && self::$sid > 0) {
+ $type = isset($ArchiveTypes[$_POST['podstran']])?$ArchiveTypes[$_POST['podstran']]:null;
+ if (isset($content) && trim($content) != null && self::$sid > 0) {
SurveyAnalysisArchive :: Init(self::$sid);
- SurveyAnalysisArchive :: CreateArchive($content,$name,$note,$access,$type,$duration,$durationType,$settings,$access_password);
-
- } else {
+ SurveyAnalysisArchive :: CreateArchive($content,$name,$note,$access,$type,$duration,$durationType,$settings,$access_password);
+ }
+ else {
echo 'Error! (SurveyAnalysisArchive :: CreateArchive)';
}
|